//SCRIPT FOR MENU BAR
var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;
var submenuitem = 0;
var subtimer = 0;
var subsubmenuitem = 0;
var subsubtimer = 0;

function togglepathbox()
{
	if (document.getElementById("pathbox").style.display == "" || document.getElementById("pathbox").style.display == "none")
	{
		document.getElementById("pathbox").style.display = "inline";
		document.getElementById("pathboxcontrol").innerHTML = "Hide paths and loops";
	}
	else
	{
		document.getElementById("pathbox").style.display = "none";
		document.getElementById("pathboxcontrol").innerHTML = "Show paths and loops";
	}
}

function ddopen(id)
{
	ddcancel();

	if (ddmenuitem)
		ddmenuitem.style.visibility = 'hidden';
	if (submenuitem)
		submenuitem.style.visibility = 'hidden';
		
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';
}

function ddclosed()
{
	if (ddmenuitem)
		ddmenuitem.style.visibility = 'hidden';
}

function ddclose()
{
	closetimer = window.setTimeout(ddclosed, timeout);
}

function ddcancel()
{
	if (closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

function clearcookies()
{
	window.location = "clear.php";
}
