var t
var j = 0
var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = arrImg[i]
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   //t = setTimeout('runSlideShow()', slideShowSpeed)
}
function galleryBack() {
	j=j-2;
	if (j<0) j=0;
	galleryPause();
	runSlideShow();
}
function galleryNext() {
	galleryPause();
	runSlideShow();
}
function galleryPause() {
	clearInterval(t);
	if (document.getElementById('galleryPause')) {
		document.getElementById('galleryPause').style.display='none';
		document.getElementById('galleryPlay').style.display='inline';
	}
}
function galleryPlay() {
	//runSlideShow()
	t = setInterval('runSlideShow()', slideShowSpeed)
	if (document.getElementById('galleryPause')) {
		document.getElementById('galleryPause').style.display='inline';
		document.getElementById('galleryPlay').style.display='none';
	}
}
function galleryHover(obj, dir, img) {
	if (!obj) return false;
	obj.src='/dcminc/img/icons/gallery/' + img + (dir=='in' ? '_a' : '') + ".gif";
}

