// JavaScript Document
// Flexible Image Slideshow- By JavaScriptKit.com (http://www.javascriptkit.com)
// For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/
// This notice must stay intact for use


//ultimateshow[x]=["path to image", "OPTIONAL link for image", "OPTIONAL link target"]

var myimage=new Array()
var name=new Array()


myimage[0]=['images/fac1.jpg']
name[0]=['6000 square foot Infield Space']

myimage[1]=['images/fac2.jpg']
name[1]=['Speed and Agility Training']

myimage[2]=['images/fac3.jpg']
name[2]=['Weight Room']

myimage[3]=['images/fac4.jpg']
name[3]=['Basketball Court']

myimage[4]=['images/fac5.jpg']
name[4]=['Five Dirt Pitching Mounds']

myimage[5]=['images/fac6.jpg']
name[5]=['Six Coin Operated Pitching Machines']

myimage[6]=['images/fac7.jpg']
name[6]=['Lobby/Reception Area']

myimage[7]=['images/fac8.jpg']
name[7]=['One on One Lessons']

//configure the below 3 variables to set the dimension/background color of the slideshow

var slidewidth="400px" //set to width of LARGEST image in your slideshow
var slideheight="330px" //set to height of LARGEST iamge in your slideshow
var slidecycles="continous" //number of cycles before slideshow stops (ie: "2" or "continous")
var randomorder="no" //randomize the order in which images are displayed? "yes" or "no"
var preloadimages="yes" //preload images? "yes" or "no"
var slidebgcolor=''

//configure the below variable to determine the delay between image rotations (in miliseconds)
var slidedelay=5000

////Do not edit pass this line////////////////

var ie=document.all
var dom=document.getElementById
var curcycle=0

	/*if (preloadimages=="yes"){
	for (i=0;i<myimage.length;i++){
	var cacheimage=new Image()
	cacheimage.src=myimage[i][0]
	}
for (i=0;i<name.length;i++){
	var cacheimage=new Image()
	cacheimage.src=name[i][0]
	}
	for (i=0;i<quotes.length;i++){
	var cacheimage=new Image()
	cacheimage.src=quotes[i][0]
	}*/


if (preloadimages=="yes"){
for (i=0;i<myimage.length;i++){
var cacheimage=new Image()
cacheimage.src=myimage[i][0]
}
}

var currentslide=0

function randomize(targetarray){
myimageCopy=new Array()
var the_one
var z=0
while (z<targetarray.length){
the_one=Math.floor(Math.random()*targetarray.length)
if (targetarray[the_one]!="_selected!"){
myimageCopy[z]=targetarray[the_one]
targetarray[the_one]="_selected!"
z++
}
}
}

if (randomorder=="yes")
randomize(myimage)
else
myimageCopy=myimage

function rotateimages(){
curcycle=(currentslide==0)? curcycle+1 : curcycle
ultcontainer='<table  width="400"  ><tr><td height="300">'
if (myimageCopy[currentslide][1]!="")
ultcontainer+='<img width="400" height="300" src="'+myimageCopy[currentslide][0]+'" border="0">'
ultcontainer+='</td></tr>'
ultcontainer+='<tr><td height="30" align="center">'+name[currentslide]+'</td></tr>'
ultcontainer+='</table>';

/*function rotateimages(){
curcycle=(currentslide==0)? curcycle+1 : curcycle
ultcontainer='<table  width="270"  ><tr><td height="178" >'
if (myimageCopy[currentslide][1]!="")
ultcontainer+='<a border="0" href="'+myimageCopy[currentslide][1]+'" target="'+myimageCopy[currentslide][2]+'">'
ultcontainer+='<img width="264" height="178" src="'+myimageCopy[currentslide][0]+'" border="0">'
ultcontainer+='</a></td></tr><tr><td>'
ultcontainer+='<a border="0" href="'+myimageCopy[currentslide][1]+'" target="'+myimageCopy[currentslide][2]+'">'
ultcontainer+='<img width="264" height="178" src="'+name[currentslide][0]+'" border="0">'
ultcontainer+='</a></td></tr><tr><td>'
ultcontainer+='<a border="0" href="'+myimageCopy[currentslide][1]+'" target="'+myimageCopy[currentslide][2]+'">'
ultcontainer+='<img width="264" height="178" src="'+quotes[currentslide][0]+'" border="0">'
//ultcontainer+='<tr><td colspan="2"><font size="2">'+piccaptions[currentslide]+'</font></td></tr>'
ultcontainer+='</a></td></tr>'
ultcontainer+='</table>'
*/


if (ie||dom)
crossrotateobj.innerHTML=ultcontainer
if (currentslide==myimage.length-1) currentslide=0
else currentslide++
if (curcycle==parseInt(slidecycles) && currentslide==0)
return
setTimeout("rotateimages()",slidedelay)
}

if (ie||dom)
document.write('<div id="slidedom" align="center" style="width:'+slidewidth+';height:'+slideheight+'; background-color:'+slidebgcolor+'"></div>')

function start_slider(){
crossrotateobj=dom? document.getElementById("slidedom") : document.all.slidedom
rotateimages()
}

if (ie||dom)
window.onload=start_slider