var px = 0;
var en_uso = 0;
var suma = 97;//12;
var aux = 970;
//var cantidad_carrucel = 2;


function derech(){

if(en_uso==0){
	en_uso = 1;
	n_div++;
	if(cantidad_carrucel<n_div)
			n_div = 1;

	px=970;
	document.getElementById('divSiguiente').innerHTML = document.getElementById('carrucel_'+n_div).innerHTML ;
	window.setTimeout ("move_derech();", 60);
	
	}

}


function izq(){
if(en_uso==0){
	en_uso = 1;
	n_div--;
	if(n_div<1)
		n_div = cantidad_carrucel;
		
	px=970;
	document.getElementById('divAnterior').innerHTML = document.getElementById('carrucel_'+n_div).innerHTML ;
	window.setTimeout ("move_izq();", 60);
	}
}


function move_izq(){
//alert(px)
	if(px > 0){
		px = px - suma;
		window.setTimeout ("move_izq();", 25);
		obj = document.getElementById("carruce");
		obj.style.left = "-"+px +'px';
		}
	else{
		document.getElementById('divActual').innerHTML=document.getElementById('divAnterior').innerHTML;
		document.getElementById('divAnterior').innerHTML="&nbsp;";
		obj.style.left = '-970px';
		px=970;
		en_uso = 0;
	}

}




function move_derech(){
//alert(px)
	if(px < 1900){
		px = px + suma;
		window.setTimeout ("move_derech();", 25);
		obj = document.getElementById("carruce");
		obj.style.left = "-"+px +'px';
		}
	else{
		document.getElementById('divActual').innerHTML=document.getElementById('divSiguiente').innerHTML;
		document.getElementById('divSiguiente').innerHTML="&nbsp;";
		obj.style.left = '-970px';
		px=970;
		en_uso = 0;
	}

}

