if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.menu{display: none;}\n')
document.write('.submenu2{display: none;}\n')
document.write('.menuItem img{visibility: hidden;}\n')
document.write('</style>\n')
}

function getPage(myFakeURL) {

	var myNewURL;
	var mySub1 = "/"; 
	
	//Strip out everything before the last "/" 
	myNewURL = rightFromSubStringToEndOfFullString(location.href, mySub1); 

	//Get url of page
	if (myFakeURL)
	{
		myNewURL = myFakeURL;
	}

	if ( myNewURL == "" )
	{
		myNewURL = "index.html"
	}	


	//Create an array of anchor tags in the list menuList
	var ar = document.getElementById("leftnavigation").getElementsByTagName("a");


	//Loop through array of achor tags
	for (var i=0; i<ar.length; i++){

		//Get the href value of the anchor tag
		var myHref = ar[i].href;		

		//Strip out everything before the last "/" leaving the filename
		var myNewHref = rightFromSubStringToEndOfFullString(myHref, mySub1); 
		
		//Check if url of page matches url of anchor href
		if (myNewHref == myNewURL) {

			ar[i].style.color = "#f79749";

			if ( ar[i].lastChild.style )
			{			
				// displays the page locator arrows
				ar[i].lastChild.style.display = "inline";
			}
		}				
	}
}

function getTopNav(myFakeURL) {

	var myNewURL;
	var mySub1 = "/"; 
	
	//Strip out everything before the last "/" 
	myNewURL = rightFromSubStringToEndOfFullString(location.href, mySub1); 

	//Get url of page
	if (myFakeURL)
	{
		myNewURL = myFakeURL;
	}

//	if ( myNewURL == "" )
//	{
//		myNewURL = "index.html"
//	}	

	//Create an array of anchor tags in the list menuList
	var ar = document.getElementById("topnav").getElementsByTagName("a");

	//Loop through array of achor tags
	for (var i=0; i<ar.length; i++){

		//Get the href value of the anchor tag
		var myHref = ar[i].href;				

		//Strip out everything before the last "/" leaving the filename
		var myNewHref = rightFromSubStringToEndOfFullString(myHref, mySub1); 		

		//Check if url of page matches url of anchor href
		if (myNewHref == myNewURL) {
			ar[i].style.color = "#f79749";			
		}				
	}
}

//Returns everything right of the last instance of the subString to the end of the fullString 
function rightFromSubStringToEndOfFullString(fullString, subString) { 
	if (fullString.lastIndexOf(subString) == -1) { 
		return ""; 
	} 
	else { 
		return fullString.substring(fullString.lastIndexOf(subString)+1, fullString.length); 
	} 
} 

function resetMenu(obj){
	if(document.getElementById){
		var el = document.getElementById(obj);
		var ar = document.getElementById("menuList").getElementsByTagName("ol");
		var array = document.getElementById(obj).getElementsByTagName("ol");

		for (var i=0; i<ar.length; i++){
			if (ar[i].className=="menu" || ar[i].className=="submenu2")

			ar[i].style.display = "none";
		}
		
		el.style.display = "block";
		
		for (var i=0; i<array.length; i++){
			if (array[i].className=="submenu2")
		
			array[i].style.display = "none";
		}		
	}
}
