// Set up the image files to be used.
var theImages = new Array(); // do not change this
var imagesUsed = new Array("n", "n", "n", "n", "n", "n", "n", "n", "n", "n");

// To add more image files, continue with the pattern below, adding to the array.

theImages[0] = '/images/squarephotos/civil/1.jpg';
theImages[1] = '/images/squarephotos/civil/2.jpg';
theImages[2] = '/images/squarephotos/civil/3.jpg';
theImages[3] = '/images/squarephotos/civil/4.jpg';
theImages[4] = '/images/squarephotos/civil/5.jpg';
theImages[5] = '/images/squarephotos/civil/6.jpg';
theImages[6] = '/images/squarephotos/civil/7.jpg';
theImages[7] = '/images/squarephotos/civil/8.jpg';
theImages[8] = '/images/squarephotos/civil/9.jpg';
theImages[9] = '/images/squarephotos/civil/10.jpg';

// do not edit anything below this line
var preBuffer = new Array();
for (i = 1; i < theImages.length; i++){
   preBuffer[i] = new Image();
   preBuffer[i].src = theImages[i];
}

function showImage() {
	for (cnt=1; cnt<4; cnt++){	
	// keep picking at random until a new image is found
		do {
			var ran = Math.floor(Math.random() * theImages.length);

				if (ran == 0) {
					ran = 1;
				}	
		} while (imagesUsed[ran] == "y");
		imagesUsed[ran] = "y"; //record that the image was used
		document.write('<img src="'+theImages[ran]+'">');
	}
}
