// JavaScript Document
/*
Slide show with fading effect.

Date: 06-03-2010
*/

<!--Begin
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;
//Path to the folder where images are held
var imagePath = "images/footer/";
// Duration of crossfade (seconds)
var crossFadeDuration = 3;
// Specify the image files
var Pic = new Array();
// to add more images, just continue
// the pattern, adding to the array below
Pic[0] = imagePath + '1.jpg'
Pic[1] = imagePath + '2.jpg'
Pic[2] = imagePath + '3.jpg'
Pic[3] = imagePath + '4.jpg'
Pic[4] = imagePath + '5.jpg'
Pic[5] = imagePath + '6.jpg'
Pic[6] = imagePath + '7.jpg'

// please do not edit anything below this line
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}

function runSlideShow() {
document.images.SlideShow.src = preLoad[getRandomNumber()].src; //source to the image holder
j = j + 1; //increment the pointer
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow()', slideShowSpeed);
}
//  End
//-->

//Gets a random number from 0-7
function getRandomNumber() {
return Math.floor(Math.random()*6);	
}
