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 gone = 1;
	var beginner = 0;
	seeya = setTimeout('',100000);

	if (menu == null || actuator == null) return;

	actuator.onmouseover = function() {
	        if (currentMenu == null) {
			this.showMenu();
	    	} else {
	            currentMenu.style.visibility = "hidden";
	            currentMenu = null;
	        }
		this.showMenu();
		if (gone == 1) {
			clearInterval(seeya);
		}
		gone = 0;
	        return false;
	}
	hide = function() {
		currentMenu.style.visibility = "hidden";
		currentMenu = null;
	}

	actuator.onmouseout = function() {
		seeya = setTimeout('hide()',100);
		gone = 1;
	}


	actuator.showMenu = function() {
		menu.style.visibility = "visible";
		currentMenu = menu;
	}

	menu.onmouseover = function() {
		if (gone == 1) {
			clearInterval(seeya);
			gone = 0;
		}
	}

	menu.onmouseout = function() {
		seeya = setTimeout('hide()',100);
		gone = 1;
	}


}

window.onload = function() {
	initializeMenu("l1", "t1");
	initializeMenu("l2", "t2");
	initializeMenu("l3", "t3");
	initializeMenu("l4", "t4");
}


