sfHover = function() {
	var sfEls = document.getElementById("menu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
			this.style.zIndex=200; //this line added to force flyout to be above relatively positioned stuff in IE
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover);

function HightLightNav(){
	var highlightcolor = '#d5dae0';
	var lowlightcolor = '#ecf0f6';
	
	// Hight Light the parent category links when mouse is over the link
	var li = document.getElementsByTagName("li");
	
	for ( var j = 0; j < li.length; j++ ) {
		var h2 = li[j].getElementsByTagName("h2");
		for ( var k = 0; k < h2.length; k++ ) {
			h2[k].onmouseover=function() {
				this.style.backgroundColor = highlightcolor;
			}
			h2[k].onmouseout=function() {
				if( this.className != 'nav-active' ) this.style.backgroundColor = lowlightcolor;
			}
		}
	}
	
	// Keep the parent category link highlighted while looking at the sub categories
	var _li = document.getElementById("menu").getElementsByTagName("LI");

	for ( var l = 0; l < _li.length; l++ ) {
		var _ul = _li[ l ].getElementsByTagName("ul");
		for ( var m = 0; m < _ul.length; m++ ) {
			_ul[ m ].onmouseover=function() {
				var _h2 = this.parentNode.getElementsByTagName("h2");
				_h2[ 0 ].style.backgroundColor = highlightcolor;
			}
			_ul[ m ].onmouseout=function() {
				var _h2 = this.parentNode.getElementsByTagName("h2");
				_h2[ 0 ].style.backgroundColor = lowlightcolor;
			}
		}
	}
}

window.onload = function(){
	HightLightNav();	
}

