$(document).ready(function () {

	// Call PNG fix plugin
	$(document).pngFix();
	
	/* ----------------------------------------------------------------
	PAGE OVERLAY AND RANDOM IMAGE
	---------------------------------------------------------------- */
	
	// Add a div over the top of everything
	$("body#index").prepend("<div id=\"body_wrap\"><\/div>");
	
	// Array that holds all random images to display
	var randomImages = ['papaBg1','papaBg2','papaBg3','papaBg4','papaBg5','papaBg6'];
	
	// Generate a random number based on the array length
	var rndNum = Math.floor(Math.random() * randomImages.length); // or * 6
  	
  	// Place random image in the body
	$("body#index").css({ background: "url(img/index/indexBg/" + randomImages[rndNum] + ".jpg) 0 0 no-repeat" });

	// Set up slides for the index quotes
	$('#slideshow3').cycle({ 
		timeout: 4000,
		delay:  -1000,
		sync: 1,
		speed:  1500 
	}); 
	
	$(window).load(function(){
	
	// FAKE DELAY
	$("#body_wrap").animate({ opacity: "1.0"}, 1000);
	
	// FADE OUT INDEX OVERLAY
	$("#body_wrap").fadeOut(1000, function() {
	
	//
	$(this).remove();
	});
});

});