/*Code for basic dropdown menus*/

  var maxTime = 500; //half a second before menu goes away
  var myTimer = 0;
  var myElement = 0;
  function drop(id)
  {
    //alert("about us menu - hover");
    //cancel an existing timeout
    dropTimeoutCancel();
    //hide any other open menus
    if (myElement) myElement.style.visibility = 'hidden';
    //finally show the menu for whatever we're hovering over
    myElement = document.getElementById(id);
    myElement.style.visibility = 'visible';
  }

  function undrop()
  {
    //just hide anything that's open

    if (myElement)
    {
    //alert("hiding");
    myElement.style.visibility = 'hidden';
    }
  }

  function dropTimeout()
  {
    //set undrop to run in maxTime ms
    myTimer = window.setTimeout(undrop,maxTime);
  }

  function dropTimeoutCancel()
  {
    //belay that undrop, browser
    if(myTimer)
    {
      window.clearTimeout(myTimer);
      myTimer = null;
    }
  }

  document.onclick = undrop; //click anywhere else and this menu gets it
