$(document).ready(function() { RefreshTitlesathenspartyplus(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function RefreshTitlesathenspartyplus() { $.ajax({ type: "GET", url: "/whatson/athenspartyplus/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowTitleArtistathenspartyplus }); //alert("/whatson_remote/updateartistpic.asp?timestamp="+addTimeStamp()+"&q="+qArtist); $.ajax({ type: "GET", url: "/whatson/athenspartyplus/AirPlayNext.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowNextSongsathenspartyplus }); $.ajax({ type: "GET", url: "/whatson/athenspartyplus/AirPlayHistory.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowLastSongsathenspartyplus }); } function ShowTitleArtistathenspartyplus(xml) { $(xml).find("Song").each(function() { qTitle = $(this).attr("title"); $("#athenspartyplus_title").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#athenspartyplus_artist").html($(this).attr("name")); qArtist = $(this).attr("name"); $.ajax({ type: "GET", url: "/whatson_remote/updatetrackpic.asp?timestamp="+addTimeStamp()+"&t="+qTitle+"&a="+qArtist, dataType: "text", success: ShowNowPicathenspartyplus }); }); }); } function ShowNowPicathenspartyplus(txt) { if (txt!=''){ $("#athenspartyplus_pic").attr("src",txt); $("#athenspartyplus_pic").show(); } else{ $("#athenspartyplus_pic").attr("src",''); $("#athenspartyplus_pic").hide(); } } function ShowLastSongsathenspartyplus(xml) { var tmpLastSongs=""; $(xml).find("Song").each(function() { tmpLastSongs = tmpLastSongs + $(this).find("Info").attr("StartTime")+ " > "; tmpLastSongs = tmpLastSongs +"" + $(this).attr("title") + " >"; tmpLastSongs = tmpLastSongs + $(this).find("Artist").attr("name")+ "
"; }); $("#athenspartyplus_lastsongs").html(tmpLastSongs); } function ShowNextSongsathenspartyplus(xml) { var j=0; $(xml).find("Song").each(function() { if (j==0 ){ $("#athenspartyplus_nexttitle").html( $(this).attr("title") ); $("#athenspartyplus_nextartist").html( $(this).find("Artist").attr("name") ); } j=j+1; $("#nextheader").show(); }); } var oRefreshathenspartyplus; oRefreshathenspartyplus = window.setInterval("RefreshTitlesathenspartyplus()", 50000);