//########################//
//## 広告Flashタグ挿入 ##//
//########################//
var CtrlADFlash = {
	'init' : function(days, finish, cookie, setTime, imgPath, jumpURL, dummyURL) {
		YAHOO.util.Event.onDOMReady(function() {
			CtrlADFlash.draw(days, finish, cookie, setTime, imgPath, jumpURL, dummyURL, 'ad-flash-small', '../../flash/ad_small.swf',  'small');
		});
	},
	
	'draw' : function(days, finish, cookie, setTime, imgPath, jumpURL, dummyURL, id, swfname, type) {
		if(finish.match(/^\d\d\d\d-\d\d-\d\d/)) {
			var parts = finish.split(" ");
			
			var YMD = parts[0].split("-");
			if(typeof parts[1] != 'undefined') {
				if(parts[1].match(/^\d\d:\d\d:\d\d$/)) {
					var HMS = parts[1].split(":");
					var d = new Date(YMD[0], YMD[1]-1, YMD[2], HMS[0], HMS[1], HMS[2]);
				} else {
					var d = new Date(YMD[0], YMD[1]-1, YMD[2]);
				}
			} else {
				var d = new Date(YMD[0], YMD[1]-1, YMD[2]);
			}
			
			if(serverTime - d.getTime() < 0) {
				if(cookie != 'ALWAYS' && document.cookie.indexOf(cookie + "=true") != -1) {
					return;
				} else {
					var winWidth;
					var winHeight;
					if(type == 'small') {
						winWidth = "400";
						winHeight = "300";
					} else {
						winWidth = window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth);
						winHeight = window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight);
					}
					
					var tempImg = document.createElement("img");
					tempImg.path = imgPath;
					tempImg.onload = function() {
						if(winWidth / winHeight > this.width / this.height) {
							if(winHeight < this.height + 100) {
								imgPath = 'http://www.teichiku.co.jp/script/original/ctrl_image.php%3Fsrc=' + imgPath + '%26height=' + (winHeight - 100);
							}
						} else {
							if(winWidth < this.width + 100) {
								imgPath = 'http://www.teichiku.co.jp/script/original/ctrl_image.php%3Fsrc=' + imgPath + '%26width=' + (winWidth - 100);
							}
						}
						var body = document.getElementsByTagName("BODY");
						var insertPoint = document.getElementById("header");
						
						var div = document.createElement("div");
						div.setAttribute("id", id);
						
						var hr = document.createElement("hr");
						
						if(YAHOO.env.ua.ie) {
							if(jumpURL != null) {
								if(dummyURL != null) {
									div.innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="' + swfname + '" /><param name="quality" value="high" /><param name="wmode" value="transparent"><param name="FlashVars" value="setTime=' + setTime + '&imgPath=' + imgPath + '&jumpURL=' + jumpURL + '&dummyURL=' + dummyURL + '" /></object>';
								} else {
									div.innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="' + swfname + '" /><param name="quality" value="high" /><param name="wmode" value="transparent"><param name="FlashVars" value="setTime=' + setTime + '&imgPath=' + imgPath + '&jumpURL=' + jumpURL + '" /></object>';
								}
							} else {
								div.innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="' + swfname + '" /><param name="quality" value="high" /><param name="wmode" value="transparent"><param name="FlashVars" value="setTime=' + setTime + '&imgPath=' + imgPath + '" /></object>';
							}
						} else {
							var wrapper = document.createElement("div");
							var embed = document.createElement("embed");
							
							embed.setAttribute("src", swfname);
							embed.setAttribute("quality", "high");
							embed.setAttribute("wmode", "transparent");
							embed.setAttribute("width", "100%");
							embed.setAttribute("height", "100%");
							if(jumpURL != null) {
								if(dummyURL != null) {
									embed.setAttribute("FlashVars", 'setTime=' + setTime + '&imgPath=' + imgPath + '&jumpURL=' + jumpURL + '&dummyURL=' + dummyURL);
								} else {
									embed.setAttribute("FlashVars", 'setTime=' + setTime + '&imgPath=' + imgPath + '&jumpURL=' + jumpURL);
								}
							} else {
								embed.setAttribute("FlashVars", 'setTime=' + setTime + '&imgPath=' + imgPath);
							}
							embed.setAttribute("allowScriptAccess", "sameDomain");
							embed.setAttribute("type", "application/x-shockwave-flash");
							embed.setAttribute("pluginspage", "http://www.macromedia.com/go/getflashplayer");
							
							wrapper.appendChild(embed);
							div.appendChild(wrapper);
						}
						div.appendChild(hr);
						body[0].insertBefore(div, insertPoint);
						div.style.height = winHeight + "px";
						
						if(YAHOO.env.ua.ie && YAHOO.env.ua.ie < 7) {
							window.attachEvent('onscroll',  CtrlADFlash.fixed);
							window.attachEvent('onresize',  CtrlADFlash.fixed);
							
							CtrlADFlash.fixed();
						}
						
						var limit = new Date();
						limit.setTime(limit.getTime() + (1000 * 60 * 60 * 24 * days));
						limitGMT = limit.toGMTString();
						document.cookie = cookie + "=true;expires=" + limitGMT + ";";
					}
					var d = new Date();
					tempImg.setAttribute("src", imgPath + '?t=' +d.getTime());
				}
			}
		}
	},
	
	'remove' : function() {
		var target;
		
		if(document.getElementById("ad-flash")) {
			target = document.getElementById("ad-flash");
		} else if(document.getElementById("ad-flash-small")) {
			target = document.getElementById("ad-flash-small");
		}
		
		target.parentNode.removeChild(target);
		if(YAHOO.env.ua.ie && YAHOO.env.ua.ie < 7) {
			window.detachEvent('onscroll',  CtrlADFlash.fixed);
			window.detachEvent('onresize',  CtrlADFlash.fixed);
		}
	},
	
	'fixed' : function() {
		var target;
		
		if(document.getElementById("ad-flash")) {
			target = document.getElementById("ad-flash");
		} else if(document.getElementById("ad-flash-small")) {
			target = document.getElementById("ad-flash-small");
		}
		
		target.style.top = GET.scrollY() + "px";
		target.style.left = GET.scrollX() + "px";
		target.style.height = "100%";
	},
	
	'addFooter' : function(interval, limit, image , url, dummy, title) {
		YAHOO.util.Event.onDOMReady(function() {
			var max = limit.length;
			
			var parent = document.getElementById("footer");
			var target = document.getElementById("insertPointFooter");
			
			var hr = document.createElement("hr");
			if(YAHOO.env.ua.ie && YAHOO.env.ua.ie < 8) {
				hr.setAttribute("className", "clear");
			} else {
				hr.setAttribute("class", "clear");
			}
			var ul = document.createElement("ul");
			ul.setAttribute("id", "AD");
			
			var p = document.createElement("p");
			p.setAttribute("id", "AD-note");
			p.innerHTML = '現在このページに「お知らせ」として表示されるFLASH一覧です。クリックするとFLASHを再表示します。';
			
			for(var i = 0; i < max; i++) {
				var parts = limit[i].split(" ");
				
				var YMD = parts[0].split("-");
				if(typeof parts[1] != 'undefined') {
					if(parts[1].match(/^\d\d:\d\d:\d\d$/)) {
						var HMS = parts[1].split(":");
						var d = new Date(YMD[0], YMD[1]-1, YMD[2], HMS[0], HMS[1], HMS[2]);
					} else {
						var d = new Date(YMD[0], YMD[1]-1, YMD[2]);
					}
				} else {
					var d = new Date(YMD[0], YMD[1]-1, YMD[2]);
				}
				
				if(serverTime - d.getTime() < 0) {
					var text = document.createTextNode(title[i]);
					
					var li = document.createElement("li");
					
					var a = document.createElement("a");
					a.setAttribute("href", dummy[i]);
					a.interval = interval[i];
					a.image = image[i];
					a.url = url[i];
					a.dummy = dummy[i];
					a.appendChild(text);
					a.onclick = function() {
						if(!document.getElementById('ad-flash-small')) {
							CtrlADFlash.draw(this.interval, '2099-01-01 23:59:00', 'ALWAYS', -1, this.image, this.url, this.dummy, 'ad-flash', '../../flash/ad.swf', 'full');
						} else {
							alert("現在表示されている「お知らせ」を非表示にして下さい。")
						}
						return false;
					}
					
					li.appendChild(a);
					ul.appendChild(li);
				}
			}
			
			if(ul.hasChildNodes()) {
				parent.insertBefore(hr, target);
				parent.insertBefore(ul, target);
				parent.insertBefore(p, target);
			}
		});
	}
}

