/*
 * Puts a random image up
 */
function makeRandomImager(imageTag, imageBase, numImages, doTest) {
	var img = eval('document.' + imageTag);	
	var imgNum;
	if(doTest == null) {
		imgNum = (Math.round((Math.random() * numImages))) + 1;
	} else {
		imgNum = 1;
	}
	img.src = imageBase + imgNum + ".jpg";
	
	if(doTest != null)
		setTimeout("cycleRandomImages('" + imageTag +"', '" + imageBase + "', " + numImages + ", 1)", 1000);
}

/*
 * This will cycle through all available images, to check that they're all there
 */
function cycleRandomImages(imageTag, imageBase, numImages, currentImg) {
	var img = getNamedElement(imageTag);
	var imgNum;

	currentImg++;
	img.src = imageBase + currentImg + ".jpg";
	if(currentImg < numImages)
		setTimeout("cycleRandomImages('" + imageTag +"', '" + imageBase + "', " + numImages + ", " + currentImg + ")", 1000);
}

function init() {
makeRandomImager("myimage","images/image",14);
makeRandomImager("myimage2","images/image",14);
}
