// test the browser to make sure it's ok
var browserName = navigator.appName;
var browserVer = parseInt(navigator.appVersion);
var browserOK = (((browserName == "Netscape") && (browserVer >= 3)) || 
	((browserName == "Microsoft Internet Explorer") && (browserVer >= 4)));

// URLs of images in slide show
var slideURL = Array("images/sachoom1.gif",
					 "images/sachoom2.gif",
					 "images/sachoom3.gif",
					 "images/sachoom4.gif",
					 "images/sachoom5.gif",
					 "images/sachoom6.gif",
					 "images/sachoom12.gif",
					 "images/sachoom7.gif",
					 "images/sachoom8.gif",
					 "images/sachoom9.gif",
					 "images/sachoom10.gif",
					 "images/sachoom11.gif");
// delay between slides (in milliseconds)
var slideDelay = 5000;
// Index of the current slide
var curSlide = -1;
// timeout id for the current setTimeout command
var curTimeout;

function showSlide() {
	if (browserOK) {
		// alert(slideURL.length);
		curSlide = ((curSlide + 1) % slideURL.length);
		// alert(curSlide);
		document.images["slideImg"].src = slideURL[curSlide];
		curTimeout = setTimeout("showSlide()", slideDelay);
	} else {
		// show an error message for older browsers
		alert("This page requires Netscape 3.0+ or IE 4.0+");
	}
}

function goNext() {
	if (browserOK) {
		clearTimeout(curTimeout);
		showSlide();
	}
}

function goPrev() {
	if (browserOK) {
		clearTimeout(curTimeout);
		curSlide = (((curSlide - 2) + slideURL.length) % slideURL.length);
		showSlide();
	}
}

