//現在位置

function highlightpage(){
	if(!document.getElementsByTagName) return false;
	if(!document.getElementById) return false;
	if(!document.getElementById("menu")) return false;
	var nav = document.getElementById("menu");
	var links = nav.getElementsByTagName("a");
	
	for(var i=0; i<links.length; i++){
		var linkurl = links[i].getAttribute("href");
		var currenturl = window.location.href;
		if(currenturl.indexOf(linkurl) != -1){
			var linkimages = links[i].getElementsByTagName("img")[0]
			var src_replace = linkimages.getAttribute("src").replace("_off.", "_on.");
			linkimages.setAttribute("src",src_replace);
				
		}
	}
}

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


//ロールオーバー

 function smartRollover() {  
     if(document.getElementsByTagName) {  
        var images = document.getElementsByTagName("img");  
         for(var i=0; i < images.length; i++) {  
            if(images[i].getAttribute("src").match("_off."))  
             {  
               images[i].onmouseover = function() {  
                   this.setAttribute("src", this.getAttribute("src").replace("_off.", "_ov."));  
                }  
                images[i].onmouseout = function() {  
                    this.setAttribute("src", this.getAttribute("src").replace("_ov.", "_off."));  
               }  
             }  
         }  
     }  
 }  
 if(window.addEventListener) {  
     window.addEventListener("load", smartRollover, false);  
 }  
 else if(window.attachEvent) {  
     window.attachEvent("onload", smartRollover);  
}  
