/* 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.
*/

/* PICTURE SIZE - Enter width and height, respectively, for all the images being rotated. */	
	var imgWidth = 300;
	var imgHeight = 248;

function imageToUse(picNum){			

/*ROTATING PICTURES - 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 separate items.*/
		
	var randomPics = new Array("homeimage1","homeimage2","homeimage3","homeimage4","homeimage5","homeimage6");
	imageDisplayed = randomPics[picNum];
	return imageDisplayed;
	}

/*ALTERNATIVE CAPTIONS FOR THE ROTATING PICTURES - Place the captions within the array below. Place them in the same order
as the picture names in the array above. Captions must be surrounded in quotes and commas must separate items.*/	

	
var randomPicsText = new Array("http://www.sustainableunh.unh.edu/coreframework.html",
								"http://www.unh.edu/news/cj_nr/2009/sept/bp21sustain.cfm",
								"http://www.unh.edu/academic-affairs/discovery/dialogue/index.html",
								"http://signals.unh.edu/2009/10/26/save-energy-power-down-for-the-holidays/",
								"http://www.unh.edu/healthyunh/index.html",
								"http://www.wsbe.unh.edu/gourmetdinner");

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


