$(document).ready(function() { RefreshTitlesDELUXE(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function RefreshTitlesDELUXE() { $.ajax({ type: "GET", url: "/whatson/akousdeluxe/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowTitleArtistDELUXE }); $.ajax({ type: "GET", url: "/whatson/akousdeluxe/AirPlayNext.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowNextSongsDELUXE }); } function ShowTitleArtistDELUXE(xml) { $(xml).find("Song").each(function() { $("#DELUXE_title").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#DELUXE_artist").html($(this).attr("name")); }); }); } function ShowNextSongsDELUXE(xml) { var j=0; $(xml).find("Song").each(function() { if (j==0 ){ $("#DELUXE_nexttitle").html( $(this).attr("title") ); $("#DELUXE_nextartist").html( $(this).find("Artist").attr("name") ); } j=j+1; }); } var oRefreshDELUXE; oRefreshDELUXE = window.setInterval("RefreshTitlesDELUXE()", 50000);