$(document).ready(function() { RefreshTitleseurovisionfm(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function RefreshTitleseurovisionfm() { $.ajax({ type: "GET", url: "/whatson_remote/updateNowOnAir.asp?sid=4×tamp="+addTimeStamp(), dataType: "xml", success: ShowTitleArtisteurovisionfm }); //alert("/whatson_remote/updateartistpic.asp?timestamp="+addTimeStamp()+"&q="+qArtist); $.ajax({ type: "GET", url: "/whatson_remote/updateAirPlayNext.asp?sid=4×tamp="+addTimeStamp(), dataType: "xml", success: ShowNextSongseurovisionfm }); $.ajax({ type: "GET", url: "/whatson_remote/updateAirPlayHistory.asp?sid=4×tamp="+addTimeStamp(), dataType: "xml", success: ShowLastSongseurovisionfm }); } function ShowTitleArtisteurovisionfm(xml) { $(xml).find("Song").each(function() { qTitle = $(this).attr("title"); $("#eurovisionfm_title").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#eurovisionfm_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: ShowNowPiceurovisionfm }); }); }); } function ShowNowPiceurovisionfm(txt) { if (txt!=''){ $("#eurovisionfm_pic").attr("src",txt); $("#eurovisionfm_pic").show(); } else{ $("#eurovisionfm_pic").attr("src",''); $("#eurovisionfm_pic").hide(); } } function ShowLastSongseurovisionfm(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")+ "
"; }); $("#eurovisionfm_lastsongs").html(tmpLastSongs); } function ShowNextSongseurovisionfm(xml) { var j=0; $(xml).find("Song").each(function() { if (j==0 ){ $("#eurovisionfm_nexttitle").html( $(this).attr("title") ); $("#eurovisionfm_nextartist").html( $(this).find("Artist").attr("name") ); } j=j+1; $("#nextheader").show(); }); } var oRefresheurovisionfm; oRefresheurovisionfm = window.setInterval("RefreshTitleseurovisionfm()", 50000);