// Chooses a random background image for the top (history) picture, and the bottom header image.

var topHeaderSrcs = new Array(
	'css/images/random/topheader/1.jpg',
	'css/images/random/topheader/2.jpg',
	'css/images/random/topheader/3.jpg',
	'css/images/random/topheader/4.jpg',
	'css/images/random/topheader/5.jpg',
	'css/images/random/topheader/6.jpg',
	'css/images/random/topheader/7.jpg',
	'css/images/random/topheader/8.jpg'
	);
var bottomHeaderSrcs = new Array(
	'css/images/random/bottomheader/01.jpg',
	'css/images/random/bottomheader/02.jpg',
//	'css/images/random/bottomheader/03.jpg',
//	'css/images/random/bottomheader/04.jpg',
//	'css/images/random/bottomheader/05.jpg',
	'css/images/random/bottomheader/06.jpg',
	'css/images/random/bottomheader/07.jpg',
//	'css/images/random/bottomheader/08.jpg',
//	'css/images/random/bottomheader/09.jpg',
//	'css/images/random/bottomheader/10.jpg',
//	'css/images/random/bottomheader/11.jpg',
//	'css/images/random/bottomheader/12.jpg',
//	'css/images/random/bottomheader/13.jpg',
	'css/images/random/bottomheader/14.jpg',
//	'css/images/random/bottomheader/15.jpg',
//	'css/images/random/bottomheader/16.jpg',
//	'css/images/random/bottomheader/17.jpg',
	'css/images/random/bottomheader/18.jpg',
//	'css/images/random/bottomheader/19.jpg',
	'css/images/random/bottomheader/20.jpg',
//	'css/images/random/bottomheader/21.jpg',
//	'css/images/random/bottomheader/22.jpg',
	'css/images/random/bottomheader/23.jpg',
	'css/images/random/bottomheader/24.jpg',
	'css/images/random/bottomheader/25.jpg',
//	'css/images/random/bottomheader/26.jpg',
//	'css/images/random/bottomheader/27.jpg',
	'css/images/random/bottomheader/28.jpg',
	'css/images/random/bottomheader/89.jpg',
	'css/images/random/bottomheader/91.jpg',
	'css/images/random/bottomheader/90.jpg',
	'css/images/random/bottomheader/92.jpg',
	'css/images/random/bottomheader/100.jpg',
	'css/images/random/bottomheader/128.jpg',
	'css/images/random/bottomheader/101.jpg'

	);

var topheaderbg=topHeaderSrcs[(Math.round(Math.random()*(topHeaderSrcs.length-1)))];
var bottomheaderbg=bottomHeaderSrcs[(Math.round(Math.random()*(bottomHeaderSrcs.length-1)))];
if (chosenTopImage != null) {
	topheaderbg = 'css/images/' + chosenTopImage + '.jpg';
}
if(chosenBottomImage != null) {
	bottomheaderbg = 'css/images/' + chosenBottomImage + '.jpg';
}

// This is called as a body onload event.
function pickimage(chosenTopImage, chosenBottomImage) 
{ 
	var headerflash = document.getElementById("headerflash")
	var logo = document.getElementById("logo")
	var slogan = document.getElementById("slogan")
	var header = document.getElementById("header")
	var bottomheader = document.getElementById("bottomheader")

	if (chosenTopImage != null) {
		slogan.style.display="none";
		topheaderbg = 'css/images/' + chosenTopImage + '.jpg';
	}
	
	if(chosenBottomImage != null) {
		bottomheaderbg = 'css/images/' + chosenBottomImage + '.jpg';
	}

	if (headerflash != null) {
		logo.style.display="none";
		slogan.style.display="none";
	} else {
		header.style.backgroundImage = 'url("' + topheaderbg + '")'; 
	}
	bottomheader.style.backgroundImage = 'url("' + bottomheaderbg + '")';
		
}