// Velocità dello scroller: un numero più alto indica una velocità inferiore 
var ph_speed=2000;		
var ph_count=0;
//var ph_tot=2;//messa in jsp

/*window.onload=function() 
{
	if(!document.getElementById){return;}
	initPromohome();
}*/
window.onunload=function()
{
	clearInterval(promo_interval);
}

promo_interval=setInterval('scrollPromohome()',ph_speed);
/*function initPromohome()
{
	var n=document.getElementById('divpromo1');
	
	if(!n){return;}
	n.onmouseover=function()
	{		
		clearInterval(promo_interval);
	}
	n.onmouseout=function()
	{
		promo_interval=setInterval('scrollPromohome()',ph_speed);
	}
}*/

function scrollPromohome()
{
	if(ph_count==ph_tot) ph_count=0;
	for(i=0; i<ph_tot; i++)
	{
		var n = document.getElementById('divpromo'+i)
		if(!n){return;}
		//alert(i)
		if(i==ph_count)
			n.style.display='block'
		else
			n.style.display='none'
	}
	ph_count++;
}