window.onload = function (){
var myHref = document.location.href;
var myUrl = FilePass(myHref);

var TextLink = document.getElementsByTagName("A");
for(var i=0; i < TextLink.length; i++) {
if(TextLink[i].href==myHref && TextLink[i].parentNode.parentNode.parentNode.parentNode.id=="navi02"){
	TextLink[i].style.color='#f60';
	}
else if(TextLink[i].href==myHref && TextLink[i].parentNode.parentNode.parentNode.className=="practice-list"){
	TextLink[i].style.color='#f60';
	}
	}	
	
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");
		
		for(var i=0; i < images.length; i++) {
			if(images[i].parentNode.nodeName=="A"){
			before=images[i].parentNode.href;
			after=FilePass(before);
			}
			if(images[i].className=="rollover" && before==myHref && images[i].parentNode.parentNode.className=="sub-navi")
			{
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".gif", "_on.gif"));
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".jpg", "_on.jpg"));
				
			}
			
			else if(images[i].className=="rollover" && images[i].parentNode.parentNode.className=="sub-navi" && before.match('practice-') && before!=myHref &&myHref.match('practice-') && myHref.match('education'))
			{
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".gif", "_on.gif"));
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".jpg", "_on.jpg"));
				
			}
	
			else if(images[i].className=="rollover" && images[i].parentNode.parentNode.className=="sub-navi" && before.match('-practice') && before!=myHref &&myHref.match('-practice') && myHref.match('education'))
			{
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".gif", "_on.gif"));
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".jpg", "_on.jpg"));
				
			}
			
			else if(images[i].className=="rollover" && images[i].parentNode.parentNode.className=="sub-navi" && before.match('project') && before!=myHref &&myHref.match('project') && myHref.match('education'))
			{
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".gif", "_on.gif"));
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".jpg", "_on.jpg"));
				
			}
			
			else if(images[i].className=="rollover" && images[i].parentNode.parentNode.className=="sub-navi" && before.match('overseas') && before!=myHref &&myHref.match('overseas') && myHref.match('education'))
			{
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".gif", "_on.gif"));
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".jpg", "_on.jpg"));
				
			}
			
			else if(images[i].className=="rollover" && images[i].parentNode.parentNode.className=="sub-navi" && before.match('w-curriculum') && before!=myHref &&myHref.match('w-curriculum') && myHref.match('education'))
			{
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".gif", "_on.gif"));
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".jpg", "_on.jpg"));
				
			}

			else if(images[i].className.match("rollover") && before==myHref && images[i].parentNode.parentNode.className=="wd-655 mg-auto" && myHref.match("outside"))
			{
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".gif", "_on.gif"));
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".jpg", "_on.jpg"));
				
			}

			else if(images[i].className.match("rollover") && before.match(myHref) && myHref.match("project"))
			{
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".gif", "_on.gif"));
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".jpg", "_on.jpg"));
				
			}

			else if(images[i].className.match("rollover") && before.match(myHref) && myHref.match("oversea"))
			{
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".gif", "_on.gif"));
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".jpg", "_on.jpg"));
				
			}

			else if(images[i].className.match("rollover") && before.match(myHref) && myHref.match("w-curriculum"))
			{
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".gif", "_on.gif"));
				images[i].setAttribute("src", images[i].getAttribute("src").replace(".jpg", "_on.jpg"));
				
			}

			else {
				if(images[i].className.match("rollover")){
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace(".jpg", "_on.jpg"));
					this.setAttribute("src", this.getAttribute("src").replace(".gif", "_on.gif"));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on", ""));
				}
				}
				}
			
		}
	}
}

function FilePass(str){
        var FilePass = str.substring(str.lastIndexOf("/")+1,str.length);
        return FilePass;
}



