// JavaScript Document by Nick Rigby edited by Derrick Dardano
//Original
/*
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav2");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
*/

startList = function() {
  if (document.all&&document.getElementById) {
    var idArray = new Array();
    idArray[0] = "nav";
    idArray[1] = "nav2";
    idArray[2] = "nav3";
//	idArray[3] = "nav4";

    for(var x=0;x<idArray.length;x++){
	  iterateNav(idArray[x]);
    }
  }
iterNest("nav4");
}

function iterateNav(id){    
var navRoot = document.getElementById(id);
if(navRoot==null)
	return;
for (i=0; i<navRoot.childNodes.length; i++) {
   var node = navRoot.childNodes[i];

   if (node.nodeName=="LI" ) {
	  
      node.onmouseover=function() { 
      this.className+=" over";//display 
      }
      node.onmouseout=function() {
      this.className=this.className.replace(" over", "");
      }
   }
}
}

	
function iterNest(id){
	
		var navRoot = document.getElementById(id);
		if(navRoot==null)
		    return;
		list = navRoot.getElementsByTagName("LI");
        subnavs = document.getElementsByName("sub");
        if(navigator.appName == "Netscape"){
		   for(i = 0;i < subnavs.length;i ++){
			   node = subnavs[i];
			   node.parentNode.onmouseover = function(){
	               node.firstChild.className=node.firstChild.className.replace("out", "over");
			   }
			   node.parentNode.onmouseout = function(){				   				   
				   node.firstChild.className=node.firstChild.className.replace("over", "out");
				   
			   }
		   }
        subnavs1 = document.getElementsByName("sub1");
//        if(navigator.appName == "Netscape"){
		   for(i = 0;i < subnavs1.length;i ++){
			   node1 = subnavs1[i];
			   node1.parentNode.onmouseover = function(){
	               node1.firstChild.className=node1.firstChild.className.replace("out", "over");
			   }
			   node1.parentNode.onmouseout = function(){				   				   
				   node1.firstChild.className=node1.firstChild.className.replace("over", "out");
				   
			   }
		   }		   
		}else{  
		    var nodes = new Array();
            var child = new Array(list.length);
			for(i = 0;i < list.length;i++){
				nodes[i] = list[i].lastChild;
			}
  		   for(var i = 0;i < list.length;i++){  
		    // node = list[ i ].lastChild;
			 if(nodes[i].tagName == "UL"){				 
				 child[i] = nodes[i].firstChild;
				 j = i;
				 nodes[i].parentNode.onmouseover = function(){ 
					child[j].className =child[j].className.replace("out", "over");
				 } 
				 nodes[i].parentNode.onmouseout = function(){
					  child[j].className=child[j].className.replace("over", "out");
				 }
			 }
		   }
		
		}
}

function expand(id,y,image){

	if(document.getElementById(id).className=='out'){
		image.src='networks/images/collaps.gif'
		window.scroll(0,y);
		document.getElementById(id).className = 'over';
		
			
	}else{
		image.src='networks/images/expand2.gif'
		document.getElementById(id).className = 'out';	
			
		
	}
	
}



window.onload=startList;