$(document).ready(function(){
	
	pollNews();
	// Poll every 30 seconds	
	var _pollNews = setInterval("pollNews()",30000);
	
});

function pollNews() {
		
	$.get(APPNAME+"services.php?pollnews="+POLL,
		 function(data){
		 	data = data.replace(/^\s*|\s*$/g,'');
		 	
			if(data == "0") {
				
			} else {
				bnData = data.split("|");
				POLL = bnData[1];
				
				$("#bn-container").fadeOut(1000, function(){
					$("#bn-container").html(bnData[0]);
					$("#bn-container").fadeIn(1000, function(){
						alert("Breaking news just got in!");
					});
				});
				
				
			}
		 });
}
