var currentMenu = null;if (!document.getElementById)    document.getElementById = function() { return null; }function initializeMenu(menuId, actuatorId) {    var menu = document.getElementById(menuId);    var actuator = document.getElementById(actuatorId);    if (menu == null || actuator == null) return;    actuator.onmouseover = function() {        if (currentMenu) {            currentMenu.style.visibility = "hidden";            this.showMenu();        }    }          actuator.onclick = function(e) {        if (currentMenu == null) {            this.showMenu();        }        else {            currentMenu.style.visibility = "hidden";            currentMenu = null;        }        if (!e) var e = window.event;        e.cancelBubble = true;                if (e.stopPropagation) e.stopPropagation();                return false;    }            document.onclick = function() {               if (currentMenu != null) {            currentMenu.style.visibility = "hidden";            currentMenu = null;        }        return true;    }        actuator.showMenu = function() {        menu.style.left = this.offsetLeft + "px";        menu.style.top = this.offsetTop + this.offsetHeight + "px";        menu.style.visibility = "visible";        currentMenu = menu;    }               var elements = menu.getElementsByTagName('a');      var maxWidth = 0;    for (var iIndex = 0; iIndex < elements.length; iIndex++) {       var len = elements.item(iIndex).firstChild.nodeValue.length;       maxWidth = Math.max(len, maxWidth);    }        menu.style.width = maxWidth + 1 + "em";}