// =======================================
// Set up the image files to be used.
// =======================================
var theImages = new Array(); // do not change this

// =======================================
// To add more image files, continue with the
// pattern below, adding to the array. Rememeber
// to increment the theImages[x] index!
// =======================================

theImages[0] = 'fileadmin/template/main/images/random/1.jpg'; //plain image syntax
theImages[1] = 'fileadmin/template/main/images/random/2.jpg';
theImages[2] = 'fileadmin/template/main/images/random/3.jpg';
theImages[3] = 'fileadmin/template/main/images/random/4.jpg';
theImages[4] = 'fileadmin/template/main/images/random/5.jpg';
theImages[5] = 'fileadmin/template/main/images/random/6.jpg';
theImages[6] = 'fileadmin/template/main/images/random/7.jpg';
theImages[7] = 'fileadmin/template/main/images/random/8.jpg';
theImages[8] = 'fileadmin/template/main/images/random/9.jpg';
theImages[9] = 'fileadmin/template/main/images/random/10.jpg';

// =======================================
// set the following variables
// =======================================
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 4000;
// Duration of crossfade (seconds)
var crossFadeDuration = 3;

// ======================================
// do not change anything below this line
// ======================================

var t;
var i;
var p = theImages.length;
var j = Math.floor(Math.random()*p);

var preBuffer = new Array();
for (i = 0; i < p; i++){
   preBuffer[i] = new Image();
   preBuffer[i].src = theImages[i];
}

function showImage(){
document.write('<img src="'+theImages[j]+'" class="random-img" name="SlideShow" alt="Slideshow">');
}
function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)";
      document.images.SlideShow.style.filter="blendTrans(duration=3)";
      document.images.SlideShow.filters.blendTrans.Apply();
   }
   document.images.SlideShow.src = preBuffer[j].src;
   oldj = j;
   if (document.all) {document.images.SlideShow.filters.blendTrans.Play();}
   while (j==oldj) {j = Math.floor(Math.random()*p);}
   t = setTimeout('runSlideShow()', 4000);
}
