/**************GENERAL JAVASCRIPT THAT WRITES THE SIDE NAVIGATION BAR*******/
var sidePtr = 0 ;      					    
 barSideArray = new Array(sidePtr +30); // create global barSideArray to store images for verical and sideizontal bars
function BarClass(num,nicName,refFile,theName) {
  // Attributes:
  this.barNum=num; 
  this.barNicName= nicName;
  this.ref= refFile; 
  this.barTheName= theName;		//this.imgBarName="bar"+ num; 	//e.g. "bar2"	  
  //this.idcalss ="" ;  				
  this.display= display;  
}

function display() {   							
	  document.write('<li><a href="'); 
	  document.write(this.ref); 	
	  document.write('"  ');
	  document.write(this.idcalss); 
	  document.write(' >');
      document.write(this.barTheName); 
	  document.write('</a></li>');
}

function NavClass(len, visualtop, visualbot, classhomeid) { // NavClass Class declaration
   this.navLen=len;
   this.topHtml = visualtop;
   this.botHtml = visualbot;
   this.classHome = classhomeid
	 //methods:
   this.displayNavSide=displayNavSide;   //puts the navagation table frame  //and loops over all bar display each
}

//-----------------------------------------------------------------

// displayNavSide Method

//-----------------------------------------------------------------

function displayNavSide(barname) {  
   document.write(this.topHtml);
    var k;
	  for (k=sidePtr +1 ; k <= this.navLen  ; k++)
	  {
       if  ( barSideArray[k].barNicName == barname ){
     				barSideArray[k].idcalss = ' id="current" ';                    
       }    
   	   barSideArray[k].display();
	 }
   document.write(this.botHtml);	
}

/**************GENERAL JAVASCRIPT THAT WRITES THE TOP NAVIGATION BAR*******/
var topPtr = 0 ;      					    
 barTopArray = new Array(topPtr +30); // create global barTopArray to store images for verical and topizontal bars
function BarClass(num,nicName,refFile,theName) {
  // Attributes:
  this.barNum=num; 
  this.barNicName= nicName;
  this.ref= refFile; 
  this.barTheName= theName;		//this.imgBarName="bar"+ num; 	//e.g. "bar2"	  
  //this.idcalss ="" ;  				
  this.display= display;  
}

function display() {   							
	  document.write('<li><a href="'); 
	  document.write(this.ref); 	
	  document.write('"  ');
	  document.write(this.idcalss); 
	  document.write(' >');
      document.write(this.barTheName); 
	  document.write('</a></li>');
}

function NavTopClass(len, visualtop, visualbot, classhomeid) { // NavTopClass Class declaration
   this.navLen=len;
   this.TOPtopHtml = visualtop;
   this.TOPbotHtml = visualbot;
   this.classHome = classhomeid
	 //methods:
	 this.displayNavTop=displayNavTop;   //puts the navagation table frame  //and loops over all bar display each
}

//-----------------------------------------------------------------

// displayNavTop Method

//-----------------------------------------------------------------

function displayNavTop(barname) {  
   document.write(this.TOPtopHtml);
    var k;
	  for (k=topPtr +1 ; k <= this.navLen  ; k++)
	  {
       if  ( barTopArray[k].barNicName == barname ){
      				barTopArray[k].idcalss = ' id="current" ';                    
       }    
   	   barTopArray[k].display();
	 }
   document.write(this.TOPbotHtml);	
}


//function to clear the text in a text field on click.  the code should be <input name="q" id="query" type="text" value="Search our Site" onclick="clearText(this)" size="20" style="color:#1e1f76;">

function clearText(thefield) { 
 if (thefield.defaultValue == thefield.value)
  thefield.value = "" 
 else 
  thefield.value = thefield.defaultValue 
} 

