function setRandomBackground(backgrounds)
{
	// selects a random image and uses that as the background for the page
	
	if (backgrounds instanceof Array) {
		// select random array index
		var selectedId = rand(0, backgrounds.length - 1);
		
		// set background to URL contained within selected index
		document['body'].style.backgroundImage = "url("+backgrounds[selectedId]+")";
		
	};
}

function rand( min, max ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Leslie Hoare
 
    if( max ) {
        return Math.floor(Math.random() * (max - min + 1)) + min;
    } else {
        return Math.floor(Math.random() * (min + 1));
    }
}

