// JavaScript Document

var SSDur = 10000;
var CFDur = 7;
var img = new Array(); 
/*var Caption = new Array(); */

img[1]  = 'images/SH1.jpg';
img[2]  = 'images/SH2.jpg';
img[3]  = 'images/SH3.jpg';
img[4]  = 'images/SH4.jpg';
img[5]  = 'images/SH5.jpg';
img[6]  = 'images/SH6.jpg';
img[7]  = 'images/SH7.jpg';
img[8]  = 'images/SH8.jpg';

/*Caption[1]  = "This is the first caption.";
Caption[2]  = "This is the second caption.";
Caption[3]  = "This is the third caption.";
Caption[4]  = "This is the fourth caption.";*/


var x;
var i;
var j = 1;
var p = img.length-1;

var preLoad = new Array();
for (i = 1; i < p+1; i++){
preLoad[i] = new Image();
preLoad[i].src = img[i];}

function runSS(){
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CFDur)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[j].src;
/*if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];*/
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
//j = j+ 1;
j = (j + Math.floor(Math.random()*(img.length-1)))+ 1;
if (j > (p)) j=1;
x = setTimeout('runSS()', SSDur);
}
