function updateNowPlaying()
{
	$.getJSON("http://vivo.ondabeta.fm/nowjson.php?jsonp=?",function(d)
	{
		var nowPlaying = d[1];
		var nowSays = $("#nowplaying").html();
		
		if((nowPlaying != nowSays) && nowSays != "") 
		{
			$("#nowplaying").fadeOut("500",function(){$(this).html(nowPlaying).fadeIn("500")});
		} 
		else
		{
			$("#nowplaying").html(nowPlaying);
		}
	});
}

function regPlayButton()
{
	$("#playnow").click(function()
	{
		window.open("http://vivo.ondabeta.fm/player.php", "player", "height=100,width=530,status=yes,toolbar=0,menubar=0,location=0,resizable=0");
	});
	
}
function regNowPlayingTimer()
{
	updateNowPlaying();
	$(document).everyTime("15s",function(){ updateNowPlaying(); });
}


$(document).ready(function()
{ 
    regNowPlayingTimer();
    regPlayButton();
});
