/*  
 This file is a template file for setting of Vertical Navigation Bars

  The Vertical bar setting is done by initializing values into the pre defined barArray  in NavGen: :    
        - bar Array  is used and  is initialized for VERTICAL  bar  images  from loaction 0 up-to  30
        - bar Array  is used and  is initialized for HORIZONTAL  bar images in from location 31 up-to  60

   the declaration in NavGen.js is  
            var horPtr = 30 ;       // the location and the allocation  of the Horizontal bars starts in barAry at location 31
                                               //    therefore we set the horPtr as 30     
          barArray = new Array(horPtr +30);  // create global barArray to store images for verical and horizontal bars
                                                                   //  this is equal to say BarArray = new Array(60 ); 

*/  
/*  Set the array of icons
     for each image in the Vertical navigator bar, replace the corresponding
     image source files and the corresponding link file/url
*/  
//-----------------------------------------------------------------
// NavClass Method - function setBarArray()
//         creates bar instances with correct settings for each bar in Vertical navagation bar
//-----------------------------------------------------------------
function setBarArray()	
{	
  barArray[1] = new BarClass(1,"home", 
                 "/materials/images/btn_home1.gif",  //default image file
	             "/materials/images/btn_home2.gif",  //image for mouseOn
                 "/materials/images/btn_home3.gif",  //image for selected category 
                 "/materials/home.html",    //the link for bar#1
                 "Home");   //alt tag    
							  
barArray[2]= new BarClass(2,"faculty",  
              "/materials/images/btn_stuff1.gif",
		      "/materials/images/btn_stuff2.gif",
		      "/materials/images/btn_stuff3.gif", 
		      "/materials/faculty.html",
              "Faculty and Stuff");

barArray[3] = new BarClass(3,"sactivities",  
              "/materials/images/btn_scact1.gif",   
		      "/materials/images/btn_scact2.gif",
              "/materials/images/btn_scact3.gif",
		      "/materials/sactivities.html", 
              "Scientific Activities");

barArray[4]= new BarClass(4,"centers",  
              "/materials/images/btn_centers1.gif",
		      "/materials/images/btn_centers2.gif",
		      "/materials/images/btn_centers3.gif", 
		      "/materials/centers.html",
              "Centers");


barArray[5]= new BarClass(5,"lectures",  
              "/materials/images/btn_lect1.gif",
		      "/materials/images/btn_lect2.gif",
		      "/materials/images/btn_lect3.gif", 
		      "/materials/calendar/lectures.html",
              "Lectures and Events");

	barArray[6]= new BarClass(6,"courses",  
              "/materials/images/btn_courses1.gif",
		      "/materials/images/btn_courses2.gif",
		      "/materials/images/btn_courses3.gif", 
		      "/materials/courses.html",
              "Courses");
	
	barArray[7]= new BarClass(7,"positions",  
              "/materials/images/btn_pos1.gif",
		      "/materials/images/btn_pos2.gif",
		      "/materials/images/btn_pos3.gif", 
		      "/materials/positions.html",
              "Research Positions");
	
	
	barArray[8]= new BarClass(8,"www",  
              "/materials/images/btn_www1.gif",
		      "/materials/images/btn_www2.gif",
		      "/materials/images/btn_www3.gif", 
		      "/materials/www.html",
              "WWW to go");
	
	
	barArray[9]= new BarClass(9,"contact",  
              "/materials/images/btn_cont1.gif",
		      "/materials/images/btn_cont2.gif",
		      "/materials/images/btn_cont3.gif", 
		      "/materials/contact.html",
              "Contact Us");
	
	
	
}	


//-----------------------------------------------------------------
// function initNav(): Set the parameter numOfBars to total number of the Vertical bars (icon-images)
//-----------------------------------------------------------------
function initNav() { 
  var numOfBars= 9 ;
  var  topHtml='';
  var  botHtml=' ';

topHtml += '<table width="100%"  height="100%" border="0" cellspacing="0" cellpadding="0">' ;
topHtml += '<tr><td width="171" height="100%" align="left" valign="top">' ;  
topHtml += '<img src="/materials/images/Nav_top_b.jpg" width="171" height="57">' ;  
topHtml += '<table width="137"  border="0" align="left" cellpadding="0" cellspacing="0" background="/materials/images/bc_nav.jpg">' ;
  

  
  botHtml += '<tr><td width="137" height="100%" align="right" valign="top"><img src="/materials/images/spacer.gif" width="19" height="146"></td></tr>' ;
  botHtml += '</table></td>';
  botHtml += '<td width="100%" valign="top">';	 
  
 theNav= new NavClass(numOfBars, topHtml, botHtml);  //the parameter - number of the bars in the navagation bar 
  setBarArray();             //fill barAray with images          //fill barAray with images
}
 

function writeHeader() {
	
document.write('<table width="100%"  height="158" border="0" cellspacing="0" cellpadding="0">');	  
document.write('<tr background="/materials/images/bc_top.jpg">');
document.write('<td width="171" height="106" align="left" valign="top"><img src="/materials/images/top_l.jpg" width="171" height="106"></td>');
document.write('<td width="128" height="106" align="left" valign="top" background="/materials/images/bc_top.jpg"><img src="/materials/images/t_2.jpg" width="128" height="106"></td>');
document.write('<td align="left" valign="top" background="/materials/images/bc_top.jpg"><a href="/materials/"><img src="/materials/images/title.gif" alt="Materials and Interfaces" width="353" height="106" border="0"></a></td>');
document.write('<td align="right" valign="top" background="/materials/images/bc_top.jpg"><a href="/"><img src="/materials/images/wis.gif" alt="Weizmann Institute of Science" width="224" height="61" border="0"></a><br><a href="/chemistry/"><img src="/materials/images/fchem.gif" width="224" height="45" border="0"></a></td>');
document.write('</tr><tr>');
document.write('<td width="171" height="52" align="left" valign="top"><img src="/materials/images/Nav_top.jpg" width="171" height="52"></td>');

document.write('<td colspan="3"  height="52" align="right" valign="top">');
document.write('<div align="bottom"><form id="googleSearch" method="get" action="results.php">');
document.write('<input class="searchQuery" type="text" name="text" value="" > ');
document.write('<input class="searchButton" type="submit" name="search" value="Search" />');
//document.write('</form></div></td>');
document.write('</form></td>');

document.write('</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="-2" color="#2c486b">Comments and suggestions to ');
document.write('<a href="mailto:nir.kampf@weizmann.ac.il">nir.kampf@weizmann.ac.il</a>');
document.write('</font>');
document.write('</td>');
document.write('<td align="right" width="30%"><font size="-2" color="2c486b">Last Updated: ');
document.write (document.lastModified);
document.write('</font></td></tr>');
document.write('</table>');
}

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

  }	
   var imageNumber=Math.round(Math.random()*8);//change the number according to how many pictures
	function changepic(){
	//document.write("<a href='pages/" + imageNumber + ".shtml'>");
	document.write("<img src='/materials/images/pics/" + imageNumber + ".jpg' border='0' width='294' height='210'>");
	//document.write("</a>");
	}	
