var current_menu = null;
var timer = null;

if (!document.getElementById) document.getElementById = function()
{
 return null;
}

function initialize_menu(menuId, actuatorId)
{
 var menu = document.getElementById(menuId);
 var actuator = document.getElementById(actuatorId);

 if (menu == null || actuator == null) return;

    actuator.onmouseover = function()
      {
        if (current_menu == null)
          {
            this.showMenu();
          }
        else
          {
            current_menu.style.visibility = "hidden";
            this.showMenu();
          }
      }

    actuator.onmouseout = function()
      {
        if (current_menu)
          {
            timer = setTimeout('current_menu.style.visibility = "hidden"', 600);
          }
      }
    
    menu.onmouseover = function()
      {
        window.clearTimeout(timer);
      }

    menu.onmouseout = function()
      {
        timer = setTimeout('current_menu.style.visibility = "hidden"', 600);
      }

    actuator.onclick = function()
      {
        top.location.href = actuator.href;
        return false;
      }

    actuator.showMenu = function()
      {
        window.clearTimeout(timer);
        menu.style.left = (this.offsetLeft) + "px";
        menu.style.top = (this.offsetTop) + this.offsetHeight + "px";
        menu.style.visibility = "visible";
        current_menu = menu;
      }


  }
