// JavaScript Document
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = '/img/photos/1.jpg'
theImages[1] = '/img/photos/2.jpg'
theImages[2] = '/img/photos/3.jpg'
theImages[3] = '/img/photos/4.jpg'
theImages[4] = '/img/photos/5.jpg'
theImages[5] = '/img/photos/6.jpg'
theImages[6] = '/img/photos/7.jpg'
theImages[7] = '/img/photos/8.jpg'
theImages[8] = '/img/photos/9.jpg'
theImages[9] = '/img/photos/10.jpg'
theImages[10] = '/img/photos/11.jpg'
theImages[11] = '/img/photos/12.jpg'

// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
firstImage = whichImage +1;

//if more than 12 images are going to be in here, make another expression for firstImage == 13
if(firstImage >9) {
	if(firstImage == "12") {
	  firstImage = "0";
	  secondImage = "5";
	  thirdImage = "10";
	} 
	if(firstImage == "11") {
	  firstImage = "1";
	  secondImage = "4";
	  thirdImage = "9";
	} 
	if(firstImage == "10") {
	  firstImage = "2";
	  secondImage = "7";
	  thirdImage = "11";
	} 
} else {
  secondImage = firstImage + 1;
  thirdImage = firstImage + 2;
}

//alert("whichImage is " + whichImage + " first is " + firstImage + " second is " + secondImage + " third is "+ thirdImage); 
var path = "";
function showImage(path){
  document.write('<img src="'+theImages[whichImage]+'">');
}
function showImage2(path) {
  document.write('<img src="'+theImages[firstImage]+'">');
}
function showImage3(path) {
  document.write('<img src="'+theImages[secondImage]+'">');
}
function showImage4(path) {
  document.write('<img src="'+theImages[thirdImage]+'">');
}
