
lim = 1; 	/* limite de loops*/
d = 300;		/*duracion defecto (segundos)*/
//dr = 60;	/*duracion onmouseover (segundos)*/
nbox = 50;	/*numero de caixas*/
ele = 'livestream';	/*nome do div a mover*/
cw = $('livestream_container').getWidth();	/*anchura do contenerdor de ele*/

e = cw; 		/*distancia total q percorre a animacion*/
for(x=0;x<nbox;x++)
	{
		var xy = 'box' + x;
		e = e + $(xy).getWidth() + 25;
	}
sld = $(ele);
sld.setStyle({width: e + 'px'});

function FullEnd() {
	new Effect.Move(sld, {
		  x: cw, y: 0, mode: 'absolute',
		  transition: Effect.Transitions.full
		});
}


function LiveStart(x, d) {
	
	ef = new Effect.Move(sld, {
			  x: x, y: 0,
			  mode: 'relative',
			  fps: 20,
			  transition: Effect.Transitions.linear,
			  duration: d
			});
	FullEnd.delay(d);	
}


//inicializa a animacion
function LiveInit() {
	LiveStart(-e, d);
	new PeriodicalExecuter(function(pe) {
			LiveStart(-e-cw, d);
		}, d);
	
}

LiveInit();



