
//--------------------------------------------------
// RollOver Group
//--------------------------------------------------
plLoad_ON = new Array();
plLoad_ON[0] = "";
var tmpcnt = 0;
var ovnm = "_on";
var myObj,oldImg,myReImg;
function imgpl(){
	var links = document.getElementsByTagName("body")[0].getElementsByTagName("a");
	for(i=0;i<links.length;i++){
		var imglnks = links[i].getElementsByTagName("img");
		if(links[i].rel == "rollov"){
			// count -----------------------------------
			tmpcnt++;
			// preload ---------------------------------
			myReImg = imglnks[0].src.match(/.gif|.jpg|.png/);
			plLoad_ON[tmpcnt] = new Image();
			plLoad_ON[tmpcnt].src = imglnks[0].src.split(myReImg)[0] + ovnm + myReImg;
			// set -------------------------------------
			SetRoll(links[i],tmpcnt);
		}
	}
}
function SetRoll(wk,cnt){
	wk.onmouseover=imgON;
	wk.onmouseout=imgOT;
}
function imgON(){
	var wk = this.getElementsByTagName("img")[0];
	oldImg  = wk.src;
	myObj   = wk.src.split(/.gif|.jpg|.png/)[0];
	myReImg = wk.src.split(myObj)[1];
	wk.src = myObj + ovnm + myReImg;
}
function imgOT(){
	var wk = this.getElementsByTagName("img")[0];
	wk.src = oldImg;
}

//--------------------------------------------------
// ONLOAD
//--------------------------------------------------
function doOnLoad() {
	imgpl();
}
// -- ACTIVE
window.onload =	doOnLoad;



//=============================================
// ImgOver()
//=============================================

if(document.images) {
	menu0off = new Image();
	menu0off.src = "/images/menu01.gif";
	menu0on = new Image();
	menu0on.src = "/images/menu01_on.gif";
	menu1off = new Image();
	menu1off.src = "/images/menu02.gif";
	menu1on = new Image();
	menu1on.src = "/images/menu02_on.gif";
	menu2off = new Image();
	menu2off.src = "/images/menu03.gif";
	menu2on = new Image();
	menu2on.src = "/images/menu03_on.gif";
	menu3off = new Image();
	menu3off.src = "/images/menu04.gif";
	menu3on = new Image();
	menu3on.src = "/images/menu04_on.gif";
	menu4off = new Image();
	menu4off.src = "/images/menu05.gif";
	menu4on = new Image();
	menu4on.src = "/images/menu05_on.gif";
	menu5off = new Image();
	menu5off.src = "/images/menu06.gif";
	menu5on = new Image();
	menu5on.src = "/images/menu06_on.gif";
}


imgId = "";
function ImgOver(imgName,imgState) {
	if(document.images) {
		stringId0 = imgName.substring(0,4);
		stringId1 = imgName.substring(4,6);
		if((stringId0 == "menu") && (stringId1==stayId)){
			document[imgName].src = eval(imgName + "on" + ".src")
		} else if((stringId0 == "menu") && (stringId1!=stayId) && ((stringId1 == imgId))){
			document[imgName].src = eval(imgName + "on" + ".src");
		} else {
			document[imgName].src = eval(imgName + imgState + ".src");
		}
	}
}

//=============================================
// StayMenu()　※カレント表示に使用します
//=============================================
function StayMenu(stayId){
	ImgOver("menu" + stayId,"on");
	imgId = stayId;
}


