
// refresh our banner every 30 seconds via ajax
setTimeout('refresh()', 30000);

function refresh(){
	// get our new banner data
	$.get("index.php?module=banner&action=getBanner", function(data){
		 // compare the data that we got with what is already in the banner div
		 // if it's different then we want to fade out the div, change the content,
		 // and fade it back in
		 var bannerDiv = document.getElementById('bannerDiv');
		 //alert(data+'\n'+bannerDiv.innerHTML);
		 if (data != bannerDiv.innerHTML){
			$('#bannerDiv').fadeOut('slow', function (){
				this.innerHTML = data;
				$(this).fadeIn('slow');
			});
		 }
	});

	setTimeout('refresh()', 30000);
}
