theimage = new Array();


// The dimensions of ALL the images should be the same or some of them may look stretched or reduced in Netscape 4.
// Format: theimage[...]=[image URL, link URL, name/description]
theimage[0]=["photos/wslide1.jpg", "", ""];
theimage[1]=["photos/wslide2.jpg", "", ""];
theimage[2]=["photos/wslide3.jpg", "", ""];
theimage[3]=["photos/wslide4.jpg", "", ""];
theimage[4]=["photos/wslide5.jpg", "", ""];
theimage[5]=["photos/wslide6.jpg", "", ""];
theimage[6]=["photos/wslide7.jpg", "", ""];
theimage[7]=["photos/wslide8.jpg", "", ""];
theimage[8]=["photos/wslide9.jpg", "", ""];
theimage[9]=["photos/wslide10.jpg", "", ""];
theimage[10]=["photos/wslide11.jpg", "", ""];
theimage[11]=["photos/wslide12.jpg", "", ""];
theimage[12]=["photos/wslide13.jpg", "", ""];
theimage[13]=["photos/wslide14.jpg", "", ""];
theimage[14]=["photos/wslide15.jpg", "", ""];
theimage[15]=["photos/wslide16.jpg", "", ""];
theimage[16]=["photos/wslide17.jpg", "", ""];
theimage[17]=["photos/wslide18.jpg", "", ""];
theimage[18]=["photos/wslide19.jpg", "", ""];
theimage[19]=["photos/wslide20.jpg", "", ""];
theimage[20]=["photos/wslide21.jpg", "", ""];
theimage[21]=["photos/wslide22.jpg", "", ""];
theimage[22]=["photos/wslide23.jpg", "", ""];
theimage[23]=["photos/wslide24.jpg", "", ""];
theimage[24]=["photos/wslide25.jpg", "", ""];
theimage[25]=["photos/wslide26.jpg", "", ""];
theimage[26]=["photos/wslide27.jpg", "", ""];
theimage[27]=["photos/wslide28.jpg", "", ""];
theimage[28]=["photos/wslide29.jpg", "", ""];
theimage[29]=["photos/wslide30.jpg", "", ""];
theimage[30]=["photos/wslide31.jpg", "", ""];
theimage[31]=["photos/wslide32.jpg", "", ""];
theimage[32]=["photos/wslide33.jpg", "", ""];
theimage[33]=["photos/wslide34.jpg", "", ""];
theimage[34]=["photos/wslide35.jpg", "", ""];
theimage[35]=["photos/wslide36.jpg", "", ""];
theimage[36]=["photos/wslide37.jpg", "", ""];
theimage[37]=["photos/wslide38.jpg", "", ""];
theimage[38]=["photos/wslide39.jpg", "", ""];
theimage[39]=["photos/wslide40.jpg", "", ""];
theimage[40]=["photos/wslide41.jpg", "", ""];
theimage[41]=["photos/wslide42.jpg", "", ""];
theimage[42]=["photos/wslide43.jpg", "", ""];
theimage[43]=["photos/wslide44.jpg", "", ""];
theimage[44]=["photos/wslide45.jpg", "", ""];

///// Plugin variables

playspeed=3000;// The playspeed determines the delay for the "Play" button in ms
playdiffernce=500; // The speed that the autoplay speed is changed by. 1000=1sec

//#####
//key that holds where in the array currently are
i=0;


//###########################################
window.onload=function(){

	//preload images into browser
	preloadSlide();

	//set the first slide
	SetSlide(0);

	//autoplay
	PlaySlide();
}

//###########################################
function SetSlide(num) {
	//too big
	i=num%theimage.length;
	//too small
	if(i<0)i=theimage.length-1;

	//switch the image
	document.images.imgslide.src=theimage[i][0];

	//if they want current slide number and total
	document.getElementById('slidecount').innerHTML= "Image "+(i+1)+" of "+theimage.length;

	//if they have the speed timer
	if(document.slideshow.slidespeed){
		SetSpeed(0);
	}

}


//###########################################
function PlaySlide() {
	if (!window.playing) {
		PlayingSlide(i+1);
		if(document.slideshow.play){
			document.slideshow.play.value="   Stop   ";
		}
	}
	else {
		playing=clearTimeout(playing);
		if(document.slideshow.play){
			document.slideshow.play.value="   Play   ";
		}
	}
	// if you have to change the image for the "playing" slide
	if(document.images.imgPlay){
		setTimeout('document.images.imgPlay.src="'+imgStop+'"',1);
		imgStop=document.images.imgPlay.src
	}
}


//###########################################
function PlayingSlide(num) {
	playing=setTimeout('PlayingSlide(i+1);SetSlide(i+1);', playspeed);
}


//###########################################
function SetSpeed(num){
	if(playspeed+num>0){
		playspeed+=num;
		document.slideshow.slidespeed.value=playspeed;
	}
}


//###########################################
function preloadSlide() {
	for(k=0;k<theimage.length;k++) {
		theimage[k][0]=new Image().src=theimage[k][0];
	}
}