var ARR_ACTIVEX=["MSXML4.DOMDocument","MSXML3.DOMDocument","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XmlDom"];var STR_ACTIVEX="";var isIE=navigator.userAgent.toLowerCase().indexOf("msie")>-1;var isMoz=document.implementation&&document.implementation.createDocument;if(isIE){var bFound=false;for(var i=0;i<ARR_ACTIVEX.length&&!bFound;i++){try{var objXML=new ActiveXObject(ARR_ACTIVEX[i]);STR_ACTIVEX=ARR_ACTIVEX[i];bFound=true}catch(objException){}}if(!bFound)throw "No DOM DOcument found on your computer."}if(isMoz){Document.prototype.loadXML=function(strXML){changeReadyState(this,1);var objDOMParser=new DOMParser();var objDoc=objDOMParser.parseFromString(strXML,"text/xml");while(this.hasChildNodes())this.removeChild(this.lastChild);for(var i=0;i<objDoc.childNodes.length;i++){var objImportedNode=this.importNode(objDoc.childNodes[i],true);this.appendChild(objImportedNode)}handleOnLoad(this)};Node.prototype.__defineGetter__("xml",_Node_getXML);Document.prototype.readyState="0";Document.prototype.__load__=Document.prototype.load;Document.prototype.load=_Document_load;Document.prototype.onreadystatechange=null;Document.prototype.parseError=0};function jsXML(){};jsXML.createDOMDocument=function(strNamespaceURI,strRootTagName){var objDOM=null;if(isMoz){objDOM=document.implementation.createDocument(strNamespaceURI,strRootTagName,null);objDOM.addEventListener("load",_Document_onload,false)}else if(isIE){objDOM=new ActiveXObject(STR_ACTIVEX);if(strRootTagName){if(strNamespaceURI){objDOM.loadXML("<a0:"+strRootTagName+" xmlns:a0=\""+strNamespaceURI+"\" />")}else{objDOM.loadXML("<"+strRootTagName+"/>")}}}return objDOM};function _Node_getXML(){var objXMLSerializer=new XMLSerializer;var strXML=objXMLSerializer.serializeToString(this);return strXML};function _Document_load(strURL){this.parseError=0;changeReadyState(this,1);try{this.__load__(strURL)}catch(objException){this.parseError=-9999999;changeReadyState(this,4)}};function _Document_onload(){handleOnLoad(this)};function handleOnLoad(objDOMDocument){if(!objDOMDocument.documentElement||objDOMDocument.documentElement.tagName=="parsererror")objDOMDocument.parseError=-9999999;changeReadyState(objDOMDocument,4)};function changeReadyState(objDOMDocument,iReadyState){objDOMDocument.readyState=iReadyState;if(objDOMDocument.onreadystatechange!=null&&typeof objDOMDocument.onreadystatechange=="function")objDOMDocument.onreadystatechange()};

function xml_read(node) {
	var x='';
	for(z=0;z<node.length;z++) {
		if(node[z].nodeValue!=null)
			x=x + node[z].nodeValue;
		else 
//			x=x + xml_read(node[z].childNodes);
			if(node[z].childNodes[0]!=null)
				x=x + '<'+node[z].nodeName+'>'+node[z].childNodes[0].nodeValue+'</'+node[z].nodeName+'>';
			else
				x=x + '<'+node[z].nodeName+'/>';
	}
	return x;
};

function xml_error(xmldoc) {
	alert("Error" +
	"errorCode: " + xmldoc.parseError.errorCode + "\n" +
	"filepos: " + xmldoc.parseError.filepos + "\n" +
	"line: " + xmldoc.parseError.line + "\n" +
	"linepos: " + xmldoc.parseError.linepos + "\n" +
	"reason: " + xmldoc.parseError.reason + "\n" +
	"srcText: " + xmldoc.parseError.srcText + "\n" +
	"url: " + xmldoc.parseError.url);
};
function xml_ready() {
	var state = xmldoc.readyState;
	if (state == 4) {
		if (xmldoc.parseError != 0) {
			xml_error(xmldoc);
			return false;
		} else {
				return true;

		};
	};
};