
var slideshow=new Array()
slideshow[4]= 'public/foto_testa/colosseum_night3_1.jpg|Colosseum by Night';slideshow[1]= 'public/foto_testa/spqr_1.jpg|Rome nick name';slideshow[2]= 'public/foto_testa/colosseum2_1.jpg|Colosseum by Day';slideshow[3]= 'public/foto_testa/romanforum2_1.jpg|Roman Forum.';slideshow[0]= 'public/foto_testa/angel_castle_1x.jpg|St. Angel Castle';slideshow[5]= 'public/foto_testa/vatican02_1.jpg|Vatican at Sunset';slideshow[6]= 'public/foto_testa/sordi_1.jpg|Great actor  roman style';slideshow[7]= 'public/foto_testa/isola_tiberina_trastevere_1.jpg|Tiberine Island(trastevere)';slideshow[8]='public/foto_testa/magnani.jpg|Great actors representing roman style';slideshow[9]='public/foto_testa/campo_pesce.jpg|Fish desk at Campo dei fiori square';
// slideshow[4]= 'public/foto_testa/colosseum_night3_1.jpg|Colosseum by Night';slideshow[1]= 'public/foto_testa/spqr_1.jpg|Rome nick name';slideshow[2]= 'public/foto_testa/colosseum2_1.jpg|Colosseum by Day';slideshow[3]= 'public/foto_testa/romanforum2_1.jpg|Roman Forum.';slideshow[0]= 'public/foto_testa/angel_castle_1x.jpg|St. Angel Castle';slideshow[5]= 'public/foto_testa/vatican02_1.jpg|Vatican at Sunset';slideshow[6]= 'public/foto_testa/fontana_del_nettuno_p1_1.jpg|Neptune Fountain (Navona square)';slideshow[7]= 'public/foto_testa/isola_tiberina_trastevere_1.jpg|Tiberine Island(trastevere)';slideshow[8]='public/foto_testa/campo_fiori.jpg|Campo dei fiori square';slideshow[9]='public/foto_testa/campo_pesce.jpg|Fish desk at Campo dei fiori square';
// the font-family of the messages
var fntfamily="ultra vertex23"

// the font-size of the messages (ranging from 1 to 6)
var fntsize=4

// the font-color of the messages 
// instead of "yellow" you also could write "FFFF00"
var fntcolor="yellow"

// the background-color of the messages
// instead of "black" you also could write "000000"
var bgrndcolor="black"

// the width of the slides (pixels)
var imagewidth=481 //238

// the height of the slides (pixels)
var imageheight=265 // 234  156

// the minimum interval between each slide (seconds)
var standstill=4

///////////////////////////////////////////////////////////////////////////
// CONFIGURATION ENDS HERE
///////////////////////////////////////////////////////////////////////////

// do not change the code below
var imgstop=0
var imgsleft=0
var mestop=imageheight
var mesleft=0
var firstslide=true
var starttime
var nowtime
var imgurl=new Array()
var message=new Array()
var imgurlandmessagearray=new Array()
var imgurlandmessage
var imgpreload=new Array()
var playertop=0
var playerleft=0
var i_imgs=0
var i_loop=0
var i_preloadloop=0
var i_transition=0
var timerrotate=false
var timercheck=false
var contentimg
var contentmes
var slideshowlength=slideshow.length

var topdivheight=imageheight+40

var ns6=document.getElementById&&!document.all?1:0
var standstill=standstill*1000

function init() {
    firstslide=true
    i_imgs=0
    i_loop=0
    i_preloadloop=randommaker(slideshowlength)
    if (timerrotate) {
        clearTimeout(timerrotate)
        clearTimeout(timercheck)
    }
    imgurl=new Array
    message=new Array
    for (i=0;i<=slideshow.length-1;i++) {
        imgurlandmessage=slideshow[i].split("|")
        imgurl[i]=imgurlandmessage[0]
        message[i]=imgurlandmessage[1] 
    }

    if (document.all) {
        imgs.innerHTML=""
        mes.innerHTML=""
	    document.all.imgs.style.posTop=imgstop
        document.all.imgs.style.posLeft=imgsleft
		document.all.mes.style.posTop=mestop
        document.all.mes.style.posLeft=mesleft
        checkpreloadtime()
        preloadimage()
        checkifloaded()
    }
    if (ns6) {
		document.getElementById('imgs').innerHTML=""
        document.getElementById('mes').innerHTML=""
        document.getElementById('imgs').style.top=imgstop
        document.getElementById('imgs').style.left=imgsleft
        document.getElementById('mes').style.top=mestop
        document.getElementById('mes').style.left=mesleft
        checkpreloadtime()
        preloadimage()
        checkifloaded()
    }
	if (document.layers) {
		document.topdiv.document.imgs.document.write("")
        document.topdiv.document.imgs.document.close()
        document.topdiv.document.mes.document.write("")
        document.topdiv.document.mes.document.close()
	    document.topdiv.document.imgs.top=imgstop
        document.topdiv.document.imgs.left=imgsleft
		document.topdiv.document.mes.top=mestop
        document.topdiv.document.mes.left=mesleft
        checkpreloadtime()
        preloadimage()
        checkifloaded()
    }
}

