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]=["../Images/CollectionSlideShow/Bentley-Cont04-nose.jpg", "", ""];
theimage[1]=["../Images/CollectionSlideShow/Bentley-Cont04-FrontAngle.jpg", "", ""];
theimage[2]=["../Images/CollectionSlideShow/Bentley-Cont06-Steeringwhee.jpg", "", ""];
theimage[3]=["../Images/CollectionSlideShow/Bentley-Cont04-Rear.jpg", "", ""];
theimage[4]=["../Images/CollectionSlideShow/BentleyContinentalGTCBlue5.jpg", "", ""];
theimage[5]=["../Images/CollectionSlideShow/BentleyContinentalGTCBlue4.jpg", "", ""];
theimage[6]=["../Images/CollectionSlideShow/F360FrontSideAngle.jpg", "", ""];
theimage[7]=["../Images/CollectionSlideShow/Ferrari360Side.jpg", "", ""];
theimage[8]=["../Images/CollectionSlideShow/Ferrari360RearSideAngle.jpg", "", ""];
theimage[9]=["../Images/CollectionSlideShow/RollsRoycePhantomNose.jpg", "", ""];
theimage[10]=["../Images/CollectionSlideShow/RollsRoycePhantomSideAnglej.jpg", "", ""];
theimage[11]=["../Images/CollectionSlideShow/RollsRoycePhantomFrontSideA.jpg", "", ""];
theimage[12]=["../Images/CollectionSlideShow/FordGtSide.jpg", "", ""];
theimage[13]=["../Images/CollectionSlideShow/FordGtFrontSide.jpg", "", ""];
theimage[14]=["../Images/CollectionSlideShow/FordGtFrontSideAngle.jpg", "", ""];
theimage[15]=["../Images/CollectionSlideShow/GallardoFrontSideAngle.jpg", "", ""];
theimage[16]=["../Images/CollectionSlideShow/GallardoRearSide.jpg", "", ""];
theimage[17]=["../Images/CollectionSlideShow/GallardoSide.jpg", "", ""];
theimage[18]=["../Images/CollectionSlideShow/LamborghiniMurcielagoNoseAn.jpg", "", ""];
theimage[19]=["../Images/CollectionSlideShow/LamborghiniMurcielagoRearAn.jpg", "", ""];
theimage[20]=["../Images/CollectionSlideShow/LamborghiniMurcielagoSideOp.jpg", "", ""];

///// Plugin variables

playspeed=3500;// The playspeed determines the delay for the "Play" button in ms
dotrans=1; // if value = 1 then there are transitions played in IE
transtype='blendTrans';// 'blendTrans' or 'revealtrans'
transattributes='23';// duration=seconds,transition=#<24
//#####
//key that holds where in the array currently are
i=0;


//###########################################
window.onload=function(){

	//preload images into browser
	preloadSlide();

	//set transitions
	GetTrans();

	//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
	if(document.all&&!window.opera&&dotrans==1)eval('document.images.imgslide.filters.'+transtype+'.Apply()')
	document.images.imgslide.src=theimage[i][0];
	if(document.all&&!window.opera&&dotrans==1)eval('document.images.imgslide.filters.'+transtype+'.Play()')

}


//###########################################
function PlaySlide() {
	if (!window.playing) {
		PlayingSlide(i+1);
		if(document.slideshow.play){
			document.slideshow.play.src="SlideShowButtons/Stop.jpg";
		}
	}
	else {
		playing=clearTimeout(playing);
		if(document.slideshow.play){
			document.slideshow.play.src="SlideShowButtons/Play.jpg";
		}
	}
	// 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);
}


//###########################################
//desc: picks the transition to apply to the images
function GetTrans() {
	//si=document.slideshow.trans.selectedIndex;

		if((document.slideshow.trans && document.slideshow.trans.selectedIndex == 0) || (!document.slideshow.trans && dotrans==0)){
		dotrans=0;
	}
	else if ((document.slideshow.trans && document.slideshow.trans.selectedIndex == 1) || (!document.slideshow.trans && transtype == 'blendTrans')){
		dotrans=1;
		transtype='blendTrans';
		document.imgslide.style.filter = "blendTrans(duration=1,transition=1)";
	}else{
		dotrans=1;
		transtype='revealtrans';
		if(document.slideshow.trans) transattributes=document.slideshow.trans[document.slideshow.trans.selectedIndex].value;
		document.imgslide.style.filter = "revealTrans(duration=1,transition=" +transattributes+ ")";
	}

}
//###########################################
function preloadSlide() {
	for(k=0;k<theimage.length;k++) {
		theimage[k][0]=new Image().src=theimage[k][0];
	}
}