/* JavaScript Document

Developed by: 
	Mike McIntire
	Web Solutions
	April 2004
For:
	Rotating the image, caption, caption color and background color on the unh homepage.
Rights:
	May be used, modified, re-distributed freely dependant that alterations of the manner in which the code behaves
	is well documented to maintain ease of use.
*/

/* Enter width and height, respectively, for image being rotated */	
	var imgWidth = 523;
	var imgHeight = 227;

function imageToUse(picNum){			
/*The following code is where you name your images. .jpg will be automatically appended
so it is only necessary to use the file's name. Image names must be surrounded in quotes and commas must seprate items.*/


		
	var randomPics = new Array("home_tyrone","home_JuChinHuang","home_cdc","home_toddler");
	imageDisplayed = randomPics[picNum];
	return imageDisplayed;
			
}



function picsText(picNum){
	
/*place text within this array in the format in the example. Place them in the same order as the 
picture names in the above array. Captions must be surrounded in quotes and commas must seprate items.*/	
	
	
var randomPicsText = new Array("Mentoring is a fundamental part of the UNH experience for all students. Doctoral candidate in <a href=http://zoology.unh.edu target=_blank>zoology</a> Tyrone Spady not only works with world-class scientists, he mentors undergraduates who come into the lab. Says Tyrone: &quot;It's within these relationships that significant learning takes place.&quot;",
									"Innovative research undertaken by environmental economist Ju-Chin Huang helps New England policymakers understand the economic value of beaches, parks, wildlife, and other &quot;non-market&quot; contributors to regional quality of life.",
									"At the University's renowned Child Study and Development Center, faculty, students, and children form a closely-knit learning community. &quot;What we value most and teach our students is respect&#8212;for others and for the process of learning itself,&quot; says Family Studies Professor Soyeon Park.",
									"Future leaders of tomorrow. <br />Toddlers enrolled at the UNH Child Study and Development Center"

						   );
	textToUse =randomPicsText[picNum];			
	return textToUse; 
}
	
/* Background color of filler div.*/
	var fillerBkgnd = new Array("#a5d7ec","#edec7f","#a5d7ec","#edec7f");
						
/* Color of text in randomPicsText */
	var captionColor = new Array("#000","#000", "#000", "#000");
	
			


/*  Make No Other Changes   */	


function getPicNum(){	
			var numItems = captionColor.length;
			var picNum = Math.floor(Math.random()*numItems) + 0;
			
			if(picNum >= numItems){
				picNum = 0;
				}
return picNum;
}
			//document.write("<div id='filler' style='background-color:" + fillerBkgnd[picNum] +";'><div id='holder'><div id='content'><img src=images/i/" + randomPics[picNum] + ".jpg border='0' width='" + imgWidth + "' height='"+ imgHeight + "' >  </div><div id='sidebar-b'><p style='color:" + captionColor[picNum] +"'>" +  randomPicsText[picNum] +"</p>");
			//document.write("<div id='filler'><div id='content'><img src=images/i/" + randomPics[picNum] + ".jpg border=0 width='" + imgWidth + "' height='"+ imgHeight + "' >  </div><div id='sidebar-b'><p>" +  randomPicsText[picNum] +"</p>");





