<!--
var fullarrayRotator
var currentIndexRotator
var StopRotator=0
function StartRotator()
{
	currentIndexRotator=-1;

//	alert ('Start rotator');

	$('play').src = '/images/content/NewsRotator/play_off.gif';
	//

	//new Insertion.Bottom($('rotatordettagli'), $('test').innerHTML)	


	fullarrayRotator = $$('#rotatordettagli div[]');	
//	alert (fullarrayRotator.length);
//	fullarrayRotator.each(function(item) 
//	{
//		new Insertion.Bottom($('rotatordettagli'), item.outerHTML)
	//	alert(item.outerHTML)
		//item.remove();
//	});
	$('rotatorloading').hide();
	$('rotatordettagli').show();

	updateRotator(+1);
	SetPeriodicalExecutorRotator();
}


function updateRotator(step)
{
	if(currentIndexRotator>-1)
	{
		fullarrayRotator[currentIndexRotator].hide();
	}
	currentIndexRotator = currentIndexRotator + step
	
	//alert (currentIndexRotator)
	if (currentIndexRotator ==-1){currentIndexRotator =fullarrayRotator.length -1}
	if (fullarrayRotator.length == currentIndexRotator){currentIndexRotator=0;}
	fullarrayRotator[currentIndexRotator].show();
	$("N").innerHTML = '(' + ((currentIndexRotator*1)+1) + ' di ' + fullarrayRotator.length + ')';
}

function prevRotator()
{
	stopRotator();
	updateRotator(-1);
}

function nextRotator()
{
	stopRotator();
	updateRotator(+1);
}

function restartRotator()
{
	StopRotator=0;
	$('stop').src = '/images/content/NewsRotator/stop.gif';
	$('play').src = '/images/content/NewsRotator/play_off.gif';
	SetPeriodicalExecutorRotator()
}

function stopRotator()
{
	StopRotator=1;
	
	$('stop').src = '/images/content/NewsRotator/stop_off.gif';
	$('play').src = '/images/content/NewsRotator/play.gif';
}
//Fine Gestione contenuto della pagina------------------------------------------------------------------------



	function SetPeriodicalExecutorRotator()
	{
	
		new PeriodicalExecuter(
		function(pe) {
		
		if(StopRotator==1)
		{
		pe.stop();
		}
		else
		{
		updateRotator(+1);
		}
		}, 3);		
	}
	
	
	Event.observe(window, 'load',StartRotator);	
-->
