function initNav()
{
	var nav = document.getElementById("main-nav");
	var current;
	var first = true;
	if (nav)
	{
		var nodes = nav.getElementsByTagName("span");
		for (var i = 0; i < nodes.length; i++)
		{
			if(nodes[i].className.indexOf("separator") != -1)
			{					
				nodes[i].onmouseover = function () 
				{
					if(this.className.indexOf("separator") != -1)
						this.className += " hover";
				}
				nodes[i].onmouseout = function ()
				{
					if(this.className.indexOf("separator") != -1)
						this.className = this.className.replace("hover", "");
				}	
				nodes[i].onclick = function ()
				{
					current = document.getElementById("current");
					if(current)
					{
						current.id = "";
						this.parentNode.id = "current";
						if(first)
						{
							first = false;
							var nav = document.getElementById("main-nav");
							var li = nav.getElementsByTagName("li");
							if(li)
							{
								for(var i = 0; i < li.length; i++)
								{
									li[i].className = li[i].className.replace("active", "");
								}
							}					
						}
					}
				}
			}
		}
	}
}
if (window.addEventListener){
	window.addEventListener("load", initNav, false);
}
else if (window.attachEvent){
	window.attachEvent("onload", initNav);
}
