
var currentMenu = null;


if (!document.getElementById)
   document.getElementById = function() { return null; }

function initializeMenu(menuId, actuatorId) {/* start of initializemenu function */
    var menu = document.getElementById(menuId);
    var mbar = document.getElementById(actuatorId);
   
 if (menu == null || mbar == null) return;

   mbar.onmouseover = function() {
   	if (currentMenu != null) {  
     	 	currentMenu.style.visibility = "hidden";             
      		this.showMenu();
        }
  	if(currentMenu == null){
      		this.showMenu();
  	 } 

     menu.onmouseout = function(){
     currentMenu.style.visibility = "hidden"; 
     }
    
    
}  /*    end of initializemenu */




 mbar.onclick = function() {
  if (currentMenu == null) {
          this.showMenu();
       }      
  else {
      currentMenu.style.visibility = "hidden"; 
           currentMenu = null;
         
           
        }
          /*   return false; */
  }
  
 
   
  
  
  mbar.showMenu = function() {
        menu.style.left = this.offsetLeft + "px";
        menu.style.top = this.offsetTop + this.offsetHeight + "px";
        menu.style.visibility = "visible";
        currentMenu = menu;}
  }