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);
	var timer;
	
    if (menu == null || actuator == null) return;
	
	actuator.onmouseover = function() {
		window.clearTimeout(timer);
        if (currentMenu) {
            currentMenu.style.visibility = "hidden";
			menu.style.left ="";
			menu.style.top = "";
            this.showMenu();
        }
    }
	
	actuator.onmouseout = function() {
		window.clearTimeout(timer);
        if (currentMenu != menu) {
			menu.style.left ="";
			menu.style.top = "";
            this.showMenu();
        }
    }
	
	menu.onmouseout = function() {
        if (currentMenu != null) {
			timer = window.setTimeout('currentMenu.style.visibility = "hidden"',1000)
		}
		else {
			window.clearTimeout(timer);
		}
    }
	
	menu.onmouseover = function() {
   		window.clearTimeout(timer);
    }

	actuator.showMenu = function() {
		tmph = menu.offsetTop + 0;
		halfway = menu.offsetWidth/ 2;
		halfdist = this.offsetWidth / 2;
		
		var browser = navigator.appName 

		if (browser == "Microsoft Internet Explorer") 
	{
		
		menu.style.left = this.offsetLeft + halfdist - halfway /*- 26 30*/ + /*0*/"px";
		menu.style.top =  tmph + (this.offsetTop + this.offsetHeight) + /*6*/9 + "px";
	}
		else if (browser == "Netscape")
	{
		menu.style.left = this.offsetLeft + halfdist - halfway  + /*11*//*3*/0 + /*9*/ 35 +"px";
		menu.style.top =  tmph + (this.offsetTop /*+ this.offsetHeight*/) -/*4*/1 + "px";
		/*menu.style.width = 679;*/
	}
		else
	{
		menu.style.left = this.offsetLeft + /*0*/"px";
		menu.style.top = tmph + (this.offsetTop + this.offsetHeight) -6  + "px"; 
		//38-6-16
	}
		
	
		
		menu.style.visibility = "visible";
		currentMenu = menu
	}
}



