// this function shows the declared menu by changing the visibility of the div element containing the menu.
function showMenu(which) {
	//before actually showing the menu, it hides all the menus except the one it's about to bring up. This is used in case a hideMenu call is missed, to avoid ever having two menus appearing at once.
	hideAllNowExcept(which);
	document.getElementById(which).style.visibility = "visible";
}
//this function hides the specified div which has the menu in it
function hideMenu(which) {
	//setTimeout("document.getElementById('" + which + "').style.visibility='hidden'",500); (this fucks things up!)
	document.getElementById(which).style.visibility='hidden';
}
function hideAllNowExcept(which) {
	//get an array of all divs in the page and loop through them
	var menus = document.getElementsByTagName("div");
	for (i=0; i<menus.length-1; i++) {
		//if the div is a "menu" class (specified in the "class" attribute), and the id of the menu div isn't the one passed-in, then hide the menu div.
		if (menus[i].className == "menu" && menus[i].className != which)
			menus[i].style.visibility = "hidden";
	}
}