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

function highlightMainNavLink(menu){
	var regexp = /(https?:\/\/[^\/]*)?(\/.*\/)?(.*)?/;;
	var hPage = regexp.exec(window.location.pathname);
	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 = regexp.exec(hlink.href);
					//alert("Page2 = "+page[2]+ " - Href2 = "+hPage[2]);
					//alert("Page3 = "+page[3]+ " - Href3 = "+hPage[3]);
					if(page[2] && page[2] == hPage[2] && !page[3]){
						if(hlink.className){
							hlink.className = hlink.className+' currentpage';
						}
						else{
							hlink.className = 'currentpage';
						}
						hlink.title = 'The Section you are Currently Browsing';
						page = null
					}
					else if (page[3] && page[3] == hPage[3] || page[3] && page[3] == "/" && hPage[3] == "/index.html" || page[2] == hPage[2] && page[3] == "index.html" && !hPage[3]){
						if(hlink.className){
							hlink.className = hlink.className+' currentpage';
						}
						else{
							hlink.className = 'currentpage';
						}
						hlink.title = 'The Page you are Currently Viewing';
						page = null
					}
				}
	   		}
		}
	}
}

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)"
			linktext = eclink.childNodes[0];
			linktext.data = "Collapse the Content Area";
		}
		else{
			wrap.className = "";
			eclink.title = "Expand the Content Area (removing the Side Bar)"
			linktext = eclink.childNodes[0];
			linktext.data = "Expand the Content Area";
		}
	}
	return false;
}
addLoadEvent(highlightNavigation);

