/**------------ 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."/bogmeeting/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 width="100%"  border="0" cellspacing="0" cellpadding="0"><tr>');
   document.write('<td width="40" height="10" align="left" valign="top"><img src="/Biological_Chemistry/scientist/Wallach/images/pas_blue.gif" width="40" height="10"></td>');
   document.write('<td width="125" height="10"><img src="/Biological_Chemistry/scientist/Wallach/images/pas_blue.gif" width="125" height="10"></td>');
   document.write('<td height="10" colspan="2" bgcolor="#045074"></td>');
	
document.write(' <td height="83" rowspan="3" align="right" valign="top" bgcolor="#045074"><img src="/Biological_Chemistry/scientist/Wallach/images/v_blue.gif" width="33" height="83"></td>');
  document.write('</tr>');
 document.write('<tr>');
   document.write('<td width="40" height="63" align="left" valign="top"><img src="/Biological_Chemistry/scientist/Wallach/images/mol_left.gif" width="40" height="63"></td>');
   document.write('<td width="125" height="63" align="left" valign="top"><a href="/Biological_Chemistry/"><img src="/Biological_Chemistry/scientist/Wallach/images/mol_lg.gif" alt="Biological Chemistry" width="125" height="63" border="0"></a></td>');
   document.write('<td width="100%" align="center" valign="middle" background="/Biological_Chemistry/scientist/Wallach/images/bc_blue.gif"><img src="/Biological_Chemistry/scientist/Wallach/images/name.gif" alt="Prof. David Wallach" width="278" height="42"></td>');
document.write('<td width="174" align="right" valign="top" background="/Biological_Chemistry/scientist/Wallach/images/bc_blue.gif"><a href="/"><img src="/Biological_Chemistry/scientist/Wallach/images/wis.gif" alt="Weizmann Institute of Science" width="174" height="63" border="0"></a></td>');
 document.write('</tr><tr>');
 document.write('<td height="10" colspan="2" align="left" valign="top" bgcolor="#045074"><img src="/Biological_Chemistry/scientist/Wallach/images/mol_btm.gif" width="136" height="10"></td>');
 document.write('<td height="10" colspan="2" bgcolor="#045074"><img src="/Biological_Chemistry/scientist/Wallach/images/pas_blue.gif" width="326" height="10"></td>');
 document.write('</tr>');
document.write('</table>');
     
document.write('<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr><td width="165" height="100%" align="left" valign="top" rowspan="2"><img src="/Biological_Chemistry/scientist/Wallach/images/nav_top.gif" width="165" height="49">');
document.write('<table width="165" border="0" cellspacing="0" cellpadding="0">'); 
        

                	   var k;
      //document.write(this.navLen);
	  barArray[categoryNum].setLive(); 	
	  for (k=1 ; k <= this.navLen  ; k++)
	  {
	   document.write('<tr>');
	   document.write('<td>');
	 
	   barArray[k].display();
	   document.write('</tr>');
	 }
	 		
			
            document.write('</table>');
			document.write('</td>');
	document.write('<td align="left" valign="top" height="32"><img src="/Biological_Chemistry/scientist/Wallach/images/gr_name.gif" alt="The TNF Group" width="169" height="32"></td>');
	 	
		document.write('</tr><tr>');
   document.write('<td width="100%" valign="top">');
        
	
		//tohen table
}

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

  }	

function writeFooter() {

document.write('<hr width="100%">');
document.write('<table width="90%">');
document.write('<tr>');
document.write('<td width="70%" align="left">');
document.write('<font size="-1" color="#045074">Comments and Suggestions: ');
document.write('<a href="mailto:andrew.kovalenko@weizmann.ac.il">andrew.kovalenko@weizmann.ac.il</a>');
document.write('</font>');
document.write('</td>');
document.write('<td align="right" width="30%"><font size="-1" color="#045074">Last Updated: ');
document.write (document.lastModified);
document.write('</font></td></tr>');
document.write('</table>');
}

