function highlightNavigation(){
	// Add each navigation menu you want to highligh here
	// Example: highlightNavLink('NavigationListID');
	highlightNavLink('mainmenu');
	highlightNavLink('submenu');
	highlightNavLink('inthissection');
}

function highlightNavLink(menu){
	var hPath = window.location.pathname;
	var hPage = hPath.substring(hPath.lastIndexOf('/') + 1);
	
	if (document.getElementById && document.getElementById(menu)) {
		var navRoot = document.getElementById(menu);
		for (i=0; i<navRoot.childNodes.length; i++) {
			var node = navRoot.childNodes[i];
			if (node.nodeName == "LI") {
				if (node.childNodes[0].href){
					var hlink = node.childNodes[0];
					var page = hlink.href.substring(hlink.href.lastIndexOf('/') + 1);
					if(page == hPage){
						if(hlink.className){
							hlink.className = hlink.className+' currentpage';
						}
						else{
							hlink.className = 'currentpage';
						}
						hlink.title = 'The Section you are Currently Browsing';
					}
				}
	   		}
		}
	}
}

function collapsesidebar(){
	if (document.getElementById) {
		wrap = document.getElementById("wrapper");
		eclink = document.getElementById("expandcollapse");
		if (wrap.className == ""){
			wrap.className = 'sidebarhidden';
			eclink.title = "Collapse the Content Area (showing the Side Bar)"
		}
		else{
			wrap.className = "";
			eclink.title = "Expand the Content Area (removing the Side Bar)"
		}
	}
}

addLoadEvent(highlightNavigation);
