// Define and Initialize Variables
var ImgDisplayInterval = 3000;
var ImgFaderInterval = 3;
var ImgArray = new Array();
var ImgCache = new Array();
var ssIndex = ssStartIndex;
var ssMax = (ssStartIndex + IMAGE_COUNT) - 1;
var ssTimeout, idx, ImgNum;

// document.write("<h2>Image Slideshow</h2><hr><br>");

if (playSlideShow) {
for (idx=ssStartIndex; idx < (ssStartIndex+IMAGE_COUNT); idx++){

   if (idx < 10){
      ImgNum = "00" + idx.toString();}
   else if (idx < 100) {
      ImgNum = "0" + idx.toString();}
   else {
      ImgNum = idx.toString();
   }

   ImgArray[idx] = BaseImgDir + "/" + BaseImgName + ImgNum + ImgExt;

//   document.write("ImgArray[" + idx.toString() + "]=" + ImgArray[idx]);
//   document.write("<br>");

   ImgCache[idx] = new Image();
   ImgCache[idx].src = ImgArray[idx];
}
}

function displayImgSlideShow(){
if (playSlideShow){
   if (document.all){
      document.images.ImageFrame.style.filter="blendTrans(duration=2)";
      document.images.ImageFrame.style.filter="blendTrans(duration=ImgFaderInterval)";
      document.images.ImageFrame.filters.blendTrans.Apply();}
      document.images.ImageFrame.src = ImgCache[ssIndex].src;
      if (document.all) document.images.ImageFrame.filters.blendTrans.Play();
      ssIndex = ssIndex + 1;
      if (ssIndex > ssMax){
         ssIndex = ssStartIndex;
         ssTimeout = setTimeout("displayImgSlideShow();", firstImgTimeout);
      }
      else
         ssTimeout = setTimeout("displayImgSlideShow();", firstImgTimeout);  
}
}
