// JavaScript Document
var Index1 = 0;
var Pics = new Array();

function LoadImages()
{
  Pics[0] = new Image();
  Pics[0].src = "fotos/1.jpg";
  Pics[1] = new Image();
  Pics[1].src = "fotos/2.jpg";
  Pics[2] = new Image();
  Pics[2].src = "fotos/3.jpg";
}

function SetTimer()
{
  LoadImages();
  var Timer = setInterval("Animate()", 5000);
}

function Animate()
{
  Index1 ++;
  if (Index1 > 2) {
    Index1 = 0;
  }
  document.getElementById("foto").style.backgroundImage = "url("+Pics[Index1].src+")"
}
