<!--

window.onload = function()
{
  CCL.Init('Display,XML', start);
}

function start()
{
    setInterval(function() {showPhotos($('photo'));}, 3500);
    
    // set random first image
    //
    img = $('photo').getElementsByTagName('IMG');
    var i = Math.round((img.length-1) * Math.random());
    img[i].style.zIndex = 2;
    img[i].setAttribute('show', 1);
    for(var i=0; i<img.length; i++)
    {
      img[i].style.display = 'inline';
    }
    if ($('content').getElementsByTagName('form').length > 0)
      window.scrollTo(0,600);
}



function showPhotos(obj)
{
  img = obj.getElementsByTagName('IMG');
  var previous = -1;
  for(var i=0; i<img.length; i++)
  {
    var show = img[i].getAttribute('show');
    img[i].style.zIndex = 0;
    if(show == 1 && previous < 0)
      previous = i;
  }
  var next = 0;
  if(previous >= 0)
  {
    next = previous + 1;
    img[previous].setAttribute('show', 0);
    img[previous].style.zIndex = 1;
  }
  if(next == img.length)
    next = 0;
  img[next].setAttribute('show', 1);
  img[next].style.zIndex = 2;
  CCL.Display.Fade(img[next], 100, 0, 100, 10);
}


//-->

