//set the absolute path to the photos
var linkPath = "/images/photos/"
//will store the actual image to display
var randomImage
//will store/preload the actual image objects
var imageArrayTop = new Array()
var imageArrayBottom = new Array()
//get the list of images
var imageListTop = new Array("1", "2", "3")
var imageListBottom = new Array("1", "2", "3")

//create an array of image paths
for (i in imageListTop){
  imageArrayTop[i] = linkPath + "home-top" + imageListTop[i] + ".jpg"
}
for (i in imageListBottom){
  imageArrayBottom[i] = linkPath + "home-bottom" + imageListBottom[i] + ".jpg"
}

scrambleImagesTop()
scrambleImagesBottom()

function scrambleImagesTop() {
	randomImage = parseInt(Math.random() * 10)
	while((randomImage > 2) || (isNaN(randomImage))) {
		randomImage = parseInt(Math.random() * 10)
		randomImage = (isNaN(randomImage) ? 0 : randomImage)
	}
	document.getElementById('home-photo-top').style.background = "#E2DACD url(" + imageArrayTop[randomImage] + ") top left no-repeat"
}

function scrambleImagesBottom() {
	randomImage = parseInt(Math.random() * 10)
	while((randomImage > 2) || (isNaN(randomImage))) {
		randomImage = parseInt(Math.random() * 10)
		randomImage = (isNaN(randomImage) ? 0 : randomImage)
	}
	document.getElementById('home-photo-bottom').style.background = "#FFFFFF url(" + imageArrayBottom[randomImage] + ") top left no-repeat"
}

