var sourceURL = ''; function streamInfoRefresh() { var myBody = document.getElementsByTagName('BODY')[0]; var newElement = document.createElement('script'); newElement.type = 'text/javascript'; newElement.src = sourceURL; myBody.appendChild(newElement) } function callback(streamInfo) { if (getObject('current_song') != null) { getObject("current_song").innerHTML=streamInfo.song; } if (getObject('current_dj') != null) { getObject("current_dj").innerHTML=streamInfo.dj; } if (getObject('station_name') != null) { getObject('station_name').innerHTML=streamInfo.name; } if (getObject('station_url') != null) { getObject('station_url').innerHTML=streamInfo.url; } if (getObject('station_genre') != null) { getObject('station_genre').innerHTML=streamInfo.genre; } if (getObject('station_pub') != null) { getObject('station_pub').innerHTML=streamInfo.pub; } if (getObject('history_1') != null) { getObject('history_1').innerHTML=streamInfo.history1; } if (getObject('history_2') != null) { getObject('history_2').innerHTML=streamInfo.history2; } if (getObject('history_3') != null) { getObject('history_3').innerHTML=streamInfo.history3; } if (getObject('history_4') != null) { getObject('history_4').innerHTML=streamInfo.history4; } if (getObject('history_5') != null) { getObject('history_5').innerHTML=streamInfo.history5; } if (getObject('history_6') != null) { getObject('history_6').innerHTML=streamInfo.history6; } if (getObject('history_7') != null) { getObject('history_7').innerHTML=streamInfo.history7; } if (getObject('history_8') != null) { getObject('history_8').innerHTML=streamInfo.history8; } if (getObject('history_9') != null) { getObject('history_9').innerHTML=streamInfo.history9; } if (getObject('history_10') != null) { getObject('history_10').innerHTML=streamInfo.history10; } if (getObject('next_up') != null) { getObject('next_up').innerHTML=streamInfo.nextup; } sourceURL = streamInfo.urlRefresh; setTimeout(streamInfoRefresh, 60000); } function getObject(_x) { return document.getElementById(_x); }