function cambio(sen)
{
contador+= sen;
if (contador == lista.length)
     {contador = 0;}
else{
    if (contador < 0) {contador = 0;}
	try
	{document.images.centro.src = lista[contador];
	document.images.centro.title = titulos[contador];
	document.getElementById("imagen1").href = referencias[contador];
	document.getElementById("fecha1").innerHTML = fechas[contador];}
	catch(err)
	{}
	}
}
function reset()
{
contador = 0;
fin = false;
if (lista[0] != NULL)
{
document.images.centro.src = lista[0]
}
if (titulos[0] != NULL)
{
document.images.centro.title = titulos[0]
}
if (referencias[0] != NULL)
{
document.images.centro.href = referencias[0]
}
if (noticias[0] != NULL)
{
document.getElementById("texto1").innerHTML = noticias[0]
}
if (referencias[0] != NULL)
{
document.getElementById("texto1").href = referencias[0]
}
if (fechas[0] != NULL)
{
document.getElementById("fecha1").innerHTML = fechas[0]
}
}
function automat(seg)
{
tiempo = parseInt(seg);
/*reset();*/
if (isNaN(tiempo) || tiempo <= 0)
    alert("Error en el tiempo")
else
    tempor = setTimeout("pasar()", tiempo)
}
function parar()
{
clearTimeout(tempor);
}
function pasar()
{
cambio(1);
tempor = setTimeout("pasar()", tiempo)
}
function cambio_foto(num_foto)
{
parar();
contador = num_foto;
document.images.centro.src = lista[contador];
document.images.centro.title = titulos[contador];
document.getElementById("imagen1").href = referencias[contador];
document.getElementById("fecha1").innerHTML = fechas[contador];

}

