/**------------ FILE WiccJS.js  ------------------- 
------------ THE NAVIGATION BAR  ----------------**/
function barActOn( bar_num) {
   document [barArray[bar_num].imgBarName].src = barArray[bar_num].onImgSrc;
}

function barActOff(num) {
   var bar_num=num;
   document [barArray[bar_num].imgBarName].src = barArray[bar_num].offImgSrc;
}	
//----------------  Bar Class -------------------------------------	

function BarClass(num,offSrc,onSrc,liveSrc,refFile,altTag) {
  // parameters:
  // following lines are of use - if we would want to build ourselves  x3 image source file names 
  this.barNum=num; 
  this.offImgSrc= offSrc;
  this.onImgSrc=onSrc;
  this.liveImgSrc=liveSrc; 
  this.ref= refFile; 
  this.alt = altTag;			  	   	   		  
  this.imgBarName="bar"+ num; 	//e.g. "bar2"	  
 //methods:
  this.setLive = setLive;						  
  this.display= display;  
}

function setLive()  { // Method of BarClass 
    // set img-src for the entered categoryNum
  this.offImgSrc= this.liveImgSrc;
  this.onImgSrc=this.liveImgSrc;
}

function setNormal() { //Method of BarClass (not in use!) opposite of set live 
  this.offImgSrc= this.srcBaseName + "1" + imgExt;
  this.onImgSrc = this.srcBaseName + "2" + imgExt; 
}

/** Method of BarClass - display the bar with all its features  
 the bar-instance  is displayed with it's according link and according 
 ActOn/Off function (e.g. mouse on/out) in the future may extend 
 to support alt-status. assumes being displayed within table-td already
**/
function display() {
 // have to create act On/off call with the actual barNum
 var actOnCall="barActOn("+ this.barNum + ")" ;   // = barActOn(j)
 var actOffCall="barActOff("+ this.barNum + ")" ; // = barActOff(j)
	  document.write('<a href='); 
	  document.write(this.ref); 
	  document.write(' OnMouseOver=');
 	  document.write(actOnCall); 
	  document.write(' OnMouseOut=');
 	  document.write(actOffCall);  
	  document.write(' >');
  	  document.write(' <img src="');
	  document.write(this.offImgSrc);        //e.g."images/contact1.jpg" ;
	  document.write('" border="0" name= ');
	  document.write(this.imgBarName);
	  document.write(' alt="');
      document.write(this.alt);
      document.write('">');
	  document.write("</a>");
}

//--------------- Nav Class ---------------------------------------

function NavClass(len) { // NavClass Class declaration
	 this.navLen=len;
	 //methods:
	 this.setBarArray=setBarArray; // bar: barArray[j]=new BarClass(); 
	 this.displayNav=displayNav;   //puts the navagation table frame 
		 		    //and loops over all bar display each
}

function displayNav(categoryNum) { 
// NavClass Method - display navigator in a table
// activate display method for each bar
document.write('<table border="0" cellspacing="0" cellpadding="0">');  
document.write('<tr><td width="204" valign="top">'); 
 
document.write('<table width="204" border="0" cellspacing="0" cellpadding="0">');
//document.write('<tr>'); 
//document.write('<td align="left" valign="top"><img src="images/nav_top.gif" width="204" height="84"></td>');
document.write('<tr>');
document.write('<td align="left" valign="top"><img src="images/spacer.gif" width="1" height="12"></td>');
document.write('</tr>');
	  var k;
      //document.write(this.navLen);
	  barArray[categoryNum].setLive();
	  for (k=1 ; k <= this.navLen  ; k++)
	  {
	   document.write('<tr>');
	   document.write('<td align="left" valign="top">');
	  	   //document.write("<br>");
	   //barPtr=k;
	   barArray[k].display();
	   document.write('</td>');
	   document.write('</tr>');
	 }
	document.write('</table></td>');
    document.write('<td valign="top" align="left">'); 	
	
}

//Closes the table for teh navigation bar
function writeHeader() {
  document.write('<table border="0" cellspacing="0" cellpadding="0" width="95%" >');
  document.write('<tr><td align="left" valign="top" ><img src="images/header.jpg"></td></tr>');
 
document.write('</table>');
}	



//Closes the table for teh navigation bar
function closeAll() {
  document.write('</td>');
  document.write('</tr>');
document.write('</table>');
}	





















