

var menuTimers = new Array();

function openMenu(menuId) {
	var menu = document.getElementById(menuId);
	if (menuTimers[menuId] || menu.style.display == "block") {
		menuGone(menuId);
		return;
	}
	menu.style.display = "block";
}

function refreshVisibility(menu) {
	if (menuTimers[menu.id]) {
		clearTimeout(menuTimers[menu.id]);
		menuTimers[menu.id] = null;
	}
}

function hideMenu(menu) {
	if (!menuTimers[menu.id]) {
		menuTimers[menu.id] = setTimeout("menuGone('"+menu.id+"')",600);
	}
}

function menuGone(menuId) {
	var menu = document.getElementById(menuId);
	menu.style.display = "none";
	menuTimers[menuId] = null;
}

function selectNode(me) {
	if (me.selectedIndex<1)
		return;
	var theForm = document.forms["TeamMenuBar"];
	theForm.submit();
}

function highlightOptions() {
	var theForm = document.forms["TeamMenuBar"];
	if (theForm) {
		var sel = theForm.elements[0];
		if (sel) {
			sel.options[1].className = "TopDepartment";
			for (var i=2;i<sel.options.length;i++) {
				var op = sel.options[i];
				if (op.text.charAt(0)!="-") {
					op.className = "MainDepartment";
				}
			}
		}
	}
}





