var t = null;
var maxindex = 5;

function showmenu(index) {
	window.clearTimeout(t);
	for (var i=0; i<=maxindex; i++) {
		if (i != index) {
			document.getElementById("submenu_"+String(i)).className = "submenu hide";
		}
	}
	document.getElementById("submenu_"+String(index)).className = "submenu show";
}

function hidemenu() {
	t = window.setTimeout("hidenow()", 400);
}

function hidenow() {
	for (var i=0; i<=maxindex; i++) {
		document.getElementById("submenu_"+String(i)).className = "submenu hide";
	}
}
