// JavaScript Document

navHover = function() {
	var lis = document.getElementById("navmenu").getElementsByTagName("LI");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover=function() {
			this.className+=" iehover";
		}
		lis[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", navHover);


function onloading()
{
	var root = document.getElementById("navmenu");
	for(i=0 ;i< root.childNodes.length;i++)
	{   
		var childnodes = root.childNodes[i];
		if(childnodes.hasChildNodes())
		{
			for(j=0;j<childnodes.childNodes.length;j++)
			{   
				var innerChild = childnodes.childNodes[j]; 
				if(innerChild.nodeName == 'UL')
				{
					innerChild.onmouseover = function()
					{ 
						var tagA = this.parentNode.getElementsByTagName('A');
						if(tagA[0].className != 'current')
						{
							tagA[0].className = "current";
						}
						else
						{
							tagA[0].className += " over";
						}
					}
					innerChild.onmouseout = function()
					{ 
						var tagA = this.parentNode.getElementsByTagName('A');
						if(tagA[0].className.indexOf('over') > -1)
						{
							tagA[0].className = tagA[0].className.replace(new RegExp(" over\\b"), '');
						}
						else
						{
							tagA[0].className = "now";
						}
					}
				}
				/*if(innerChild.hasChildNodes())
				{
					for(k=0;k<innerChild.childNodes.length;k++)
					{
						var innerSecond =  innerChild.childNodes[k];
						if(innerSecond.hasChildNodes())
						{
							for(m=0 ;m<innerSecond.childNodes.length; m++)
							{
								var innerThird = innerSecond.childNodes[m];
								if(innerThird.nodeName == 'A')
								{				
									innerThird.onmouseover = function()
									{ 
										var tagA = this.parentNode.parentNode.parentNode.getElementsByTagName('A');
										tagA[0].className = "current";
									}
									innerThird.onmouseout = function()
									{ 
										var tagA = this.parentNode.parentNode.parentNode.getElementsByTagName('A');
										tagA[0].className = "now";
									}
								}
							}
						}
					}
				}*/
			}
		}
	}
}
//function IEHoverPseudo() {
//
//	var navItems = document.getElementById("primary-nav").getElementsByTagName("li");
//	
//	for (var i=0; i<navItems.length; i++) {
//		if(navItems[i].className == "menuparent") {
//			navItems[i].onmouseover=function() { this.className += " over"; }
//			navItems[i].onmouseout=function() { this.className = "menuparent"; }
//		}
//	}
//
//}
//window.onload = IEHoverPseudo;