﻿function initMenu() {	//mainMenu = document.getElementById("mainMenu");	//tmpMainMenu = document.getElementById("mainMenu");	linkList  = document.getElementsByTagName("a");	for( var i=0 ; i<linkList.length ; i++ ) {		if( isLinkActive( linkList[i].href ) ) {			linkList[i].className = "active";		}	}	/*tmpMainMenu = document.getElementById("subMenu");	linkList  = tmpMainMenu.getElementsByTagName("a");	for( var i=0 ; i<linkList.length ; i++ ) {		if( isLinkActive( linkList[i].href ) ) {			linkList[i].className = "active";		}	}*/}Event.observe(window,"load",initMenu,true);function isLinkActive( link ) {		tmpLink = link;	if( tmpLink.indexOf("#") != -1 ) return false;	//alert(tmpLink.substring(tmpLink.length-10));	/*if( tmpLink.substring(tmpLink.length-10) == "index.html" ) {		tmpLink = tmpLink.substring(0,tmpLink.length-10);		//alert(tmpLink.substring(0,tmpLink.length-10));	}*/	if( tmpLink.charAt(tmpLink.length-1) != "/" ) {		tmpIndex = tmpLink.lastIndexOf(".");		tmpLink = tmpLink.substring(0,tmpIndex)+"/";	}		currentUrl = new String(document.location);	if( currentUrl.charAt(currentUrl.length-1) != "/" ) {		tmpIndex = currentUrl.lastIndexOf(".");		currentUrl = currentUrl.substring(0,tmpIndex)+"/";	}		currentUrl = currentUrl.substring(0,tmpLink.length);		//alert(tmpLink+" "+currentUrl);	return ( tmpLink == currentUrl );	/*real_link = link.substring(0, link.length-5)+"/";    current_url = new String(document.location);    current_url = current_url.substring(0,current_url.length-5)+"/";    current_url = current_url.substring(0,real_link.length);    return ( real_link == current_url );*/}