function checkifloaded() {   
   if (imgpreload.complete) { 
        nowtime=new Date()
        nowtime=nowtime.getTime()
        nowtime=nowtime-starttime
        var interval=standstill-nowtime
        if (interval<=0 ) {
            interval=1
        }
        if (firstslide) {
            interval=1
            firstslide=false
        }
        if (i_preloadloop==i_loop) {
            interval=1
        }
        timerrotate=setTimeout("rotateimages()", interval)
   }
   else {
        timercheck=setTimeout("checkifloaded()", 100)
   }
}

function preloadimage() { 
	imgpreload=new Image()
	imgpreload.src=imgurl[i_preloadloop]
}

function rotateimages() {
    i_loop=i_preloadloop
    i_preloadloop=randommaker()  
    checkpreloadtime()
    preloadimage()
    getcontent()
    if (document.all) {
        imgs.filters[i_transition].apply()
        imgs.innerHTML=contentimg
        imgs.filters[i_transition].play()
        i_transition++
        if (i_transition>21) {i_transition=0}
        mes.innerHTML=contentmes
    }    
    if (ns6) {
        document.getElementById('imgs').innerHTML=contentimg
        document.getElementById('mes').innerHTML=contentmes
    }
    if (document.layers) {
        document.topdiv.document.imgs.document.write(contentimg)
        document.topdiv.document.imgs.document.close()
        document.topdiv.document.mes.document.write(contentmes)
        document.topdiv.document.mes.document.close()
    }
    i_loop++
    checkifloaded()    
}

function randommaker() {		
	rand=Math.floor(slideshowlength*Math.random())
    return rand

}

function getcontent() {
    contentimg="<img src='"+imgurl[i_loop]+"'>"
contentmes="<table cellpadding=2 cellspacing=0 border=0 bgcolor="+bgrndcolor+" width="+imagewidth+"><tr><td><font size="+fntsize+" color="+fntcolor+" face="+fntfamily+">"+message[i_loop]+"</font></td></tr></table>"

	
	
}

if (document.all) {
    document.write('<div id="topdiv" style="position:relative;width:'+imagewidth+'px;height:'+topdivheight+'px">')
    document.write('<div id="mes" style="position:absolute;"> </div>')
    document.write('<div id="imgs" style="position:absolute;filter: revealTrans(Transition=1, Duration=2) revealTrans(Transition=2, Duration=2) revealTrans(Transition=3, Duration=2)  revealTrans(Transition=4, Duration=2)  revealTrans(Transition=5, Duration=1)  revealTrans(Transition=6, Duration=2)  revealTrans(Transition=7, Duration=2)  revealTrans(Transition=8, Duration=1)  revealTrans(Transition=9, Duration=2)  revealTrans(Transition=10, Duration=1)  revealTrans(Transition=11, Duration=2)  revealTrans(Transition=12, Duration=2)  revealTrans(Transition=13, Duration=1)  revealTrans(Transition=14, Duration=2)  revealTrans(Transition=15, Duration=2)  revealTrans(Transition=16 Duration=1)  revealTrans(Transition=17, Duration=2)  revealTrans(Transition=18, Duration=2) revealTrans(Transition=19, Duration=1) revealTrans(Transition=20, Duration=2) revealTrans(Transition=21, Duration=2) revealTrans(Transition=22, Duration=2)"> </div>')
    document.write('</div>')     
}

if (ns6) {
    document.write('<div id="topdiv" style="position:relative;width:'+imagewidth+'px;height:'+topdivheight+'px">')
    document.write('<div id="mes" style="position:absolute; top:250px; left:300px; "> </div>')
    document.write('<div id="imgs" style="position:absolute;"> </div>')
    document.write('</div>')     
}

if (document.layers) {
    document.write('<ilayer name="topdiv" width='+imagewidth+' height='+topdivheight+'>')
    document.write('<ilayer name="mes"> </layers>')
    document.write('<ilayer name="imgs"> </layers>')
    document.write('</ilayer>')     
}

function checkpreloadtime() {
	starttime= new Date()
	starttime=starttime.getTime()
}

function checktime() {

}

window.onresize=new Function("window.location.reload()");
//window.onload=init;
window.onload=init();