var ultimateshow=new Array()

//ultimateshow[x]=["path to image", "OPTIONAL link for image", "OPTIONAL link target"]

ultimateshow[0]=["images/banner_Big_RPGrassi.jpg", "", "_blank"]
ultimateshow[1]=["images/Banner_Big_il_Crostolo.jpg", "http://www.ilcrostolo.it/index1.html?lang=it&target=d1.html&lang=it", "_blank"]
ultimateshow[2]=["images/Banner_Big_C_Ernestina.jpg", "http://www.ilcrostolo.it/index.html?target=d10.html&product=P21&lang=it", "_blank"]
ultimateshow[3]=["images/Banner_Big_C_contadina.jpg", "http://www.ilcrostolo.it/index.html?target=d8.html&product=P4&lang=it", "_blank"]
ultimateshow[4]=["images/Banner_Big_C_Meraviglie.jpg", "http://www.ilcrostolo.it/index.html?target=d10.html&product=P20&lang=it", "_blank"]
ultimateshow[5]=["images/Banner_Big_P_Ricordi.jpg", "http://www.ilcrostolo.it/index.html?target=d12.html&product=P5&lang=it", "_blank"]
ultimateshow[6]=["images/Banner_Big_Feudatario.jpg", "http://www.ilcrostolo.it/index.html?target=d10.html&product=P2&lang=it", "_blank"]
ultimateshow[7]=["images/Banner_Big_Pane.jpg", "http://www.ilcrostolo.it/", "_blank"]
ultimateshow[8]=["images/Banner_Big_Tozzetti.jpg", "http://www.ilcrostolo.it/index.html?target=d12.html&product=P3&lang=it", "_blank"]
ultimateshow[9]=["images/BannerCadellAiaG.jpg", "http://www.cadellaia.it/", "_blank"]
ultimateshow[10]=["images/BannerPubblG.jpg", "mailto:direzione@lavocedelfornaio.it?subject=Richiesta informazioni pubblicità su lavocedelfornaio.it", ""]

//configure the below 3 variables to set the dimension/background color of the slideshow

var slidewidth="620px" //set to width of LARGEST image in your slideshow
var slideheight="97px" //set to height of LARGEST iamge in your slideshow
var slidecycles="10" //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 randomorder="no" //randomize the order in which images are displayed? "yes" or "no"
var preloadimages="yes" //preload images? "yes" or "no"
var slidebgcolor='#FFBE00'

//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
