
function newXMLHttpRequest(){var xmlreq=false;if(window.XMLHttpRequest){xmlreq=new XMLHttpRequest();}else{if(window.ActiveXObject){try{xmlreq=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e1){try{xmlreq=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e2){}}}}
return xmlreq;}
function getReadyStateHandler(req,responseXmlHandler){return function(){if(req.readyState==4){try{if(req.status&&req.status==200){responseXmlHandler(req.responseXML);}else{if(this.gen_log){gen_log("HTTP problem "+req.status?(": "+req.status):'');}}}catch(e){if(this.gen_log){gen_log("HTTP error [not available] "+e);}}}};}
function newXMLDocument(rootTagName){if(!rootTagName){rootTagName="";}
var xmlDocument;if(document.implementation&&document.implementation.createDocument){xmlDocument=document.implementation.createDocument("",rootTagName,null);}
else{xmlDocument=new ActiveXObject("MSXML2.DOMDocument");var rootElement=xmlDocument.createElement(rootTagName);xmlDocument.appendChild(rootElement);}
return xmlDocument;}
function serializeXMLDocumentToString(xmlDocument){var xml;if(typeof XMLSerializer!="undefined"){xml=new XMLSerializer().serializeToString(xmlDocument);}
else if(typeof xmlDocument.xml!="undefined"){xml=xmlDocument.xml;}
else{xml="";}
return xml;}