// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header // NS4-6,IE4-6 // Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 3000
var newsSlideShowSpeed = 7000

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

// =======================================
// do not edit anything below this line
// =======================================
// i did, to make it so slideshows could be either random or sequential
// added start_random_show and turned start_show into start_sequential_show

var t
var j = 0
var p = pictures.length

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

function start_random_show(){
   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()
   }
   // Use a random picture.
   j = Math.floor(Math.random()*p)
   t = setTimeout('start_random_show()', slideShowSpeed) }

function start_sequential_show(){
   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()
   }
   // Iterate through pictures in sequence, then repeat.
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('start_sequential_show()', newsSlideShowSpeed) }

// Now obsolete, but left in just in case someone still refers to it.
function start_show(){
   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()
   }
   // Iterate through pictures in sequence, then repeat.
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('start_show()', slideShowSpeed) }

