// JavaScript Document
/*
 * // $RCSfile: slideshow.js,v $
// $Source: /cvs/cyplonweb-live/slideshow.js,v $, $Revision: 1.1 $, $Date: 2010/07/12 10:30:12 $, $State: Exp $
 */
var slideShowSpeed = 5000; // Set slideShowSpeed (milliseconds)
var crossFadeDuration = 3; // Duration of crossfade (seconds)

var t;
var j = 0;
var p = 0, preLoad = null;

addLoadEvent(function() {
    p = Pic.length;
    preLoad = new Array();
    for (i = 0; i < p; i++){
       preLoad[i] = new Image();
       preLoad[i].src = Pic[i][0];
       preLoad[i].alt = Pic[i][1];
    }
});

function runSlideShow(){
   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;
   document.images.SlideShow.alt = preLoad[j].alt;
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play();
   }
   j = j + 1;
   if (j > (p-1)) j=0;
   t = setTimeout('runSlideShow()', slideShowSpeed);
}

