
// Used to randomly load images on page load

/*window.onload=function(){
	// Total possible images available
	// This must match the number of photos on the server, named sequentially in a specific format
	var totalImages = 26;
	// Generate a usable random number based on the amount of images available
	var imgNum = (Math.floor(Math.random()*totalImages) + 1)
	// build reference to image src
	var bgPhoto = 'url(/images/photography/photo_' + imgNum + '.jpg)';
	// load the image
	document.getElementById('wrapper').style.backgroundImage = bgPhoto;
}*/



// Used to open "Study Questions" Pop-Open Windows

function openStudyQuestions(sermonDate) { 

	var winWidth = 625;
	var winHeight = 500;
	
	var url="/eat-truth/study-questions/studyQuestions_" + sermonDate + ".html";
	
	var x = (640 - winWidth)/2, y = (480 - winHeight)/2;
	if (document.body) {
		y = (document.body.scrollHeight - winHeight)/2;
		x = ((document.body.scrollWidth - winWidth)/2) ;  // 5px adjust for shadow area on page+ 5
	}
	if (document.body.scrollWidth > 1800) {
		x = ((document.body.scrollWidth/2) - winWidth)/2;
	}
	sqWin = window.open(url, "sqWin", "width=" + winWidth + ",height=" + winHeight + ",status=0,scrollbars=yes,toolbar=no,resizable=yes,screenX=" + x + ",screenY=" + y + ",top=" + y + ",left=" + x);		
	sqWin.focus();

}