//########################//
//## 動画 Flashタグ挿入 ##//
//########################//
var PromotionVideo = {
	'init' : function(file, sizeX, sizeY, flv, jump) {
		var parent = document.getElementById("info-push-unit");
		var div = document.createElement("div");
		div.setAttribute("id", "pv");
		
		var h4 = document.createElement("h4");
		h4.innerHTML = 'ニューリリース';
		
		parent.appendChild(h4);
        
		if(YAHOO.env.ua.ie) {
			div.innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + sizeX + '" height="' + sizeY + '"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="' + file + '" /><param name="quality" value="high" /><param name="wmode" value="opaque" /><param name="FlashVars" value="flvPath=' + flv + '&jumpURL=' + jump + '" /></object>';
        } else {
            var wrapper = document.createElement("div");
            var embed = document.createElement("embed");
            
            embed.setAttribute("src", file);
            embed.setAttribute("quality", "high");
            embed.setAttribute("wmode", "opaque");
            embed.setAttribute("width", sizeX);
            embed.setAttribute("height", sizeY);
            embed.setAttribute("FlashVars", 'flvPath=' + flv + '&jumpURL=' + jump);
            embed.setAttribute("allowScriptAccess", "sameDomain");
            embed.setAttribute("type", "application/x-shockwave-flash");
            embed.setAttribute("pluginspage", "http://www.macromedia.com/go/getflashplayer");
            
            wrapper.appendChild(embed);
            div.appendChild(wrapper);
        }
        parent.appendChild(div);
    }
}

