﻿// JScript File
function fctOpenXMLDoc(URL, FormData)
  {
//  this.XMLDoc.onreadystatechange = this.ReturnFunction;
//  this.XMLDoc.async = true;
  this.XMLDoc.open("POST", URL, false);
  this.XMLDoc.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  this.XMLDoc.setRequestHeader("Content-Length", (URL + FormData).length);
  this.XMLDoc.send(FormData);
  }
function LaddawnService(ProcessingFunction)
  {
   if (window.XMLHttpRequest) 
     {this.XMLDoc = new XMLHttpRequest();}
   else if (window.ActiveXObject) 
     {this.XMLDoc = new ActiveXObject("Microsoft.XMLHTTP");}
     // check for XPath implementation
     if( document.implementation.hasFeature("XPath", "3.0") )
        {  
        // prototying the XMLDocument  
        XMLDocument.prototype.selectSingleNode = function(cXPathString, xNode)  
          {     
          if( !xNode ) { xNode = this; }      
          var xItems = this.selectNodes(cXPathString, xNode);     
          if( xItems.length > 0 ) {return xItems[0];}
          else {return null;}  
          }    
          // prototying the Element  
          Element.prototype.selectSingleNode = function(cXPathString)  
          {if(this.ownerDocument.selectSingleNode)     {return this.ownerDocument.selectSingleNode(cXPathString, this);     }     else{throw "For XML Elements Only";}  }}        
   this.Open = fctOpenXMLDoc;
   this.ReturnFunction = ProcessingFunction;
   this.id = "TheService"
  }
