// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 4000
// Duration of crossfade (seconds)
var crossFadeDuration = 4


var t
var j = 0
var p = Pic.length
var pos = j

var preLoad = new Array()

function preLoadPic(index)
{
	if (Pic[index] != ''){
		window.status='Loading : '+Pic[index]
		preLoad[index] = new Image()
		preLoad[index].src = Pic[index]
		Pic[index] = ''
		window.status=''
	}
}

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()
	}
	
	pos = j

	j = j + 1
	if (j > (p-1)) j=0
	t = setTimeout('runSlideShow()', slideShowSpeed)
	preLoadPic(j)
}

function endSlideShow(){
	self.document.location = 'index.php?p=photos'
}

preLoadPic(j)