$(document).ready(function()
{
RefreshTitlesarionkids();
});
function addTimeStamp(){
tstmp = new Date();
return tstmp.getTime();
}
function RefreshTitlesarionkids()
{
$.ajax({
type: "GET",
url: "https://onair.e-radio.gr/whatson/arion/arionkids/NowOnAir.xml?timestamp="+addTimeStamp(),
dataType: "xml",
success: ShowTitleArtistarionkids
});
//alert("/whatson_remote/updateartistpic.asp?timestamp="+addTimeStamp()+"&q="+qArtist);
$.ajax({
type: "GET",
url: "https://onair.e-radio.gr/whatson/arion/arionkids/AirPlayNext.xml?timestamp="+addTimeStamp(),
dataType: "xml",
success: ShowNextSongsarionkids
});
$.ajax({
type: "GET",
url: "https://onair.e-radio.gr/whatson/arion/arionkids/AirPlayHistory.xml?timestamp="+addTimeStamp(),
dataType: "xml",
success: ShowLastSongsarionkids
});
}
function ShowTitleArtistarionkids(xml)
{
$(xml).find("Song").each(function()
{
qTitle = $(this).attr("title");
$("#arionkids_title").html($(this).attr("title"));
$(xml).find("Artist").each(function()
{
$("#arionkids_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: ShowNowPicarionkids
});
*/
});
});
}
function ShowNowPicarionkids(txt)
{
if (txt!=''){
$("#arionkids_pic").attr("src",txt);
$("#arionkids_pic").show();
}
else{
$("#arionkids_pic").attr("src",'');
$("#arionkids_pic").hide();
}
}
function ShowLastSongsarionkids(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")+ "
";
});
$("#arionkids_lastsongs").html(tmpLastSongs);
}
function ShowNextSongsarionkids(xml)
{
var j=0;
$(xml).find("Song").each(function()
{
if (j==0 ){
$("#arionkids_nexttitle").html( $(this).attr("title") );
$("#arionkids_nextartist").html( $(this).find("Artist").attr("name") );
}
j=j+1;
$("#nextheader").show();
});
}
var oRefresharionkids;
oRefresharionkids = window.setInterval("RefreshTitlesarionkids()", 50000);