+
+ function sendquery(lo, hi) {
+ var url = "query.cgi";
+
+ if (lo && hi) url += "?lo=" + lo + "&" + hi;
+ else url = "query.cgi?lo=2015-12-19+00:00:00&hi=2015-12-20+00:00:00"; //FIX
+ xmlhttp.onreadystatechange = function() {
+ if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
+ // dbg.innerHTML = xmlhttp.responseText;
+ var myData = JSON.parse(xmlhttp.responseText);
+ gotdata(myData);
+ }
+ }
+ xmlhttp.open("GET", url, true);
+ xmlhttp.send();
+ }
+
+ function initialize() {
+ dbg = document.getElementById("debug");
+ xmlhttp = new XMLHttpRequest();
+ sendquery();
+ }
+
+ /* Set up */
+ if(window.attachEvent) {
+ window.attachEvent('onload', initialize);
+ } else {
+ window.onload = initialize;
+ }