
var path = location.pathname;
function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");
		var imgName = nowPage();
		for(var i=0; i < images.length; i++) {
			if(imgName != ""){
				if(images[i].getAttribute("src").match(imgName))
				{
					images[i].src = images[i].src.replace("_off.", "_on.");
				}
			}
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}

function nowPage(){
	if((path == "/")||(path == "/index.html")){
		return "gnavi_top_off.jpg";
	}else if(path.match("/racinggear/")){
		return "gnavi_racinggear_off.jpg";
	}else if(path.match("/spingear/")){
		return "gnavi_spingear_off.jpg";
	}else if(path.match("/mobilefull/")){
		return "gnavi_mobilefull_off.jpg";
	}else if(path.match("/company/")){
		return "gnavi_company_off.jpg";
	}else if(path.match("/contact/")){
		return "gnavi_contact_off.jpg";
	}else{
		return "";
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}


//フッターをウィンドウの下つきにする
//document.write('<script type="text/javascript" src="/common/js/footerFixed.js"></script> ');

