<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=Unicode" /> <title>Carnage Contest Servers</title> <style type="text/css"> body { margin: 0; width: 130px; height: 40px; font-family: verdana; font-weight: bold; font-size: 10px; color:#600; } #gadgetContent { margin-left:35px; margin-top:13px; width: 95px; vertical-align: middle; text-align: left; overflow: hidden; } </style> <script type="text/jscript" language="jscript"> // Initialize the gadget. function init(){ document.getElementById("imgBackground").src = "url(bg.png)"; setInterval(update,30000); } // Update function update(){ var xmlhttp=new XMLHttpRequest(); xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ var response = xmlhttp.responseText; document.getElementById("gadgetContent").innerHTML='Servers: '+response if (parseInt(response)>0){ document.getElementById("imgBackground").src = "url(bg2.png)"; }else{ document.getElementById("imgBackground").src = "url(bg.png)"; } } }; var ts = new Date().getTime() xmlhttp.open("GET","http://www.unrealsoftware.de/usgn.php?getcount=cc&time="+ts,true); xmlhttp.send(); } </script> </head> <body onload="init()"> <g:background id="imgBackground"> <span id="gadgetContent">Servers: 0</span> </g:background> </body> </html>