 //builds menu (netscape 4 only)
 function arrange(whichMenu, firstLayer) {	
  nextY = document.layers[firstLayer].pageY + document.layers[firstLayer].document.height;
  for (i=firstLayer+1; i<document.layers.length; i++) {	 
   whichEl = document.layers[i];   
   if (whichEl.id.indexOf(whichMenu) != -1) {
		if (whichEl.visibility != "hide") {
		 whichEl.pageY = nextY;
		 nextY += whichEl.document.height;
		}		
   }   
  }  

 }  
 

 //determine which expand function to call
 function expandIt(el, whichMenu, thisRow) {
  if (!ver4) return;  
  if (newBrowser) {expandNew(el, whichMenu, thisRow)}
  else if(IE4) {expandIE4(el, whichMenu, thisRow)}
	else {expandNS(el, whichMenu, thisRow)}	
 }
 
 
 //expand menu function (5.0+ )
 function expandNew(el, whichMenu, thisRow) { 	
  //whichEl = el + "Child";
  whichEl = document.getElementById(el + "Child");
 whichIm = document.getElementById(el);
    
  	
	
	//loop through divs, change display to "none"
	if (newBrowser) {tempColl = document.getElementsByTagName("div")} else {tempColl = document.all.tags("div")}	
  for (i=0; i<tempColl.length; i++) {
		if (tempColl[i].id.indexOf("Child") != -1 && tempColl[i].id.indexOf(whichMenu) != -1 && tempColl[i].id != whichEl.id) {tempColl[i].style.display = "none";} 		
	}	
	//*******************************************************	
                        
  //expand selected div
  if (whichEl.style.display == "none") {
		whichEl.style.display = "block"; 
					
		
		
	}
  else {		
		whichEl.style.display = "none"; 
							
		
	}	 
 }
 
 //expand menu function (ie4 )
 function expandIE4(el, whichMenu, thisRow) { 	
  whichEl = eval(el + "Child");
  if (newBrowser) {whichIm = document.getElementById(el)}
  else {whichIm = document.all(el)}
    
  
	
	//loop through divs, change display to "none"
	if (newBrowser) {tempColl = document.getElementsByTagName("div")} else {tempColl = document.all.tags("div")}	
  for (i=0; i<tempColl.length; i++) {
		if (tempColl(i).id.indexOf("Child") != -1 && tempColl(i).id.indexOf(whichMenu) != -1 && tempColl(i).id != whichEl.id) {tempColl(i).style.display = "none";} 		
	}	
	//*******************************************************	
                        
  //expand selected div
  if (whichEl.style.display == "none") {
		whichEl.style.display = "block"; 
					
		
		
	}
  else {		
		whichEl.style.display = "none"; 
							
		
	}	 
 }
 
 //expand menu function (netscape 4 only)
 function expandNS(el, whichMenu, thisRow) {		
  whichEl = eval("document." + el + "Child");
  whichIm = eval("document." + el + "Parent.document.images['imEx']");             	
	
	//only expand one row at a time
	//*******************************************************	  
  for (i=0; i<document.layers.length; i++) {
		thisEl = document.layers[i];								
    if (thisEl.id.indexOf("Child") != -1 && thisEl.id.indexOf(whichMenu) != -1 && thisEl.id != whichEl.id) {thisEl.visibility = "hide";}	//change visibility to none
		
	}	    	
	//*******************************************************
	
  //expand selected layer
  if (whichEl.visibility == "hide") {
		whichEl.visibility = "show";
				
	}	
  else {
		whichEl.visibility = "hide"; 
					
  }      
  if (location.href.indexOf("shopelvis") == -1) {
		arrange('el_', 0);
		arrange('main', 1);      
	 }
	 else {arrange('main', 0)
	} 
 } 
