// ** javascript file for photo navigation...

// define variables
var imgNumber=1;
var now=new Date();
imgTimer=setTimeout("nextImage('imgMain')", 5000)

// function to move to the next image
function nextImage(imgName) {
	if (document.images) {
		imgNumber++;
		if (imgNumber>5) {
			imgNumber=1;
		}
		document.images[imgName].src = imgFile + "0" + imgNumber + ".jpg?" + now.getTime();
		clearTimer();
		imgTimer=setTimeout("nextImage('imgMain')", 3000);
	}
}

// function to move to the previous image
function prevImage(imgName) {
	if (document.images) {
		imgNumber--;
		if (imgNumber<1) {
			imgNumber=5;
		}
		document.images[imgName].src = imgFile + "0" + imgNumber + ".jpg?" + now.getTime();
		clearTimer();
	}
}

// function to clear an existing timers
function clearTimer() {
	if (typeof(imgTimer=="number")) {
		clearTimeout(imgTimer);
	}
}
