function topNavigation()
{
	if ( document.all && document.getElementById )
	{
		topNavRoot = document.getElementById("topNavBar");
		// You should always check that you got an element, Scott! :p -Soren
		if(topNavRoot){
			mainNodes = topNavRoot.childNodes;

			var subNodes = new Array();

			for ( count = 0; count < mainNodes.length; count++ )
			{
				for ( i = 0; i < mainNodes[count].childNodes.length; i++ )
				{
					if ( mainNodes[count].childNodes[i].nodeName == "UL" )
					{
						subNodes[count] = mainNodes[count].childNodes[i];
					}
				}
			}

			// MAIN TOP BAR NAV FUNCTIONALITY
			for ( count = 0; count < mainNodes.length; count++ )
			{
				node = mainNodes[count];

				if ( node.nodeName == "LI" )
				{
					node.onmouseover = function() {	this.className += " over"; }

					node.onmouseout = function() { this.className = this.className.replace(" over", ""); }
				}
			}

			// DROPDOWN FUNCTIONALITY
			for ( count = 0; count < subNodes.length; count++ )
			{
				if ( !subNodes[count] ) { continue; }

				for ( j = 0; j < subNodes[count].childNodes.length; j++ )
				{
					subnode = subNodes[count].childNodes[j];

					if ( subnode.nodeName == "LI" )
					{
						subnode.onmouseover = function() { this.parentNode.parentNode.className += "Over"; }

						subnode.onmouseout = function() { this.parentNode.parentNode.className = 
this.parentNode.parentNode.className.replace("Over", ""); }
					}
				}
			}
		}
	}
}



function leftNavigation()
{
	bodyTag = document.getElementsByTagName("body");
	if(bodyTag){
		bodyClass = bodyTag[0].className;

		if ( bodyClass.charAt(0) == " " )
		{
			bodyClass = bodyClass.substring(1);
		}

		if ( bodyClass.indexOf(" ") != -1 )
		{
			subZone = bodyClass.split(" ");

			if ( subZone[1] != "" )
			{
				subZone = subZone[1];
				var sub = document.getElementById(subZone);
				if(sub){
					sub.className += " highlighted";
				}
				sub = document.getElementById(subZone + "Chevron");
				if(sub){
					sub.src = "img/bullet_collapse.gif";
				}
			}
		}
	}
}

window.onload=function(){
	topNavigation();
	leftNavigation();
}



// Channel sub nav drop down fix for I.E. - acts as :hover psuedo class
sfHover = function() {     
 var sfEls = document.getElementById("nav-super");
 if(sfEls) {
  sfEls = sfEls.getElementsByTagName("LI");
  for (var i=0; i<sfEls.length; i++) {
   sfEls[i].onmouseover=function() {
    this.className+=" sfhover";
   }
   sfEls[i].onmouseout=function() {
    this.className=this.className.replace(new RegExp(" sfhover\\b"), "");         
   }     
  } 
 }
} 

if (window.attachEvent) window.attachEvent("onload", sfHover);