// =====================================
// Initialization Variables

// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 4500;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;

// Set the number of pictures you have in the images directory
var n = 5;

// =====================================


// =====================================
// Do not edit anything below this line!
// =====================================
var Picture = new Array(); // don't change this

var r = (Math.round(n * Math.random()) + 1) // Random Start

  for (i = 1; i < (n + 1); i++) {
  	Picture[i]  = './hpimages/pic' + i + '.jpg';
  }
 
var tss;
var preLoad = new Array();

for (i = 1; i < (n + 1); i++){
preLoad[i] = new Image();
preLoad[i].src = Picture[i];}

function runSlideShow(){
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[r].src;
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
r = r + 1;
if (r > n) r=1;
tss = setTimeout('runSlideShow()', SlideShowSpeed);
}

//-->
