81 |
*/ |
*/ |
82 |
function debug(msg) |
function debug(msg) |
83 |
{ |
{ |
84 |
return; // Disable debugging |
// return; // Disable debugging |
85 |
|
|
86 |
if(!debug.box) |
var debug_div = element_id('debug'); |
|
{ |
|
|
debug.box = document.createElement("div"); |
|
|
debug.box.setAttribute("style", |
|
|
"background-color:white" + |
|
|
"font-family: monospace; " + |
|
|
"border: solid black 3px; "+ |
|
|
"padding: 10px;"); |
|
|
|
|
|
document.body.appendChild(debug.box); |
|
|
debug.box.innerHTML = "<h1 style='test-align:cent'>Debugging Output</h1>"; |
|
|
} |
|
87 |
|
|
88 |
var p = document.createElement("p"); |
if (debug_div) debug_div.innerHTML += msg+"<br/>\n"; |
|
p.appendChild(document.createTextNode(msg)); |
|
|
debug.box.appendChild(p); |
|
89 |
} |
} |
90 |
|
|
91 |
// |
// |
120 |
watchdog_callback(new Array()); |
watchdog_callback(new Array()); |
121 |
} |
} |
122 |
|
|
123 |
|
var xmldoc; |
124 |
|
|
125 |
// This function loads the XML document from the specified URL, and when |
// This function loads the XML document from the specified URL, and when |
126 |
// it is fully loaded, passes that document and the url to the specified |
// it is fully loaded, passes that document and the url to the specified |
127 |
// handler function. This function works with any XML document |
// handler function. This function works with any XML document |
141 |
if (document.implementation && document.implementation.createDocument) |
if (document.implementation && document.implementation.createDocument) |
142 |
{ |
{ |
143 |
// Create a new Document object |
// Create a new Document object |
144 |
var xmldoc = document.implementation.createDocument("", "", null); |
xmldoc = document.implementation.createDocument("", "", null); |
145 |
|
|
146 |
// Specify what should happen when it finishes loading |
// Specify what should happen when it finishes loading |
147 |
xmldoc.onload = function() { handler(xmldoc, url, data, result_handler); } |
xmldoc.onload = function() { handler(xmldoc, url, data, result_handler); } |
156 |
// Something about not following standards once again |
// Something about not following standards once again |
157 |
else if (window.ActiveXObject) |
else if (window.ActiveXObject) |
158 |
{ |
{ |
159 |
//var xmldoc = new ActiveXObject("MSXML2.DOMDocument"); // Create doc. |
xmldoc = new ActiveXObject("Microsoft.XMLDOM"); // Create doc. |
160 |
var xmldoc = new ActiveXObject("Microsoft.XMLDOM"); // Create doc. |
if (! xmldoc) xmldoc = new ActiveXObject("MSXML2.DOMDocument"); // Create doc. |
161 |
// Specify onload |
// Specify onload |
162 |
xmldoc.onreadystatechange = function() |
xmldoc.onreadystatechange = function() |
163 |
{ |
{ |