var pollActive=true;$(document).ready(function(){$("#nowPlaying").html("Loading song information...");pollNowPlaying()});function pollNowPlaying(){pollActive&&getNowPlaying();setTimeout("pollNowPlaying()",15E3)}
function getNowPlaying(){var a="";$.getJSON("/now-playing.json.asp?format=json&callback=?",function(b){$.each(b.song,function(c,d){if(d){if(c==0){$("#playing .artist").html(d.artist);$("#playing .song").html(d.songTitle);$("#playing img").attr("src",d.albumArtUrl);$("#playing").css("opacity")==0&&$("#playing").animate({opacity:"1"},500,function(){})}if(d.songId.length>0){a+="<strong>"+d.artist+"</strong> - "+d.songTitle;if(d.albumTitle.length>0)a+=" ("+d.albumTitle+")";a+=" - "+showTime(d.startTime);
a+="<br>"}}});$("#nowPlaying").html(a)})}function showTime(a){try{var b=new Date(a);if(b.getHours()>=0){var c=b.getHours(),d=b.getMinutes();if(c>=12&&c<24){if(c>12)c-=12;var e="PM"}else{if(c==0)c=12;e="AM"}return c+":"+Right("0"+d,2)+" "+e}else return""}catch(f){}}function Left(a,b){return b<=0?"":b>String(a).length?a:String(a).substring(0,b)}function Right(a,b){if(b<=0)return"";else if(b>String(a).length)return a;else{var c=String(a).length;return String(a).substring(c,c-b)}};