// this array consists of the id attributes of the divs we wish to alternate between


	
var divs_to_fade = new Array('banner_1', 'banner_2', 'banner_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 fade_i = 0;

// the number of milliseconds between swaps.  Default is five seconds.
var wait = 5000;

// the function that performs the fade
function swapFade() {
	try {
	  new Effect.Fade($(divs_to_fade[fade_i]), { duration:1.5});
	  fade_i++;
	  if (fade_i == 3) fade_i = 0;
	  new Effect.Appear($(divs_to_fade[fade_i]), { duration:1.5});	
	} catch(e) {
		console.log('error!');
	}
	setTimeout('swapFade()',wait);
}

// the onload event handler that starts the fading.
	
function startFade() {
     setTimeout('swapFade()',wait);
}

/*Use Object Detection to detect IE6*/
var  m = document.uniqueID /*IE*/
&& document.compatMode  /*>=IE6*/
&& !window.XMLHttpRequest /*<=IE6*/
&& document.execCommand;

if(!m)
	Event.observe(window, 'load', startFade);
