var counter = 0;	
var t; //this variable will have the value of the setTimout function
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){
		// Believe that this is IE specific.
		document.images.SlideShow.style.filter="blendTrans(duration=2)";
		document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
		document.images.SlideShow.filters.blendTrans.Apply();
	}
	
	// Set the source of the image.
	document.images.SlideShow.src = preLoad[j].src;
	
	if(document.all){
		document.images.SlideShow.filters.blendTrans.Play();
	}
	
	// Increment
	j = j + 1;
   
	if(j > (p-1)){
		j = 0;
	}
	
	// Pause and proceed
	t = setTimeout('runSlideShow()', slideShowSpeed);
	
	if(j==0){
		clearTimeout(t);
	}		   
}