// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 8000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

slideshow_photos = new Array("graphics/header-image-1.jpg",
				   	         "graphics/header-image-2.jpg",
							 "graphics/header-image-3.jpg",
							 "graphics/header-image-4.jpg",
							 "graphics/header-image-5.jpg",
							 "graphics/header-image-6.jpg",
							 "graphics/header-image-7.jpg",
							 "graphics/header-image-8.jpg")
var nphotos = slideshow_photos.length
var header_array = new Array(nphotos)

for (var i = 0; i < nphotos; i++) {
	header_array[i] = new Image(640,120)
	header_array[i].src = slideshow_photos[i] 
}

var current_photo = Math.floor(Math.random() * nphotos)

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 = header_array[current_photo].src	
	if (document.all) document.images.SlideShow.filters.blendTrans.Play()
	if (++current_photo > (nphotos - 1)) current_photo = 0
   	setTimeout('runSlideShow()', slideShowSpeed)
}
