// JavaScript Document
/*
Slide show with fading effect.

Date: 06-03-2010
*/

<!--Begin
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 6000;
//Path to the folder where images are held (may already be set)
if (imagePath == null) {
    var imagePath = "images/home_page/";
}
// 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'
Pic[7] = imagePath + '8.jpg'
Pic[8] = imagePath + '9.jpg'
Pic[9] = imagePath + '10.jpg'
Pic[10] = imagePath + '11.jpg'
Pic[11] = imagePath + '12.jpg'
Pic[12] = imagePath + '13.jpg'
Pic[13] = imagePath + '14.jpg'
Pic[14] = imagePath + '15.jpg'
Pic[15] = imagePath + '16.jpg'
Pic[16] = imagePath + '17.jpg'
Pic[17] = imagePath + '18.jpg'
Pic[18] = imagePath + '19.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() {
    if (isIE() == 1) {
        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[getRandomNumber()].src; //source to the image holder
        document.images.SlideShow.filters.blendTrans.Play();
    } else {
        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);
}

// Gets a random number from 0-11 (now increased to 0-18 by increasing number below from 12 to 19 - Feb 2011 PW)
function getRandomNumber() {
    return Math.floor(Math.random()*19);
}

function isIE()
{
    if (navigator.appName == 'Microsoft Internet Explorer') return 1;
    else return 0;
}

//  End
//-->


