﻿var dropdownDisabled = false;


function JumpMenu(oSelect)
{
	document.location.href = oSelect.options[oSelect.selectedIndex].value;
}

var timer = null;
var potentialTimer = null;

var timeOut = 400;

var activemenu = "";

function potentiallyHide(menuid)
{
	potentialTimer = window.setTimeout( "hideMenu('" + menuid + "')", timeOut );
}

function revealMenu( menuid )
{
   if (dropdownDisabled)
   	return false;
	
   window.clearTimeout(timer); // make sure this one isn't subsequently hidden 
   window.clearTimeout(potentialTimer);
	  
  if (activemenu == menuid) 
  {
  	 return false;  
  }  

  hideAllMenus();
  
  if (activemenu != "") { hideMenu( activemenu ); }
  document.getElementById(menuid).style.display="block";
  document.getElementById(menuid).style.zIndex="200";
  activemenu = menuid;
  
  document.getElementById(menuid).onmouseover = function () { 
  	if ( potentialTimer != null ) window.clearTimeout(potentialTimer);
    if ( timer != null ) { window.clearTimeout( timer ); timer = null; }
    document.getElementById(menuid).onmouseout = function () {
      timer = window.setTimeout( "hideMenu('" + menuid + "')", timeOut );
    }
  }   
}
function hideMenu( menuid )
{
	  if (dropdownDisabled)
   	return false;
	
  document.getElementById(menuid).style.display="none";
  activemenu="";
}

function hideAllMenus()
{

 	document.getElementById("dropdown1").style.display="none";
 	document.getElementById("dropdown2").style.display="none";
 	document.getElementById("dropdown4").style.display="none";
	document.getElementById("dropdown5").style.display="none";
 	document.getElementById("dropdown7").style.display="none";
}
