//-----------------------------------------------
//  Slideshow player
//-----------------------------------------------

var iss2;
var jss2 = 0;
var pss2 = Picture2.length;

var preLoad2 = new Array();
for (iss2 = 0; iss2 < pss2; iss2++) {
  preLoad2[iss2] = new Image();
  preLoad2[iss2].src = Picture2[iss2];
}

var timerID2 = 0;
var tStart2 = null;
var playSpeed2 = 7;
var fadeDuration2 = 2;

function startTimer2() {
  tStart2 = new Date();
  timerID2 = setTimeout("updateTimer2()", 1000);
}

function clearTimer2() {
  if (timerID2) {
    clearTimeout(timerID2);
    timerID2 = 0;
  }
}

function updateTimer2() {
  clearTimer2();
  var tDate2 = new Date();
  var tDiff2 = tDate2.getTime() - tStart2.getTime();
  tDate2.setTime(tDiff2);
  if (tDate2.getSeconds() >= playSpeed2) {
    tStart2 = new Date();
    playNext2();
  }
  timerID2 = setTimeout("updateTimer2()", 1000);
}

function playNext2() {
  jss2 = jss2 + 1;
//jss2 = Math.round(Math.random() * pss2);
  if (jss2 >= pss2) jss2=0;
  if (document.all) {
    document.images.slideshow2.style.filter="blendTrans(duration="+fadeDuration2+")";
    document.images.slideshow2.filters[0].Apply();
  }
  document.images.slideshow2.src = preLoad2[jss2].src;
  if (document.all) document.images.slideshow2.filters[0].Play();
}