//navRollovers.js
// functions for controlling nav rollovers
 if (document.images) {
    imgIcon1 = new Image();
	imgIcon1.src = "/assets/lay/bg_nav_on.gif";
	imgIcon2 = new Image();
	imgIcon2.src = "/assets/lay/btn_bg_on.gif";
	imgIcon3 = new Image();
	imgIcon3.src = "/assets/lay/btn_bg_on.gif";
	imgIcon4 = new Image();
	imgIcon4.src = "/assets/lay/icon_leftNav_arrow_on.gif";
 }
 
 function swapBGTop(e) {
	    /*
		 called onMouseover when a user mouses over a navigation link
		*/
		
	    var el = e.parentNode;
		el.className =  el.className + " topNavOn";
		
	   }//eof
	   
	   function swapBGTopBack(e) {
	    /*
		 called onMouseover when a user mouses over a navigation link
		*/
		
	   var el = e.parentNode;
		//alert(el.className.indexOf("last"))
		 if (el.className.indexOf("last") == 0)
		   el.className = "last"; //want to make sure the right border doesn't go away when we mouse off
		 else el.className = "";
	     
	   }//eof
	   
	function swapBtnBG(e) {
	    /*
		 called onMouseover when a user mouses over a navigation link
		*/
		
	    var el = findTarget(e,'input');
		el.style.color = "#666666";
		el.style.backgroundImage = "url('assets/lay/btn_bg_on.gif')";
		
	   }//eof
	   
	   function swapBtnBack(e) {
	    /*
		 called onMouseover when a user mouses over a navigation link
		*/
		
	    var el = findTarget(e,'input');
		el.style.color = "#f39a60";
		el.style.backgroundImage = "url('/assets/lay/btn_bg_off.gif')";
		
	   }
	
	//add listeners for the left navigation
     function addNavListeners() {
	    //will loop through the child elements of leftNav and attach a mouseover function to each element 
        if(! document.getElementsByTagName ||
		   ! document.getElementById)
		   return;
		
		   //alert(childs.length);
		   //get top nav
		   //main Nav
		   var  parentEl = document.getElementById("navbar");
		 
		  // alert(parent.childNodes.length);
		   var childs = parentEl.getElementsByTagName('a');
		   
		   for (var i = 0; i < childs.length; i++ ) {
		      if(childs[i].className.indexOf("li") ) {
			      childs[i].onmouseover = swapBGTop;
				  childs[i].onmouseout = swapBGTopBack;
			  }
		   }//for (i = 0; 1 < childs.length; i++ )
		   //alert(childs.length);
		   //left side navigation
		 
	   }//eof
	   
	
       //addNavListeners()

        // ;
     
	   
	  
	