function showOffline() { document.getElementById('player').innerHTML='
'; } function showOnline() { document.getElementById('player').innerHTML='
'; } var http = false; var currentStatus='3'; if(navigator.appName == "Microsoft Internet Explorer") { http = new ActiveXObject("Microsoft.XMLHTTP"); } else { http = new XMLHttpRequest(); } function checkStatus() { ko = new Date(); ji = ko.getTime(); http.open("GET", "status.php?"+ji); http.onreadystatechange=function() { if(http.readyState == 4) { if(http.responseText=='0') { if(currentStatus!='0') showOffline(); currentStatus='0'; setTimeout("checkStatus();",5000); } else { if(currentStatus!='1') showOnline(); currentStatus='1'; setTimeout("checkStatus();",10000); } } } http.send(null); } function pageSetup() { checkStatus(); document.getElementById('title').innerHTML='Dfizzy has 503 subscribers'; } window.onload = pageSetup;