function AdfXmlHttpDataTransferService(domWindow) {
  this.Init(domWindow)
}
AdfObject.createSubclass(AdfXmlHttpDataTransferService, AdfDataTransferService);
AdfXmlHttpDataTransferService.InitClass = function() {
  this._MULTIPART_FRAME = "_afrDTSFrame";
  this._ADF_STREAMING_IFRAME_ID = "_adfStreamingIframe";
  this._XMLHTTP_TYPE = 0;
  this._MULTIPART_TYPE = 1;
  this._STREAMING_TYPE = 2;
  this._POLLING_TYPE = 3
};
AdfXmlHttpDataTransferService.prototype.Init = function(domWindow) {
  AdfXmlHttpDataTransferService.superclass.Init.call(this);
  this._state = AdfDataTransferService.STATE_READY;
  this._requestQueue = new Array;
  this._stateChangeListeners = null;
  this._window = domWindow;
  this._streamingCount = 0;
  this._reqCount = 0;
  this._suspendCount = 0;
  this._pageUnloading = false
};
AdfXmlHttpDataTransferService.prototype.dispose = function() {
  this.pageUnloading();
  this._requestQueue = null;
  this._stateChangeListeners = null;
  this._window = null
};
AdfXmlHttpDataTransferService.prototype.pageUnloading = function() {
  this._pageUnloading = true
};
AdfXmlHttpDataTransferService.__broadcastRequestStatusChanged = function(listeners, event) {
  AdfLogger.LOGGER.fine("Broadcasting:", event);
  var listenerCount = listeners ? listeners.length : 0;
  for(var i = 0;i < listenerCount;i++) {
    var currListener = listeners[i];
    if(currListener.requestStatusChanged) {
      try {
        currListener.requestStatusChanged(event)
      }catch(e) {
        AdfLogger.LOGGER.logError(e, AdfLogger.WARNING, "Error delivering Datatransfer request status changed to:", currListener)
      }
    }
  }
};
AdfXmlHttpDataTransferService.prototype._addRequestToQueue = function(type, context, actionURL, headerParams, content, listeners, eventListeners, minBusyState) {
  var newRequest = new AdfXmlHttpDataTransferRequest(type, context, actionURL, headerParams, content, listeners, eventListeners);
  this._requestQueue.push(newRequest);
  newRequest.setStatus(AdfDataTransferRequestEvent.STATUS_QUEUED);
  try {
    var dtsRequestEvent = new AdfDataTransferRequestEvent(AdfDataTransferRequestEvent.STATUS_QUEUED, context, null);
    AdfXmlHttpDataTransferService.__broadcastRequestStatusChanged(listeners, dtsRequestEvent)
  }catch(e) {
    AdfLogger.LOGGER.severe("Error on listener callback invocation - STATUS_QUEUED\n")
  }
  if(this._state <= minBusyState && this._requestQueue.length == 1) {
    this._doNextRequest()
  }
  return newRequest
};
AdfXmlHttpDataTransferService.prototype.sendRequest = function(context, actionURL, headerParams, content, listeners) {
  return this._addRequestToQueue(AdfXmlHttpDataTransferService._XMLHTTP_TYPE, context, actionURL, headerParams, content, listeners, null, AdfDataTransferService.STATE_READY)
};
AdfXmlHttpDataTransferService.prototype.sendPollingRequest = function(actionURL, listeners) {
  return this._addRequestToQueue(AdfXmlHttpDataTransferService._POLLING_TYPE, null, actionURL, null, null, listeners, null, AdfDataTransferService.STATE_READY)
};
AdfXmlHttpDataTransferService.prototype.sendMultiPartRequest = function(context, actionURL, headerParams, htmlForm, params, listeners, eventListeners) {
  var newRequest = null;
  if(context == null) {
    context = {"_htmlForm":htmlForm}
  }else {
    context._htmlForm = htmlForm
  }
  if(htmlForm["nodeType"] != null && htmlForm.nodeName == "FORM") {
    if(params || headerParams) {
      var domDocument = null;
      if(htmlForm.ownerDocument) {
        domDocument = htmlForm.ownerDocument
      }else {
        domDocument = this._getDomDocument()
      }
      for(var key in params) {
        this._appendParamNode(domDocument, htmlForm, key, params[key])
      }
      for(var key in headerParams) {
        this._appendParamNode(domDocument, htmlForm, key, headerParams[key])
      }
    }
    newRequest = this._addRequestToQueue(AdfXmlHttpDataTransferService._MULTIPART_TYPE, context, actionURL, headerParams, null, listeners, eventListeners, AdfDataTransferService.STATE_READY)
  }else {
    if(params) {
      for(var key in params) {
        htmlForm.append(key, params[key])
      }
    }
    context._formData = true;
    newRequest = this._addRequestToQueue(AdfXmlHttpDataTransferService._MULTIPART_TYPE, context, actionURL, headerParams, htmlForm, listeners, eventListeners, AdfDataTransferService.STATE_READY)
  }
  return newRequest
};
AdfXmlHttpDataTransferService.prototype.sendStreamingRequest = function(actionURL, params) {
  if(actionURL.indexOf("?") == -1) {
    actionURL += "?"
  }else {
    actionURL += "\x26"
  }
  actionURL += "Adf-Rich-Message\x3dtrue\x26unique\x3d";
  actionURL += (new Date).getTime();
  for(var name in params) {
    actionURL += "\x26" + name + "\x3d" + params[name]
  }
  var agent = AdfAgent.AGENT;
  if(agent.getPlatform() == AdfAgent.IE_PLATFORM && agent.getVersion() < 9) {
    actionURL += "\x26oracle.adf.view.rich.forceHTML\x3dtrue"
  }
  return this._addRequestToQueue(AdfXmlHttpDataTransferService._STREAMING_TYPE, null, actionURL, null, null, null, null, AdfDataTransferService.TRANSFER_COMPLETE)
};
AdfXmlHttpDataTransferService.prototype.streamingResponsesOutstanding = function() {
  return this._streamingCount > 0
};
AdfXmlHttpDataTransferService.prototype.processStreamingResponse = function(script) {
  AdfAssert.assert(this._streamingFrame, "Unexpected streaming response");
  if(this._isSuspended() || this._reqCount > 1) {
    if(!this._streamingMsgQueue) {
      this._streamingMsgQueue = new Array
    }
    this._streamingMsgQueue.push(script)
  }else {
    this._processQueuedStreamingMessages();
    AdfAgent.AGENT.execScript(this._streamingFrame.contentWindow, script)
  }
};
AdfXmlHttpDataTransferService.prototype._processQueuedStreamingMessages = function() {
  if(this._streamingMsgQueue) {
    var agent = AdfAgent.AGENT;
    while(this._streamingMsgQueue && this._streamingMsgQueue.length > 0) {
      agent.execScript(this._streamingFrame.contentWindow, this._streamingMsgQueue.shift())
    }
    this._streamingMsgQueue = null
  }
};
AdfXmlHttpDataTransferService.prototype.notifyStreamingRequestComplete = function() {
  var iframeDoc = this._streamingFrame.contentWindow.document;
  iframeDoc.removeChild(iframeDoc.documentElement);
  this._streamingFrame = null;
  this._streamingCount--;
  AdfAssert.assert(this._streamingCount >= 0, "Streaming request underflow");
  this._requestDone()
};
AdfXmlHttpDataTransferService.prototype._doTransfer = function() {
  var requestItem = this._requestQueue.shift();
  if(requestItem.getStatus() == AdfDataTransferRequestEvent.STATUS_ABORTED) {
    AdfLogger.LOGGER.fine("Transfer request aborted beforing sending to server:", requestItem);
    return
  }
  requestItem.setStatus(AdfDataTransferRequestEvent.STATUS_SEND_BEFORE);
  AdfLogger.LOGGER.fine("Transfer start:", requestItem);
  this._reqCount++;
  AdfAssert.assert(this._reqCount <= 2, "Request count overflow");
  switch(requestItem.getType()) {
    case AdfXmlHttpDataTransferService._XMLHTTP_TYPE:
      this._doXmlHttpTransfer(requestItem);
      break;
    case AdfXmlHttpDataTransferService._POLLING_TYPE:
      this._doXmlHttpTransfer(requestItem, AdfDhtmlActiveData._requestCallback);
      break;
    case AdfXmlHttpDataTransferService._MULTIPART_TYPE:
      if(requestItem.getContent() != null) {
        this._doXmlHttpTransfer(requestItem, AdfDhtmlMultipartUpload._requestCallback)
      }else {
        this._doTransferThroughIframe(requestItem)
      }
      break;
    case AdfXmlHttpDataTransferService._STREAMING_TYPE:
      var agent = AdfAgent.AGENT;
      var domWindow = agent.getDomWindow();
      this._streamingCount++;
      if(agent.getPlatform() == AdfAgent.GECKO_PLATFORM && domWindow != domWindow.top) {
        page.scheduleTimer(this, this._doStreamingTransfer, requestItem, 0)
      }else {
        this._doStreamingTransfer(requestItem)
      }
      break;
    default:
      AdfAssert.assert(false, "Unknown transfer type");
      this._reqCount--
  }
};
AdfXmlHttpDataTransferService.prototype.suspend = function() {
  this._suspendCount++
};
AdfXmlHttpDataTransferService.prototype.resume = function() {
  this._suspendCount--;
  AdfAssert.assert(this._suspendCount >= 0, "Suspend count underflow");
  if(!this._isSuspended()) {
    this._doNextRequest()
  }
};
AdfXmlHttpDataTransferService.prototype._isSuspended = function() {
  return this._suspendCount > 0
};
AdfXmlHttpDataTransferService.prototype._doXmlHttpTransfer = function(requestItem, callback) {
  var xmlHttp = new AdfXMLRequest;
  var context = xmlHttp.__dtsRequestContext = requestItem.getContext();
  xmlHttp.__dtsRequestListeners = requestItem.getListeners();
  requestItem.setAdfXMLRequest(xmlHttp);
  var isSynchronous = context && context.__isSynchronous ? true : false;
  xmlHttp.setSynchronous(isSynchronous);
  if(callback !== undefined) {
    xmlHttp.setCallback(callback)
  }else {
    xmlHttp.setCallback(AdfXmlHttpDataTransferService._requestCallback)
  }
  var isFormData = false;
  if(context != null && context._formData) {
    isFormData = true
  }
  if(!isFormData) {
    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset\x3dUTF-8")
  }
  var headerParams = requestItem.getHeaderParams();
  if(headerParams != null) {
    for(var headerName in headerParams) {
      var currHeader = headerParams[headerName];
      if(AdfCollections.isArray(currHeader)) {
        currHeader = currHeader.join(",")
      }
      xmlHttp.setRequestHeader(headerName, currHeader)
    }
  }
  var ourWindow = this._window;
  var actionUrl = requestItem.getActionURL();
  if(!actionUrl) {
    actionUrl = "" + ourWindow.document.location.href
  }
  var windowId = ourWindow.name;
  var pageId = AdfPage.PAGE.getPageStateId();
  actionUrl = AdfXmlHttpDataTransferService.__encodeWindowIdOnUrl(actionUrl, windowId);
  if(context && context.richPostback) {
    actionUrl = AdfXmlHttpDataTransferService.__encodePageIdOnUrl(actionUrl, pageId)
  }
  var eventListeners = requestItem.getEventListeners();
  if(eventListeners != null) {
    for(var i = 0;i < eventListeners.length;i = i + 2) {
      xmlHttp.addEventListener(eventListeners[i], eventListeners[i + 1])
    }
  }
  AdfPage.PAGE.__perfTimings(false, false, true, "Request sent to server: ", actionUrl);
  var logger = AdfLogger.LOGGER;
  logger.fine("Request sent to server:", requestItem);
  logger.getLogWriter().flush();
  xmlHttp.send(actionUrl, requestItem.getContent())
};
AdfXmlHttpDataTransferService.prototype._doTransferThroughIframe = function(requestItem) {
  var context = requestItem.getContext();
  var htmlForm = context._htmlForm;
  var windowId = this._window.name;
  var pageId = AdfPage.PAGE.getPageStateId();
  var actionURL = AdfXmlHttpDataTransferService.__encodeWindowIdOnUrl(requestItem.getActionURL(), windowId);
  actionURL = AdfXmlHttpDataTransferService.__encodePageIdOnUrl(actionURL, pageId);
  AdfAssert.assert(htmlForm.action, "form action cannot be null for multiform post");
  var frameName = AdfXmlHttpDataTransferService._MULTIPART_FRAME;
  var agent = AdfAgent.AGENT;
  var domDocument = this._getDomDocument();
  var hiddenFrame = domDocument.getElementById(frameName), iframeDoc;
  var agentIsIE = agent.getPlatform() == AdfAgent.IE_PLATFORM;
  if(this._iframeLoadCallback == null) {
    this._iframeLoadCallback = this.createCallback(this._handleIFrameLoad)
  }
  if(!hiddenFrame) {
    hiddenFrame = domDocument.createElement("iframe");
    hiddenFrame.name = frameName;
    hiddenFrame.id = frameName;
    hiddenFrame.dataset.postReqCounter = 0;
    var frameStyle = hiddenFrame.style;
    frameStyle.top = frameStyle.left = "0px";
    frameStyle.width = frameStyle.height = "1px";
    frameStyle.position = "absolute";
    frameStyle.visibility = "hidden";
    domDocument.body.appendChild(hiddenFrame);
    if(!agentIsIE) {
      hiddenFrame.onload = this._iframeLoadCallback
    }
  }
  if(agentIsIE) {
    hiddenFrame = domDocument.frames[frameName];
    hiddenFrame.name = frameName;
    iframeDoc = hiddenFrame.document
  }else {
    iframeDoc = hiddenFrame.contentDocument
  }
  if(iframeDoc.firstChild) {
    iframeDoc.removeChild(iframeDoc.firstChild)
  }
  this._dtsContext = context;
  this._dtsRequestlisteners = requestItem.getListeners();
  this._htmlForm = htmlForm;
  this._savedActionUrl = htmlForm.action;
  this._savedTarget = htmlForm.target;
  htmlForm.method = "POST";
  htmlForm.action = actionURL;
  htmlForm.target = frameName;
  this._appendParamNode(domDocument, htmlForm, "Adf-Rich-Message", "true");
  this._appendParamNode(domDocument, htmlForm, "partial", "true");
  this._appendParamNode(domDocument, htmlForm, AdfXmlHttpDataTransferService._WINDOW_PARAM, this._window.name);
  AdfAgent.AGENT.autoCompleteForm(htmlForm);
  try {
    var frameNode = !hiddenFrame.parentNode ? hiddenFrame.frameElement : hiddenFrame;
    frameNode.dataset.postReqCounter++;
    htmlForm.submit();
    if(agentIsIE) {
      this._iframeLoadTimerId = AdfPage.PAGE.scheduleTimer(this, this._handleIFrameLoad, null, 50)
    }
  }catch(e) {
    AdfInputFileUtils.addUploadErrorMessage();
    this._requestDone()
  }
};
AdfXmlHttpDataTransferService.prototype._appendParamNode = function(domDocument, form, name, value) {
  AdfAssert.assert(form != null);
  var nodes = this._paramNodes;
  if(!nodes) {
    nodes = new Array;
    this._paramNodes = nodes
  }
  var node = domDocument.createElement("input");
  node.type = "hidden";
  node.name = name;
  node.value = value;
  nodes.push(node);
  form.insertBefore(node, form.firstChild)
};
AdfXmlHttpDataTransferService.prototype._clearParamNodes = function() {
  var nodes = this._paramNodes;
  if(nodes) {
    var form = nodes[0].parentNode;
    var count = nodes.length;
    for(var i = 0;i < count;i++) {
      if(form) {
        form.removeChild(nodes[i])
      }
    }
    delete this._paramNodes
  }
};
AdfXmlHttpDataTransferService.prototype._doStreamingTransfer = function(requestItem) {
  this._streamingMsgQueue = null;
  var doc = this._getDomDocument();
  var div = doc.getElementById(AdfXmlHttpDataTransferService._ADF_STREAMING_IFRAME_ID);
  if(!div) {
    div = doc.createElement("DIV");
    div.id = AdfXmlHttpDataTransferService._ADF_STREAMING_IFRAME_ID;
    div.style.display = "none";
    doc.body.appendChild(div)
  }
  var windowId = this._window.name;
  var actionUrl = AdfXmlHttpDataTransferService.__encodeWindowIdOnUrl(requestItem.getActionURL(), windowId);
  div.innerHTML = '\x3cIFRAME src\x3d"' + actionUrl + '" onload\x3d"AdfPage.PAGE.getDataTransferService().processStreamingResponse(' + "'parent.AdfPage.PAGE.streamingResponseComplete();');\"\x3e\x3c/IFRAME\x3e";
  this._streamingFrame = div.firstChild;
  AdfAssert.assertDomElement(this._streamingFrame);
  AdfAssert.assert(this._streamingFrame.tagName == "IFRAME");
  requestItem.setStreamingIFrame(this._streamingFrame)
};
AdfXmlHttpDataTransferService.prototype._handleIFrameLoad = function() {
  var domDocument = this._getDomDocument();
  var agentIsIE = AdfAgent.AGENT.getPlatform() == AdfAgent.IE_PLATFORM;
  var frameName = AdfXmlHttpDataTransferService._MULTIPART_FRAME;
  var hiddenFrame, iframeDoc;
  if(agentIsIE) {
    hiddenFrame = domDocument.frames[frameName];
    iframeDoc = hiddenFrame.document
  }else {
    hiddenFrame = domDocument.getElementById(frameName);
    iframeDoc = hiddenFrame.contentDocument
  }
  try {
    if(!iframeDoc.documentElement || !iframeDoc.documentElement.firstChild || agentIsIE && iframeDoc.readyState != "complete") {
      this._iframeLoadTimerId = AdfPage.PAGE.scheduleTimer(this, this._handleIFrameLoad, null, 50)
    }else {
      var page = AdfPage.PAGE;
      var iframeLoadTimerId = this._iframeLoadTimerId;
      if(iframeLoadTimerId) {
        delete this._iframeLoadTimerId;
        page.cancelTimer(iframeLoadTimerId)
      }
      page.scheduleTimer(this, AdfXmlHttpDataTransferService._removeFrame, hiddenFrame, 1);
      this._onIFrameLoadComplete(iframeDoc, this._dtsContext, this._dtsRequestlisteners)
    }
  }catch(e) {
    if(!this._pageUnloading) {
      AdfXmlHttpDataTransferService._alertError("unknown");
      AdfLogger.LOGGER.logErrorAsSevere(e, "Error (" + e.message + ") while performing Data Transfer request")
    }
    this._htmlForm.action = this._savedActionUrl;
    this._htmlForm.target = this._savedTarget
  }
};
AdfXmlHttpDataTransferService.prototype._onIFrameLoadComplete = function(iframeDoc, context, requestListeners) {
  try {
    var dtsRequestEvent = new AdfIFrameDataTransferRequestEvent(iframeDoc, context);
    AdfXmlHttpDataTransferService.__broadcastRequestStatusChanged(requestListeners, dtsRequestEvent)
  }finally {
    while(iframeDoc.firstChild) {
      if(iframeDoc.firstChild) {
        iframeDoc.removeChild(iframeDoc.firstChild)
      }
    }
    this._htmlForm.action = this._savedActionUrl;
    this._htmlForm.target = this._savedTarget;
    this._clearParamNodes();
    this._requestDone()
  }
};
AdfXmlHttpDataTransferService.prototype._handleRequestCallback = function(xmlHttp) {
  var httpState = xmlHttp.getCompletionState();
  if(httpState != AdfXMLRequest.COMPLETED) {
    return
  }
  var statusCode = 0;
  try {
    statusCode = xmlHttp.getStatus()
  }catch(e) {
  }
  try {
    if(statusCode != 200 && statusCode != 302 && statusCode != 0) {
      if(!this._pageUnloading) {
        AdfXmlHttpDataTransferService._alertError(statusCode);
        AdfLogger.LOGGER.severe("Error StatusCode(", statusCode, ") while performing Data Transfer request\n")
      }
    }else {
      if(!this._pageUnloading) {
        this._broadcastStateChangeEvent(AdfDataTransferService.TRANSFER_COMPLETE);
        var dtsRequestEvent = new AdfDataTransferRequestEvent(AdfDataTransferRequestEvent.STATUS_COMPLETE, xmlHttp.__dtsRequestContext, xmlHttp);
        AdfXmlHttpDataTransferService.__broadcastRequestStatusChanged(xmlHttp.__dtsRequestListeners, dtsRequestEvent)
      }
    }
  }finally {
    try {
      if(!this._pageUnloading) {
        this._setResponseIdentifierFromResponseHeader(xmlHttp)
      }
    }catch(e) {
      var warningMsg = "Not able to retrieve response id from header.";
      warningMsg += "Error (";
      warningMsg += e.message;
      warningMsg += "). The response id in page object will not be up-to-date.";
      AdfLogger.LOGGER.warning(warningMsg)
    }
    xmlHttp.cleanup();
    delete xmlHttp;
    xmlHttp = null;
    if(!this._pageUnloading) {
      this._requestDone()
    }
  }
};
AdfXmlHttpDataTransferService.prototype._setResponseIdentifierFromResponseHeader = function(request) {
  if(AdfPage.PAGE.getResponseIdentifier() == null) {
    return
  }
  if(request.getResponseHeader) {
    var responseId = request.getResponseHeader("Adf-Context-Id");
    if(!responseId) {
      responseId = request.getResponseHeader("X-ORACLE-DMS-ECID")
    }
    if(responseId) {
      AdfPage.PAGE.__setResponseIdentifier(responseId)
    }
  }
};
AdfXmlHttpDataTransferService.prototype._requestDone = function() {
  if(!this._requestQueue) {
    return
  }
  this._reqCount--;
  AdfAssert.assert(this._reqCount >= 0, "Request count underflow");
  if(this._reqCount == 1 && this._streamingCount == 1) {
    this._processQueuedStreamingMessages()
  }
  if(this._requestQueue.length == 0) {
    if(this._state != AdfDataTransferService.TRANSFER_COMPLETE) {
      this._broadcastStateChangeEvent(AdfDataTransferService.TRANSFER_COMPLETE)
    }
    this._broadcastStateChangeEvent(AdfDataTransferService.STATE_READY)
  }
  AdfPage.PAGE.scheduleTimer(this, this._doNextRequest, null, 1)
};
AdfXmlHttpDataTransferService.prototype._doNextRequest = function() {
  if(this._isSuspended()) {
    return
  }
  if(this._reqCount > 0) {
    return
  }
  if(this._requestQueue.length > 0) {
    if(this._state != AdfDataTransferService.STATE_BUSY) {
      this._broadcastStateChangeEvent(AdfDataTransferService.STATE_BUSY)
    }
    this._doTransfer()
  }
};
AdfXmlHttpDataTransferService._requestCallback = function(xmlRequest) {
  AdfLogger.LOGGER.finer("Request complete:", xmlRequest);
  var dts = AdfPage.PAGE.getDataTransferService(true);
  if(dts) {
    dts._handleRequestCallback(xmlRequest)
  }
};
AdfXmlHttpDataTransferService.prototype.addStateChangeListener = function(listener, instance) {
  AdfAssert.assertFunction(listener);
  AdfAssert.assertObjectOrNull(instance);
  var stateChangeListeners = this._stateChangeListeners;
  if(!stateChangeListeners) {
    stateChangeListeners = new Array;
    this._stateChangeListeners = stateChangeListeners
  }
  stateChangeListeners.push(listener);
  stateChangeListeners.push(instance)
};
AdfXmlHttpDataTransferService.prototype.removeStateChangeListener = function(listener, instance) {
  AdfAssert.assertFunction(listener);
  AdfAssert.assertObjectOrNull(instance);
  var stateChangeListeners = this._stateChangeListeners;
  AdfAssert.assert(stateChangeListeners, "stateChangeListeners must exist");
  var length = stateChangeListeners.length;
  for(var i = 0;i < length;i++) {
    var currListener = stateChangeListeners[i];
    i++;
    if(currListener == listener) {
      var currInstance = stateChangeListeners[i];
      if(currInstance === instance) {
        stateChangeListeners.splice(i - 1, 2)
      }
    }
  }
  if(stateChangeListeners.length == 0) {
    this._stateChangeListeners = null
  }
};
AdfXmlHttpDataTransferService.prototype.getDTSState = function() {
  return this._state
};
AdfXmlHttpDataTransferService.prototype._broadcastStateChangeEvent = function(state) {
  this._state = state;
  var stateChangeListeners = this._stateChangeListeners;
  if(stateChangeListeners) {
    var listenerCount = stateChangeListeners.length;
    for(var i = 0;i < listenerCount;i++) {
      try {
        var currListener = stateChangeListeners[i];
        i++;
        var currInstance = stateChangeListeners[i];
        var result;
        if(currInstance != null) {
          result = currListener.call(currInstance, state)
        }else {
          result = currListener(state)
        }
        if(false == result) {
          break
        }
      }catch(e) {
        AdfLogger.LOGGER.logErrorAsWarning(e, "Error on DTS State Change Listener")
      }
    }
  }
};
AdfXmlHttpDataTransferService.prototype._getDomDocument = function() {
  return this._window.document
};
AdfXmlHttpDataTransferService._alertError = function(statusCode) {
  var failedConnectionText = AdfPage.PAGE.getFailedConnectionText();
  if(failedConnectionText != null) {
    var message = failedConnectionText;
    message += " (status\x3d";
    message += statusCode;
    var ecid = AdfPage.PAGE.getResponseIdentifier();
    if(ecid) {
      message += ",ecid\x3d";
      message += ecid
    }
    message += ")";
    alert(message)
  }
};
AdfXmlHttpDataTransferService._WINDOW_PARAM = "Adf-Window-Id";
AdfXmlHttpDataTransferService.__encodeWindowIdOnUrl = function(url, windowId) {
  var actionUrl = url;
  var windowParam = AdfXmlHttpDataTransferService._WINDOW_PARAM + "\x3d";
  var windowParamValue = windowParam + windowId;
  if(actionUrl.indexOf(windowParam) == -1) {
    actionUrl += actionUrl.indexOf("?") == -1 ? "?" : "\x26";
    actionUrl += windowParamValue
  }else {
    actionUrl = actionUrl.replace(/adf-window-id=[^&#]*/, windowParamValue)
  }
  return actionUrl
};
AdfXmlHttpDataTransferService.__encodePageIdOnUrl = function(url, pageId) {
  if(pageId == null || pageId == undefined) {
    return url
  }
  var actionUrl = url;
  var pageParam = AdfDhtmlPage._PAGE_STATE_ID + "\x3d";
  var pageParamValue = pageParam + pageId;
  if(actionUrl.indexOf(pageParam) == -1) {
    actionUrl += actionUrl.indexOf("?") == -1 ? "?" : "\x26";
    actionUrl += pageParamValue
  }else {
    actionUrl = actionUrl.replace(/Adf-Page-Id=[^&#]*/, pageParamValue)
  }
  return actionUrl
};
AdfXmlHttpDataTransferService._removeFrame = function(hiddenFrame) {
  var frameNode = !hiddenFrame.parentNode ? hiddenFrame.frameElement : hiddenFrame;
  if(frameNode) {
    frameNode.dataset.postReqCounter--;
    if(frameNode.dataset.postReqCounter <= 0) {
      frameNode.onload = "void(0);";
      var parentNode = frameNode.parentNode;
      if(parentNode) {
        parentNode.removeChild(frameNode)
      }
    }
  }
};
