// JavaScript Document

// Adapted from code I found somewhere on the internet.  This started out as a basic
// push-button slide show.  I have added an auto-play option and code to stop and start
// the autoplay when any other button beside Play is clicked. This is not all my code,
// but I will take credit for the custom stuff.  bill@bwarfel.com
var photos=new Array()
var photoslink=new Array()
var which=0 //I think this is the location in the slide show
var mytimer=5 // 1= 1 second of delay

//define images. You can have as many as you want:
photos[0]="images/franchises/1.jpg"
photos[1]="images/franchises/2.jpg"
photos[2]="images/franchises/3.jpg"
photos[3]="images/franchises/4.jpg"
photos[4]="images/franchises/5.jpg"
photos[5]="images/franchises/6.jpg"
photos[6]="images/franchises/7.jpg"
photos[7]="images/franchises/8.jpg"
//photos[8]="images/franchises/9.jpg"
//photos[9]="images/franchises/10.jpg"
//photos[8]="images/slideshow/slide9.jpg"
//Specify whether images should be linked or not (1=linked)
var linkornot=0

//Set corresponding URLs for above images. Define ONLY if variable linkornot equals "1"
photoslink[0]=""
photoslink[1]=""
photoslink[2]=""
//do NOT edit past this line
var preloadedimages=new Array()
for (i=0;i<photos.length;i++){
preloadedimages[i]=new Image()
preloadedimages[i].src=photos[i]
}
function PauseShow(){clearInterval(myinterval)} //somebody hit the pause button or the navigation arrows
function ResumeShow(){ //somebody hits the resume/play button
	{if (which<photos.length-1){which++}else{which =0}
	applyeffect()
	document.images.photoslider.src=photos[which]
	playeffect()
	keeptrack()}
	myinterval = setInterval("AutoShow()",mytimer*1000)
}
function applyeffect(){
	if (document.all && photoslider.filters)
		{photoslider.filters.revealTrans.Transition=12
		//comment out the line above and uncomment out the line below if you want a random transition effect
		//{photoslider.filters.revealTrans.Transition=Math.floor(Math.random()*23)
		photoslider.filters.revealTrans.stop()
		photoslider.filters.revealTrans.apply()
	}
}
function playeffect(){
	if (document.all && photoslider.filters)
	photoslider.filters.revealTrans.play()
}
function keeptrack(){window.status="Image "+(which+1)+" of "+photos.length}
function backward(){
	if (which>0){which--} else {which = photos.length-1} // -1 because we are converting length to a 0 index
		PauseShow()
		applyeffect()
		document.images.photoslider.src=photos[which]
		playeffect()
		keeptrack()
}
function forward(){
	if (which<photos.length-1){which++} else {which =0}
		PauseShow()
		applyeffect()
		document.images.photoslider.src=photos[which]
		playeffect()
		keeptrack()
		}
function transport(){window.location=photoslink[which]}
function AutoShow()
	{if (which<photos.length-1){which++}else{which =0}
	applyeffect()
	document.images.photoslider.src=photos[which]
	playeffect()
	keeptrack()}