/* 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 separate items.*/


		
	var randomPics = new Array("fort_ecology", "fort_simmons", "fort_logging", "fort_mason");
	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 separate items.*/	
	
	
var randomPicsText = new Array("New Hampshire is the second most forested state in the country. Learn how the trees interact with the rest of their environment...and how we interact with them in course FORT 263, Forest Ecology.",
							   "With 3,800 acres of woodlands, including numerous sugar maple trees, UNH seems nicely poised to begin a maple sugaring operation. Michael Simmons, a senior forest technology major, worked to determine the feasibility of such a venture. Michael presented his findings at the Undergraduate Research Conference, winning an Award of Excellence for his presentation.",
							   "The Logging Class of the Thompson School Forestry Program takes a break from the study of modern harvesting techniques to try their hand at the old skills. On this occasion the class was  hosted by the Tasker family of Strafford, N.H. while class member Brian Tasker worked his team of Devon steers, Mike and Mack.",
							   "Kyle Mason is a senior in the Forest Technology Program.  In the summer, he is the manager of DAR State Park in Addison, Vermont.  This park was voted to be the best state park in Vermont for Region 2 for 2008.  Kyle and his staff of five are proud of this honor and the hard work that it took to get there."
						   );
	textToUse =randomPicsText[picNum];			
	return textToUse; 
}
	
/* Background color of filler div.*/
	var fillerBkgnd = new Array("#060", "#060", "#060", "#060");
						
/* Color of text in randomPicsText */
	var captionColor = new Array("#fff", "#fff", "#fff", "#fff");
	
			
function picslink(picNum){
	
/*place link within this array in the format in the example. Place them in the same order as the 
picture names in the above array. Links must be surrounded in quotes and commas must separate items.*/	
	
	
var randomPicslink = new Array("#");
	linkToUse =randomPicslink[picNum];			
	return linkToUse; 
}

/*  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><p align='right'><a href='../newsite/js/%22%20+%20randomPicslink%5BpicNum%5D%20+%20%22'>Read more...</a></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><p align='right'><a href='../newsite/js/%22%20+%20randomPicslink%5BpicNum%5D%20+%20%22'>Read more...</a></p>");





