$(document).ready(function() { RefreshTitlesGAZI(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function RefreshTitlesGAZI() { $.ajax({ type: "GET", url: "/whatson/akousgazi/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowTitleArtistGAZI }); $.ajax({ type: "GET", url: "/whatson/akousgazi/AirPlayNext.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowNextSongsGAZI }); } function ShowTitleArtistGAZI(xml) { $(xml).find("Song").each(function() { $("#GAZI_title").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#GAZI_artist").html($(this).attr("name")); }); }); } function ShowNextSongsGAZI(xml) { var j=0; $(xml).find("Song").each(function() { if (j==0 ){ $("#GAZI_nexttitle").html( $(this).attr("title") ); $("#GAZI_nextartist").html( $(this).find("Artist").attr("name") ); } j=j+1; }); } var oRefreshGAZI; oRefreshGAZI = window.setInterval("RefreshTitlesGAZI()", 50000);