var timer;  //variable to reference the timer which prevents the menus from closing right away

//FUNCTION TO SHOW A MENU (OR HIDE ALL IF THE menu VARIABLE IS EMPTY
function ShowMenu(menu) {
	var openMenu = document.getElementById(menu);
	for(var i=1; i<=5; i++) {
		if(document.getElementById('Menu' + i)) {
			document.getElementById('Menu' + i).style.top = "-999em";
		}
	}
	
	if(openMenu) {
		clearTimeout(timer)  //stop the timer, so the menu doesn't close
		openMenu.style.top = "2em";
	}
}

//FUNCTION TO HIDE ANY OPEN MENUS AFTER A GIVEN AMOUNT OF TIME
function HideMenu() {
	timer = setTimeout('ShowMenu()',1500);
}