
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

var slideShowSpeed = 5000; // milliseconds
var delay = 10;

var t;
var j = 0;
var p = picsarray.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = picsarray[i];
}
function runSlideShow() {
if (document.all) {
document.images.defaultimage.style.filter="blendTrans(duration=2)";
document.images.defaultimage.style.filter="blendTrans(duration=delay)";
document.images.defaultimage.filters.blendTrans.Apply();
}
document.images.defaultimage.src = preLoad[j].src;
if (document.all) {
document.images.defaultimage.filters.blendTrans.Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow()', slideShowSpeed);
}

