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

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 6000
// 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]['name'] != ''){
		window.status='Loading : '+Pic[index]['name']
		preLoad[index] = new Image()
		preLoad[index].src = Pic[index]['name']
		preLoad[index].width = Pic[index]['width']
		preLoad[index].height = Pic[index]['height']
		Pic[index]['name'] = ''
		window.status=''
	}
}

function runSlideShow(){
   var images = document.getElementById('slideshow');
   if (document.all){
    	images.style.filter= "blendTrans(duration=2)"
		images.style.filter= "blendTrans(duration=crossFadeDuration)"
      	images.filters.blendTrans.Apply()
	}
	images.src = preLoad[j].src
	images.width = preLoad[j].width
	images.height = preLoad[j].height
	if (document.all){
	   images.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 = '/photos/'
}

preLoadPic(j)
