// 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()
var quotes=new Array()

myimage[0]=['images/surveyor01.gif']
name[0]=['images/roadbuilder01.gif']
quotes[0]=['images/surveyor03.gif']

myimage[1]=['images/surveyor02.gif']
name[1]=['images/concrete01.gif']
quotes[1]=['images/surveyor04.gif']

myimage[2]=['images/surveyor05.gif']
name[2]=['images/surveyor01.gif']
quotes[2]=['images/roadbuilder01.gif']

myimage[3]=['images/surveyor03.gif']
name[3]=['images/surveyor02.gif']
quotes[3]=['images/concrete01.gif']

myimage[4]=['images/surveyor04.gif']
name[4]=['images/surveyor05.gif']
quotes[4]=['images/surveyor01.gif']

myimage[5]=['images/roadbuilder01.gif']
name[5]=['images/surveyor03.gif']
quotes[5]=['images/surveyor02.gif']

myimage[6]=['images/concrete01.gif']
name[6]=['images/surveyor04.gif']
quotes[6]=['images/surveyor05.gif']

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

var slidewidth="270px" //set to width of LARGEST image in your slideshow
var slideheight="552px" //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=25000

////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="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()
}
//add onload to body because there are 2 scripts requiring it
//if (ie||dom)
//window.onload=start_slider


