9 function createXMLHttpRequest() {
10 try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) {}
11 try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {}
12 try { return new XMLHttpRequest(); } catch(e) {}
19 if((httpObj=createXMLHttpRequest())!=null){
20 httpObj.onreadystatechange = displayResponse;
23 httpObj.open("GET",httpkeepUrl+"-"+nowKey+"-"+hex_md5(nextKey+sessionId) ,true);
27 nextKey=hex_md5(String(rand));
29 document.getElementById("watchdog").innerHTML = appletDescription;
35 document.getElementById("watchdog").innerHTML = appletDescription;
39 function displayResponse()
42 if(httpObj.readyState==4){
43 if(httpObj.status==200){
45 hh=today.getHours(); mm=today.getMinutes();
46 if(hh<10)hh='0'+hh; if(mm<10)mm='0'+mm;
47 document.getElementById("dispmsg").innerHTML = hh+':'+mm;
48 if(httpObj.responseText=="hello") sendHello();
50 document.getElementById("dispmsg").innerHTML = "Error!";
54 document.getElementById("watchdog").innerHTML = appletDescription;
58 function initHttpkeep(urlArg, appletArg, sid)
62 appletDescription=appletArg;
66 nextKey=hex_md5(String(rand));
68 // set timeout and send hello