var timer
var paused = true
var ie=document.all
var dom=document.getElementById

for (i=0;i<variableslide.length;i++){
var cacheimage=new Image()
cacheimage.src=variableslide[i][0]
}

var currentslide=0

function rotateimages(){
contentcontainer='<table align="center"><tr><td align="center">'
//show title if it was specified
if (variableslide[currentslide][1]!="")
contentcontainer+='<span><center><b>'+variableslide[currentslide][1]+'</b></center></span><br>'
//show image with a link to the image
contentcontainer+='<a href="'+variableslide[currentslide][0]+'">'
contentcontainer+='<img src="'+variableslide[currentslide][0]+'" width=' + imagewidth + ' height=' + imageheight + ' border="0" vspace="3"><br><br>'
contentcontainer+='</a>'
//show description if it was specified
if (variableslide[currentslide][2]!="")
contentcontainer+=variableslide[currentslide][2]
contentcontainer+='<br>'
contentcontainer+='</td></tr></table>'


if (document.layers){
crossrotateobj.document.write(contentcontainer)
crossrotateobj.document.close()
}
else if (ie||dom)
crossrotateobj.innerHTML=contentcontainer
if (currentslide==variableslide.length-1) currentslide=0
else currentslide++
if (!paused) timer = 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") : ie? document.all.slidedom : document.slidensmain.document.slidenssub
if (document.layers)
document.slidensmain.visibility="show"
rotateimages()
}

if (ie||dom)
start_slider()
else if (document.layers)
window.onload=start_slider

function show_slide(slideNumber){
paused = true
clearTimeout(timer)
if (slideNumber=="") currentslide=0
else currentslide=slideNumber
rotateimages()
}

function previous_slide(){
if (currentslide==0) currentslide=variableslide.length-2
else if (currentslide==1) currentslide=variableslide.length-1
else currentslide=currentslide-2
clearTimeout(timer)
rotateimages()
}

function pause_slideshow(){
paused = true
clearTimeout(timer)
}

function resume_slideshow(){
paused = false
clearTimeout(timer)
rotateimages()
}

function next_slide(){
clearTimeout(timer)
rotateimages()
}
