initTopNav = function() {
	var navRoot = document.getElementById("left-nav");
	var lis = navRoot.getElementsByTagName("li");
	for (var i=0; i<lis.length; i++)
	{
		lis[i].onclick = function()
		{
			if (this.className.indexOf('open') == -1)
			{
				for (var j=0; j<lis.length; j++) lis[j].className = lis[j].className.replace("open", "");
				this.className += " open";
			}
			else
			{
				this.className = this.className.replace("open", "");
			}
		}
		lis[i].onmouseover = function()
		{
			this.className += " active";
		}
		lis[i].onmouseout = function()
		{
			this.className = this.className.replace("active", "");
		}
	}
}

if (window.addEventListener)
{
	window.addEventListener("load", initTopNav, false);
}
else if (window.attachEvent && !window.opera)
{
	window.attachEvent("onload", initTopNav);
}
	
