// JavaScript Document

var isMouseOut = false;
var menuIDArray = new Array();
var timeOutVar;

function showMenu(whichMenu)
{
  if(document.getElementById) // Only use browsers that support it - otherwise - pah ignore them oldies!
  {
    var leftEdge = ((document.body.clientWidth)/2-270);
    if (leftEdge < 130)
      leftEdge = 130;
    isMouseOut = false; // Tell everyone we are over a menu...
    for( i=0; i< menuIDArray.length; i++)
    {
      document.getElementById("menuPositioningDiv"+menuIDArray[i]).style.visibility = 'hidden';
      document.getElementById("menuPositioningDiv"+menuIDArray[i]).style.left = leftEdge;
    }
    document.getElementById("menuPositioningDiv"+whichMenu).style.visibility = 'visible';

//    document.getElementById("menuDiv" + whichMenu).style.backgroundColor="#ffcc00";
//    document.getElementById("menuLink" + whichMenu).style.textdecoration="underline";

  }
}

function hideMenu(whichMenu)
{
  if(document.getElementById) // Only use browsers that support it - otherwise - pah ignore them oldies!
  {
    isMouseOut = true;
    timeOutVar = setTimeout("hideDiv("+whichMenu+")",5); // Need a timeout to handle event bubbling on IE4 etc
                                                         // This lets us breifly go off an item...
  }

//    document.getElementById("menuDiv" + whichMenu).style.backgroundColor="#ffffff";
//    document.getElementById("menuLink" + whichMenu).style.textdecoration="none";
}

function hideDiv(whichMenu)
{
  if(isMouseOut) // If we are not over any item then hide this menu
  {
    document.getElementById("menuPositioningDiv"+whichMenu).style.visibility = 'hidden';
  }
}

function goTo(whereTo)
{
  document.location=whereTo;
}

