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


var slideShowSpeed = 5000;
var t
var j = 0
var p = Pic.length

var preLoad = new Array();
var preLink = new Array();

var i=0;
for (i=0;i<p; i++){
	 preLoad[i] = new Image()
     preLoad[i].src = Pic[i];
     preLink[i] = Url[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('imagelink').href = preLink[j];
 	
//	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);
}
