﻿/*rollover script by two-ways*/
/*coryright(c)two-ways co.Ltd All rights reserved*/
/*2008.05 ver3.0*/

window.onload=LoadEvent;

function LoadEvent(){
prImg= new Array();
for (i=0; i<document.images.length; i++){
	if(document.images[i].getAttribute("class")=="over"){
	baseIMG = document.images[i].src;
	newIMG = baseIMG.replace(baseIMG.substr(baseIMG.length-4,4),("_o" + baseIMG.substr(baseIMG.length-4,4)));
	prImg[i] = new Image();
	prImg[i].src = newIMG;
	document.images[i].setAttribute("onmouseover", "Over("+i+")");
	document.images[i].setAttribute("onmouseout", "Out("+i+")");
	}else if(document.images[i].getAttribute("className")=="over"){
	baseIMG = document.images[i].src;
	newIMG = baseIMG.replace(baseIMG.substr(baseIMG.length-4,4),("_o" + baseIMG.substr(baseIMG.length-4,4)));
	prImg[i] = new Image();
	prImg[i].src = newIMG;
	document.images[i].setAttribute("onmouseover",  new Function("Over("+i+");"));
	document.images[i].setAttribute("onmouseout",  new Function("Out("+i+");"));
	}
}

	//newwin
for (k=0; k<document.links.length; k++){
	if(document.links[k].getAttribute("class")=="map"){
	document.links[k].setAttribute("onclick", "OpenWin()");
	document.links[k].target = windowname;
	}else if(document.links[k].getAttribute("className")=="map"){
	document.links[k].setAttribute("onclick", new Function("OpenWin();"));
	document.links[k].target = windowname;
	}
}



if(document.getElementById('course01')){
document.getElementById('course01').style.height = '35px';
document.getElementById('course02').style.height = '35px';
document.getElementById('course03').style.height = '35px';
document.getElementById('course04').style.height = '35px';
}

}

function Over(IMG){//mouseover
baseIMG = document.images[IMG].src;
if(baseIMG.substr(baseIMG.length-6,2) !="_o"){
newIMG = baseIMG.replace(baseIMG.substr(baseIMG.length-4,4),("_o" + baseIMG.substr(baseIMG.length-4,4)));
document.images[IMG].src=newIMG;
}
}

function Out(IMG){//mouseout
baseIMG = document.images[IMG].src;
if(baseIMG.substr(baseIMG.length-6,2) =="_o"){
newIMG = baseIMG.replace(baseIMG.substr(baseIMG.length-6,6),baseIMG.substr(baseIMG.length-4,4));
document.images[IMG].src=newIMG;
}
}

function callJavascript(toY,ID) {
document.getElementById(ID).style.height = toY+ 'px';
return toY;
} 

function ReciseArea(toY,ID) {
document.getElementById(ID).style.height = toY+ 'px';
return toY;
} 



/*newwindow script by two-ways*/
/*2006.12.21ver1.0*/

//window setting
windowname = "newwin";
option = "toolbar=no,location=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600";

function OpenWin(){
var link=this.location.href;
var win1=window.open(link,windowname, option);
win1.focus();
 }

