var crossFadeDuration = 3;	// Duration of crossfade (seconds)
// Specify the image files
var Text = new Array();


var slideShowSpeed = 3000;
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 (document.all){
		document.getElementById('mainImage').style.filter="blendTrans(duration=2)";
		document.getElementById('mainImage').style.filter="blendTrans(duration=crossFadeDuration)";
 		document.getElementById('mainImage').filters.blendTrans.Apply();
	}	
 	document.getElementById('mainImage').src = preLoad[j].src;
//	document.getElementById('mainImage').style.backgroundImage = 'url(' + preLoad[j].src + ')';
	if (document.all){
		document.getElementById('mainImage').filters.blendTrans.Play()
	}
	j = j + 1
	if (j > (p-1)) j=0
	t = setTimeout('runSlideShow()', slideShowSpeed)
}
	
function stopSlideShow(img_src,text) {
	clearTimeout(t)
	document.getElementById('mainImage').src = img_src;
}
function buttonstopSlideShow(){
	clearTimeout(t);
}