//##########################//
//## 更新履歴表示チェック ##//
//##########################//
var ChkModify = {
	'option': {
		'mainWidth' : 950,
		'targetWidth' : 475,
		'menuPaddingLeft' : 495,
		'timerID1' : setTimeout("", 20),
		'timerID2' : setTimeout("", 2000),
		'isInner' : false
	},
	
	'init': function() {
		if(document.getElementById("modify")) {
			var that = this;
			
			var menu = document.getElementById("menu");
			var modify = document.getElementById("modify");
			var pTags = modify.getElementsByTagName("P");
			var show = 0;
			var visibleIndex = 0;
			var adjuster = 0;
			var re = new RegExp("[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]");
			var re2 = new RegExp("［information］");
			
			for(var i = 0; i < pTags.length; i++) {
				if(GET.className(pTags[i]) != '' && GET.className(pTags[i]) != null) {
					if(GET.className(pTags[i]).match(/^del_[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)) {
						var parts = GET.className(pTags[i]).split("_");
						dateValue = parts[1].split("-");
						targetDate = new Date(dateValue[0], dateValue[1]-1, dateValue[2]);
						if(serverTime > targetDate.getTime()) {
							pTags[i].parentNode.removeChild(pTags[i--]);
						} else {
							show++;
							visibleIndex = i + 1;
						}
					} else {
						show++;
						visibleIndex = i + 1;
					}
				} else {
					if(re.exec(pTags[i].innerHTML) != null) {
						var string = re.exec(pTags[i].innerHTML);
						var dateValue = string[0].split("-");
						var targetDate = new Date(dateValue[0], dateValue[1]-1, dateValue[2]);
						if(serverTime - targetDate.getTime() < 30 * 24 * 60 * 60 * 1000) {
							show++;
							visibleIndex = i + 1;
						} else {
							pTags[i].parentNode.removeChild(pTags[i--]);
						}
					} else if(re2.exec(pTags[i].innerHTML) != null) {
						show++;
						pTags[i].style.display = "none";
					}
				}
			}
			if(show){
				if(!visibleIndex) {
					for(var i = 0; i < pTags.length; i++) {
						pTags[i].style.display = "block";
						visibleIndex = i + 1;
					}
				}
				
				modify.style.display = "block";
				
				for(var i = 0; i < pTags.length; i++) {
					this.setFunc(pTags[i]);
				}
				
				if(modify.offsetHeight < pTags[visibleIndex - 1].offsetHeight) {
					modify.style.height = "auto";
					
					modify.onmouseover = function() {
						clearTimeout(that.option.timerID1);
						clearTimeout(that.option.timerID2);
						
						that.option.timerID1 = setTimeout(function() {
							if(!that.option.isInner) that.allClear();
							that.option.isInner = true;
						}, 20);
					}
					
					modify.onmouseout = function() {
						clearTimeout(that.option.timerID1);
						clearTimeout(that.option.timerID2);
						
						that.option.timerID1 = setTimeout(function() {
							that.option.isInner = false;
							that.allClear();
							
							that.option.timerID2 = setTimeout(function() {
								that.autoScroll()
							}, 2000);
						}, 20);
					}
					
				} else {
					if(pTags.length > 1) {
						adjuster = 6;
						
						var more = document.createElement("p");
						more.setAttribute("id", "more-modify");
						more.innerHTML = "全ての更新履歴を表示する"
						modify.appendChild(more);
					}
					
					modify.style.height = pTags[visibleIndex - 1].offsetHeight + adjuster + "px";
					
					modify.onmouseover = function() {
						clearTimeout(that.option.timerID1);
						clearTimeout(that.option.timerID2);
						
						modify.style.height = "auto";
						
						if(pTags.length > 1) more.style.display = "none";
						
						if(!that.option.isInner) that.allClear();
						that.option.isInner = true;
					}
					
					modify.onmouseout = function() {
						clearTimeout(that.option.timerID1);
						clearTimeout(that.option.timerID2);
						
						that.option.timerID1 = setTimeout(function() {
							modify.style.height = pTags[visibleIndex - 1].offsetHeight + adjuster + "px";
							if(pTags.length > 1) more.style.display = "block";
							
							that.option.isInner = false;
							that.allClear();
							
							that.option.timerID2 = setTimeout(function() {
								that.autoScroll()
							}, 2000);
						}, 20);
					}
				}
				
				if(typeof document.body.style.maxHeight != "undefined") {
					menu.style.width = this.option.mainWidth - this.option.menuPaddingLeft + "px"
				}
				menu.style.paddingLeft = this.option.menuPaddingLeft + "px";
				
				modify.style.position = "absolute";
				
				if(GET.browserWidth() > this.option.mainWidth) {
					if (window.addEventListener) {
						if(YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 522) {
							modify.style.left = (GET.browserWidth() - 17 - this.option.mainWidth) / 2 + 20 + "px";
						} else {
							modify.style.left = (GET.browserWidth() - 17 - this.option.mainWidth) / 2 + 10 + "px";
						}
					} else {
						modify.style.left = (GET.browserWidth() - this.option.mainWidth) / 2 + 10 + "px";
					}
				} else {
					modify.style.left = "10px";
				}
				
				if (window.addEventListener) { 
					window.addEventListener("resize", function() {
						if(GET.browserWidth() > that.option.mainWidth) {
							if(YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 522) {
								modify.style.left = (GET.browserWidth() - 17 - that.option.mainWidth) / 2 + 20 + "px";
							} else {
								modify.style.left = (GET.browserWidth() - 17 - that.option.mainWidth) / 2 + 10 + "px";
							}
						} else {
							modify.style.left = "10px";
						}
					}, false);
				} else if (window.attachEvent) {
					window.attachEvent("onresize", function() {
						if(GET.browserWidth() > that.option.mainWidth) {
							modify.style.left = (GET.browserWidth() - 0 - that.option.mainWidth) / 2 + 10 + "px";
						} else {
							modify.style.left = "10px";
						}
					});
				}
				modify.style.width = this.option.targetWidth + "px";
				
				this.option.timerID2 = setTimeout(function() {
					that.autoScroll()
				}, 2000);
			}
		}
	},
   	
   	'setFunc' : function(target) {
   		var that = this;
   		
   		target.intervalID = setInterval("", 30);
   		target.timeoutID = setTimeout("", 20);
   		target.indent = 0;
   		target.style.indent = 0;
   		
		target.onmouseover = function() {
			clearTimeout(target.timeoutID);
			
			target.style.backgroundImage = "url(./img/basic/back_ani_white.gif)";
			
			var charSize = that.getCharLen(target);
			
			if(charSize > that.option.targetWidth) {
				target.intervalID = that.overMove(target, charSize);
			}
		}
		target.onmouseout = function() {
			clearTimeout(this.intervalID);
			
			target.timeoutID = setTimeout(function() {
				target.indent = 0;
				target.style.textIndent = "0";
				target.style.backgroundImage = "";
			}, 20);
		}
   	},
   	
   	'overMove': function(obj, charLen) {
   		var that = this;
   		
   		obj.indent = obj.indent - 2;
		obj.style.textIndent = obj.indent + "px";
		
		if(obj.indent < -charLen - 20) {
			obj.indent = obj.offsetWidth + 5;
		}
		
		return setTimeout(function() {
			obj.intervalID = that.overMove(obj, charLen);
		}, 30);
   	},
   	
   	'autoScroll': function() {
   		this.option.counter = 0;
   		
   		var parent = document.getElementById("modify");
   		var pTags = parent.getElementsByTagName("P");
   		
   		var len = pTags.length
   		
   		if(pTags[len - 1].innerHTML == "全ての更新履歴を表示する") len--;
   		
   		this.ctrlScroll(pTags, len);
   	},
   	
   	'ctrlScroll': function(arr, arrLen) {
		var charSize = this.getCharLen(arr[this.option.counter]);
		
		arr[this.option.counter].autoID = this.autoMove(arr[this.option.counter], charSize, arr, arrLen);
   	},
   	
   	'autoMove': function(obj, charLen, arr, arrLen) {
   		var that = this;
   		
   		if(GET.style(obj, "display") == "none") {
   			clearTimeout(obj.autoID);
   			this.option.counter++;
   			
			this.ctrlScroll(arr, arrLen);
   		} else {
	   		obj.indent = obj.indent - 2;
			obj.style.textIndent = obj.indent + "px";
			
			if(obj.indent < -charLen - 20) {
				if(arrLen > this.option.counter + 1) {
					clearTimeout(obj.autoID);
					
					obj.style.display = "none";
					this.option.counter++;
				} else {
					this.allClear();
				}
				
				setTimeout(function() {
					that.ctrlScroll(arr, arrLen);
				}, 2000);
			} else {
				return setTimeout(function() {
					obj.autoID = that.autoMove(obj, charLen, arr, arrLen);
				}, 30);
			}
		}
   	},
   	
   	'allClear' : function() {
   		this.option.counter = 0;
		
		var parent = document.getElementById("modify");
   		var pTags = parent.getElementsByTagName("P");
		var len = pTags.length;
		
		if(pTags[len - 1].innerHTML == "全ての更新履歴を表示する") len--;
		
   		for(var i = 0; i < len; i++) {
   			clearInterval(pTags[i].autoID);
   			pTags[i].style.display = "block";
   			pTags[i].indent = 0;
			pTags[i].style.textIndent = 0;
   		}
   	},
   	
   	'getCharLen': function(obj) {
   		var charSize = 0;
   		
   		var span = document.createElement("span");
		var text = document.createTextNode(obj.innerHTML.replace(/<!--.*-->|<\/?[^>]+>/gi, ""));
		span.appendChild(text);
		
		obj.appendChild(span);
		charSize = span.offsetWidth + 20;
		obj.removeChild(span);
		
		return charSize;
   	}
}

//######################//
//## ブログチェッカー ##//
//######################//
var BlogChecker = {
	'check' : function(target, url) {
		YAHOO.util.Event.onDOMReady(function() {
			var backup = document.getElementById(target).innerHTML;
			if(window.XMLHttpRequest != null) {
				var message = new XMLHttpRequest;
			} else if(window.ActiveXObject) {
				try {
					var message = new ActiveXObject("Msxml2.XMLHTTP");
				} catch(e) {
					var message = new ActiveXObject("Microsoft.XMLHTTP");
				}
			} else {
			       return null;
			}
			message.onreadystatechange = function() {
				if(message.readyState == 4) {
					if(message.status == 200) {
						document.getElementById(target).innerHTML = backup + message.responseText;
					} else {
						document.getElementById(target).innerHTML = backup + '<span class="article">ブログの読み込みに失敗しました。</span>';
					}
				} else {
					document.getElementById(target).innerHTML = backup + '<span class="article">ブログチェック中...</span>';
				}
			}
			if(url != null) {
				message.open('GET', "./script/original/get_blog.php?url=" + url, true);
			}
			message.send(null);
		});
	}
}

//##############################################################################//
//## topics スライドメニュー 要 mootools ver 1.11（Element.Event & Fx.Slide） ##//
//##############################################################################//
var TopicsSlider = {
	'init' : function() {
		var topics = document.getElementById("topics");
		var dl =  topics.getElementsByTagName("DL");
		var div = topics.getElementsByTagName("DIV");
		
		if(dl.length == div.length) {
			var len = dl.length;
			for(var i = 0; i < len; i++) {
				dl[i].id = "toggle" + i;
				div[i].id = "topics" + i;
				
				if(GET.className(dl[i]) != null) {
					if(GET.className(dl[i]).match(/^del_[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)) {
						var parts = GET.className(dl[i]).split("_");
						var dateValue = parts[1].split("-");
						var targetDate = new Date(dateValue[0], dateValue[1]-1, dateValue[2]);
						if(serverTime > targetDate.getTime()) {
							if(!YAHOO.env.ua.webkit || 522 <= YAHOO.env.ua.webkit) {
								dl[i].style.display = "none";
								div[i].style.display = "none";
							}
						}
					}
				}
				
				if(YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 5.5) {
					dl[i].style.cursor = "hand";
				} else {
					dl[i].style.cursor = "pointer";
				}
			}
			
			for(var i = 0; i < len; i++) {
				var imgHeight = 0;
				var p = div[i].getElementsByTagName("P");
				if(p != null) {
					for(var j = 0; j < p.length; j++) {
						if(GET.className(p[j]) == "image") {
							imgHeight += p[j].offsetHeight;
						}
					}
				}
					
				if(imgHeight != 0) {
					if(!YAHOO.env.ua.ie || 7 <= YAHOO.env.ua.ie) {
						div[i].style.minHeight = imgHeight + "px";
					} else {
						div[i].style.height = imgHeight + "px";
					}
				}
			}
			
			for(var i = 0; i < len; i++) {
				eval("var mySlide" + i +  " = new Fx.Slide('topics" + i + "')");
				
				var dd = dl[i].getElementsByTagName("DD");
				
				
				if(GET.className(dd[0]).match(/always/)) {
					eval("mySlide" + i + ".show()");
					dl[i].style.fontWeight = "bold";
					dl[i].style.color = "#ff0000";
				} else if(dd[0].firstChild.nodeValue.match(/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)) {
    				var dateValue = dd[0].firstChild.nodeValue.split("-")
					var targetDate = new Date(dateValue[0], dateValue[1]-1, dateValue[2]);
					if (serverTime - targetDate.getTime() < 3 * 24 * 60 * 60 * 1000) {
						eval("mySlide" + i + ".show()");
						dl[i].style.fontWeight = "bold";
						dl[i].style.color = "#ff0000";
					} else {
						eval("mySlide" + i + ".hide()");
						dl[i].style.fontWeight = "normal";
						dl[i].style.color = "#333333";
					}
				} else {
					eval("mySlide" + i + ".hide()");
					dl[i].style.fontWeight = "normal";
					dl[i].style.color = "#333333";
				}
				
				$(dl[i].id).addEvent('click', function(e){
					var tempStr = "mySlide" + (this.id).substr(6);
					e = new Event(e);
					if(eval(tempStr + ".open")) {
						this.style.fontWeight = "normal";
						this.style.color = "#333333";
						if(YAHOO.env.ua.ie == 7) {
							eval(tempStr + ".toggle()").chain(CtrlMainWidth.force);
						} else {
							eval(tempStr + ".toggle()");
						}
					} else {
						this.style.color = "#ff0000";
						this.style.fontWeight = "bold";
						eval(tempStr + ".toggle()");
					}
					e.stop();
				});
			}
		}
		
	}
}

//####################//
//## オートクリック ##//
//####################//
var AutoPlay = {
	'init' : function() {
		setTimeout(function() {
			if(document.getElementById("auto-play")) {
				var target = document.getElementById("auto-play");
				if(!YAHOO.env.ua.ie) var event = document.createEvent('MouseEvents');
				
				if(!(document.cookie.indexOf("shimobukuRecordsAutoPlay=true") != -1)) {
					if(!YAHOO.env.ua.ie) {
						event.initMouseEvent('click', true, true, document.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
						target.dispatchEvent(event);
					} else {
						target.click();
					}
					
					var limit = new Date();
					limit.setTime(limit.getTime() + (1000 * 60 * 60 * 24 * 365));
					limitGMT = limit.toGMTString();
					document.cookie = "shimobukuRecordsAutoPlay=true;expires=" + limitGMT + ";";
				}
			}
		}, 500);
	}
}


//####################//
//## イニシャライズ ##//
//####################//
YAHOO.util.Event.onDOMReady(function() {
	TopicsSlider.init();
	ChkModify.init();
	if(!YAHOO.env.ua.webkit) Shadowbox.init();
	if(!YAHOO.env.ua.webkit) AutoPlay.init();
});
