﻿// Win IE 5.0 以上のみ、アニメーションgifを使用（JavaScript+CSSでの描画処理が不安定なため）
// それ以外のブラウザでは Timeout でアニメーションさせる
// Win/Mac IE 4.x-5.x ではアニメーションOFF

function Initialize() {
	if (navigator.userAgent.indexOf("MSIE 5.") == -1 && navigator.userAgent.indexOf("MSIE5.") == -1 && navigator.userAgent.indexOf("MSIE 4.") == -1) {
		this.AnimeID = new Array(7);
		if (navigator.userAgent.indexOf("MSIE") != -1 && window.clipboardData && !window.opera) {
			var dummy = new Image();
			dummy.src = "./public/style/menu_under_1a.gif";
			dummy.src = "./public/style/menu_under_2a.gif";
			dummy.src = "./public/style/menu_under_3a.gif";
			dummy.src = "./public/style/menu_under_4a.gif";
			dummy.src = "./public/style/menu_under_5a.gif";
			dummy.src = "./public/style/menu_under_6a.gif";
			dummy.src = "./public/style/menu_under_7a.gif";
			dummy.src = "./public/style/menu_under_8a.gif";
		}
	}
}

function MouseOver(id) {
	if (navigator.userAgent.indexOf("MSIE 5.") == -1 && navigator.userAgent.indexOf("MSIE5.") == -1 && navigator.userAgent.indexOf("MSIE 4.") == -1) {
		if (navigator.userAgent.indexOf("MSIE") != -1 && window.clipboardData && !window.opera) {
			if (id == "menu_1") {
				document.getElementById(id).style.backgroundImage = "url('./public/style/menu_under_1.gif')";
			}
			if (id == "menu_2") {
				document.getElementById(id).style.backgroundImage = "url('./public/style/menu_under_2.gif')";
			}
			if (id == "menu_3") {
				document.getElementById(id).style.backgroundImage = "url('./public/style/menu_under_3.gif')";
			}
			if (id == "menu_4") {
				document.getElementById(id).style.backgroundImage = "url('./public/style/menu_under_4.gif')";
			}
			if (id == "menu_5") {
				document.getElementById(id).style.backgroundImage = "url('./public/style/menu_under_5.gif')";
			}
			if (id == "menu_6") {
				document.getElementById(id).style.backgroundImage = "url('./public/style/menu_under_6.gif')";
			}
			if (id == "menu_7") {
				document.getElementById(id).style.backgroundImage = "url('./public/style/menu_under_7.gif')";
			}
			if (id == "menu_8") {
				document.getElementById(id).style.backgroundImage = "url('./public/style/menu_under_8.gif')";
			}
			document.getElementById(id).style.backgroundPosition = "-1068px 29px";
		}
		else {
			clearTimeout(AnimeID[id]);
			document.getElementById(id).style.backgroundPosition = "-1068px 29px";
		}
	}
}

