// 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

var ultimateshow=new Array()

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

ultimateshow[0]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool1.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool1.html', '']
ultimateshow[1]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool2.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool2.html', '']
ultimateshow[2]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool3.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool3.html', '']
ultimateshow[3]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool4.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool4.html', '']
ultimateshow[4]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool5.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool5.html', '']
ultimateshow[5]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool6.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool6.html', '']
ultimateshow[6]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool7.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool7.html', '']
ultimateshow[7]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool8.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool8.html', '']
ultimateshow[8]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool9.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool9.html', '']
ultimateshow[9]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool10.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool10.html', '']
ultimateshow[10]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool11.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool11.html', '']
ultimateshow[11]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool12.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool12.html', '']
ultimateshow[12]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool13.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool13.html', '']
ultimateshow[13]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool14.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool14.html', '']
ultimateshow[14]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool15.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool15.html', '']
ultimateshow[15]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool16.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool16.html', '']
ultimateshow[16]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool17.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool17.html', '']
ultimateshow[17]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool18.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool18.html', '']
ultimateshow[18]=['http://www.porpoisepools.com.au/images/gallery/slideshow/pool19.jpg', 'http://www.porpoisepools.com.au/html/gallery/pool19.html', '']

//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="321px" //set to height of LARGEST iamge in your slideshow
var slidecycles="18" //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='white'

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

////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)
}

if (ie||dom)
document.write('<div id="slidedom" 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
