
theimage = new Array();




// The dimensions of ALL the images should be the same (245 high by 326 wide)

// Format: theimage[...]=[image URL, link URL, name/description]

theimage[0]=["http://ys.bplsonline.org/images/slideshow/FOVALENTINE.jpg", "http://ys.bplsonline.org/programs/FOValentine.html", ""];

theimage[1]=["http://ys.bplsonline.org/images/FMNslide2.jpg", "http://ys.bplsonline.org/programs/fmn.html", ""];

theimage[2]=["http://ys.bplsonline.org/images/slideshow/kickitscroll.JPG", "http://ys.bplsonline.org/programs/kickit.html", ""];

theimage[3]=["http://ys.bplsonline.org/images/slideshow/bailey.jpg", "http://ys.bplsonline.org/programs/FObailey.html", ""];

theimage[4]=["http://ys.bplsonline.org/images/slideshow/FObedtimetales.jpg", "http://ys.bplsonline.org/programs/FObedtimeflyer.html", ""];

theimage[5]=["http://ys.bplsonline.org/images/bowwow.jpg", "http://ys.bplsonline.org/programs/MObowwow.html", ""];

theimage[6]=["http://ys.bplsonline.org/images/slideshow/Legoslide.jpg", "http://ys.bplsonline.org/programs/lego.html", ""];

theimage[7]=["http://ys.bplsonline.org/images/slideshow/FODr.Seuss.jpg", "http://ys.bplsonline.org/programs/FODRSEUSS.html", ""];

/// Plugin variables



playspeed=5000;

// The playspeed determines the delay for the "Play" button. Convert is 10 secs = 10000.



//key that holds where in the array u currently are

i=0;




//function to create a random order

function SetRandom() {
	
	tempimage = new Array();

	for(p=0; p<theimage.length; p++) {

		for(p1=0; p1>-1; p1) {

			tempNum = Math.floor(Math.random()*theimage.length)

			if(!tempimage[tempNum]) {

				tempimage[tempNum]=theimage[p];

				break;

			}

		}

	}

	for(p=0;p<theimage.length;p++)theimage[p]=tempimage[p];

}


SetRandom()





//###########################################

window.onload=function() {



	//preload images into browser

	preloadSlide();



	//set the first slide

	SetSlide(0);



	//autoplay on

	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];



	//for current slide number and total

	document.getElementById('slidecount').innerHTML= "Image "+(i+1)+" of "+theimage.length;



}





//###########################################\

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 preloadSlide() {

	for(k=0;k<theimage.length;k++) {

		theimage[k][0]=new Image().src=theimage[k][0];

	}

}

