var inmenu=false;
var lastmenu=0;

function Menu(current, menuWidth) {
	if (!document.getElementById) return;
	inmenu=true;
	oldmenu=lastmenu;
	lastmenu=current;
	if (oldmenu) Erase(oldmenu);
	m=document.getElementById("menu_" + current);
	box=document.getElementById(current);
	box.style.left= m.offsetLeft + 198;
	box.style.top= m.offsetTop + m.offsetHeight + 26;
	box.style.visibility="visible";
	m.style.backgroundColor="#CCCCCC";
	box.style.backgroundColor="#CCCCCC";
	box.style.width= menuWidth;
}

function Timeout(current) {
	inmenu=false;
	window.setTimeout("Erase('" + current + "');",500);
}

function Erase(current) {
	if (!document.getElementById) return;
	if (inmenu && lastmenu==current) return;
	m=document.getElementById("menu_" + current);
	box=document.getElementById(current);
	box.style.visibility="hidden";
}

function Highlight(menu,item) {
	if (!document.getElementById) return;
	inmenu=true;
	lastmenu=menu;
	obj=document.getElementById(item);
	obj.style.backgroundColor="#DDDDDD";
}

function UnHighlight(menu,item) {
	if (!document.getElementById) return;
	Timeout(menu);
	obj=document.getElementById(item);
	obj.style.backgroundColor="#CCCCCC";
}
