// JavaScript Document

// this array consists of the id attributes of the divs we wish to alternate between
var divs_to_fade = new Array('box-1', 'box-2', 'box-3', 'box-4');

// the starting index in the above array.
var i = 0;

// the number of milliseconds between swaps.
var wait = 5000;

// the function that performs the fade
function swapFade() {
	Effect.Fade(divs_to_fade[i], { duration:2, from:1.0, to:0.0 });
	i++;
	if (i == 4) i = 0;
	Effect.Appear(divs_to_fade[i], { duration:2, from:0.0, to:1.0 });
}

// the onload event handler that starts the fading.
function startPage() {
	setInterval('swapFade()',wait);
}

window.onload = startPage();
