// JavaScript Document
  // if the given id is off, turn it on, and vice versa
  function toggleMenu(theid) {
	  if(document.getElementById) {
		  if(document.getElementById(theid).style.display == 'none') {
			  showMenu(theid);
		  } else {
			  hideMenu(theid);
		  }
	  } else {
		  // browser can't handle getelementbyid. do nothing
		  return;
	  }
  };
	
	// show the given block
  function showMenu(theid) {
	  if(document.getElementById) {
		  document.getElementById(theid).style.display = 'block';
	  } else {
		  // browser can't handle getelementbyid. do nothing
		  return;
	  }
  };
  
  // hide the given block
  function hideMenu(theid) {
	  if(document.getElementById) {
		  document.getElementById(theid).style.display = 'none';
	  } else {
		  // browser can't handle getelementbyid. do nothing
		  return;
	  }
  };
	  
  function initHideMenus() {
	  if(document.getElementById) {
			
			if(document.getElementById(currentMenu)){
				document.getElementById(currentMenu).style.fontWeight = "bold";
				document.getElementById(currentMenu).style.cursor = "default";
				document.getElementById(currentMenu).style.background = "#C9C9C9";
   			document.getElementById(currentMenu).style.color = "#3C3C3C";
			}
			
		  for(i=0;i<menuList.length;i++) {
			  hideMenu(menuList[i], false);
			  // make sure to expand the current section
			  //if(document.getElementById(menuList[i]).className == "expanded") toggleMenu(menuList[i]);
				if(menuList[i] == menuExpanded) toggleMenu(menuList[i]);
		  }
	  } else {
		  // browser can't handle getelementbyid. do nothing
		  return;
	  }
  }

	window.onload = initHideMenus;
	
	function showHighlight(theid) {
	  
		if (theid == currentMenu){
			return;
		}
		
		if(document.getElementById) {
		  if(document.getElementById(theid) != null) {
			  document.getElementById(theid).style.background = "#AFAFAF";
				document.getElementById(theid).style.color = "#FFFFFF";
		  }
	  } else {
		  // browser can't handle getelementbyid. do nothing
		  return;
	  }
  }
	
	function hideHighlight(theid) {
		
		if (theid == currentMenu){
			return;
		}

	  if(document.getElementById) {
		  if(document.getElementById(theid) != null) {
			  document.getElementById(theid).style.background = "#969696";
				document.getElementById(theid).style.color = "#FFFFFF";
		  }
	  } else {
		  // browser can't handle getelementbyid. do nothing
		  return;
	  }
  }
	
	function goLocation(parentMenu, theid) {
		
		if (theid == currentMenu){
			return;
		}

	  if(document.getElementById) {
		  if(document.getElementById(theid) != null) {
				var goURL = '../'+ parentMenu + '/' + theid +'.php';
				window.location.assign(goURL);
		  }
	  } else {
		  // browser can't handle getelementbyid. do nothing
		  return;
	  }
  }
	
	function rootGoLocation(parentMenu, theid) {
		
		if (theid == currentMenu){
			return;
		}

	  if(document.getElementById) {
		  if(document.getElementById(theid) != null) {
				var goURL = parentMenu + '/' + theid +'.php';
				window.location.assign(goURL);
		  }
	  } else {
		  // browser can't handle getelementbyid. do nothing
		  return;
	  }
  }
 