function MouseOut(id) {
	if (navigator.userAgent.indexOf("MSIE 5.") == -1 && navigator.userAgent.indexOf("MSIE5.") == -1 && navigator.userAgent.indexOf("MSIE 4.") == -1) {
		if (navigator.userAgent.indexOf("MSIE") != -1 && window.clipboardData && !window.opera) {
			if (id == "menu_1") {
				document.getElementById(id).style.backgroundImage = "url('./public/style/menu_under_1a.gif')";
			}
			if (id == "menu_2") {
				document.getElementById(id).style.backgroundImage = "url('./public/style/menu_under_2a.gif')";
			}
			if (id == "menu_3") {
				document.getElementById(id).style.backgroundImage = "url('./public/style/menu_under_3a.gif')";
			}
			if (id == "menu_4") {
				document.getElementById(id).style.backgroundImage = "url('./public/style/menu_under_4a.gif')";
			}
			if (id == "menu_5") {
				document.getElementById(id).style.backgroundImage = "url('./public/style/menu_under_5a.gif')";
			}
			if (id == "menu_6") {
				document.getElementById(id).style.backgroundImage = "url('./public/style/menu_under_6a.gif')";
			}
			if (id == "menu_7") {
				document.getElementById(id).style.backgroundImage = "url('./public/style/menu_under_7a.gif')";
			}
			if (id == "menu_8") {
				document.getElementById(id).style.backgroundImage = "url('./public/style/menu_under_8a.gif')";
			}
			document.getElementById(id).style.backgroundPosition = "0px 29px";
		}
		else {
			document.getElementById(id).style.backgroundPosition = "-890px 29px";
			if (id == "menu_1") {
				AnimeID[id] = setTimeout("document.getElementById('menu_1').style.backgroundPosition = \"-712px 29px\"" ,100)
				AnimeID[id] = setTimeout("document.getElementById('menu_1').style.backgroundPosition = \"-534px 29px\"" ,200)
				AnimeID[id] = setTimeout("document.getElementById('menu_1').style.backgroundPosition = \"-356px 29px\"" ,300)
				AnimeID[id] = setTimeout("document.getElementById('menu_1').style.backgroundPosition = \"-178px 29px\"" ,400)
				AnimeID[id] = setTimeout("document.getElementById('menu_1').style.backgroundPosition = \"0px 29px\"" ,500)
			}
			if (id == "menu_2") {
				AnimeID[id] = setTimeout("document.getElementById('menu_2').style.backgroundPosition = \"-712px 29px\"" ,100)
				AnimeID[id] = setTimeout("document.getElementById('menu_2').style.backgroundPosition = \"-534px 29px\"" ,200)
				AnimeID[id] = setTimeout("document.getElementById('menu_2').style.backgroundPosition = \"-356px 29px\"" ,300)
				AnimeID[id] = setTimeout("document.getElementById('menu_2').style.backgroundPosition = \"-178px 29px\"" ,400)
				AnimeID[id] = setTimeout("document.getElementById('menu_2').style.backgroundPosition = \"0px 29px\"" ,500)
			}
			if (id == "menu_3") {
				AnimeID[id] = setTimeout("document.getElementById('menu_3').style.backgroundPosition = \"-712px 29px\"" ,100)
				AnimeID[id] = setTimeout("document.getElementById('menu_3').style.backgroundPosition = \"-534px 29px\"" ,200)
				AnimeID[id] = setTimeout("document.getElementById('menu_3').style.backgroundPosition = \"-356px 29px\"" ,300)
				AnimeID[id] = setTimeout("document.getElementById('menu_3').style.backgroundPosition = \"-178px 29px\"" ,400)
				AnimeID[id] = setTimeout("document.getElementById('menu_3').style.backgroundPosition = \"0px 29px\"" ,500)
			}
			if (id == "menu_4") {
				AnimeID[id] = setTimeout("document.getElementById('menu_4').style.backgroundPosition = \"-712px 29px\"" ,100)
				AnimeID[id] = setTimeout("document.getElementById('menu_4').style.backgroundPosition = \"-534px 29px\"" ,200)
				AnimeID[id] = setTimeout("document.getElementById('menu_4').style.backgroundPosition = \"-356px 29px\"" ,300)
				AnimeID[id] = setTimeout("document.getElementById('menu_4').style.backgroundPosition = \"-178px 29px\"" ,400)
				AnimeID[id] = setTimeout("document.getElementById('menu_4').style.backgroundPosition = \"0px 29px\"" ,500)
			}
			if (id == "menu_5") {
				AnimeID[id] = setTimeout("document.getElementById('menu_5').style.backgroundPosition = \"-712px 29px\"" ,100)
				AnimeID[id] = setTimeout("document.getElementById('menu_5').style.backgroundPosition = \"-534px 29px\"" ,200)
				AnimeID[id] = setTimeout("document.getElementById('menu_5').style.backgroundPosition = \"-356px 29px\"" ,300)
				AnimeID[id] = setTimeout("document.getElementById('menu_5').style.backgroundPosition = \"-178px 29px\"" ,400)
				AnimeID[id] = setTimeout("document.getElementById('menu_5').style.backgroundPosition = \"0px 29px\"" ,500)
			}
			if (id == "menu_6") {
				AnimeID[id] = setTimeout("document.getElementById('menu_6').style.backgroundPosition = \"-712px 29px\"" ,100)
				AnimeID[id] = setTimeout("document.getElementById('menu_6').style.backgroundPosition = \"-534px 29px\"" ,200)
				AnimeID[id] = setTimeout("document.getElementById('menu_6').style.backgroundPosition = \"-356px 29px\"" ,300)
				AnimeID[id] = setTimeout("document.getElementById('menu_6').style.backgroundPosition = \"-178px 29px\"" ,400)
				AnimeID[id] = setTimeout("document.getElementById('menu_6').style.backgroundPosition = \"0px 29px\"" ,500)
			}
			if (id == "menu_7") {
				AnimeID[id] = setTimeout("document.getElementById('menu_7').style.backgroundPosition = \"-712px 29px\"" ,100)
				AnimeID[id] = setTimeout("document.getElementById('menu_7').style.backgroundPosition = \"-534px 29px\"" ,200)
				AnimeID[id] = setTimeout("document.getElementById('menu_7').style.backgroundPosition = \"-356px 29px\"" ,300)
				AnimeID[id] = setTimeout("document.getElementById('menu_7').style.backgroundPosition = \"-178px 29px\"" ,400)
				AnimeID[id] = setTimeout("document.getElementById('menu_7').style.backgroundPosition = \"0px 29px\"" ,500)
			}
			if (id == "menu_8") {
				AnimeID[id] = setTimeout("document.getElementById('menu_8').style.backgroundPosition = \"-712px 29px\"" ,100)
				AnimeID[id] = setTimeout("document.getElementById('menu_8').style.backgroundPosition = \"-534px 29px\"" ,200)
				AnimeID[id] = setTimeout("document.getElementById('menu_8').style.backgroundPosition = \"-356px 29px\"" ,300)
				AnimeID[id] = setTimeout("document.getElementById('menu_8').style.backgroundPosition = \"-178px 29px\"" ,400)
				AnimeID[id] = setTimeout("document.getElementById('menu_8').style.backgroundPosition = \"0px 29px\"" ,500)
			}
		}
	}
}

function FoldIndex(){
	if (document.getElementById) {
		if (document.getElementById('index_list').style.display == "none") {
			document.getElementById('index_list').style.display = "block";
			document.getElementById('switch').firstChild.nodeValue = "close";
		}
		else {
			document.getElementById('index_list').style.display = "none";
			document.getElementById('switch').firstChild.nodeValue = "open";
		}
	}
	else if (document.all) {
		if (document.all('index_list').style.display == "none") {
			document.all('index_list').style.display = "block";
			document.all('switch').firstChild.nodeValue = "close";
		}
		else {
			document.all('index_list').style.display = "none";
			document.all('switch').firstChild.nodeValue = "open";
		}
	}
	else if (document.layers) {
		if (document.layers['index_list'].display == "none") {
			document.layers['index_list'].display = "block";
			document.layers['switch'].firstChild.nodeValue = "open";
		}
		else {
			document.layers['index_list'].display = "block";
			document.layers['switch'].firstChild.nodeValue = "open";
		}
	} 
}