
var lista = new Array('construccion.jpg','construccion2.jpg');

var contador = 0;
var tiempo = 0;
var tempor = null;
var modoAutomatico = true;

function cambio(sen){
contador+= sen;
if (contador ==lista.length) 
     contador = 0;
else 
    if (contador < 0) contador = lista.length-1;
document.getElementById("centro").src = lista[contador];
}


function automat(seg){
tiempo = parseInt(seg);
if (isNaN(tiempo) || tiempo <= 0)
    alert("Error en el tiempo")
else 
    tempor = setTimeout("pasar()", tiempo*1000)
}


function pasar()
{
cambio(1);
tempor = setTimeout("pasar()", tiempo*1000)
}
