
function switchImage(imgName, imgSrc){
	if (document.images){
		if (imgSrc != "none"){
			document.images[imgName].src = "img/slideshow/"+imgSrc;
		}
	}
}

var mySlideList1 = ['001.jpg', '002.jpg', '003.jpg', '004.jpg', '005.jpg', '006.jpg', '007.jpg', '008.jpg', '009.jpg', '010.jpg', '011.jpg', '012.jpg', '013.jpg', '014.jpg', '015.jpg', '016.jpg', '017.jpg', '018.jpg', '019.jpg', '020.jpg', '021.jpg', '022.jpg', '023.jpg', '024.jpg', '025.jpg', '026.jpg', '027.jpg', '028.jpg', '029.jpg', '030.jpg',  '031.jpg', '032.jpg', '033.jpg', '034.jpg', '035.jpg', '036.jpg', '037.jpg', '038.jpg', '039.jpg', '040.jpg', '041.jpg', '042.jpg', '043.jpg', '044.jpg', '045.jpg', '046.jpg', '047.jpg', '048.jpg', '049.jpg', '050.jpg', '051.jpg', '052.jpg', '053.jpg', '054.jpg', '055.jpg', '056.jpg', '057.jpg', '058.jpg', '059.jpg', '060.jpg', '061.jpg', '062.jpg', '063.jpg', '064.jpg', '065.jpg', '066.jpg', '067.jpg', '068.jpg', '069.jpg', '070.jpg', '071.jpg', '072.jpg', '073.jpg', '074.jpg', '075.jpg'];
var mySlideShow1 = new SlideShow(mySlideList1, 'slide1', 2000, "mySlideShow1");

function SlideShow(slideList, image, speed, name){
	this.slideList = slideList;
	this.image = image;
	this.speed = speed;
	this.name = name;
	this.current = 0;
	this.timer = 0;
}

SlideShow.prototype.play = SlideShow_play;

function SlideShow_play(){
	with(this){
		if(current++ == slideList.length-1) current = 0;
		switchImage(image, slideList[current]);
		clearTimeout(timer);
		timer = setTimeout(name+'.play()', speed);
	}
}
