// JavaScript Document

//Discovers all the div tags inside of the top_nav element (i.e. menu) 
//hides all displayed menus but for the one with the id passed into the script.
function showMenu( dropDownId ){
		
	//get the div elements inside of leftmenu
	var allDropDownLists = document.getElementById( "top_nav" ).getElementsByTagName("div");
	
	//loop through the list of menus
	for( index = 0; index < allDropDownLists.length; index++ ){
		
		//get the div tag element in the current element if it exists
		var dropDownLists = allDropDownLists[index].getElementsByTagName("div");
		
		//if the div element contains another then a drop-down menu item exists 
		if( dropDownLists.length > 0 ){
			
			//if the element id matches the input id value
			if( allDropDownLists[index].id == dropDownId ){
			
				//Show the element
				dropDownLists[0].style.display = "block";
			} else {
			
				//Hide the element.`
				dropDownLists[0].style.display = "none" ;
			}
		}
	}
}
