
function onImg(){
	document.getElementById("live_li").src="../common/images/gnavi_live_r.gif";
}
function outImg(){
	document.getElementById("live_li").src="../common/images/gnavi_live.gif";
}
function onImg1(){
	document.getElementById("play_li").src="../common/images/gnavi_play_r.gif";
}
function outImg1(){
	document.getElementById("play_li").src="../common/images/gnavi_play.gif";
}
function onImg2(){
	document.getElementById("study_li").src="../common/images/gnavi_study_r.gif";
}
function outImg2(){
	document.getElementById("study_li").src="../common/images/gnavi_study.gif";
}
function onImg3(){
	document.getElementById("buy_li").src="../common/images/gnavi_buy_r.gif";
}
function outImg3(){
	document.getElementById("buy_li").src="../common/images/gnavi_buy.gif";
}
function onImg4(){
	document.getElementById("access_li").src="../common/images/gnavi_access_p.gif";
}
function outImg4(){
	document.getElementById("access_li").src="../common/images/gnavi_access.gif";
}


function onMouse() {
	if (!document.getElementById) return
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'ov') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_r'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			aImages[i].onmouseover = function() {
				
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_on'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
				/*if(flag!=0){
					document.getElementById("live_li").src="/common/images/gnavi_live.gif";
					flag=0;
					return flag;
				}*/
			}
			aImages[i].onclick = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_on'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = onMouse;


//=============================================
// ImgOver()
//=============================================
function ImgOver(wk1,wk2){
	//wk1:イメージ名　wk2:イメージパス
	document.images[wk1].src = wk2;
}


//=============================================
// ImgLoad()
//=============================================
function ImgLoad(){
	mAry = new Array();
	for( var i = 0; i < ImgLoad.arguments.length; i ++ ){
		mAry[i] = new Image();		mAry[i].src = ImgLoad.arguments[i];
		//document.write("<img src='" + mAry[i].src + "'><br>");
	}
}

