function AdfXMLRequest(){this.Init()}AdfObject.createSubclass(AdfXMLRequest);AdfXMLRequest.UNINITIALIZED=0;AdfXMLRequest.LOADING=1;AdfXMLRequest.LOADED=2;AdfXMLRequest.INTERACTIVE=3;AdfXMLRequest.COMPLETED=4;AdfXMLRequest._CHECKPOINT=AdfCheckpoint.getCheckpoint("send","postback");AdfXMLRequest._CHECKPOINT.setDescription("A measurement of how long is spend processing an XMLHttpRequest");AdfXMLRequest._startCheckpoint=function(){void 0==AdfXMLRequest._checkpointId&&(AdfXMLRequest._checkpointId=AdfXMLRequest._CHECKPOINT.start())};
AdfXMLRequest._stopCheckpoint=function(){void 0!=AdfXMLRequest._checkpointId&&(AdfXMLRequest._CHECKPOINT.stop(AdfXMLRequest._checkpointId),AdfXMLRequest._checkpointId=void 0)};
AdfXMLRequest.prototype.Init=function(){AdfXMLRequest.superclass.Init.call(this);this.isSynchronous=!1;this.callback=null;this._state=AdfXMLRequest.UNINITIALIZED;this.headers={};this.xmlhttp=AdfAgent.AGENT.createXMLHttpRequest();if(!this.xmlhttp){var a=AdfPage.PAGE.getLookAndFeel().getTranslatedString("af_document.XMLHTTP_UNSUPPORTED");alert(a)}};AdfXMLRequest.prototype.toString=function(){return AdfXMLRequest.superclass.toString.call(this)+" completionState:"+this.getCompletionState()};
AdfXMLRequest.prototype.setSynchronous=function(a){this.isSynchronous=a};AdfXMLRequest.prototype.setCallback=function(a){this.callback=a};AdfXMLRequest.prototype.addEventListener=function(a,b){this.xmlhttp.upload&&this.xmlhttp.upload.addEventListener(a,b,!1)};AdfXMLRequest.prototype.getCompletionState=function(){return this._state};AdfXMLRequest.prototype.getStatus=function(){return this.xmlhttp.status};AdfXMLRequest.prototype.getResponseXML=function(){return this.xmlhttp.responseXML};
AdfXMLRequest.prototype.getResponseText=function(){return this.xmlhttp.responseText};
AdfXMLRequest.prototype.send=function(a,b,d){var e=this.xmlhttp;if(!this.isSynchronous&&this.callback){var f=function(){arguments.callee.obj.__onReadyStateChange()};f.obj=this;e.onreadystatechange=f}AdfXMLRequest._startCheckpoint();e.open(null!==b&&void 0!==b?"POST":"GET",a,!this.isSynchronous);for(var g in this.headers)e.setRequestHeader(g,this.headers[g]);d||e.setRequestHeader("Adf-Rich-Message","true");e.send(b);this.isSynchronous&&this.__onReadyStateChange()};
AdfXMLRequest.prototype.abort=function(){var a=this.xmlhttp;a&&a.abort()};AdfXMLRequest.prototype.getResponseHeader=function(a){return this.xmlhttp.getResponseHeader(a)};AdfXMLRequest.prototype.getAllResponseHeaders=function(){return this.xmlhttp.getAllResponseHeaders()};AdfXMLRequest.prototype.setRequestHeader=function(a,b){this.headers[a]=b};
AdfXMLRequest.prototype.__onReadyStateChange=function(){this._state=this.xmlhttp.readyState;this._state==AdfXMLRequest.COMPLETED&&(AdfXMLRequest._stopCheckpoint(),AdfPage.PAGE.isUserActivityMonitoringOn()&&this.xmlhttp.responseXML&&AdfUserActivityInfo.setResponseReceivedTime());this.callback&&this.callback(this)};AdfXMLRequest.prototype.cleanup=function(){this.callback=null;delete this.headers;delete this.xmlhttp};