// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;

// Duration of crossfade (seconds)
var crossFadeDuration = 4;

// Preload Images

var timeout;
var current_img = 1;
var total_img = Img_Total; // Img_Total is generated by ASP document - Grabs total from Filesystem Object
                           // Img_Folder is generated by ASP document - Determined by QueryString
var preLoad=new Array();
for (count = 1; count < total_img; count++){
   preLoad[count] = new Image();
   preLoad[count].src = "/images/municipal_design/headers/"+Img_Folder+"/"+count+".jpg";
   
};

// Run the Slideshow - To run put 'onload="runSlideShow()"' in the body tag
// The <img> name must equal SlideShow - I.E. <img name="SlideShow">

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[current_img].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   current_img = current_img + 1
   if (current_img > (total_img-1)) current_img=1
   timeout = setTimeout('runSlideShow()', slideShowSpeed)
}

