// JavaScript Document

// handles display of rollover images on = murphy home =

/*
This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com */

//also need images arrays for the buttons:  one array of "off", one of "on" (5 each)
	buttons_off = new Array;
	buttons_on = new Array;
	
	//array containing preView window images, 480x160
	preViews = new Array;

	//princeton university home
	buttons_off[0] = new Image;  buttons_off[0].src = "images_final/button_tiger_off.gif";  
	buttons_on[0] = new Image;  buttons_on[0].src = "images_final/button_tiger_on.gif";
	
	//default window image
	preViews[0] = new Image; preViews[0].src = "images_final/home_preDefault_480.jpg"; 
	
	//research
	buttons_off[1] = new Image;  buttons_off[1].src = "images_final/button_research_off.gif";
	buttons_on[1] = new Image;  buttons_on[1].src = "images_final/button_research_on.gif";
	preViews[1] = new Image; preViews[1].src = "images_final/home_preResearch_480.jpg";
	
	//pubs
	buttons_off[2] = new Image;  buttons_off[2].src = "images_final/button_publications_off.gif";
	buttons_on[2] = new Image;  buttons_on[2].src = "images_final/button_publications_on.gif";
	preViews[2] = new Image; preViews[2].src = "images_final/home_prePublications_480.jpg";
	
	
	//members
	buttons_off[3] = new Image;  buttons_off[3].src = "images_final/button_members_off.gif";
	buttons_on[3] = new Image;  buttons_on[3].src = "images_final/button_members_on.gif";
	preViews[3] = new Image; preViews[3].src = "images_final/home_preMembers_480.jpg";
	
	//fun
	buttons_off[4] = new Image;  buttons_off[4].src = "images_final/button_fun_off.gif";
	buttons_on[4] = new Image;  buttons_on[4].src = "images_final/button_fun_on.gif";
	preViews[4] = new Image; preViews[4].src = "images_final/home_preFun_480.jpg";
	
	//links
	buttons_off[5] = new Image;  buttons_off[5].src = "images_final/button_links_off.gif";
	buttons_on[5] = new Image;  buttons_on[5].src = "images_final/button_links_on.gif";
	
	preViews[5] = new Image; preViews[5].src = "images_final/home_preLinks_480.jpg";
	
	//contact
	buttons_off[6] = new Image;  buttons_off[6].src = "images_final/button_contact_off.gif";
	buttons_on[6] = new Image;  buttons_on[6].src = "images_final/button_contact_on.gif";
	
	preViews[6] = new Image; preViews[6].src = "images_final/home_preContact_480.jpg";
	
	//extra buttons for lsi, molBio links
	buttons_off[7] = new Image; buttons_off[7].src = "images_final/lsi_vLink200x40_off.gif";
	buttons_on[7] = new Image; buttons_on[7].src = "images_final/lsi_vLink200x40_on.gif";
	
	buttons_off[8] = new Image; buttons_off[8].src = "images_final/molBio_hLink180_off.gif";
	buttons_on[8] = new Image; buttons_on[8].src = "images_final/molBio_hLink180_on.gif";
	
	
	
 	
	function on(imgName, imgNum)  { 
		document[imgName].src = buttons_on[imgNum].src; 
	}
	
	function off(imgName, imgNum) { 
		document[imgName].src = buttons_off[imgNum].src; 
	}
 
	function up(imgName, imgNum) { 
		document[imgName].src = preViews[imgNum].src; 
	}
	
	//display info about lab member onMouseOver in div called 'div_description'
	//string memInfo is new HTML to write
	//props to DUSTIN DIAZ
	function showInfo(memInfo) {
  		/*	adopted from following addElement code
			var ni = document.getElementById('myDiv');
			var numi = document.getElementById('theValue');
		  	var num = (document.getElementById('theValue').value -1)+ 2;
			numi.value = num;
		  	var newdiv = document.createElement('div');
			var divIdName = 'my'+num+'Div';
			newdiv.setAttribute('id',divIdName);
			newdiv.innerHTML = 'Element Number '+num+' has been added! <a href='#' onclick='removeElement('+divIdName+')'>Remove the div "'+divIdName+'"</a>';
			ni.appendChild(newdiv);*/
		var descriptionS = document.getElementById('div_description');
		descriptionS.innerHTML = memInfo;
	}
	

	/* to launch a new window of specified dimensions */
	//source:  www.spoono.com/flash
	function fixedSize(url,name,features) {
		//This launches a new window and then
		//focuses it if window.focus() is supported.
		win = window.open(url,name,features);
	}