var LastMain = false;
var LastSub = false;
var TimerID = false;

function ShowMenu(id)
	{
	CancelHide();
	Hide();
	LastMain = id;
	document.getElementById("menu"+id).style.visibility = "visible";
	}
	
function ShowSubMenu(id)
	{
	CancelHide();
	HideSub();
	LastSub = id;
	document.getElementById("menu"+id).style.visibility = "visible";
	//alert(id);
	}
	
function InitHide()
	{
	TimerID = setTimeout('Hide()', 2000);
	}
	
function Hide()
	{
	if (LastMain) document.getElementById("menu"+LastMain).style.visibility = "hidden";
	HideSub();
	}

function HideSub()
	{
	if (LastSub) document.getElementById("menu"+LastSub).style.visibility = "hidden";
	}

function CancelHide()
	{
	clearTimeout(TimerID);
	}
	
function MenuOver(id)
	{
	document.getElementById("Menucell"+id).style.backgroundColor = "#FF9966";
	}
	
function MenuOut(id)
	{
	document.getElementById("Menucell"+id).style.backgroundColor = "#C7E8FF";
	}
	
function SetLang(l)
	{
	document.langform.Lang.value = l;
	document.langform.submit();
	}