var slideCache = new Array();

function RunSlideShow(pictureName,linkName,imageFiles,linkFiles,displaySecs)
{
  var imageSeparator = imageFiles.indexOf(";");
  var linkSeparator = linkFiles.indexOf(";");
  var nextImage = imageFiles.substring(0,imageSeparator);
  var nextLink = linkFiles.substring(0,linkSeparator);

  if (document.all)
  {
    document.getElementById(pictureName).style.filter="blendTrans(duration=2)";
    document.getElementById(pictureName).filters.blendTrans.Apply();
  }
  document.getElementById(pictureName).src = nextImage;
  document.getElementById(linkName).href = nextLink;
  if (document.all)
  {
    document.getElementById(pictureName).filters.blendTrans.Play();
  }
  var futureImages= imageFiles.substring(imageSeparator+1,imageFiles.length)
    + ';' + nextImage;
  var futureLink= linkFiles.substring(linkSeparator+1,linkFiles.length)
    + ';' + nextLink;
  setTimeout("RunSlideShow('"+pictureName+"','"+linkName+"','"+futureImages+"','"+futureLink+"',"+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;
  }

  linkSeparator = futureLink.indexOf(";");
  nextLink = futureLink.substring(0,linkSeparator);
  if (slideCache[nextLink] == null) {
    slideCache[nextLink] = new Link;
    slideCache[nextLink].href = nextLink;
  }

}

