
// Flexible Image Slideshow- By Lynn Lockhart

var ultimateshow=new Array()

//ultimateshow[x]=["path to image", "OPTIONAL link for image", "OPTIONAL link target"]

ultimateshow[0]=['images/rotate/img1.jpg', '', '']
ultimateshow[1]=['images/rotate/img2.jpg', '', '']
ultimateshow[2]=['images/rotate/img3.jpg', '', '']
ultimateshow[3]=['images/rotate/img4.jpg', '', '']
ultimateshow[4]=['images/rotate/img5.jpg', '', '']
ultimateshow[5]=['images/rotate/img6.jpg', '', '']
ultimateshow[6]=['images/rotate/img7.jpg', '', '']
ultimateshow[7]=['images/rotate/img8.jpg', '', '']
ultimateshow[8]=['images/rotate/img9.jpg', '', '']
ultimateshow[9]=['images/rotate/img10.jpg', '', '']
ultimateshow[10]=['images/rotate/img11.jpg', '', '']
ultimateshow[11]=['images/rotate/img12.jpg', '', '']
ultimateshow[12]=['images/rotate/img13.jpg', '', '']
ultimateshow[13]=['images/rotate/img14.jpg', '', '']
ultimateshow[14]=['images/rotate/img15.jpg', '', '']
ultimateshow[15]=['images/rotate/img16.jpg', '', '']
ultimateshow[16]=['images/rotate/img17.jpg', '', '']
ultimateshow[17]=['images/rotate/img18.jpg', '', '']
ultimateshow[18]=['images/rotate/img19.jpg', '', '']
ultimateshow[19]=['images/rotate/img20.jpg', '', '']
ultimateshow[20]=['images/rotate/img21.jpg', '', '']
ultimateshow[21]=['images/rotate/img22.jpg', '', '']
ultimateshow[22]=['images/rotate/img23.jpg', '', '']

//configure the below 3 variables to set the dimension/background color of the slideshow

var slidewidth="253px" //set to width of LARGEST image in your slideshow
var slideheight="219px" //set to height of LARGEST iamge in your slideshow
var slidecycles="continous" //number of cycles before slideshow stops (ie: "2" or "continous")
var randomorder="yes" //randomize the order in which images are displayed? "yes" or "no"
var preloadimages="yes" //preload images? "yes" or "no"
var slidebgcolor='#000033';

//configure the below variable to determine the delay between image rotations (in miliseconds)
var slidedelay=2000

////Do not edit pass this line////////////////

var ie=document.all
var dom=document.getElementById
var curcycle=0

if (preloadimages=="yes"){
for (i=0;i<ultimateshow.length;i++){
var cacheimage=new Image()
cacheimage.src=ultimateshow[i][0]
}
}

var currentslide=0

function randomize(targetarray){
ultimateshowCopy=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!"){
ultimateshowCopy[z]=targetarray[the_one]
targetarray[the_one]="_selected!"
z++
}
}
}

if (randomorder=="yes")
randomize(ultimateshow)
else
ultimateshowCopy=ultimateshow

function rotateimages(){
curcycle=(currentslide==0)? curcycle+1 : curcycle
ultcontainer='<center>'
if (ultimateshowCopy[currentslide][1]!="")
ultcontainer+='<a href="'+ultimateshowCopy[currentslide][1]+'" target="'+ultimateshowCopy[currentslide][2]+'">'
ultcontainer+='<img src="'+ultimateshowCopy[currentslide][0]+'" border="0">'
if (ultimateshowCopy[currentslide][1]!="")
ultcontainer+='</a>'
ultcontainer+='</center>'
if (ie||dom)
crossrotateobj.innerHTML=ultcontainer
if (currentslide==ultimateshow.length-1) currentslide=0
else currentslide++
if (curcycle==parseInt(slidecycles) && currentslide==0)
return
setTimeout("rotateimages()",slidedelay)
}

function start_slider(){
crossrotateobj=dom? document.getElementById("slidedom") : document.all.slidedom
crossrotateobj.width=slidewidth;
crossrotateobj.height=slideheight;
crossrotateobj.bgcolor=slidebgcolor;
rotateimages()
}

