/* 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");
	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('<a href=http://farmtocafeteriaconference.com/> Save the Date: May 17-19, Taking Root: 5th Annual Farm to Cafeteria Conference, Detroit, Michigan',
							   '<a href=http://www.nhfarmtoschool.org/FTSinaction.html> There are many ways to participate. Find out what other schools are doing!',
							   '<a href=http://www.nhfarmtoschool.org/6%20Steps.html> Follow these 6 Steps to get local foods into your cafeteria!',
							   'Over half of the schools in NH serve local apples and cider. Is your <a href=http://www.nhfarmtoschool.org/particpants.html> school one of them?',
							   '<a href=http://www.nhfarmtoschool.org/Resources.html> Get fresh food storage and recipe ideas from our Fruit and Vegetable Fact Sheets.');




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;
}
	


