var delay = 3000;

NewImg = new Array (
	"images/frontimage.jpg",
	"images/frontimage3.jpg",
	"images/frontimage4.jpg",
	"images/frontimage5.jpg",
	"images/frontimage6.jpg",
	"images/frontimage7.jpg",
	"images/frontimage8.jpg",
	"images/frontimage9.jpg"
);

var ImgNum = 0;
var ImgLength = NewImg.length - 1;
var lock = false;
var run;

auto();

function chgImg(direction) {
	if (document.images) {
		ImgNum = ImgNum + direction;
		if (ImgNum > ImgLength) {
			ImgNum = 0;
		}
		if (ImgNum < 0) {
			ImgNum = ImgLength;
		}
		document.slideshow.src = NewImg[ImgNum];
	}
}

function auto() {
	if (lock == true) {
		lock = false;
		window.clearInterval(run);
	}
	else if (lock == false) {
		lock = true;
		run = setInterval("chgImg(1)", delay);
   }
}
