// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 3900
var slideShowSpeed2 = 4200
var slideShowSpeed3 = 4500

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array() // don't touch this
var Pic2 = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = 'images/pic_midDropPool.jpg'
Pic[1] = 'images/pic_midClouds.jpg'
Pic[2] = 'images/pic_midDropFlowers.jpg'
Pic[3] = 'images/pic_midDropPool.jpg'
Pic[4] = 'images/pic_midDropsGlass.jpg'
Pic[5] = 'images/pic_midMud.jpg'

Pic2[0] = 'images/pic_endDrinkingWater.jpg'
Pic2[1] = 'images/pic_endDropTile.jpg'
Pic2[2] = 'images/pic_endSprinkler.jpg'
Pic2[3] = 'images/pic_endDrop.jpg'
Pic2[4] = 'images/pic_endGrass.jpg'


// =======================================
// do not edit anything below this line
// =======================================

var t,u,v
var j = 0
var k = 0
var m = 0
var p = Pic.length
var q = Pic2.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

var preLoad2 = new Array()
for (i = 0; i < q; i++){
   preLoad2[i] = new Image()
   preLoad2[i].src = Pic2[i]
}


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[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}

function runSlideShow2(){
   if (document.all){
      document.images.SlideShow2.style.filter="blendTrans(duration=2)"
      document.images.SlideShow2.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow2.filters.blendTrans.Apply()      
   }
   document.images.SlideShow2.src = preLoad2[k].src
   if (document.all){
      document.images.SlideShow2.filters.blendTrans.Play()
   }
   k = k + 1
   if (k > (q-1)) k=0
   u = setTimeout('runSlideShow2()', slideShowSpeed2)
}
