var pe = null;
var container_width = 0;
var total_width = 0;

function moveText() {
	nowPos = parseInt($$("#testoscorrevole_int")[0].style.left);
	if (nowPos<-total_width)
		$$("#testoscorrevole_int")[0].style.left = container_width + "px";
	else
		$$("#testoscorrevole_int")[0].style.left = (nowPos-3)+"px";
}

function startTextShift() {
	container_width = parseInt($$("#testoscorrevole")[0].getWidth());
	var num_news = $$("#testoscorrevole_int div").length;
	$$("#testoscorrevole_int")[0].style.left = container_width + "px";
	for(i=0; i<num_news; i++)
		total_width += $$("#testoscorrevole_int div")[i].getWidth();

	pe = new PeriodicalExecuter(moveText, 0.1);

}

Event.observe(window, 'load', startTextShift);
