
var myElement;
var prevElement;
var curListElement;
var prevListElement;
var myLocation;

function closeMenu()
{
	if (prevListElement != null) 
	{
		if (prevListElement.nodeName == "LI")
		{
			prevListElement.style.display = "none";
		}
		prevListElement = prevListElement.nextSibling;
		window.setTimeout("closeMenu()", 40);
	}else
	{
		window.location.href = myLocation;
	}
}

function openMenu()
{
	if (curListElement != null) 
	{
		if (curListElement.nodeName == "LI")
		{
			curListElement.style.display = "block";
		}
		curListElement = curListElement.nextSibling;
		window.setTimeout("openMenu()", 40);
	}else
	{
		closeMenu();
	}
}


function openclose(myUrl, myId, prevId)
{
	if (myId != prevId)
	{
		myLocation = myUrl;
		myElement = document.getElementById("top" + myId);
		curListElement = myElement.firstChild;
		prevElement = document.getElementById("top" + prevId);
		if (prevElement)
		{
			prevListElement = prevElement.firstChild;
		}else
		{
			prevListElement = null;
		}
		openMenu();
	}
}



