// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// Fade effect only in IE;
//
// Modified for p4b by Garet Jax
//

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000

// pause after last slide duration (milliseconds). 0 (zero) to disable.
var pauseDuration = 3000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// images folder
var folder = 'images/home/';

// images names
var prefix = 'home_slide_';
var suffix = '.jpg';

// number of images
var nrPictures = 5;

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

var t
var j = 1

var preLoad = new Array()
for (i = 1; i <= nrPictures; i++){
   preLoad[i] = new Image()
   preLoad[i].src = folder+prefix+i+suffix;
}

var isIE = (navigator.appName == "Microsoft Internet Explorer")

function runSlideShow(){
	document.images.h_slide.src = preLoad[1].src
	stepSlideShow()
}

function stepSlideShow(){
   if (isIE){
      document.images.h_slide.style.filter="blendTrans(duration=2)"
      document.images.h_slide.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.h_slide.filters.blendTrans.Apply()
   }
   document.images.h_slide.src = preLoad[j].src
   if (isIE){
      document.images.h_slide.filters.blendTrans.Play()
   }
   j = j + 1
	 timeout = slideShowSpeed
   if (j > nrPictures) {
		 j=1
		 timeout += pauseDuration
	 }
   t = setTimeout('stepSlideShow()', timeout)
}