// JavaScript Document
var anuncio1 = 0;
var anuncio2 = 1;
setInterval("espacio()",5000);

function espacio(){
	try{
	if(total_productos > 2){
		for(var i=0; i < total_productos; i++){
			var unaCadena = "accion_"+i;
			var estado = 0+"px";
			if(i == anuncio1 || i == anuncio2){
				estado = 300+"px";
			}
			document.getElementById(unaCadena).style.width=estado;
		}
		anuncio1+=2;
		if(anuncio1 >= total_productos){
			anuncio1 = 0;
		}
		anuncio2 = anuncio1+1;
		if(anuncio2 >= total_productos){
			anuncio2 = 0;
		}
	}
	}
	catch(e){
		anuncio1 = 0;
		anuncio2 = 1;
	}
}