// this array consists of the id attributes of the divs we wish to alternate between
var divs_to_fade = new Array('#banner1', '#banner2', '#banner3', '#banner4');
// 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 divs = 4;

// the number of milliseconds between swaps.  Default is five seconds.
var wait = 3000;

// the function that performs the fade
function swapFade() {
	$(divs_to_fade[i]).fadeOut(1000);
	i++;
	if (i == divs) i = 0;
	$(divs_to_fade[i]).fadeIn(1000);
}

// the onload event handler that starts the fading.
function startPage() {
	setInterval('swapFade()',wait);
}

var browserName=navigator.appName;
if (browserName=="Microsoft Internet Explorer") {
	if(window.attachEvent) {
		window.attachEvent('onload', startPage, true);
	}
	else {
		window.addEventListener('onload', startPage, true);
	}
}
else {
	if(window.attachEvent) {
		window.attachEvent('load', startPage, true);
	}
	else {
	window.addEventListener('load', startPage, true);
	}
}