$(document).ready(function()
{
RefreshTitlesarionlaikos();
});
function addTimeStamp(){
tstmp = new Date();
return tstmp.getTime();
}
function RefreshTitlesarionlaikos()
{
$.ajax({
type: "GET",
url: "https://onair.e-radio.gr/whatson/arion/arionlaikos/NowOnAir.xml?timestamp="+addTimeStamp(),
dataType: "xml",
success: ShowTitleArtistarionlaikos
});
//alert("/whatson_remote/updateartistpic.asp?timestamp="+addTimeStamp()+"&q="+qArtist);
$.ajax({
type: "GET",
url: "https://onair.e-radio.gr/whatson/arion/arionlaikos/AirPlayNext.xml?timestamp="+addTimeStamp(),
dataType: "xml",
success: ShowNextSongsarionlaikos
});
$.ajax({
type: "GET",
url: "https://onair.e-radio.gr/whatson/arion/arionlaikos/AirPlayHistory.xml?timestamp="+addTimeStamp(),
dataType: "xml",
success: ShowLastSongsarionlaikos
});
}
function ShowTitleArtistarionlaikos(xml)
{
$(xml).find("Song").each(function()
{
qTitle = $(this).attr("title");
$("#arionlaikos_title").html($(this).attr("title"));
$(xml).find("Artist").each(function()
{
$("#arionlaikos_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: ShowNowPicarionlaikos
});
*/
});
});
}
function ShowNowPicarionlaikos(txt)
{
if (txt!=''){
$("#arionlaikos_pic").attr("src",txt);
$("#arionlaikos_pic").show();
}
else{
$("#arionlaikos_pic").attr("src",'');
$("#arionlaikos_pic").hide();
}
}
function ShowLastSongsarionlaikos(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")+ "
";
});
$("#arionlaikos_lastsongs").html(tmpLastSongs);
}
function ShowNextSongsarionlaikos(xml)
{
var j=0;
$(xml).find("Song").each(function()
{
if (j==0 ){
$("#arionlaikos_nexttitle").html( $(this).attr("title") );
$("#arionlaikos_nextartist").html( $(this).find("Artist").attr("name") );
}
j=j+1;
$("#nextheader").show();
});
}
var oRefresharionlaikos;
oRefresharionlaikos = window.setInterval("RefreshTitlesarionlaikos()", 50000);