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;
  hideSelects( 'hidden' );
  
  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="";
  
  hideSelects( 'visible' );
}

function hideAllMenus()
{
	document.getElementById("dropdown0").style.display="none";
 	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("dropdown6").style.display="none";
  hideSelects( 'visible' );
}

function hideSelects(action) {
	return false;
  if (action!='visible'){action='hidden';}
  if (navigator.appName.indexOf("MSIE")) {
    var selects = document.getElementsByTagName("SELECT");
    for (var i = 0; i < selects.length; i++) {
        selects[i].style.visibility = action;
    }
  }
}

function getElementsByClassName(classname){
        var rl = new Array();
        var re = new RegExp('(^| )'+classname+'( |$)');
        var ael = document.getElementsByTagName('*');
        var op = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
        if (document.all && !op) ael = document.all;
        for(i=0, j=0 ; i<ael.length ; i++) {
                if(re.test(ael[i].className)) {
                        rl[j]=ael[i];
                        j++;
                }
        }
        return rl;
}


