<!-- configurable script -->

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]=["http://cloudnoveevents.com/images/headerImages/Brucculeri1.jpg", "", "Thomas Paul Photography"];
theimage[1]=["http://cloudnoveevents.com/images/headerImages/Murgolo1.jpg", "", "Janelle Brooke Photography"];
theimage[2]=["http://cloudnoveevents.com/images/headerImages/Murgolo3.jpg", "", "Janelle Brooke Photography"];
theimage[3]=["http://cloudnoveevents.com/images/headerImages/Burke5.jpg", "", "David Gordon Photography"];
theimage[4]=["http://cloudnoveevents.com/images/headerImages/cialone2.jpg", "", "Duet Photography"];
theimage[5]=["http://cloudnoveevents.com/images/headerImages/Florit3.jpg", "", "Thomas Paul Photography"];
theimage[6]=["http://cloudnoveevents.com/images/headerImages/Gomez4.jpg", "", "Black Rock Photography"];
theimage[7]=["http://cloudnoveevents.com/images/headerImages/diane2.jpg", "", "J'Adore Love Photography"];
theimage[8]=["http://cloudnoveevents.com/images/headerImages/Gomez1.jpg", "", "Black Rock Photography"];
theimage[9]=["http://cloudnoveevents.com/images/headerImages/Waine3.jpg", "", "Indigo Foto"];
theimage[10]=["http://cloudnoveevents.com/images/headerImages/Greco1.jpg", "", "Jo Von Photography"];
theimage[11]=["http://cloudnoveevents.com/images/headerImages/Waine6.jpg", "", "Indigo Foto"];
theimage[12]=["http://cloudnoveevents.com/images/headerImages/diane1.jpg", "", "J'Adore Love Photography"];
theimage[13]=["http://cloudnoveevents.com/images/headerImages/grooms1.jpg", "", "Jamie VanBuskirk"];


///// Plugin variables

playspeed=6000;// The playspeed determines the delay for the "Play" button in ms
//#####
//key that holds where in the array currently are
i=0;


//###########################################
//if random
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];
}

//if random order
SetRandom()


//###########################################
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 name of current slide
	document.getElementById('slidebox').innerHTML=theimage[i][2];

}


//###########################################
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];
	}
}

