
// Dissequenza by Califfo

var imgpreload=new Array()

var imgpreload2=new Array()

var timer
var i_fadestrength=99
var i_images=0
var step=1
var content
var PicNumber=0
var GiaFat=0
var first_time=1

function setimage() {
	document.all.imagebox.style.visibility="hidden"
	if (i_images>=zoomimages.length) 
		{i_images=0
		 first_time=0}
	zoomin()
}


function zoomin() {
	if (i_fadestrength > 0) {
		if (first_time==1) {
			imgpreload[i_images]=new Image()
			imgpreload[i_images].src=zoomimages[i_images]			
		}
		content="<img name='newpic' src='"+zoomimages[i_images]+"' width='"+document.body.clientWidth+"' height='"+document.body.clientWidth/1.182+"' usemap='#return' border='0'><map name='return'><area shape='rect' coords='0,0,202,68' href='index.htm'></map>"
		imagebox.innerHTML=content
        	imagebox.filters.alpha.opacity=Math.floor(100-i_fadestrength)
		document.all.imagebox.style.overflowX="hidden"
		document.all.imagebox.style.visibility="visible"
		step+=1.5
		i_fadestrength-=step
	        if(i_fadestrength<2) {i_fadestrength = 0}
		timer=setTimeout("zoomin()",50)
}
else {
	clearTimeout(timer)
	content="<img name='newpic' src='"+zoomimages[i_images]+"' width='"+document.body.clientWidth+"' height='"+document.body.clientWidth/1.182+"' usemap='#return' border='0'><map name='return'><area shape='rect' coords='0,0,202,68' href='index.htm'></map>"
	imagebox.innerHTML=content
	if (first_time==1) {
		imgpreload2[i_images]=new Image()
		imgpreload2[i_images].src=zoomimages2[i_images]			
	}
	document.all.imagebox.style.posLeft = 0
	document.all.imagebox.style.position = "absolute"
	document.all.imagebox.style.posTop = 16
	document.all.imagebox.style.overflowX="hidden"
	document.all.imagebox.style.visibility="visible"
	document.all.imagebox.style.width = document.body.clientWidth
	document.roll.style.width = document.body.clientWidth
	document.roll.style.height = document.body.clientWidth/1.182
	document.roll.src = zoomimages[i_images]
	timer=setTimeout("zoomout()",15000)
        step = 1
	}
}

function zoomout() {
if (i_fadestrength<101) {
		
        if(GiaFat==0) {
		document.roll.style.width = document.body.clientWidth
		document.roll.style.height = document.body.clientWidth/1.182
		document.roll.src = zoomimages2[i_images]
		GiaFat = 1}
	content="<img name='newpic' src='"+zoomimages[i_images]+"' width='"+document.body.clientWidth+"' height='"+document.body.clientWidth/1.182+"' usemap='#return' border='0'><map name='return'><area shape='rect' coords='0,0,202,68' href='index.htm'></map>"
	imagebox.innerHTML=content
	imagebox.filters.alpha.opacity=Math.floor(100-i_fadestrength)
	document.all.imagebox.style.posLeft = 0
	document.all.imagebox.style.posTop = 16
	document.all.imagebox.style.overflowX="hidden"
	document.all.imagebox.style.visibility="visible"
	step+=1.5
	i_fadestrength+=step
	timer=setTimeout("zoomout()",50)
}
else {
	GiaFat = 0
	clearTimeout(timer)
	i_fadestrength=99;
	step=1;
	i_images++
	imagebox.filters.alpha.opacity = 0
	setTimeout("setimage()",15000)
	}
}

if (document.all) {
	document.write("<DIV id='imagebox' style='position:absolute;top:0;left:0;filter:alpha(opacity=0)'></DIV>")
}

