<!--
// =======================================
// SET THE FOLLOWING VARIABLES
// =======================================

// Set slide interval duration (milliseconds):
var intervalDuration = 7000;

// Set duration of cross fade (seconds):
var crossFadeDuration = 2;

// Set slide interval duration randomization
// factor (randomizes the slide duration by
// +/- this % of the corresponding
// IntervalDuration):
var intervalDurationRandomizationFactor = 20;

// Set to false for sequential order. Set to
// true if you wish to randomize slide order
// (protected from picking the same image
// twice in a row):
var orderRandomization = true;

// Specify the image files
var picList = new Array(); // don't touch this line
// To add more images, just continue the
// pattern, adding to the array below:

picList[0] = '/images/slideshow/1.jpg';
picList[1] = '/images/slideshow/2.jpg';
picList[2] = '/images/slideshow/3.jpg';
picList[3] = '/images/slideshow/4.jpg';
picList[4] = '/images/slideshow/5.jpg';
picList[5] = '/images/slideshow/6.jpg';
picList[6] = '/images/slideshow/7.jpg';
picList[7] = '/images/slideshow/8.jpg';
picList[8] = '/images/slideshow/9.jpg';
picList[9] = '/images/slideshow/10.jpg';


// =======================================
// DO NOT EDIT ANYTHING BELOW THIS LINE
// =======================================

var next = 0;
var previous;
var intervalDurationRandomization;
var intervalDurationDuration;
var preLoad = new Array();

for (i = 0; i < picList.length; i++){
   preLoad[i] = new Image();
   preLoad[i].src = picList[i];
}

function advanceSlide() {
   if (document.all){
      document.images.slide.style.filter="blendTrans(duration=crossFadeDuration)";
      document.images.slide.filters.blendTrans.Apply()   ;   
   }
   
   document.images.slide.src = preLoad[next].src;
   previous = next;
   
   if(orderRandomization) {
      do {
         next = Math.floor(Math.random() * picList.length);
      } while (next == previous)
   } else {
      next = next++;
   }
   
   if (document.all)
      document.images.slide.filters.blendTrans.Play();
   
   if (next > (picList.length - 1))
      next = 0;
   
   intervalDurationRandomization = intervalDuration * (Math.floor(Math.random() * intervalDurationRandomizationFactor) / 100);

   if(Math.round(Math.random()) == 1)
      intervalDurationRandomization *= -1;
   
   intervalDurationDuration = intervalDuration + (crossFadeDuration * 1000) + intervalDurationRandomization;

   setTimeout('advanceSlide()', intervalDurationDuration);
}

addOnloadHook(advanceSlide());
// -->