/***************************/
//@Author: Eudosia Systems
//@website: http://www.eudosia-systems.it
//@email: info@eudosia-systems.it
//@license: freeware
/***************************/

$(document).ready(function(){
	//global vars
	//var onair = $(".content > ul");
	var box_onair = $("#box_onair");
	var loading = $("#loading");
	var refreshId = setInterval(function()
      {
          $('#box_onair').fadeOut("slow", updateOnAir()).fadeIn		("slow");
	}, 300000);
	//5 min
	//functions
      
	function updateOnAir(){
		//just for the fade effect
		box_onair.hide();
		loading.fadeIn(2000);
		//send the post to onair.php
		$.ajax({
			type: "POST", url: "onair.php", data: "action=update",
			complete: function(data){
				loading.fadeOut();
				box_onair.html(data.responseText);
				box_onair.fadeIn(2000);
			}
		});
	}

	
	//Load for the first time the shoutbox data
	updateOnAir();
	
});