// jQuery Document. Built with jquery-1.4.2


/**************	 Random Background script  *********************
	
	to use script link to this document and a version of jquery-1.4.2 in the header and initialize using the following in the header of the document:
	
	<script type="text/javascript"> 
	
		$(document).ready(function(){
		
			initRandBackground();
			
		});
	
	</script> 
	
*/


function initRandBackground(){
		
	
	var numImages = 5;
	
	//list all available backgrounds: background#=["filepath"]
	var backgroundList = [
	
	background1=["/images/backgrounds/background-content-1.jpg"],
	background2=["/images/backgrounds/background-content-2.jpg"],
	background3=["/images/backgrounds/background-content-3.jpg"],
	background4=["/images/backgrounds/background-content-4.jpg"],
	background4=["/images/backgrounds/background-content-5.jpg"],
	background5=["/images/backgrounds/background-content-6.jpg"]
	
	];
	
	var backgroundIndex = Math.floor(Math.random()*numImages);
	var backgroundURL = "url(" + backgroundList[backgroundIndex][0] + ")"
	
	if( backgroundIndex < backgroundList.length) {
		$("#site_background").css('background-image', backgroundURL);
	}
	
	else {
		return false; // use default settings in CSS
	}
	
	/*alert(backgroundIndex);
	alert(backgroundList[backgroundIndex][0]);*/
};


