var SlideShowSpeed = 3000; // How long for each picture in ms
var CrossFadeDuration = 1;
var t, i, j = 0, p = Picture.length-1; 
//var ie = ((navigator.userAgent.indexOf("5.5") > 0 || navigator.userAgent.indexOf("6.") > 0) && document.all);

// to test in ie 5.5 remove line 4 and use line 7 instead (we don't have correct dll files for transitions
var ie = (navigator.userAgent.indexOf("6.") > 0 && document.all);

var preLoad = new Array();
for (i = 0; i < p+1; i++){
preLoad[i] = new Image();
preLoad[i].src = "Images/" + Picture[i];}

function runSlideShow(){
	if (ie){
		document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
		document.images.PictureBox.filters.blendTrans.Apply();
	}
	document.images.PictureBox.src = preLoad[j].src;
	var alt = Caption2[j];
	document.images.PictureBox.alt = alt;
	if (ie) document.images.PictureBox.filters.blendTrans.Play();
	document.getElementById("caption_top").innerHTML = Caption1[j];
	document.getElementById("caption_bot").innerHTML = Caption2[j];
	j++;
	if (j > p) j=0;
	t = setTimeout('runSlideShow()', SlideShowSpeed);
}