// array of the divs to alternate between
var divs_to_fade = new Array('photo-1', 'photo-2', 'photo-4', 'photo-3');
// the starting index in the above array.  It should be set to the value of the div which doesn't have the CSS Display property set to "none"
var frameID = 0;
// the number of milliseconds between swaps.  Default is five seconds.
var wait = 3500;
// the function that performs the fade
function swapFade() {
	i = frameID;
	Effect.Fade(divs_to_fade[i], { duration:1, from:1.0, to:0.0 });
	i++;
	if (i == 4) {i = 0;}
	Effect.Appear(divs_to_fade[i], { duration:1, from:0.0, to:1.0 });
	frameID=i;
}
// the onload event handler that starts the fading.
function initCrossfade(){			
	for (i=0; i<divs_to_fade.length;i++) {
		if(i!=frameID){
			document.getElementById(divs_to_fade[i]).style.display='none';
		}
		document.getElementById(divs_to_fade[i]).style.height='359px';
	}
	autoFade();
}
function autoFade(frameID) {intVal = setInterval('swapFade()',wait);}
function stopAutoFade(){clearInterval(intVal);}
