// JavaScript functions for auto slideshow 

// show slides or not?
var doSlides = false;   
//var doSlides = true; 

// Manual Slide show functions
var Slides = new Array();
var which=0;  
var ie=document.all;
var dom=document.getElementById;
var slidedelay = 4000;  //time between slides in milliseconds = 20

		// List all the slides with captions which may contain html link information
						// Slides[nn] = ['filename','caption']
	/*Slides[0]=['horseimgs/fancyfilly2.jpg', '']
	Slides[1]=['horseimgs/foal2.jpg', '']
	Slides[2]=['horseimgs/deedeecolt2.jpg', '']
	Slides[3]=['horseimgs/foal3.jpg', '']
	Slides[4]=['horseimgs/foal4.jpg', '']
	Slides[5]=['horseimgs/ranch_1.jpg', '']
	*/
	/*
	Slides[0]=['horseimgs/mare1.jpg', '']
	Slides[1]=['horseimgs/Chip1.jpg', '']
	Slides[2]=['horseimgs/fate001.jpg', '']
	Slides[3]=['horseimgs/Chestnut.jpg', '']
	Slides[4]=['horseimgs/ribbons.jpg', '']
	*/
	Slides[0]=['horseimgs/slides/show09_9.jpg', '']
	Slides[1]=['horseimgs/slides/show09_1.jpg', '']
	Slides[2]=['horseimgs/slides/show09_15.jpg', '']
	Slides[3]=['horseimgs/slides/show09_4.jpg', '']
	Slides[4]=['horseimgs/slides/show09_7.jpg', '']
	Slides[5]=['horseimgs/slides/show09_11.jpg', '']
	Slides[6]=['horseimgs/slides/show09_14.jpg', '']
	Slides[7]=['horseimgs/slides/show09_3.jpg', '']
	Slides[8]=['horseimgs/slides/show09_2.jpg', '']
	Slides[9]=['horseimgs/slides/show09_6.jpg', '']
	Slides[10]=['horseimgs/slides/show09_5.jpg', '']
	Slides[11]=['horseimgs/slides/show09_10.jpg', '']
	Slides[12]=['horseimgs/slides/show09_8.jpg', '']
	Slides[13]=['horseimgs/slides/show09_13.jpg', '']
	Slides[14]=['horseimgs/slides/show09_12.jpg', '']
	/*
	Slides[0]=['images/ec_jr_equestrian_year_.jpg', 'Conley Driediger']
	Slides[1]=['images/Fire & Ally slidingSm.jpg', 'VLQ Friendly Fire+/']
	Slides[2]=['images/KohlminerSm.jpg', 'Kohlminer++++//']
	*/
function preLoadSlides() {
	var prepSlides=new Array()
	for (i=0;i<Slides.length;i++){
		prepSlides[i]=new Image()
		prepSlides[i].src=Slides[i][0]
	}
}

/*
function keeptrack(){
	window.status="Image "+(which+1)+" of "+Slides.length
}

function checkButtons(){
	if (ie) {
		document.all.Previous.disabled = (which == 0);
		document.all.Next.disabled = (which == (Slides.length-1));  }
	else if (dom) {
		document.getElementById("Previous").disabled = (which == 0);
		document.getElementById("Next").disabled = (which == (Slides.length-1));  }
	else {
		document.slideshow.document.Previous.disabled = (which == 0);
		document.slideshow.document.Next.disabled = (which == (Slides.length-1));  }
}

function backward(){
	if (which>0)
		which--;
	else 
		which=Slides.length-1;
	document.images.photomat.src=Slides[which][0];
	putCaption();
	keeptrack();					
}

function forward(){
	if (which<Slides.length-1)
		which++;
	else
		which=0;

	document.images.photomat.src=Slides[which][0];
	putCaption();
	keeptrack();
}
 
function putCaption(){
	captionobj=dom? document.getElementById("captionCell") : ie? document.all.captionCell : document.slideshow.document.captionCell;
	thisCaption = Slides[which][1];
	if (document.layers){
		captionobj.document.write(thisCaption);
		captionobj.document.close();	}
	else if (ie||dom)
		captionobj.innerHTML=thisCaption;
}

function getSlide(thisSlide) {
	which = thisSlide - 1;
	forward();
}		
*/

function rotateSlides() {
	if (doSlides) {
		document.images.photomat.src=Slides[which][0];
		if (which<Slides.length-1)
			which++;
		else
			which=0;
			
		setTimeout("rotateSlides()",slidedelay);
	}
}

//setup for slides
if (doSlides) preLoadSlides();