function slideShow ( ) {
	// Set the object to change
	this.id = arguments[0]

	// Set image name
	this.name = arguments[1]

	// Set slideShowSpeed (milliseconds)
	this.start = arguments[2]
	this.speed = arguments[3]

	// Duration of crossfade (seconds)
	this.duration = arguments[4]

	this.timeout
	this.position = arguments[5]

	this.preLoad = new Array()
	for ( i = 6; i < arguments.length; i++ ) {
                this.preLoad[i-6] = new Image ( )
                this.preLoad[i-6].src = arguments[i]
	}
}

function init ( ) {
	
	for ( i = 0; i < s.length; i++ ) {
                if (document.images[s[i].name]) s[i].timeout = runSlideShow( s[i].id, s[i].start)
	}
	
}

function runSlideShow ( ) {
	if ( document.all ) {
		document.images[s[arguments[0]].name].style.filter="blendTrans(duration=2)"
		document.images[s[arguments[0]].name].style.filter="blendTrans(duration=s[arguments[0]].duration)"
		document.images[s[arguments[0]].name].filters.blendTrans.Apply()      
	}
	document.images[s[arguments[0]].name].src = s[arguments[0]].preLoad[s[arguments[0]].position].src
	if ( document.all ) {
		document.images[s[arguments[0]].name].filters.blendTrans.Play ( )
	}

	if (arguments[1] == s[arguments[0]].start) { s[arguments[0]].timout = setTimeout( 'runSlideShow( ' + arguments[0] + ')', s[arguments[0]].start) }
	else { s[arguments[0]].timout = setTimeout( 'runSlideShow( ' + arguments[0] + ')', s[arguments[0]].speed) }

	if (s[arguments[0]].position < s[arguments[0]].preLoad.length-1) { s[arguments[0]].position++ }
	else { s[arguments[0]].position = 0; }
	
}
window.onload=init