// Get base url var base_url = "http://studio.rhemawidebay.com/"; var ajax_get_error = false; function ajax_do (url) { if (url.substring(0, 4) != 'http') { url = base_url + url; } var jsel = document.createElement('SCRIPT'); jsel.type = 'text/javascript'; jsel.src = url; document.body.appendChild (jsel); return true; } function ajax_get (url, el) { if (typeof(el) == 'string') { el = document.getElementById(el); } if (el == null) { return false; } if (url.substring(0, 4) != 'http') { url = base_url + url; } getfile_url = base_url + 'getfile.php?url=' + escape(url) + '&el=' + escape(el.id) + '&' + rand ( 1000 ); ajax_do (getfile_url); return true; } function secsToMins(theValue) { var theMin = Math.floor(theValue / 60); var theSec = (theValue % 60); if (theSec < 10) theSec = "0" + theSec; return(theMin + ":" + theSec); } function countDown() { countDownTime--; if (countDownTime < -4) { document.getElementById("countDownText").innerHTML = null; setTimeout("listeninit();listenerinit();",10000); // Give it 10 secs to try again return; } if (countDownTime == 0) { document.getElementById("countDownText").innerHTML = secsToMins(countDownTime); setTimeout("listeninit();listenerinit();",2000); // Give it 2 secs to try again return; } if (countDownTime == 1) { document.getElementById("countDownText").innerHTML = secsToMins(countDownTime); setTimeout("listeninit();listenerinit();",1000); // Give it 1 sec to try again return; } if (document.getElementById) { document.getElementById("countDownText").innerHTML = secsToMins(countDownTime); counter = setTimeout("countDown()", 1000); } else { // Browser unsupported } } function listeninit() { var ajax = ajax_do('listen_to_current.php'); } function playinginit() { var ajax = ajax_do('listen_playingnow.php'); } function listenerinit() { var ajax = ajax_do('http://s.desertcrystal.net:8050/listeners.xsl'); }