/* JavaScript Document

Developed by: 
	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 = 300;
	var imgHeight = 237;

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("ex1","ex2", "ex3", "ex4", "ex5", "ex6");
	imageDisplayed = randomPics[picNum];
	return imageDisplayed;
	}


	
/*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('The first Introduction to EcoGastronomy course offered drew almost 50 students.<a href=http://www.unh.edu/registrar/timeroom/timeandroom.html</a> Register for the course, offered again this fall: HMGT 698.',
							   'As part of their EcoGastronomy requirements, students must spend a semester studying at the <a href=http://www.unisg.it/eng/index.php>University of Gastronomic Sciences</a> in Italy.',
							   'UNH is the first higher education institution in the US to offer an experiential, interdisciplinary and international academic program in EcoGastronomy.',
							   'Students from all majors, from hospitality mangement to nutrition to journalism and more, can add the dual major in EcoGastronomy to their primary studies.',
							   'UNH hosts first group of <a href=http://www.unh.edu/news/cj_nr/2009/july/lw9eco.cfm</a>Italian EcoGastronomy students.',
							   'The dual major in EcoGastronomy came about after <a href=http://www.slowfood.com/>Slow Food International</a> founder Carlo Petrini, who visited UNH in 2006 to receive his first honorary degree in the US, met with faculty and staff who engage in teaching, research, engagement and sustainable operations efforts as part of the UNH Food & Society Initiative.');


function picsText(picNum){
	textToUse =randomPicsText[picNum];			
return textToUse; 
}



/*  Make No Other Changes   */	

function getPicNum(){	
			var numItems = randomPicsText.length;
			var picNum = Math.floor(Math.random()*numItems) + 0;
			
			if(picNum >= numItems){
				picNum = 0;
				}
return picNum;
}
	


