/* 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 = 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("ca2010", "forestparkcookbook", "cablesetup", "gablescafe", "catvision", "limitedbyimagination",  "oversuds", "SERCpromenadebicycle");
	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(	"Apply now for a position as a 2010-2011 Community Assistant.  Applications on line or at Woodside or Gables Office.  What does your future hold?",
								
								"One World, One Table.  UNH's Forest Park Apartments celebrates its diverse community by publishing the 2nd edition of their cookbook! Download your copy today!",
								 "Setting Up Your TV is Easy.  Setup instructions, guides and FAQs are just a step away!",
								
								"The Gables Cafe features hot drinks and all of the convenience items on-campus apartment residents need to keep their apartments well supplied. Located in Gables North, open til 11:00pm.",
								"Channel 3, UNH's own information station, provides news, weather, and on-campus happenings.  Tune in to Channel 3 and find out what's on your TV?",
								
								"Limited Only By Your Imagination!!!! Students in Hubbard Hall create a soothing oasis in their quad rooms.",
								"1/4 cup of liquid detergent is all you need!  Less truly is more (at least when it comes to laundry detergents and oversudsing)",
								
								
								"UNH's Southeast Residential Community, commonly called SERCs, include three medium-large residence halls which have traditional and suite-style living.  The SERCs are home to over 800 students."
								
								
								
								);
	
textToUse =randomPicsText[picNum];			
return textToUse; 
}

/* Background color of filler div.*/
	var fillerBkgnd = new Array("#000000","#799E51", "#000000", "#E5D050", "#0B76B2",  "#AE3467", "#44443a","#CF6");
						
/* Color of text in randomPicsText */
	var captionColor = new Array( "#fff", "#fff","#fff", "#000", "#FFF",  "#FFF", "#FFF", "#000");
	
/* Color of links in randomPicsText */
	var captionLinks = new Array("#fff", "#fff","#fff", "#fff",  "#fff", "#FFF", "#FFF", "#000");

/* Color of hovers in randomPicsText */
	var captionHovers = new Array("#fff", "#ccc","#fff", "#000",  "#000", "#000", "#FFF", "#000");

function picsURL(picNum){
	var randomPicsURL = new Array(	"http://www.unh.edu/housing/jobs/index.html",
								
								"http://www.unh.edu/housing/famhousing/FP_Cookbook_2008.pdf",
								"http://www.unh.edu/housing/catvision/setupguide.html",
								
								"http://www.unh.edu/housing/apartments",
								"http://www.unh.edu/housing/catvision",
								
								"http://www.unh.edu/housing/reshalls",
								"http://www.unh.edu/housing/housinginfo/Housing_LaundryRoom.pdf",
								"http://www.unh.edu/housing/reshalls/SERC.html"
								);
								
									  
	URLToUse =randomPicsURL[picNum];			
	return URLToUse; 
}
	
/*  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;
}