// Script copyright (C) 2004 www.cryer.co.uk.
// Script is free to use provided this copyright header is included.
var slideCache = new Array();
function RunSlideShowAndStop(pictureName,imageFiles,displaySecs)
{
  var imageSeparator = imageFiles.indexOf(";");
  var nextImage = imageFiles;
  if (imageSeparator > 0)
    nextImage = imageFiles.substring(0,imageSeparator);
  if (document.all)
  {
    document.getElementById(pictureName).style.filter=
      "blendTrans(duration=2)";
    document.getElementById(pictureName).filters.blendTrans.Apply();
  }
  document.getElementById(pictureName).src = nextImage;
  if (document.all)
  {
    document.getElementById(pictureName).filters.blendTrans.Play();
  }
  if (imageSeparator > 0)
  {
    var futureImages = imageFiles.substring(imageSeparator+1,imageFiles.length);
    setTimeout("RunSlideShowAndStop('"+pictureName+"','"+futureImages+"',"+displaySecs+")",
      displaySecs*1000);
    // Cache the next image to improve performance.
    imageSeparator = futureImages.indexOf(";");
    nextImage = futureImages.substring(0,imageSeparator);
    if (slideCache[nextImage] == null) {
      slideCache[nextImage] = new Image;
      slideCache[nextImage].src = nextImage;
    }
  }
}
