//List of all menus
var menus = new Array();
var drops = new Array();

var menuTimer;

//This function creates and stores all the menuDropObj objects
function menuRegister(menuId, dropId) {

  menus[menus.length] = menuId;
  drops[menuId] = new menuDropObj(menuId, dropId, -8, 20);
}

//Called from a mouse over this hides all visible drop downs 
//and displays the specified one
function menuActive(menuId) {

  menuCancelTimeout();
  menuHideAll();
  drops[menuId].Show();  
}

//This function hides all the menu drop downs
function menuHideAll() {

  for (i = 0; i < menus.length; i++)
    drops[menus[i]].Hide();
}

//Function to hide the drop downs after 300 miliseconds
function menuTimeout() {

  menuTimer = setTimeout(menuHideAll, 300);
}

//This function cancels the above timer
function menuCancelTimeout() {

  clearTimeout(menuTimer);
}