/* menu.js version 1.01 */
/* author:	Rumiya Murtazina (RNJQ) */

window.onload=boldLink;

function boldLink()
{
	//Get filename from the URL
	thisPage = document.URL.substring(document.URL.lastIndexOf("/")+1 ,document.URL.length);
	
	//Loop through all the links
	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);
		
		//if the current filename & the link-ed file name are the same, change the background color of that link
		if (thisPage == pageLink)
		{	
			
			document.links[i].className = "currentPage";	
			
			doubleLiHr=document.getElementById("doubleLi").href.substring(document.links[i].href.lastIndexOf("/")+1 ,document.links[i].href.length);				
			if (thisPage == doubleLiHr && thisPage !="")
			{
				document.getElementById("doubleLi").className = "currentPage";				
			}
			//if (thisPage == "")
			//{
			//	document.getElementById("defauLi").className = "currentPage";				
			//}
			


			thisId = document.links[i].id;
			parentThisId = document.links[i].parentNode.id
			parentName = document.links[i].parentNode.name
			
			
			if (parentThisId == "sideNavChild"){
				parentThisId = document.getElementById(parentThisId).parentNode.id
				document.getElementById(parentName+'Sub').style.display = "block";
				document.getElementById(parentName).className = "currentPage";	
				
			}
			
			
			
			//show sub menu
			document.getElementById(thisId +'Sub').style.display = "block";
			
			
			document.links[i].onclick = function() {return false;}
		}
		
	}
}