// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 7000;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;
var Picture = new Array(); // don't change this
var Caption = new Array(); // don't change this
var Link = new Array(); // don't change this

var tss;
var iss;
var jss = 1;
var pss;

var preLoad = new Array();     

function runSlideShow(pg)
{
  setupPics(pg);
  
  pss = Picture.length-1;

  for (iss = 1; iss < pss+1; iss++)
  {
    preLoad[iss] = new Image();
    preLoad[iss].src = Picture[iss];
  }

  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[jss].src; //Set the src of the picture to the picture in the array
  
  document.getElementById('PictureLink').href=Link[jss];
  document.getElementById('PictureLink').target="_blank";

//  if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
  if (document.all) document.images.PictureBox.filters.blendTrans.Play();
  jss = jss + 1;
  if (jss > (pss)) jss=1;
  tss = setTimeout('runSlideShow()', SlideShowSpeed);
}

function setupPics(pg)
{
  if (pg == 'events')
  {
    Picture[1]  = 'img/christmas12.png';  Caption[1]  = "This is the 1 caption."; Link[1] = 'uploadFiles/christmas2009.pdf';
    Picture[2]  = 'img/christmas22.png';  Caption[2]  = "This is the 1 caption."; Link[2] = 'uploadFiles/christmas2009.pdf';
    Picture[3]  = 'img/christmas32.png';  Caption[3]  = "This is the 1 caption."; Link[3] = 'uploadFiles/christmas2009.pdf';
 }

}
