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() {
            this.showMenu();
    }
	
	actuator.onmouseout = function() {
            currentMenu.style.visibility = "hidden";
    }
	
    actuator.showMenu = function() {
		if (navigator.userAgent.indexOf("Safari") != -1){
			safadj = 5;
		} else {
			safadj = 0;
		}
		if (navigator.userAgent.indexOf("MSIE") != -1){
			ieadj =  document.body.clientWidth/2 - 770/2;
		} else {
			ieadj = 0;
		}	
		if ((navigator.userAgent.indexOf("MSIE") != -1)&&(navigator.userAgent.indexOf("Mac") != -1)){
			macieadj = -10;
		} else {
			macieadj = 0;
		}
		
        menu.style.left = this.offsetLeft + ieadj + safadj - macieadj + "px";
        menu.style.top = "252px";
        menu.style.visibility = "visible";
        currentMenu = menu;
    }
}
