

var slideShowSpeed = 4000;
var crossFadeDuration = 5;

var picArrLen = 0;
var idx = 0;
var preLoad = new Array();

function preLoadTheseImages( PicArr ) {
	picArrLen = PicArr.length;
	for (i = 0; i < picArrLen; i++) {
		preLoad[i] = new Image();
		preLoad[i].src = PicArr[i];
	}
}
function runSlideShowTimedOutForVideo() {
	var videoLengthInSecs = 15;
	setTimeout("runSlideShow()", videoLengthInSecs*1000);
}
function runSlideShow() {
	var t;
	var j = 0;
	if (document.all) {
		document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
		document.images.SlideShow.filters.blendTrans.Apply();
	}
	document.getElementById( "SlideShowVideoDiv" ).style.display = "none";
	document.images.SlideShow.style.display = "inline";
	//var rand = Math.round(Math.random() * (preLoad.length - 1));
	//alert(idx);
	if( idx >= preLoad.length ) idx = 0;
	document.images.SlideShow.src = preLoad[ idx++ ].src;
	if (document.all) {
		document.images.SlideShow.filters.blendTrans.Play();
	}
	j = j + 1;
	if (j > (picArrLen - 1)) j = 0;
	t = setTimeout("runSlideShow()", slideShowSpeed);
}
