$(document).ready(function() { RefreshTitlesarionchristmas(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function RefreshTitlesarionchristmas() { $.ajax({ type: "GET", url: "/whatson/arionchristmas/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowTitleArtistarionchristmas }); //alert("/whatson_remote/updateartistpic.asp?timestamp="+addTimeStamp()+"&q="+qArtist); $.ajax({ type: "GET", url: "/whatson/arionchristmas/AirPlayNext.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowNextSongsarionchristmas }); $.ajax({ type: "GET", url: "/whatson/arionchristmas/AirPlayHistory.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowLastSongsarionchristmas }); } function ShowTitleArtistarionchristmas(xml) { $(xml).find("Song").each(function() { qTitle = $(this).attr("title"); $("#arionchristmas_title").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#arionchristmas_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: ShowNowPicarionchristmas }); }); }); } function ShowNowPicarionchristmas(txt) { if (txt!=''){ $("#arionchristmas_pic").attr("src",txt); $("#arionchristmas_pic").show(); } else{ $("#arionchristmas_pic").attr("src",''); $("#arionchristmas_pic").hide(); } } function ShowLastSongsarionchristmas(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")+ "
"; }); $("#arionchristmas_lastsongs").html(tmpLastSongs); } function ShowNextSongsarionchristmas(xml) { var j=0; $(xml).find("Song").each(function() { if (j==0 ){ $("#arionchristmas_nexttitle").html( $(this).attr("title") ); $("#arionchristmas_nextartist").html( $(this).find("Artist").attr("name") ); } j=j+1; $("#nextheader").show(); }); } var oRefresharionchristmas; oRefresharionchristmas = window.setInterval("RefreshTitlesarionchristmas()", 50000);