
window.onload = function highlightLink(){

//alert("test buzz");

	//Get filename from the URL
	thisPage = document.URL.substring(document.URL.lastIndexOf("/")+1 ,document.URL.length);
	//alert(thisPage);
	
	//if (thisPage == ""){
	//document.getElementById("nav1").className = "current1";
	//}

	//Loop through all the links
	//alert(document.links.length);
	for (i=0; i<document.links.length; i++ )
	{
		//Get only the filename from the href of navigation link
		pageLink = document.links[i].href.substring(document.links[i].href.lastIndexOf("/")+1 ,document.links[i].href.length);
		//
		//alert(pageLink);
		//if the current filename & the link-ed file name are the same, change the background color of that link

		navnum = i - 2; //since there are 3 links before the top nav subtract 2 from navmum so that including the 0 in the loop the top nav starts at 1 when the className is set below
		
		//alert(navnum);

		if (thisPage == pageLink)
		{
		
			if (navnum > 0){
			
			document.links[i].className = "current" + navnum;
			//alert (document.links[i].className);
			//alert (document.links.length);
			}
			
		}

	}
}

