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;

	function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt,"Left"); }
	function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); }
	function getAbsPos(elt,which) {
		iPos = 0;
		while (elt != null) {
			iPos += elt["offset" + which];
			elt = elt.offsetParent;
		}
		return iPos;
	}

    actuator.onmouseover = function() {
		this.showMenu();
    }
    menu.onmouseover = function() {
		actuator.showMenu();
    }
    
    menu.onmouseout = function(event) {
    	actuator.hideMenu();
    }
    actuator.onmouseout = function() {
    	this.hideMenu();
    }

    actuator.showMenu = function() {
		menu.style.left = getAbsX(this) + eval(9) + "px";
		menu.style.top = getAbsY(this) + this.offsetHeight + "px";
        menu.style.visibility = "visible";
        MM_swapImage(actuator.name,'','images/common/' + actuator.name + '_over.gif',1);
        currentMenu = menu;
    }

    actuator.hideMenu = function() {
        menu.style.visibility = "hidden";
        MM_swapImgRestore();
    }
}
