var menuTimer = null;

function menuitemOver(obj) {
	obj.style.background = '#bddb47';
	menuResetTimeout();
}

function menuitemOut(obj) {
	obj.style.background = 'transparent';
}

function menuOut() {
	menuTimer = setTimeout('hideAll()',200);
}

function menuShow(menuId) {
	hideAll();
	var menu = document.getElementById(menuId);
	menu.style.display = 'block';
}

function hideAll() {
	menuResetTimeout();
	hide(document.getElementById('catmenu'));
	hide(document.getElementById('authormenu'));
	hide(document.getElementById('bookmenu'));
	hide(document.getElementById('licCountries'));
	hide(document.getElementById('licTypes'));
	hide(document.getElementById('licTitles'));
}

function hide(menu) {
	menu.style.display = 'none';
}

function menuResetTimeout() {
	if (menuTimer) clearTimeout(menuTimer);
	menuTimer = null;
}
