// JavaScript Document
var finalX;
var posX=0;

intervalo=0;
incremento=0;

function mueve (donde,cual) {
	clearInterval(intervalo);
	finalX=donde;
	intervalo=setInterval("__mueve()",5);
	active=cual;
}
function __mueve(){
	clearInterval(intervaloAuto);
	var capa=document.getElementById("imageStrip");
	posX+=(finalX-posX)/12;
	capa.style.left=posX+"px";
	if (Math.round(posX)==finalX){
		capa.style.left=finalX+"px"
		clearInterval(intervalo);
	} else {
		capa.style.left=posX+"px";
	}
	document.getElementById("noticia01").style.width="410px";
	document.getElementById("noticia01").style.backgroundImage="url(img/rotatorBg.gif)";
	document.getElementById("noticia01").style.margin="6px 0px 0px 22px";
	document.getElementById("noticia01").style.color="#333";
	document.getElementById("noticia01").style.padding="5px 10px 5px 10px";
	document.getElementById("noticia01").style.cursor="pointer";
	document.getElementById("noticia02").style.width="410px";
	document.getElementById("noticia02").style.backgroundImage="url(img/rotatorBg.gif)";
	document.getElementById("noticia02").style.margin="6px 0px 0px 22px";
	document.getElementById("noticia02").style.color="#333";
	document.getElementById("noticia02").style.padding="5px 10px 5px 10px";
	document.getElementById("noticia02").style.cursor="pointer";
	document.getElementById("noticia03").style.width="410px";
	document.getElementById("noticia03").style.backgroundImage="url(img/rotatorBg.gif)";
	document.getElementById("noticia03").style.margin="6px 0px 0px 22px";
	document.getElementById("noticia03").style.color="#333";
	document.getElementById("noticia03").style.padding="5px 10px 5px 10px";
	document.getElementById("noticia03").style.cursor="pointer";
	var boton=document.getElementById(active);
	boton.style.width="410px";
	boton.style.backgroundImage="url(img/rotatorArrow.png)";
	boton.style.margin="6px 0px 0px 0px";
	boton.style.color="#FFF";
	boton.style.cursor="default";
	boton.style.padding="5px 10px 5px 32px";
	intervaloAuto=setInterval("movAuto()",10000);
}
function para(){
	clearInterval(intervalo);
}


var intervaloAuto;
var posicion=1;
var active="noticia01";

intervaloAuto=setInterval("movAuto()",10000);

function movAuto () {
	if (posicion==1) {
		active="noticia01";	
		posicion++;
		mueve(0,'noticia01')
	} else if (posicion==2) {
		active="noticia02";	
		posicion++;
		mueve(-465,'noticia02')
	} else if (posicion==3) {
		active="noticia03";	
		posicion=1;
		mueve(-930,'noticia03')
	}
}

