// 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');

// 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 i = 0;
var scroller; 

// the number of milliseconds between swaps.  Default is ten seconds.
var wait = 7000;

// the function that performs the fade
function swapFade() {
	Effect.Fade(divs_to_fade[i]);
	i++;
	if (i == divs_to_fade.length) i = 0;
	//Effect.Appear(divs_to_fade[i]);
	fade_in(divs_to_fade[i]);
}
function fade_in(div_id) {
	setTimeout("Effect.Appear('"+div_id+"')",1500);	
}



function backward(){
	i = i-1;
	if(i<0) i=(divs_to_fade.length-1);
	clearInterval(scroller);
	alert('-('+i+')');
	swapFade();
	startPage();
}
function foreward() {
	clearInterval(scroller);
	swapFade();
	startPage();
}

// the onload event handler that starts the fading.
function startPage() {
	scroller = setInterval('swapFade()',wait);
}



