var _slideShowOut = null;
var _slideShowImages = null;
var _slideShowCounter = 0;
var _slideShowDelay = 20000;

function InitSlideShow(slideShowOutId, slideShowImages)
{
  _slideShowOut = document.getElementById(slideShowOutId);
  _slideShowImages = new Array(slideShowImages.length);

  for (var i = 0; i < slideShowImages.length; i++)
  {
    _slideShowImages[i] = new Image();
    _slideShowImages[i].src = slideShowImages[i];
  }
}

function RunSlideShow()
{
  if (document.all)
  {
    _slideShowOut.style.filter = "blendTrans(duration=2)";
    _slideShowOut.filters.blendTrans.Apply();
  }

  _slideShowOut.style.backgroundImage = "url(" + _slideShowImages[_slideShowCounter].src + ")";

  if (document.all)
  {
    _slideShowOut.filters.blendTrans.Play();
  }

  if (++_slideShowCounter >= _slideShowImages.length)
  {
    _slideShowCounter = 0;
  }

  setTimeout("RunSlideShow()", _slideShowDelay);
}

function RunImageSlideShow()
{
  if (document.all)
  {
    _slideShowOut.style.filter = "blendTrans(duration=2)";
    _slideShowOut.filters.blendTrans.Apply();
  }

  _slideShowOut.src = _slideShowImages[_slideShowCounter].src;

  if (document.all)
  {
    _slideShowOut.filters.blendTrans.Play();
  }

  if (++_slideShowCounter >= _slideShowImages.length)
  {
    _slideShowCounter = 0;
  }

  setTimeout("RunImageSlideShow()", _slideShowDelay);
}
