function AdfDhtmlPage(lookAndFeel, domWindow) {
  this.Init(lookAndFeel, domWindow)
}
AdfObject.createSubclass(AdfDhtmlPage, AdfPage);
AdfDhtmlPage.SCREEN_READER_ACCESSIBILITY_MODE = "screenReader";
AdfDhtmlPage.DEFAULT_ACCESSIBILITY_MODE = "default";
AdfDhtmlPage.INACCESSIBLE_ACCESSIBILITY_MODE = "inaccessible";
AdfDhtmlPage.OUPUTMODE_ATTACHMENT = "attachment";
AdfDhtmlPage._LOAD_CHECKPOINT = AdfCheckpoint.getCheckpoint("onload total", "startup");
AdfDhtmlPage._LOAD_CHECKPOINT.setDescription("Total time spent in onLoad");
AdfDhtmlPage._CALLBACK_CHECKPOINT = AdfCheckpoint.getCheckpoint("onload callback", "startup");
AdfDhtmlPage._CALLBACK_CHECKPOINT.setDescription("Time spent in onload callback plus post-callback layout");
AdfDhtmlPage._POSTBACK_CHECKPOINT = AdfCheckpoint.getCheckpoint("postaback total", "postback");
AdfDhtmlPage._POSTBACK_CHECKPOINT.setDescription("Total time spent in postback");
AdfDhtmlPage._BROWSER_RESIZE_CHECKPOINT = AdfCheckpoint.getCheckpoint("browser resize", "resize");
AdfDhtmlPage._BROWSER_RESIZE_CHECKPOINT.setDescription("Time spent in resize notify during browser resize");
AdfDhtmlPage._CUSTOM_PPR_URL_EXPANDO = "_adfCustomPPRUrlExpando";
AdfDhtmlPage.ACTIVE_DOM_ELEMENT_PROPERTY = "activeDomElement";
AdfDhtmlPage._INCOMPLETE_IMAGE_CLASS_NAME = "_afrImageNotLoadedInTime";
AdfDhtmlPage._ECID = "_afrECID";
AdfDhtmlPage._PRINTABLE_STATE = "p_AFPrintable";
AdfDhtmlPage._PRINTABLE_WINDOW_NAME = "_new";
AdfDhtmlPage.TIMER_IS_SYNCHRONIZED = "isSynchronized";
AdfDhtmlPage.TIMER_CALLBACK = "callback";
AdfDhtmlPage.TIMER_CONTEXT = "context";
AdfDhtmlPage.TIMER_STATE = "state";
AdfDhtmlPage.TIMER_ID = "timerId";
AdfDhtmlPage.TIMER_DOM_ID = "domTimerId";
AdfDhtmlPage._FOR_CONTAINER_PREFIX = "afr::msgFor";
AdfDhtmlPage.InitClass = function() {
  var keyStrokeOverrides = new Object;
  var overrideList = [AdfKeyStroke.getKeyStroke(AdfKeyStroke.A_KEY, AdfKeyStroke.CTRL_MASK), AdfKeyStroke.getKeyStroke(AdfKeyStroke.C_KEY, AdfKeyStroke.CTRL_MASK), AdfKeyStroke.getKeyStroke(AdfKeyStroke.V_KEY, AdfKeyStroke.CTRL_MASK), AdfKeyStroke.getKeyStroke(AdfKeyStroke.X_KEY, AdfKeyStroke.CTRL_MASK), AdfKeyStroke.getKeyStroke(AdfKeyStroke.DELETE_KEY, 0)];
  for(var i = overrideList.length - 1;i >= 0;i--) {
    keyStrokeOverrides[overrideList[i].toMarshalledString()] = true
  }
  this._KEYSTROKE_OVERRIDES = keyStrokeOverrides;
  this._EDITABLE_STYLE = "p_AFInlineEditable";
  this._SELECTABLE_STYLE = "p_AFInlineSelectable";
  this._STATE_PARAM_NAME = "javax.faces.ViewState";
  this._PAGE_STATE_ID = "Adf-Page-Id";
  this._STREAMING_IDS_PARAM = "oracle.adf.view.rich.STREAM";
  this._REMOVED_STREAMING_IDS_PARAM = "oracle.adf.view.rich.NOSTREAM";
  this._STREAMING_REQUEST_SENT = 0;
  this._STREAMING_STARTED = 1;
  this._STREAMING_COMPLETE = 2;
  this._LAZY_FETCH_ID_PARAM = "oracle.adf.view.rich.LAZY_FETCH";
  this._RICH_UPDATE_FLAG = "oracle.adf.view.faces.RICH_UPDATE";
  this._NAVIGATION_WRAPPER_ID = "afr::DocWrapper";
  this._NAVIGATION_VIEW_ROOT = "_afrNavViewRoot";
  this._NAVIGATION_QUERY_PARAMS = "_afrNavParams";
  this._DELAYED_RESIZE_TIMEOUT = 150;
  var keyCode = AdfKeyStroke.R_KEY;
  var modifiers = AdfKeyStroke.ALT_MASK | AdfKeyStroke.CTRL_MASK;
  this._ACTIVE_DATA_HOT_KEY = AdfKeyStroke.getKeyStroke(keyCode, modifiers);
  this._ACTIVE_DATA_HOT_KEY_TEXT = "Ctrl+Alt+R";
  this._DOCUMENT_STYLE_HOLDER = "_afrStyleHolder";
  this.PPR_NAVIGATION_ON = 1;
  this.PPR_NAVIGATION_FORCE_PPR = 2;
  this._MSG_RESET_CLIENT_AND_SERVER = 0;
  this._MSG_RESET_SERVER = 1;
  this._PARSER_DIV_ID = "_afrParserDiv";
  this._BLOCKING_DIV_ID = "_afBlockingDiv";
  this._BLOCKING_OPACITY = 0;
  this._POSTSCRIPT_ID_SUFFIX = "::postscript";
  this._UI_BLOCK_REASON_PPR = "ppr";
  this._UI_BLOCK_REASON_SCRIPT_LOADING = "scriptLoading"
};
AdfDhtmlPage.prototype.Init = function(lookAndFeel, domWindow) {
  AdfAssert.assertPrototype(lookAndFeel, AdfLookAndFeel);
  AdfDhtmlPage.superclass.Init.call(this, lookAndFeel);
  this._preloadImages = false;
  this._window = domWindow;
  this._document = domWindow.document;
  this._lastDomEvent = null;
  this._jsfAjaxInit = null;
  this._clientIdToComponentMap = new Object;
  this._clientIdToAbsoluteLocatorMap = new Object;
  var logger = AdfLogger.LOGGER.getLogWriter();
  if(AdfClientFileLogWriter.prototype.isPrototypeOf(logger)) {
    logger.setSessionId(AdfDhtmlPage._getCookie(this._document, "JSESSIONID"))
  }
  AdfDhtmlPage.PARTIAL_TARGETS_PARAM = "oracle.adf.view.rich.RENDER";
  this._eventQueue = new Array;
  this._serverQueue = new AdfServerEventQueue;
  this._busyCounts = {};
  this._accessibilityMode = AdfDhtmlPage.DEFAULT_ACCESSIBILITY_MODE;
  this._portlet = false;
  this._rootClientId = "";
  this._automationEnabled = false;
  this._cssSelectorsUncompressed = false;
  this._animationEnabled = true;
  this._interpretEmptyString = false;
  this._validateEmptyFields = false;
  this._uiBlocks = [];
  this._activeDomNode = null;
  this._inLayout = false;
  domWindow.onunload = this.createCallback(this.Dispose);
  domWindow.onresize = this.createCallback(this._handleResize);
  var domDocument = this.getDomDocument();
  domDocument.ondragstart = AdfAgent.eatEventCallback;
  domDocument.onselectstart = this.createCallback(this._onSelectStart);
  this._dragStartX = 0;
  this._dragStartY = 0;
  this._dragLastX = 0;
  this._dragLastY = 0;
  var dragMouseMoveCallback = this.createCallback(this._dragMouseMove);
  var dragMouseUpCallback = this.createCallback(this._dragMouseUp);
  var dragKeyDownCallback = this.createCallback(this._dragKeyDown);
  this._dragDropCallbacks = {"mousemove":dragMouseMoveCallback, "mouseup":dragMouseUpCallback, "keydown":dragKeyDownCallback, "touchmove":dragMouseMoveCallback, "touchend":dragMouseUpCallback, "touchcancel":dragKeyDownCallback};
  this._resizeNotifyTree = new Object;
  this._resizeNotifyMap = new Object;
  this._descendantResizeNotifyList = new Array;
  this._keyStrokeToCallbackMap = new Object;
  this._keyStrokeToCallbackContextMap = new Object;
  this._pageProperties = new Object;
  AdfDhtmlPage._timers = new Object;
  AdfDhtmlPage._nextTimerId = 1;
  this._selectedEditingComponents = null;
  this._editableSubtreeId = null;
  this._editedComponentId = null;
  this._inlineEditor = null;
  this._editableCallback = null;
  this._editableCallbackContext = null;
  this._autoPPRComponents = new Object;
  this._startADSClientIds = new Object;
  this._startADSClientIdCount = 0;
  this._restartAllADSComponents = false;
  this._stopADSClientIds = new Array;
  this._canReceiveActiveDataCount = 1;
  this._stopGlobalActiveData();
  this._defaultMessageKey = "____GLOBAL_MESSAGES";
  this._messages = {};
  this._messages.dirtyComponentsToRender = [];
  this._delayedMessages = {};
  this._globalMessagesResetStrategy = AdfDhtmlPage._MSG_RESET_CLIENT_AND_SERVER;
  this._pendingStreamingIDs = new Object;
  this._documentClientId = null;
  this._replaceJsfAjaxFunctions();
  this._sessionId = null;
  this._responseId = null;
  this.__shouldTracePPRRequestId = false;
  this._perfProfileEnabled = domWindow._afrTimingPreLoadStart ? true : false;
  this._perfProfileTimingEnabled = domWindow._afrTimingPreLoadTimingStart ? true : false;
  this._positionBlockingGlassPaneCallback = this.createCallback(this._positionBlockingGlassPane);
  if(this._perfProfileEnabled || this._perfProfileTimingEnabled) {
    var profilerLogger = new AdfLogger("profiler", AdfAgent.AGENT.createDefaultLogWriter());
    if(profilerLogger.getLevel() > AdfLogger.INFO) {
      profilerLogger.setLevel(AdfLogger.INFO)
    }
    AdfLogger.PROFILER_LOGGER = AdfLogger["PROFILER_LOGGER"] = profilerLogger;
    AdfLogger.PROFILER_LOGGER.register()
  }
  this._haveOutstandingPPRRequest = false;
  this._perfProfileLogClosed = true;
  this._loadingComponents = [];
  this._dirtyStateService = new AdfDirtyStateService(this);
  this._componentsUpdatedByPollEvent = null;
  this._scriptLoadingPolicy = null;
  this._windowDetectionStrategy = "aggressive";
  this._poppedUpComponentInfo = {};
  this._seleniumRC = false;
  this._isHighContrast = false
};
AdfDhtmlPage.prototype.isPageFullyLoaded = function() {
  return this.isSynchronizedWithServer()
};
AdfDhtmlPage.prototype.isPageOnloadCalled = function() {
  return this._initializationComplete
};
AdfDhtmlPage.prototype.getDirtyStateService = function() {
  return this._dirtyStateService
};
AdfDhtmlPage.prototype.isSynchronizedWithServer = function() {
  this._throwAndClearSavedErrors();
  return this.whyIsNotSynchronizedWithServer() == null
};
AdfDhtmlPage.prototype.whyIsNotSynchronizedWithServer = function(currentDialogReturnId) {
  var isAutomation = this.isAutomationEnabled();
  if(isAutomation && currentDialogReturnId) {
    var why = AdfDhtmlRichDialogService.whyIsNotDialogSynchronizedWithServer(currentDialogReturnId);
    if(why && AdfAutomationHelper.WAIT_REASONS["NO_SUCH_DIALOG_ERROR"]["reason"] !== why["reason"]) {
      return why
    }
  }
  var config = new Object;
  var confConst = AdfAutomationHelper.CONFIG;
  config[confConst["AUTOMATION_ENABLED"]] = isAutomation;
  config[confConst["DTS"]] = this.getDataTransferService();
  config[confConst["PHASE"]] = this.getPhase();
  config[confConst["EVENT_QUEUE_LENGTH"]] = this._eventQueue.length;
  config[confConst["IS_ATTACHMENT_MODE"]] = this.isAttachmentMode();
  config[confConst["INITIALIZATION_COMPLETE"]] = this._initializationComplete;
  config[confConst["PARTIAL_TARGETS"]] = this._partialTargets;
  config[confConst["START_ADS_CLIENT_ID_COUNT"]] = this._startADSClientIdCount;
  config[confConst["WINDOW_EVENT_HEADER_MAP"]] = this._windowEventHeaderMap;
  config[confConst["IN_HANDLE_RICH_RESPONSE"]] = this._inHandleRichResponse;
  config[confConst["PARTIAL_REQUEST_REDIRECT"]] = this._partialRequestRedirect;
  config[confConst["IN_DELIVER_QUEUED_SERVER_EVENTS"]] = this._inDeliverQueuedServerEvents;
  config[confConst["IN_DELIVER_QUEUED_EVENTS"]] = this._inDeliverQueuedEvents;
  config[confConst["WAITING_FOR_DOCUMENT_UNLOAD"]] = this._waitingForDocumentUnload;
  config[confConst["ARE_COMPONENTS_LOADED"]] = this._areComponentsLoaded();
  config[confConst["WAITING_FOR_DESCENDANT_RESIZE"]] = this._waitingForDescendantResize();
  config[confConst["WAITING_FOR_INCOMPLETE_IMAGES"]] = this._waitingForIncompleteImages();
  config[confConst["HAS_EVENTS_TO_DELIVER"]] = this._serverQueue.hasEventsToDeliver();
  config[confConst["WAITING_FOR_ANIMATION"]] = this._waitingForAnimation();
  config[confConst["ARE_SYNCHRONOUS_TIMERS_CLEARED"]] = this._areSynchronousTimersCleared();
  config[confConst["IN_GET_REQUEST_NAVIGATION"]] = this._inGetRequestNavigation;
  config[confConst["TIMERS"]] = AdfDhtmlPage._timers;
  return AdfAutomationHelper.getInstance().whyIsNotSynchronizedWithServer(config)
};
AdfDhtmlPage.prototype.getFailedConnectionText = function() {
  var text = AdfDhtmlPage.superclass.getFailedConnectionText.call(this);
  if(text == null) {
    var laf = this.getLookAndFeel();
    text = laf.getTranslatedString("af_document.MSG_FAILED_CONNECTION")
  }
  return text
};
AdfDhtmlPage.prototype.registerLoadingComponent = function(component) {
  var clientId = component.getClientId();
  AdfAssert.assert(AdfCollections.indexOf(this._loadingComponents, clientId) == -1, "Component already registered");
  this._loadingComponents.push(clientId)
};
AdfDhtmlPage.prototype.unregisterLoadingComponent = function(component) {
  AdfCollections.removeArrayValue(this._loadingComponents, component.getClientId())
};
AdfDhtmlPage.prototype._areComponentsLoaded = function() {
  var loadingComponents = this._loadingComponents;
  var loadingCount = loadingComponents.length;
  for(var i = 0;i < loadingCount;i++) {
    var loadingComponent = this.findComponent(loadingComponents[i]);
    if(loadingComponent.getReadyState() != AdfUIComponent.STATE_COMPLETE) {
      return false
    }
  }
  return true
};
AdfDhtmlPage.prototype.isPerformingFullSubmit = function() {
  return this._inAppNavigationFlag
};
AdfDhtmlPage.prototype._resetPerformingFullSubmit = function() {
  this._inAppNavigationFlag = false
};
AdfDhtmlPage.prototype.getAccessibilityMode = function() {
  return this._accessibilityMode
};
AdfDhtmlPage.prototype.setAccessibilityMode = function(mode) {
  AdfAssert.assert(mode == AdfDhtmlPage.SCREEN_READER_ACCESSIBILITY_MODE || mode == AdfDhtmlPage.DEFAULT_ACCESSIBILITY_MODE || mode == AdfDhtmlPage.INACCESSIBLE_ACCESSIBILITY_MODE, "invalid accessibility mode: ", mode);
  this._accessibilityMode = mode
};
AdfDhtmlPage.prototype.isScreenReaderMode = function() {
  return this._accessibilityMode == AdfDhtmlPage.SCREEN_READER_ACCESSIBILITY_MODE
};
AdfDhtmlPage.prototype.isUserActivityMonitoringOn = function() {
  if(this._userActivityMonitoring === undefined) {
    this._userActivityMonitoring = true;
    var domWindow = this.getDomWindow();
    var sessionStorageEnabledOnAgent = AdfAgent.AGENT.isSessionStorageEnabled();
    var userActivityFeatureOn = domWindow["AdfUserActivityInfo"] != null;
    if(!sessionStorageEnabledOnAgent || !userActivityFeatureOn) {
      this._userActivityMonitoring = false;
      AdfLogger.LOGGER.fine("User Activity Monitoring has been disabled either because the feature" + " is disabled or it's enabled but its resources are missing. Please check your app configuration.")
    }
  }
  return this._userActivityMonitoring
};
AdfDhtmlPage.prototype.isAttachmentMode = function() {
  return this._outputMode === AdfDhtmlPage.OUPUTMODE_ATTACHMENT
};
AdfDhtmlPage.prototype.setPortlet = function(flag, rootClientId) {
  this._portlet = flag;
  this._rootClientId = rootClientId
};
AdfDhtmlPage.prototype.isPortlet = function() {
  return this._portlet
};
AdfDhtmlPage.prototype.getRootClientId = function() {
  return this._rootClientId
};
AdfDhtmlPage.prototype.isPPRNavigationEnabled = function() {
  return 0 != (this.getPPRNavigationOptions() & AdfDhtmlPage.PPR_NAVIGATION_ON)
};
AdfDhtmlPage.prototype.setHelpWindowName = function(windowName) {
  AdfDomUtils._setHelpWindowName(windowName)
};
AdfDhtmlPage.prototype.launchHelpWindow = function(url) {
  AdfDomUtils.launchHelpWindow(url)
};
AdfDhtmlPage.prototype.localNavigate = function(uri) {
  this._registerGetRequestNavigationTracking();
  if(!this.checkUncommittedData()) {
    delete this._inGetRequestNavigation;
    return
  }
  if(this.isPPRNavigationEnabled()) {
    this._blockUI(true);
    var hasNoActiveComponents = this.isActiveDataSupported() ? AdfCollections.isEmpty(this.getActiveDataSupport().getActiveComponents()) : true;
    var params = {};
    if(this.isUserActivityMonitoringOn() && hasNoActiveComponents) {
      var userActivityInfo = AdfUserActivityInfo.getInstance(AdfUserActivityInfo.PRIMARY);
      var currStartTime = (new Date).getTime().toString();
      userActivityInfo.setClientStartTime(currStartTime);
      params["oracle.adf.view.rich.monitoring.UserActivityInfo"] = AdfUserActivityInfo.getMarshaledObject()
    }
    var content = this._getPostbackContent(null, params, null);
    var pageId = null;
    var exp = /_afrPage=[^&^#]*&*/;
    var match = exp.exec(uri);
    if(match != null) {
      var paramValue = match[0];
      var values = paramValue.split(/[=&]/g);
      if(values.length > 1) {
        pageId = values[1]
      }
      uri = uri.replace(exp, "");
      uri = uri.replace(/[\?&]+$|[\?&]+(?=#)/, "")
    }
    var headerParams = null;
    if(pageId != null) {
      headerParams = new Object;
      headerParams[AdfDhtmlPage._PAGE_STATE_ID] = pageId
    }
    this.getDataTransferService().sendRequest(null, uri, headerParams, content, [this]);
    delete this._inGetRequestNavigation
  }else {
    this.getDomWindow().location.href = uri
  }
};
AdfDhtmlPage.prototype.checkUncommittedData = function(regionMessageCallback) {
  var proceed = true;
  var displayGlobalMessage = this._isTrackingDocumentUncommittedData() && (this._dataDirty || this._dirtyStateService.__isPotentiallyDirty());
  var dirtyRegions = null;
  var displayRegionsMessage = false;
  if(!displayGlobalMessage) {
    dirtyRegions = this._getDirtyRegionIds();
    displayRegionsMessage = dirtyRegions != null && dirtyRegions.length > 0
  }
  var message = null;
  if(displayRegionsMessage && regionMessageCallback != null) {
    message = regionMessageCallback(dirtyRegions)
  }
  if(displayGlobalMessage || displayRegionsMessage) {
    proceed = this._displayUncommittedDataWarning(message)
  }
  return proceed
};
AdfDhtmlPage.prototype.checkRegionUncommittedData = function(regionClientIds, message) {
  AdfAssert.assertArray(regionClientIds);
  var checkingClient = this._isTrackingRegionClientUncommittedData();
  var dirty = false;
  for(var i = 0;i < regionClientIds.length && !dirty;i++) {
    var id = regionClientIds[i];
    dirty = this._dirtyServerRegions != null && this._dirtyServerRegions[id];
    if(!dirty && checkingClient) {
      dirty = this._dirtyStateService.isNamingContainerDirty(id)
    }
  }
  if(dirty) {
    return this._displayRegionUncommittedDataWarning(message)
  }
  return true
};
AdfDhtmlPage.prototype.getUncommittedRegionIds = function() {
  return this._getDirtyRegionIds() || []
};
AdfDhtmlPage.prototype.__setAutomationEnabled = function(enabled) {
  AdfAssert.assertBoolean(enabled);
  this._automationEnabled = enabled;
  if(enabled && this._detectSeleniumRC()) {
    this.__markSeleniumRC()
  }
};
AdfDhtmlPage.prototype.isAutomationEnabled = function() {
  return this._automationEnabled
};
AdfDhtmlPage.prototype.__setAsynchronousUpdatesState = function(state) {
  AdfAssert.assertString(state);
  this._asynchronousUpdatesState = state
};
AdfDhtmlPage.prototype.getAsynchronousUpdatesState = function() {
  return this._asynchronousUpdatesState
};
AdfDhtmlPage.prototype.__setCssSelectorsUncompressed = function(disabled) {
  AdfAssert.assertBoolean(disabled);
  this._cssSelectorsUncompressed = disabled
};
AdfDhtmlPage.prototype.areCssSelectorsUncompressed = function() {
  return this._cssSelectorsUncompressed
};
AdfDhtmlPage.prototype.setAnimationEnabled = function(enabled) {
  AdfAssert.assertBoolean(enabled);
  this._animationEnabled = enabled
};
AdfDhtmlPage.prototype.isAnimationEnabled = function() {
  return this._animationEnabled
};
AdfDhtmlPage.prototype.getSessionIdentifier = function() {
  return this._sessionId
};
AdfDhtmlPage.prototype.__setSessionIdentifier = function(sessionId) {
  this._sessionId = sessionId;
  return this
};
AdfDhtmlPage.prototype.__notifyReturnFromDialog = function() {
  this._disableUncommittedWarnings();
  if("aggressive" != this._windowDetectionStrategy) {
    this._returnFromDialog = true
  }
};
AdfDhtmlPage.prototype.shouldInterpretEmptyStringSubmittedValuesAsNull = function() {
  return this._interpretEmptyString
};
AdfDhtmlPage.prototype.__setShouldInterpretEmptyStringSubmittedValuesAsNull = function(interpretEmptyString) {
  this._interpretEmptyString = interpretEmptyString
};
AdfDhtmlPage.prototype.shouldValidateEmptyFields = function() {
  return this._validateEmptyFields
};
AdfDhtmlPage.prototype.__setShouldValidateEmptyFields = function(validateEmptyFields) {
  this._validateEmptyFields = validateEmptyFields
};
AdfDhtmlPage.prototype.getResponseIdentifier = function() {
  return this._responseId
};
AdfDhtmlPage.prototype.__setResponseIdentifier = function(responseId) {
  this._responseId = responseId;
  return this
};
AdfDhtmlPage.prototype.__setOutputMode = function(outputMode) {
  this._outputMode = outputMode;
  return this
};
AdfDhtmlPage.prototype.getOutputMode = function() {
  return this._outputMode
};
AdfDhtmlPage.prototype.shouldTracePPRRequestId = function() {
  return this.__shouldTracePPRRequestId
};
AdfDhtmlPage.prototype.__setShouldTracePPRRequestId = function(tracePPRRequestId) {
  this.__shouldTracePPRRequestId = tracePPRRequestId
};
AdfDhtmlPage.prototype.setPageProperty = function(propertyName, propertyValue) {
  AdfAssert.assertString(propertyName);
  this._pageProperties[propertyName] = propertyValue
};
AdfDhtmlPage.prototype.getPageProperty = function(propertyName) {
  AdfAssert.assertString(propertyName);
  return this._pageProperties[propertyName]
};
AdfDhtmlPage.prototype.getComponentsByType = function(componentType) {
  AdfAssert.assertNonEmptyString(componentType);
  var componentsByType = new Array;
  for(var currClientId in this._clientIdToComponentMap) {
    var currComponent = this._clientIdToComponentMap[currClientId];
    if(currComponent && currComponent.getComponentType() == componentType) {
      componentsByType.push(currComponent)
    }
  }
  return componentsByType
};
AdfDhtmlPage.prototype.matchComponents = function(filterFunction, context) {
  AdfAssert.assertFunction(filterFunction);
  if(context === undefined) {
    context = this
  }
  var matchingComponents = [];
  for(var currClientId in this._clientIdToComponentMap) {
    var currComponent = this._clientIdToComponentMap[currClientId];
    var result = filterFunction.call(context, currComponent);
    if(result & 1) {
      matchingComponents.push(currComponent)
    }
    if(result & 2) {
      break
    }
  }
  return matchingComponents
};
AdfDhtmlPage.prototype.getViewId = function() {
  return this._viewId != undefined ? this._viewId : ""
};
AdfDhtmlPage.prototype.__setViewId = function(viewId) {
  this._viewId = viewId
};
AdfDhtmlPage.prototype.findComponent = function(clientId) {
  return this._clientIdToComponentMap[clientId]
};
AdfDhtmlPage.prototype.getClientIdToComponentMap = function() {
  return this._clientIdToComponentMap
};
AdfDhtmlPage.prototype._findComponentAbsoluteLocator = function(clientId) {
  return this._clientIdToAbsoluteLocatorMap[clientId]
};
AdfDhtmlPage.prototype._getClientIdToAbsoluteLocatorMap = function() {
  return this._clientIdToAbsoluteLocatorMap
};
AdfDhtmlPage.prototype.findComponentByAbsoluteLocator = function(absoluteLocator) {
  if(window.AdfLocators) {
    return AdfLocators.findComponentByAbsoluteLocator(this, absoluteLocator)
  }
  throw new Error("Automation must be enabled to call findComponentByAbsoluteLocator()");
};
AdfDhtmlPage.prototype.findComponentOrAncestorByAbsoluteLocator = function(absoluteLocator) {
  if(window.AdfLocators) {
    return AdfLocators.findComponentOrAncestorByAbsoluteLocator(this, absoluteLocator)
  }
  throw new Error("Automation must be enabled to call findComponentOrAncestorByAbsoluteLocator()");
};
AdfDhtmlPage.prototype.findComponentWithBackup = function(locator, backupInfo) {
  if(window.AdfLocators) {
    return AdfLocators.findComponentWithBackup(this, locator, backupInfo)
  }
  throw new Error("Automation must be enabled to call findComponentWithBackup()");
};
AdfDhtmlPage.prototype.findComponentByComplexLocator = function(locator, backupInfo) {
  if(window.AdfLocators) {
    return AdfLocators.findComponentByComplexLocator(this, locator, backupInfo)
  }
  throw new Error("Automation must be enabled to call findComponentByComplexLocator()");
};
AdfDhtmlPage.prototype.findComponentsByComplexLocator = function(locator, backupInfo) {
  if(window.AdfLocators) {
    return AdfLocators.findComponentsByComplexLocator(this, locator, backupInfo)
  }
  throw new Error("Automation must be enabled to call findComponentsByComplexLocator()");
};
AdfDhtmlPage.prototype.getAbsoluteLocator = function(component) {
  var clientId = component.getClientId();
  var absoluteLocator = this._findComponentAbsoluteLocator(clientId);
  if(absoluteLocator == null) {
    var peer = component.getPeer();
    absoluteLocator = peer.getAbsoluteLocator(component, clientId);
    if(peer.isAbsoluteLocatorCacheable()) {
      this._mapComponentAbsoluteLocator(clientId, absoluteLocator)
    }
  }
  return absoluteLocator
};
AdfDhtmlPage.prototype.unmapComponent = function(clientId) {
  if(this.isActiveDataSupported()) {
    this.getActiveDataSupport().unmapComponent(clientId)
  }
  if(clientId in this._autoPPRComponents) {
    this._stopAutoPPR(clientId)
  }
  var clientListeners = this._clientListeners;
  if(clientListeners != null) {
    var eventListeners = clientListeners[AdfComponentRemovedEvent.EVENT_TYPE];
    if(eventListeners != null) {
      AdfEventUtils.deliverEventToListeners(eventListeners, new AdfComponentRemovedEvent(this, clientId))
    }
  }
  delete this._clientIdToComponentMap[clientId];
  this._unmapComponentAbsoluteLocator(clientId)
};
AdfDhtmlPage.prototype.mapComponent = function(clientId, component) {
  this._clientIdToComponentMap[clientId] = component
};
AdfDhtmlPage.prototype._mapComponentAbsoluteLocator = function(clientId, locator) {
  this._clientIdToAbsoluteLocatorMap[clientId] = locator
};
AdfDhtmlPage.prototype._unmapComponentAbsoluteLocator = function(clientId) {
  delete this._clientIdToAbsoluteLocatorMap[clientId]
};
AdfDhtmlPage.prototype.unmapDescendantComponentAbsoluteLocators = function(parentComponent) {
  var namingContainerLocator = parentComponent.getAbsoluteLocator();
  for(currClientId in this._clientIdToAbsoluteLocatorMap) {
    var locator = this._clientIdToAbsoluteLocatorMap[currClientId];
    if(locator.substr(0, namingContainerLocator.length) === namingContainerLocator) {
      this._unmapComponentAbsoluteLocator(currClientId)
    }
  }
};
AdfDhtmlPage.prototype.addResource = function(type, value) {
  var element;
  switch(type) {
    case "javascript":
      this._loadScript(value);
      break;
    case "css":
      element = this._loadCss(value);
      element.setAttribute("afrres", "true");
      break;
    case "style":
      element = this._createStyle(value);
      element.setAttribute("afrres", "true");
      break
  }
};
AdfDhtmlPage.prototype.__applyNewPageStyleSheets = function(newStyleSheetURIs) {
  var oldStyleSheetElements = this._getExistingStyleSheetElements();
  var existingMap = oldStyleSheetElements.reduce(AdfDhtmlPage._styleSheetMapper, {});
  var newMap = newStyleSheetURIs.reduce(AdfDhtmlPage._valueMapper, {});
  for(var url in existingMap) {
    if(url in newMap) {
      delete newMap[url];
      delete existingMap[url]
    }
  }
  var removeList = oldStyleSheetElements.filter(function(value) {
    return value.getAttribute("href") in this
  }, existingMap);
  var addList = newStyleSheetURIs.filter(function(value) {
    return value in this
  }, newMap);
  if(addList.length || removeList.length) {
    var head = this._getHead();
    var props = {"data-afr-stylesheet":"1"};
    addList.reduce(AdfDhtmlPage._insertReduce, {page:this, head:head, insertBefore:null, linkProps:props});
    var removeCallback = function() {
      removeList.every(function(childNode) {
        if(childNode.parentNode) {
          childNode.parentNode.removeChild(childNode)
        }
      })
    };
    window.setTimeout(removeCallback, 1E3)
  }
};
AdfDhtmlPage._insertReduce = function(state, createURL) {
  var newLink = state.page._createLink(createURL, state.linkProps);
  state.head.insertBefore(newLink, state.insertBefore);
  state.insertBefore = newLink.nextSibling;
  return state
};
AdfDhtmlPage._valueMapper = function(map, value) {
  map[value] = value;
  return map
};
AdfDhtmlPage._styleSheetMapper = function(map, value) {
  var href = value.getAttribute("href");
  if(href) {
    map[href] = value
  }
  return map
};
AdfDhtmlPage.prototype._getExistingStyleSheetElements = function() {
  var head = this._getHead();
  return this._getLinkChildren(head).filter(function(value) {
    return value.hasAttribute("data-afr-stylesheet")
  })
};
AdfDhtmlPage.prototype.Dispose = function() {
  this.getDataTransferService().pageUnloading();
  if(AdfLogger.PROFILER_LOGGER != null) {
    AdfLogger.PROFILER_LOGGER.getLogWriter().close()
  }
  if(this._beforeUnloadDelayed) {
    this._unloading = true;
    if(this.isActiveDataSupported()) {
      this.getActiveDataSupport().onBeforeUnload()
    }
  }
  AdfDhtmlRichDialogService.getInstance().cancelAll();
  var autoDismissalManager = this._autoDismissalManager;
  if(autoDismissalManager) {
    autoDismissalManager.dispose();
    this._autoDismissalManager = null
  }
  var modalityManager = this._modalityManage;
  if(modalityManager) {
    modalityManager.dispose();
    this._modalityManager = null
  }
  var positionManager = this._positionManager;
  if(positionManager) {
    positionManager.dispose();
    this._positionManager = null
  }
  var zOrderManager = this._zOrderManager;
  if(zOrderManager) {
    zOrderManager.dispose();
    this._zOrderManager = null
  }
  var navAgent = AdfNavigationHistoryAgent.getInstance();
  if(navAgent) {
    navAgent.dispose()
  }
  this.setEditableSubtree(null);
  var agent = AdfAgent.AGENT;
  var domDocument = this.getDomDocument();
  var domWindow = this.getDomWindow();
  var touchContextMenuManager = this._touchContextMenuManager;
  if(touchContextMenuManager) {
    touchContextMenuManager.dispose()
  }
  this._disposeTimers();
  var redistributeCallback = this._redistributeEventsCallback;
  if(redistributeCallback) {
    agent.removeEventBubbles(domDocument, redistributeCallback);
    this._redistributeEventsCallback = null
  }
  if(this._onBeforeUnloadCallback) {
    agent.removeBubbleEventListener(domWindow, "beforeunload", this._onBeforeUnloadCallback);
    this._onBeforeUnloadCallback = null
  }
  var keyCallback = this._keyEventCallback;
  if(keyCallback) {
    agent.removeKeyEventListener(domDocument, keyCallback);
    this._keyEventCallback = null
  }
  domWindow.onload = null;
  domWindow.onunload = null;
  domWindow.onresize = null;
  var dataTransferService = this._dataTransferService;
  if(dataTransferService) {
    dataTransferService.dispose();
    this._dataTransferService = null
  }
  delete this._lastFocusedElement;
  this._pageProcessingIndicator = null;
  this._uiBlockingDiv = null;
  this._glassPane = null;
  this._uiMaskingFrame = null;
  this._activeElementBeforeBlocking = null;
  this._keyCaptureState = null;
  this._window = null;
  this._lastDomEvent = null;
  this._document = null;
  this._delayedResizeCallback = null;
  this._dragDropCallbacks = null;
  this._touchContextMenuManager = null;
  AdfDhtmlPage._disposeIFrames(domDocument);
  AdfDhtmlPage.superclass.Dispose.call(this);
  if(this.isScreenReaderMode()) {
    this.unregisterKeyStroke(AdfDhtmlPage._ACTIVE_DATA_HOT_KEY)
  }
};
AdfDhtmlPage.prototype.addPartialTargets = function(components) {
  var componentCount = arguments.length;
  if(componentCount > 0) {
    var partialTargets = this._partialTargets;
    if(partialTargets == null) {
      partialTargets = new Array;
      this._partialTargets = partialTargets
    }
    for(var i = 0;i < componentCount;i++) {
      var currComponent = arguments[i];
      AdfAssert.assertPrototype(currComponent, AdfUIComponent);
      var clientId = currComponent.getClientId();
      if(!(clientId in partialTargets)) {
        partialTargets[clientId] = true;
        partialTargets.push(clientId)
      }
    }
    this.__queueEventTimerIfNeeded()
  }
};
AdfDhtmlPage.prototype._scrubPartialTargets = function(oldPartialTargets) {
  var newPartialTargets = null;
  if(oldPartialTargets) {
    newPartialTargets = new Array;
    var oldCount = oldPartialTargets.length;
    for(var i = 0;i < oldCount;i++) {
      var oldClientId = oldPartialTargets[i];
      if(this.findComponent(oldClientId)) {
        newPartialTargets.push(oldClientId)
      }
    }
    if(!newPartialTargets.length) {
      newPartialTargets = null
    }
  }
  return newPartialTargets
};
AdfDhtmlPage.prototype.addComponents = function(components) {
  var domWindow = this.getDomWindow();
  if(this._perfProfileEnabled) {
    domWindow._afrTimingAddComponentsStart = (new Date).getTime()
  }
  var componentCount = arguments.length;
  for(var i = 0;i < componentCount;i++) {
    AdfAssert.assertPrototype(arguments[i], AdfUIComponent);
    arguments[i].AddNotify()
  }
  if(this._perfProfileEnabled) {
    domWindow._afrTimingAddComponentsEnd = (new Date).getTime()
  }
};
AdfDhtmlPage.prototype.addBusyStateListener = function(instance, listener) {
  AdfAssert.assertFunction(listener);
  AdfAssert.assertObjectOrNull(instance);
  this._busyStateListeners = AdfEventUtils.addListener(this._busyStateListeners, instance, listener)
};
AdfDhtmlPage.prototype.removeBusyStateListener = function(instance, listener) {
  AdfAssert.assertFunction(listener);
  AdfAssert.assertObjectOrNull(instance);
  this._busyStateListeners = AdfEventUtils.removeListener(this._busyStateListeners, listener, instance)
};
AdfDhtmlPage.prototype._broadcastBusyStateEvent = function(newBusyState) {
  var oldBusyState = this._busyState;
  if(oldBusyState == newBusyState) {
    AdfLogger.LOGGER.finest("busy state event broadcast called without a change in state");
    return
  }
  this._busyState = newBusyState;
  if(this._busyStateListeners) {
    AdfEventUtils.deliverEventToListeners(this._busyStateListeners, new AdfBusyStateEvent(this, newBusyState))
  }
};
AdfDhtmlPage.prototype.__registerDescendantResizeNotifyComponent = function(component) {
  var componentList = this._descendantResizeNotifyList;
  var componentListSize = componentList.length;
  var clientId = component.getClientId();
  var logger = AdfLogger.LOGGER;
  var checkForMultipleInstanceRegistration = logger.isLoggable(AdfLogger.WARNING);
  for(var i = 0;i < componentListSize;i++) {
    var listComponent = componentList[i].component;
    if(listComponent == component) {
      return
    }else {
      if(listComponent.getClientId() == clientId) {
        if(checkForMultipleInstanceRegistration) {
          var doc = this.getDomDocument();
          var existingConnected = "unknown";
          var newConnected = "unknown";
          var existingPeer = listComponent.getPeer();
          var newPeer = component.getPeer();
          if(existingPeer) {
            var existingElement = existingPeer.getDomElement();
            if(existingElement) {
              existingConnected = AdfDomUtils.getCommonAncestor(doc, existingElement) != null
            }
          }
          if(newPeer) {
            var newElement = newPeer.getDomElement();
            if(newElement) {
              newConnected = AdfDomUtils.getCommonAncestor(doc, newElement) != null
            }
          }
          logger.warning("__registerDescendantResizeNotifyComponent: Another (different) component instance with this same clientId is already in the descendant resize notify list: " + clientId + " (existingConnected\x3d" + existingConnected + ", newConnected\x3d" + newConnected + ")")
        }
        return
      }
    }
  }
  var componentNode = {component:component, depth:AdfDomUtils.getElementDepth(AdfRichUIPeer.getDomElementForComponent(component))};
  componentList.push(componentNode);
  if(componentList.length > 1) {
    this._descendantResizeNotifyListDirty = true
  }
  this._descendantResizeNotifyList = componentList
};
AdfDhtmlPage.prototype.__unregisterDescendantResizeNotifyComponent = function(component) {
  var componentList = this._descendantResizeNotifyList;
  var componentListSize = componentList.length;
  for(var i = 0;i < componentListSize;i++) {
    if(componentList[i].component == component) {
      componentList.splice(i, 1);
      return
    }
  }
};
AdfDhtmlPage.prototype.__queueDescendantResizeNotifySource = function(component) {
  var queue = this._descendantResizeNotifyQueue;
  var clientId = component.getClientId();
  if(queue == null) {
    queue = this._descendantResizeNotifyQueue = []
  }else {
    if(AdfCollections.indexOf(queue, clientId) != -1) {
      return
    }
  }
  queue.push(clientId)
};
AdfDhtmlPage.prototype.__doDescendantResizeNotify = function() {
  if(!this._descendantResizeNotifyQueue) {
    return
  }
  if(this._inDescendentResizeNotify) {
    return
  }
  this._inDescendentResizeNotify = true;
  try {
    while(this._descendantResizeNotifyQueue.length > 0) {
      this._doDescendantResizeNotifyOnQueue(this._descendantResizeNotifyQueue.splice(0, this._descendantResizeNotifyQueue.length))
    }
  }finally {
    delete this._inDescendentResizeNotify;
    delete this._descendantResizeNotifyQueue
  }
};
AdfDhtmlPage.prototype._doDescendantResizeNotifyOnQueue = function(descendantResizeNotifyQueue) {
  var queueSize = descendantResizeNotifyQueue.length;
  var componentList = this._descendantResizeNotifyList;
  var componentListSize = componentList.length;
  if(this._descendantResizeNotifyListDirty) {
    if(componentList.length > 1) {
      componentList.sort(AdfDhtmlPage._descendantResizeNotifyListComparator)
    }
    this._descendantResizeNotifyListDirty = false
  }
  var logger = AdfLogger.LOGGER;
  var checkForMismatchingRegistration = logger.isLoggable(AdfLogger.WARNING);
  for(var i = 0;i < componentListSize;i++) {
    var component = componentList[i].component;
    if(checkForMismatchingRegistration) {
      var currentClientId = component.getClientId();
      var matched = false;
      for(var clientId in this._resizeNotifyMap) {
        if(clientId == currentClientId) {
          matched = true
        }
      }
      if(!matched) {
        logger.warning("__doDescendantResizeNotify: A component instance is registered with the descendant resize notify list but not with the regular resize notify list but must be: " + clientId);
        return
      }
    }
    for(var j = 0;j < queueSize;j++) {
      var queuedComponent = this.findComponent(descendantResizeNotifyQueue[j]);
      if(queuedComponent && (queuedComponent == component || queuedComponent.isDescendant(component))) {
        this.doResizeNotify(component);
        break
      }
    }
  }
};
AdfDhtmlPage._descendantResizeNotifyListComparator = function(itemA, itemB) {
  var depthA = itemA.depth;
  var depthB = itemB.depth;
  if(depthA > depthB) {
    return-1
  }else {
    if(depthA < depthB) {
      return 1
    }
  }
  return 0
};
AdfDhtmlPage.prototype.registerResizeNotifyComponent = function(component) {
  var componentNode = {component:component};
  var clientId = component.getClientId();
  var componentMap = this._resizeNotifyMap;
  componentMap[clientId] = componentNode;
  var parentComponentNode;
  var domNode = AdfRichUIPeer.getDomElementForComponent(component);
  AdfAssert.assertDomElement(domNode);
  if(domNode) {
    domNode = domNode.parentNode;
    while(domNode) {
      if(domNode.nodeType == 1) {
        var domId = domNode.id;
        parentComponentNode = componentMap[domId];
        if(parentComponentNode) {
          break
        }
      }
      domNode = domNode.parentNode
    }
    if(parentComponentNode == null) {
      parentComponentNode = this._resizeNotifyTree
    }
    if(parentComponentNode.children == null) {
      parentComponentNode.children = new Array
    }
    parentComponentNode.children.push(componentNode);
    componentNode.parent = parentComponentNode
  }
};
AdfDhtmlPage.prototype.unregisterResizeNotifyComponent = function(component) {
  var clientId = component.getClientId();
  var resizeNotifyMap = this._resizeNotifyMap;
  var resizeNotifyNode = resizeNotifyMap[clientId];
  if(resizeNotifyNode) {
    delete resizeNotifyMap[clientId];
    var parentResizeNotifyNode = resizeNotifyNode.parent;
    if(parentResizeNotifyNode) {
      AdfCollections.removeArrayValue(parentResizeNotifyNode.children, resizeNotifyNode)
    }
    delete resizeNotifyNode.parent;
    var children = resizeNotifyNode.children;
    if(children) {
      AdfAssert.assert(children.length == 0, "Unexpected number of children: " + children.length);
      delete resizeNotifyNode.children
    }
  }
};
AdfDhtmlPage.prototype.doResizeNotify = function(component) {
  var resizeNotifyNode;
  if(component == null) {
    resizeNotifyNode = this._resizeNotifyTree
  }else {
    var clientId = component.getClientId();
    resizeNotifyNode = this._resizeNotifyMap[clientId];
    AdfAssert.assert(resizeNotifyNode != null, "No resizeNotifyNode in map for:" + clientId)
  }
  AdfDhtmlPage._doResizeNotify(resizeNotifyNode, true)
};
AdfDhtmlPage.prototype.doResizeNotifyDom = function(domNode, forceResize) {
  var resizeNotifyMap = this._resizeNotifyMap;
  var resizeNotifyNode = resizeNotifyMap[domNode.id];
  if(resizeNotifyNode) {
    AdfDhtmlPage._doResizeNotify(resizeNotifyNode, forceResize);
    return
  }
  var parentNode = domNode.parentNode;
  while(parentNode) {
    resizeNotifyNode = resizeNotifyMap[parentNode.id];
    if(resizeNotifyNode) {
      break
    }
    parentNode = parentNode.parentNode
  }
  var checkDescendents = false;
  var popupSupportLoaded = this._checkCoreBackgroundLoaded(false);
  if(!resizeNotifyNode) {
    if(popupSupportLoaded) {
      var zOrderManager = this.getZOrderManager();
      if(zOrderManager) {
        checkDescendents = zOrderManager.containsElement(domNode)
      }
    }
    resizeNotifyNode = this._resizeNotifyTree
  }
  this._doResizeNotifyDomChildren(domNode, resizeNotifyNode, checkDescendents);
  if(popupSupportLoaded) {
    var positionManager = this.getPositionManager();
    if(checkDescendents && positionManager) {
      positionManager.resizeFloatingElement(domNode)
    }
  }
};
AdfDhtmlPage.prototype._doResizeNotifyDomChildren = function(domNode, resizeNotifyNode, checkDescendents) {
  var agent = AdfAgent.AGENT;
  var children = resizeNotifyNode.children;
  if(children) {
    var length = children.length;
    for(var i = 0;i < length;i++) {
      var child = children[i];
      var childId = child.component.getClientId();
      var childDomNode = agent.getElementById(childId);
      if(AdfDomUtils.isAncestor(domNode, childDomNode)) {
        AdfDhtmlPage._doResizeNotify(child, false)
      }else {
        if(checkDescendents) {
          this._doResizeNotifyDomChildren(domNode, child, true)
        }
      }
    }
  }
};
AdfDhtmlPage.prototype.addPropertyChangeListener = function(instance, listener) {
  AdfAssert.assertFunction(listener);
  this._propertyChangeListeners = AdfEventUtils.addListener(this._propertyChangeListeners, instance, listener)
};
AdfDhtmlPage.prototype.removePropertyChangeListener = function(instance, listener) {
  AdfAssert.assertFunction(listener);
  this._propertyChangeListeners = AdfEventUtils.removeListener(this._propertyChangeListeners, listener, instance)
};
AdfDhtmlPage.prototype.__addPopupInfo = function(component, popupInfo) {
  var clientId = component.getClientId();
  var popupId = popupInfo["popupId"];
  var popupInfos = this._poppedUpComponentInfo[clientId];
  if(!popupInfos) {
    this._poppedUpComponentInfo[clientId] = popupInfos = {}
  }
  popupInfos[popupId] = popupInfo;
  var editableSubtree = this.getEditableSubtree();
  if(editableSubtree) {
    var agent = AdfAgent.AGENT;
    var editableElement = agent.getElementById(editableSubtree.getClientId());
    var anchorElement = agent.getElementById(popupInfo["anchorId"]);
    if(anchorElement && AdfDhtmlPopupWindow.isAncestorOrSelf(editableElement, anchorElement)) {
      popupInfo["madeEditable"] = true;
      var popupContent = popupInfo["contentDom"];
      this._filterEditableSubtree(popupContent, this._editableCallback, this._editableCallbackContext);
      AdfAgent.AGENT.addEventCaptures(popupContent, AdfDhtmlPage._inlineSelectionStub);
      AdfDomUtils.addCSSClassName(popupContent, "p_AFActiveInlineEditableContainer");
      AdfAgent.AGENT.setOpacity(popupContent, 100)
    }
  }
};
AdfDhtmlPage.prototype.__removePopupInfo = function(component, popupId) {
  var clientId = component.getClientId();
  var poppedUpComponentInfo = this._poppedUpComponentInfo;
  var popupInfos = poppedUpComponentInfo[clientId];
  var popupInfo = popupInfos[popupId];
  if(popupInfo["madeEditable"]) {
    var popupContent = popupInfo["contentDom"];
    if(popupContent) {
      AdfAgent.AGENT.removeEventCaptures(popupContent, AdfDhtmlPage._inlineSelectionStub);
      AdfDomUtils.removeCSSClassName(popupContent, "p_AFActiveInlineEditableContainer")
    }
  }
  delete popupInfos[popupId];
  if(AdfCollections.isEmpty(popupInfos)) {
    delete poppedUpComponentInfo[clientId]
  }
};
AdfDhtmlPage.prototype.getSelectedEditingComponents = function() {
  var selectedClientIds = this._selectedEditingComponents;
  var selectedComponents = null;
  if(selectedClientIds) {
    selectedComponents = [];
    var selectionCount = selectedClientIds.length;
    for(var selectionIndex = 0;selectionIndex < selectionCount;selectionIndex++) {
      var selectedClientId = selectedClientIds[selectionIndex];
      var selectedComponent = this.findComponent(selectedClientId);
      if(selectedComponent) {
        selectedComponents.push(selectedComponent)
      }
    }
  }
  return selectedComponents
};
AdfDhtmlPage.prototype.setSelectedEditingComponents = function(newSelection) {
  AdfAssert.assertArrayOrNull(newSelection);
  var editableSubtrees = this._getEditableSubtrees(this._editableSubtreeId, false);
  var validSelection = [];
  for(var i = 0;i < editableSubtrees.length;i++) {
    var editableSubtreeDom = editableSubtrees[i];
    var currIntersectedSelection = this._intersectSelectionWithEditableSubtreeDom(editableSubtreeDom, newSelection);
    if(currIntersectedSelection) {
      var intersectedItemCount = currIntersectedSelection.length;
      for(var itemIndex = 0;itemIndex < intersectedItemCount;itemIndex++) {
        validSelection.push(currIntersectedSelection[itemIndex])
      }
    }
  }
  this._setSelectedEditingComponents(validSelection)
};
AdfDhtmlPage.prototype.getEditableSubtree = function() {
  var editableSubtreeId = this._editableSubtreeId;
  return editableSubtreeId != null ? this.findComponent(editableSubtreeId) : null
};
AdfDhtmlPage.prototype.setEditableSubtreeFilter = function(callback, context) {
  AdfAssert.assertFunctionOrNull(callback);
  this._editableCallback = callback;
  this._editableCallbackContext = context;
  var editableSubtreeId = this._editableSubtreeId;
  if(editableSubtreeId != null) {
    var editableSubtrees = this._getEditableSubtrees(editableSubtreeId, true);
    for(var i = 0;i < editableSubtrees.length;i++) {
      var editableSubtreeDom = editableSubtrees[i];
      this._unfilterEditableSubtree(editableSubtreeDom);
      this._filterEditableSubtree(editableSubtreeDom, callback, context)
    }
  }
};
AdfDhtmlPage.prototype._getEditableSubtrees = function(subtreeId, returnAnchors) {
  var subtrees = [];
  var agent = AdfAgent.AGENT;
  var subtreeDom = agent.getElementById(subtreeId);
  if(subtreeDom) {
    subtrees.push(subtreeDom);
    var poppedUpComponentInfo = this._poppedUpComponentInfo;
    for(var componentId in poppedUpComponentInfo) {
      var popupInfos = poppedUpComponentInfo[componentId];
      for(var popupId in popupInfos) {
        var currPopupInfo = popupInfos[popupId];
        var anchorId = currPopupInfo["anchorId"];
        var anchorDom = agent.getElementById(anchorId);
        if(anchorDom && AdfDhtmlPopupWindow.isAncestorOrSelf(subtreeDom, anchorDom)) {
          var pushedPopup = returnAnchors ? anchorDom : currPopupInfo["contentDom"];
          subtrees.push(pushedPopup)
        }
      }
    }
  }
  return subtrees
};
AdfDhtmlPage.prototype._unfilterEditableSubtree = function(subtree) {
  AdfAssert.assertDomElement(subtree);
  var subtreeId = subtree.id;
  if(subtreeId && this.findComponent(subtreeId)) {
    AdfDomUtils.removeCSSClassName(subtree, AdfDhtmlPage._SELECTABLE_STYLE);
    AdfDomUtils.removeCSSClassName(subtree, AdfDhtmlPage._EDITABLE_STYLE)
  }
  var currChild = subtree.firstChild;
  while(currChild) {
    if(currChild.nodeType == 1) {
      this._unfilterEditableSubtree(currChild)
    }
    currChild = currChild.nextSibling
  }
};
AdfDhtmlPage.prototype._getFilterResult = function(component, filterFunction, filterContext) {
  if(component.satisfiesUsage(AdfUIComponent.USAGE_PRIVATE_CHILD)) {
    return AdfRichInlineEditor.FILTER_UNSELECTABLE
  }else {
    if(filterFunction) {
      return filterFunction.call(filterContext, component)
    }else {
      return AdfRichInlineEditor.FILTER_EDITABLE
    }
  }
};
AdfDhtmlPage.prototype._filterComponent = function(component, domElement, filterFunction, filterContext) {
  var filterResult = this._getFilterResult(component, filterFunction, filterContext);
  if(filterResult) {
    var styleClass = AdfDhtmlPage._SELECTABLE_STYLE;
    if(filterResult == AdfRichInlineEditor.FILTER_EDITABLE) {
      var inlineEditor = component.getPeer().getInlineEditor(component, null);
      if(inlineEditor && inlineEditor.preEdit(component)) {
        styleClass = AdfDhtmlPage._EDITABLE_STYLE
      }
    }
    AdfDomUtils.addCSSClassName(domElement, styleClass)
  }
};
AdfDhtmlPage.prototype._getClientIdFromComment = function(comment) {
  var commentText = comment.nodeValue;
  if("compS|" == commentText.substring(0, 6)) {
    return commentText.substr(6)
  }else {
    return null
  }
};
AdfDhtmlPage.prototype._getComponentFromComment = function(comment) {
  var clientId = this._getClientIdFromComment(comment);
  if(clientId) {
    return this.findComponent(clientId)
  }else {
    return null
  }
};
AdfDhtmlPage.prototype._filterEditableSubtree = function(subtree, filterFunction, filterContext) {
  AdfAssert.assertDomElement(subtree);
  var subtreeId = subtree.id;
  if(subtreeId) {
    var component = this.findComponent(subtreeId);
    if(component) {
      this._filterComponent(component, subtree, filterFunction, filterContext)
    }
  }
  var currChild = subtree.firstChild;
  while(currChild) {
    var nodeType = currChild.nodeType;
    if(nodeType == 1) {
      this._filterEditableSubtree(currChild, filterFunction, filterContext)
    }else {
      if(nodeType == 8) {
        var nonElementComponent = this._getComponentFromComment(currChild);
        if(nonElementComponent) {
          var nextElement = currChild.nextSibling;
          while(nextElement && nextElement.nodeType != 1) {
            nextElement = nextElement.nextSibling
          }
          if(nextElement) {
            this._filterComponent(nonElementComponent, nextElement, filterFunction, filterContext)
          }
        }
      }
    }
    currChild = currChild.nextSibling
  }
};
AdfDhtmlPage.prototype.setEditableSubtree = function(newEditableSubtree) {
  AdfAssert.assertPrototypeOrNull(newEditableSubtree, AdfUIComponent);
  var oldEditableSubtreeId = this._editableSubtreeId;
  var newEditableSubtreeId = newEditableSubtree ? newEditableSubtree.getClientId() : null;
  if(newEditableSubtreeId != oldEditableSubtreeId) {
    var oldEditableSubtree;
    var oldEditableSubtrees = this._getEditableSubtrees(oldEditableSubtreeId, true);
    var oldEditableSubtreeCount = oldEditableSubtrees.length;
    if(oldEditableSubtreeCount) {
      oldEditableSubtree = oldEditableSubtrees[0];
      for(var i = 0;i < oldEditableSubtreeCount;i++) {
        var oldSubtreeDom = oldEditableSubtrees[i];
        AdfAgent.AGENT.removeEventCaptures(oldSubtreeDom, AdfDhtmlPage._inlineSelectionStub);
        AdfDomUtils.removeCSSClassName(oldSubtreeDom, "p_AFActiveInlineEditableContainer");
        this._unfilterEditableSubtree(oldSubtreeDom)
      }
    }
    this._editableSubtreeId = newEditableSubtreeId;
    var newEditableSubtrees = this._getEditableSubtrees(newEditableSubtreeId, true);
    var editableSubtreeCount = newEditableSubtrees.length;
    var newSelection;
    if(editableSubtreeCount) {
      newSelection = this._intersectSelectionWithEditableSubtree(newEditableSubtree, this._selectedEditingComponents);
      for(i = 0;i < editableSubtreeCount;i++) {
        var newSubtreeDom = newEditableSubtrees[i];
        if(newSubtreeDom) {
          this._filterEditableSubtree(newSubtreeDom, this._editableCallback, this._editableCallbackContext);
          AdfAgent.AGENT.addEventCaptures(newSubtreeDom, AdfDhtmlPage._inlineSelectionStub);
          AdfDomUtils.addCSSClassName(newSubtreeDom, "p_AFActiveInlineEditableContainer")
        }
      }
    }
    this._setSelectedEditingComponents(newSelection);
    AdfEventUtils.firePropertyChangeEvent(this._propertyChangeListeners, this, AdfPage.EDITABLE_SUBTREE_PROPERTY, oldEditableSubtree, newEditableSubtree)
  }
};
AdfDhtmlPage.prototype.getEditedComponent = function() {
  var editedComponentId = this._editedComponentId;
  return editedComponentId != null ? this.findComponent(editedComponentId) : null
};
AdfDhtmlPage.prototype.setEditedComponent = function(newEditedComponent, event) {
  AdfAssert.assertPrototypeOrNull(newEditedComponent, AdfUIComponent);
  var newEditedComponentId;
  if(newEditedComponent != null) {
    newEditedComponentId = newEditedComponent.getClientId();
    var newEditedComponentElement = AdfRichUIPeer.getDomContentElementForComponent(newEditedComponent);
    if(!AdfDomUtils.containsCSSClassName(newEditedComponentElement, AdfDhtmlPage._EDITABLE_STYLE)) {
      newEditedComponentId = null;
      if(!AdfDomUtils.containsCSSClassName(newEditedComponentElement, AdfDhtmlPage._SELECTABLE_STYLE)) {
        newEditedComponent = null
      }
    }
  }else {
    newEditedComponentId = null
  }
  var newInlineEditor = null;
  if(newEditedComponentId != null) {
    newInlineEditor = newEditedComponent.getPeer().getInlineEditor(newEditedComponent, event);
    if(newInlineEditor == null) {
      newEditedComponentId = null;
      newEditedComponent = null
    }
  }
  var oldEditedComponentId = this._editedComponentId;
  var oldEditedComponent;
  if(oldEditedComponentId != newEditedComponentId) {
    oldEditedComponent = this.getEditedComponent();
    var oldInlineEditor = this._inlineEditor;
    if(oldInlineEditor != null) {
      oldInlineEditor.stopEdit()
    }
    this._editedComponentId = newEditedComponentId;
    this._inlineEditor = newInlineEditor
  }else {
    oldEditedComponent = newEditedComponent
  }
  if(newEditedComponent) {
    this.setSelectedEditingComponents([newEditedComponent])
  }
  if(oldEditedComponent != newEditedComponent) {
    if(newInlineEditor != null) {
      newInlineEditor.startEdit(newEditedComponent, event)
    }
    AdfEventUtils.firePropertyChangeEvent(this._propertyChangeListeners, this, AdfPage.EDITED_COMPONENT_PROPERTY, oldEditedComponent, newEditedComponent)
  }
};
AdfDhtmlPage.prototype.getDataTransferService = function(noCreate, adsDTS, uploadDTS) {
  var dts;
  if(adsDTS) {
    dts = this._adsDataTransferService
  }else {
    if(uploadDTS) {
      dts = this._uploadDataTransferService
    }else {
      dts = this._dataTransferService
    }
  }
  if(dts == null) {
    if(noCreate) {
      return null
    }
    if(this.isAttachmentMode()) {
      dts = new AdfOfflineDataTransferService(domWindow)
    }else {
      var domWindow = this.getDomWindow();
      dts = new AdfXmlHttpDataTransferService(domWindow)
    }
    if(adsDTS) {
      this._adsDataTransferService = dts
    }else {
      if(uploadDTS) {
        this._uploadDataTransferService = dts
      }else {
        this._dataTransferService = dts
      }
    }
    dts.addStateChangeListener(this._dtsStateChanged, this)
  }
  return dts
};
AdfDhtmlPage.prototype.getAutoDismissalManager = function() {
  this.__ensureCoreBackgroundLoaded();
  var autoDismissalManager = this._autoDismissalManager;
  if(autoDismissalManager == null) {
    this._autoDismissalManager = autoDismissalManager = new AdfAutoDismissalManager
  }
  return autoDismissalManager
};
AdfDhtmlPage.prototype.getModalityManager = function() {
  this.__ensureCoreBackgroundLoaded();
  var modalityManager = this._modalityManager;
  if(modalityManager == null) {
    this._modalityManager = modalityManager = new AdfDhtmlModalityManager
  }
  return modalityManager
};
AdfDhtmlPage.prototype.getPositionManager = function() {
  this.__ensureCoreBackgroundLoaded();
  var positionManager = this._positionManager;
  if(positionManager == null) {
    this._positionManager = positionManager = new AdfDhtmlPositionManager
  }
  return positionManager
};
AdfDhtmlPage.prototype.getZOrderManager = function() {
  this.__ensureCoreBackgroundLoaded();
  var zOrderManager = this._zOrderManager;
  if(zOrderManager == null) {
    this._zOrderManager = zOrderManager = new AdfDhtmlZOrderManager
  }
  return zOrderManager
};
AdfDhtmlPage.prototype.scheduleTimer = function(context, callback, state, delay, options) {
  AdfAssert.assertFunction(callback);
  AdfAssert.assertNumber(delay);
  var timers = AdfDhtmlPage._timers;
  var timerId = AdfDhtmlPage._nextTimerId++;
  var timerRecord = new Object;
  timerRecord[AdfDhtmlPage.TIMER_CONTEXT] = context;
  timerRecord[AdfDhtmlPage.TIMER_STATE] = state;
  timerRecord[AdfDhtmlPage.TIMER_CALLBACK] = callback;
  timerRecord[AdfDhtmlPage.TIMER_ID] = timerId;
  if(options && options[AdfDhtmlPage.TIMER_IS_SYNCHRONIZED] && (options[AdfDhtmlPage.TIMER_IS_SYNCHRONIZED] === "true" || options[AdfDhtmlPage.TIMER_IS_SYNCHRONIZED] === true)) {
    timerRecord[AdfDhtmlPage.TIMER_IS_SYNCHRONIZED] = true
  }
  timers[timerId] = timerRecord;
  timerRecord[AdfDhtmlPage.TIMER_DOM_ID] = this.getDomWindow().setTimeout("AdfDhtmlPage.__callTimerCallback(" + timerId + ");", delay);
  return timerId
};
AdfDhtmlPage.prototype.rescheduleTimer = function(timerId, delay) {
  AdfAssert.assertNumeric(timerId);
  AdfAssert.assertNumber(delay);
  timerId = timerId.valueOf();
  var timerRecord = AdfDhtmlPage._timers[timerId];
  if(timerRecord != null) {
    window.clearTimeout(timerRecord[AdfDhtmlPage.TIMER_DOM_ID]);
    timerRecord[AdfDhtmlPage.TIMER_DOM_ID] = this.getDomWindow().setTimeout("AdfDhtmlPage.__callTimerCallback(" + timerId + ");", delay)
  }else {
    AdfLogger.LOGGER.warning("Attempt to reschedule unknown timerId:", timerId)
  }
};
AdfDhtmlPage.prototype.cancelTimer = function(timerId) {
  AdfAssert.assertNumeric(timerId);
  timerId = timerId.valueOf();
  var timers = AdfDhtmlPage._timers;
  var timerRecord = timers[timerId];
  if(timerRecord != null) {
    this.getDomWindow().clearTimeout(timerRecord[AdfDhtmlPage.TIMER_DOM_ID]);
    delete timers[timerId]
  }else {
    AdfLogger.LOGGER.warning("Attempt to cancel unknown timerId:", timerId)
  }
};
AdfDhtmlPage.prototype._disposeTimers = function() {
  var timers = AdfDhtmlPage._timers;
  AdfDhtmlPage._timers = null;
  var theWindow = this.getDomWindow();
  for(var timerId in timers) {
    var timerRecord = timers[timerId];
    if(timerRecord != null) {
      try {
        theWindow.clearTimeout(timerRecord[AdfDhtmlPage.TIMER_DOM_ID])
      }catch(e) {
      }
    }
  }
};
AdfDhtmlPage.prototype._areSynchronousTimersCleared = function() {
  var timers = AdfDhtmlPage._timers;
  for(var timerId in timers) {
    var timerRecord = timers[timerId];
    if(timerRecord != null && timerRecord[AdfDhtmlPage.TIMER_IS_SYNCHRONIZED]) {
      return false
    }
  }
  return true
};
AdfDhtmlPage.__callTimerCallback = function(timerId) {
  AdfAssert.assertNumber(timerId);
  var timers = AdfDhtmlPage._timers;
  if(timers == null) {
    return
  }
  var timerRecord = timers[timerId];
  if(timerRecord == null) {
    return
  }
  var nextDelay;
  try {
    nextDelay = timerRecord[AdfDhtmlPage.TIMER_CALLBACK].call(timerRecord[AdfDhtmlPage.TIMER_CONTEXT], timerRecord[AdfDhtmlPage.TIMER_STATE])
  }catch(e) {
    AdfLogger.LOGGER.logErrorAsWarning(e, " when calling timer callback")
  }
  AdfAssert.assertNumberOrNull(nextDelay);
  if(nextDelay == undefined || nextDelay < 0) {
    delete timers[timerId]
  }else {
    timerRecord[AdfDhtmlPage.TIMER_DOM_ID] = AdfPage.PAGE.getDomWindow().setTimeout("AdfDhtmlPage.__callTimerCallback(" + timerId + ");", nextDelay)
  }
};
AdfDhtmlPage.prototype._getAndClearDeltas = function(doClear) {
  var changedComponents = this.GetChangedComponents();
  if(changedComponents == null) {
    return null
  }
  var encodedChanges = new Array(50);
  var hasStartMap = false;
  var commaString = AdfStrings.COMMA;
  var equalsString = AdfStrings.EQUALS;
  var startCurlyBracketString = AdfStrings.START_CURLY_BRACKET;
  var closeCurlyBracketString = AdfStrings.CLOSE_CURLY_BRACKET;
  var equalsStartCurlyBracketString = "\x3d{";
  for(var key in changedComponents) {
    var component = changedComponents[key];
    if(!component.getPeer()) {
      var clientId = component.getClientId();
      var newInstance = this.findComponent(clientId);
      if(newInstance) {
        component = newInstance
      }
    }
    var hasChanges = false;
    var propChanges = component.GetChanges();
    for(var propName in propChanges) {
      if(!hasChanges) {
        if(!hasStartMap) {
          encodedChanges.push(startCurlyBracketString);
          hasStartMap = true
        }else {
          encodedChanges.push(commaString)
        }
        encodedChanges.push(component.getClientId());
        encodedChanges.push(equalsStartCurlyBracketString);
        hasChanges = true
      }else {
        encodedChanges.push(commaString)
      }
      var propValue = propChanges[propName];
      var propName1 = propName;
      var suffixPosition = propName.length - 2;
      if(propName.lastIndexOf(AdfUIComponent._FLAG_PERSISTENCE) == suffixPosition) {
        propName1 = propName.substr(0, suffixPosition)
      }
      if(null != propValue) {
        if(propValue instanceof Date) {
          propValue = AdfAgent.AGENT.toISOString(propValue)
        }else {
          propValue = propValue.toString().replace(/\{/g, "%7B").replace(/\}/g, "%7D").replace(/\,/g, "%2C").replace(/\=/g, "%3D")
        }
      }
      encodedChanges.push(propName);
      encodedChanges.push(equalsString);
      encodedChanges.push(propValue)
    }
    if(hasChanges) {
      encodedChanges.push(closeCurlyBracketString)
    }
  }
  if(hasStartMap) {
    encodedChanges.push(closeCurlyBracketString)
  }
  if(doClear) {
    this.ClearChangesList()
  }
  return encodedChanges.join("")
};
AdfDhtmlPage.prototype.getResourceURL = function(path) {
  if(path.substring(0, 2) == "//") {
    return path.substring(1)
  }else {
    if(path.charAt(0) == "/") {
      return this._baseResourceUrl + path
    }else {
      return path
    }
  }
};
AdfDhtmlPage.prototype.removeResourceURL = function(resourcePath) {
  var baseResourceURL = this._baseResourceUrl;
  var startIndex = resourcePath.indexOf(baseResourceURL);
  if(startIndex >= 0) {
    return resourcePath.substr(startIndex + baseResourceURL.length)
  }else {
    if(resourcePath.charAt(0) == "/") {
      return"/" + resourcePath
    }else {
      return resourcePath
    }
  }
};
AdfDhtmlPage._disposeIFrames = function(domDocument) {
  var iFrames = domDocument.getElementsByTagName("iframe");
  for(var f = iFrames.length - 1;f >= 0;f--) {
    var iFrame = iFrames[f];
    iFrame.parentNode.removeChild(iFrame)
  }
};
AdfDhtmlPage._forceGC = function(count) {
  var theArray = new Array(count);
  for(var i = 0;i < count;i++) {
    var innerCount = 1E4;
    var innerArray = new Array(innerCount);
    for(var j = 0;j < innerCount;j++) {
      innerArray[j] = j
    }
    theArray[i] = innerArray
  }
};
AdfDhtmlPage.prototype._onSelectStart = function() {
  if(this.isDragging()) {
    return false
  }
  var dndContext = this.getDnDContext();
  return!(dndContext && dndContext.isDragging())
};
AdfDhtmlPage.prototype._handleResize = function() {
  if(AdfAgent.AGENT.getPlatform() == AdfAgent.IE_PLATFORM) {
    if(!this._resizePending) {
      this._resizePending = true;
      setTimeout(this._getDelayedResizeCallback(), AdfDhtmlPage._DELAYED_RESIZE_TIMEOUT)
    }
  }else {
    this._onResize()
  }
};
AdfDhtmlPage.prototype._getDelayedResizeCallback = function() {
  if(!this._delayedResizeCallback) {
    this._delayedResizeCallback = this.createCallback(this._delayedOnResize)
  }
  return this._delayedResizeCallback
};
AdfDhtmlPage.prototype._delayedOnResize = function() {
  this._resizePending = false;
  this._onResize()
};
AdfDhtmlPage.prototype._onResize = function() {
  if(this.getPhase() != AdfPage.CREATE_VIEW_PHASE) {
    this._positionGlassPane(false);
    var resizeId = AdfDhtmlPage._BROWSER_RESIZE_CHECKPOINT.start();
    AdfDhtmlPage._doResizeNotify(this._resizeNotifyTree, false);
    AdfDhtmlPage._BROWSER_RESIZE_CHECKPOINT.stop(resizeId)
  }
};
AdfDhtmlPage.prototype.startDrag = function(evt, moveCallback, dropCallback, abortCallback, showGlassPane) {
  var agent = AdfAgent.AGENT;
  var pos = agent.getMousePosition(evt);
  this._dragStartX = pos.x;
  this._dragStartY = pos.y;
  this._dragLastX = this._dragStartX;
  this._dragLastY = this._dragStartY;
  this._moveCallback = moveCallback;
  this._dropCallback = dropCallback;
  this._abortCallback = abortCallback;
  this._dragHideGlassPane = showGlassPane;
  if(showGlassPane) {
    this.showGlassPane(this._dragDropCallbacks, "auto")
  }else {
    var callbacks = this._dragDropCallbacks;
    agent.startMouseEventCapture(callbacks);
    this._keyCaptureState = agent.startDocumentKeyEventCapture(callbacks, this._document.documentElement)
  }
};
AdfDhtmlPage.prototype._dragMouseMove = function(evt) {
  var moveCallback = this._moveCallback;
  var pos = AdfAgent.AGENT.getMousePosition(evt);
  if(moveCallback) {
    moveCallback(evt, pos.x - this._dragLastX, pos.y - this._dragLastY)
  }
  this._dragLastX = pos.x;
  this._dragLastY = pos.y
};
AdfDhtmlPage.prototype._dragMouseUp = function(evt) {
  var dropCallback = this._dropCallback;
  var pos = AdfAgent.AGENT.getMousePosition(evt);
  this.stopDrag();
  if(dropCallback) {
    dropCallback(evt, pos.x - this._dragStartX, pos.y - this._dragStartY)
  }
  this._dragLastX = pos.x;
  this._dragLastY = pos.y
};
AdfDhtmlPage.prototype._dragKeyDown = function(evt) {
  if(evt.keyCode == AdfKeyStroke.ESC_KEY) {
    var abortCallback = this._abortCallback;
    if(abortCallback) {
      this.stopDrag();
      abortCallback();
      AdfAgent.AGENT.eatEvent(evt);
      return false
    }
  }
};
AdfDhtmlPage.prototype.stopDrag = function() {
  if(this._dragHideGlassPane) {
    this.hideGlassPane(this._dragDropCallbacks)
  }else {
    var agent = AdfAgent.AGENT;
    var callbacks = this._dragDropCallbacks;
    agent.stopMouseEventCapture(callbacks);
    var keyCaptureState = agent.getPlatform() == AdfAgent.IE_PLATFORM ? this._keyCaptureState : null;
    delete this._keyCaptureState;
    agent.endDocumentKeyEventCapture(callbacks, this._document.documentElement, keyCaptureState)
  }
  this._moveCallback = null;
  this._dropCallback = null;
  this._abortCallback = null
};
AdfDhtmlPage.prototype.isDragging = function() {
  return this._moveCallback ? true : false
};
AdfDhtmlPage.prototype.setOnLoadCallback = function(onLoadCallback) {
  this._onLoadCallback = onLoadCallback
};
AdfDhtmlPage.prototype.preloadImages = function() {
  this._preloadImages = true
};
AdfDhtmlPage.prototype.getActiveComponentId = function() {
  return this._activeComponentId
};
AdfDhtmlPage.prototype._setActiveComponentId = function(clientId) {
  var domElement = clientId != null ? AdfAgent.AGENT.getElementById(clientId) : null;
  this.__setActiveDomNodeInfo(domElement, clientId)
};
AdfDhtmlPage.prototype.getActiveDomElement = function() {
  return this._activeDomNode
};
AdfDhtmlPage.prototype.getActiveComponent = function() {
  var activeComponentId = this._activeComponentId;
  return activeComponentId != null ? this.findComponent(activeComponentId) : null
};
AdfDhtmlPage.prototype.__setActiveDomNodeInfo = function(domNode, clientId) {
  AdfAssert.assertDomNodeOrNull(domNode);
  AdfAssert.assertStringOrNull(clientId);
  if(domNode === undefined) {
    domNode = null
  }
  var oldActiveComponent = this.getActiveComponent();
  var oldActiveNode = this._activeDomNode;
  if(AdfAgent.AGENT.getPlatform() == AdfAgent.IE_PLATFORM && oldActiveNode && domNode && domNode.tagName == "BODY") {
    var zOrderManager = this.getZOrderManager();
    if(zOrderManager.containsElement(oldActiveNode)) {
      AdfFocusUtils.focusElementDelayed(oldActiveNode, 1);
      return false
    }
  }
  this._activeDomNode = domNode;
  this._activeComponentId = clientId;
  AdfEventUtils.firePropertyChangeEvent(this._propertyChangeListeners, this, AdfDhtmlPage.ACTIVE_DOM_ELEMENT_PROPERTY, oldActiveNode, domNode);
  AdfEventUtils.firePropertyChangeEvent(this._propertyChangeListeners, this, AdfPage.ACTIVE_COMPONENT_PROPERTY, oldActiveComponent, this.getActiveComponent());
  return true
};
AdfDhtmlPage.prototype.queueEvent = function(event) {
  if(event) {
    AdfAssert.assertPrototype(event, AdfBaseEvent);
    var type = event.getType();
    if(this._partialRequestRedirect == true && AdfRedirectEvent.REDIRECT_EVENT_TYPE != type) {
      AdfLogger.LOGGER.info("Redirect in progress... refusing to queue event : ", event);
      return
    }
    if(AdfValueChangeEvent.VALUE_CHANGE_TYPE == type || AdfSubmittedValueChangedEvent.SUBMITTED_VALUE_CHANGED_TYPE == type) {
      this._dirtyStateService.__handleValueChangeEvent(event)
    }
    if(event.propagatesToServer() == true) {
      if(this._haveOutstandingPPRRequest !== undefined && this._haveOutstandingPPRRequest == true) {
        this.__perfTimings(false, false, true, "user click event : ", event)
      }else {
        this.__perfTimings(true, true, true, "user click event: ", event)
      }
    }
    if(AdfDhtmlPage._MSG_RESET_CLIENT_AND_SERVER === this._globalMessagesResetStrategy && event.getClearMessages()) {
      AdfLogger.LOGGER.fine("Page level messages cleared by the following event: ", event);
      var globalMessageKey = this._resolveMessageComponentId(null, false);
      AdfPage.PAGE.clearMessages(globalMessageKey)
    }
    if(event.isValidationNeeded()) {
      AdfLogger.LOGGER.fine("Client validation triggered by the following event: ", event);
      var sourceComponent = event.getSource();
      var isImmediate = event.isImmediate();
      if(!this._processValidators(sourceComponent, sourceComponent.getEventRoots(event), isImmediate)) {
        event.cancel();
        this.showMessages();
        AdfLogger.LOGGER.info("Client validation failed. The following event that triggered the validation was not queued as a result: ", event);
        return
      }
    }
    this._eventQueue.push(event);
    if(this.getPhase() != AdfPage.DELIVER_EVENTS_PHASE) {
      this.__queueEventTimerIfNeeded()
    }
  }
};
AdfDhtmlPage.prototype.__queueEventTimerIfNeeded = function(timeout) {
  this._updateDeliveryTimer(timeout)
};
AdfDhtmlPage.prototype.queueEventToServer = function(event) {
  AdfAssert.assert(!this._inDeliverQueuedServerEvents);
  if(event) {
    AdfAssert.assertPrototype(event, AdfBaseEvent);
    if(this._partialRequestRedirect == true && AdfRedirectEvent.REDIRECT_EVENT_TYPE != event.getType()) {
      AdfLogger.LOGGER.info("Redirect in progress... refusing to queue event : ", event);
      return
    }
    if(event.isResponseExpected() && event.getMaxTimeBeforePropagation() == 0) {
      var sourceComponent = event.getSource();
      var clientId = sourceComponent.getClientId();
      var busyCounts = this._busyCounts;
      var currBusyCount = busyCounts[clientId];
      if(!currBusyCount) {
        currBusyCount = 0;
        if(sourceComponent.getPeer()) {
          sourceComponent.getPeer().setBusy(sourceComponent, true)
        }
      }
      busyCounts[clientId] = currBusyCount + 1
    }
    this._serverQueue.push(event);
    if(this.getPhase() != AdfPage.DELIVER_EVENTS_PHASE) {
      this.__queueEventTimerIfNeeded()
    }
  }
};
AdfDhtmlPage.__setNonHtmlResponse = function(event) {
  event.forceFullSubmit();
  event.noResponseExpected()
};
AdfDhtmlPage.__setNonHtmlResponsePartialSubmit = function(event) {
  event.setPartial(true);
  event.noResponseExpected()
};
AdfDhtmlPage.__scrollComponentIntoView = function(clientId, focus) {
  AdfPage.PAGE.scheduleTimer(AdfPage.PAGE, AdfDhtmlPage._scrollComponentIntoView, {clientId:clientId, focus:focus}, 100)
};
AdfDhtmlPage._scrollComponentIntoView = function(argObj) {
  AdfPage.PAGE.findComponent(argObj.clientId).scrollIntoView(argObj.focus)
};
AdfDhtmlPage.prototype._processValidators = function(sourceComponent, eventRoots, onlyImmediate) {
  var isValid = true;
  if(eventRoots == null) {
    return isValid
  }
  var id = sourceComponent.getClientId();
  var colonIndex = id.lastIndexOf(":");
  var eventSourceSubformIds = new Array;
  while(colonIndex > 0) {
    id = id.substring(0, colonIndex);
    var ancestor = this.findComponent(id);
    if(ancestor != null && ancestor instanceof AdfRichSubform) {
      eventSourceSubformIds.push(id)
    }
    colonIndex = id.lastIndexOf(":")
  }
  for(index = 0;index < eventRoots.length;index++) {
    var rootComponent = eventRoots[index];
    var children = new Array(rootComponent);
    if(!rootComponent) {
      continue
    }
    children = rootComponent.getDescendantComponents(children);
    for(var index = 0;children && index < children.length;index++) {
      var currComponent = children[index];
      if(currComponent != null && currComponent instanceof AdfUIEditableValue) {
        if(onlyImmediate && !currComponent.getImmediate()) {
          continue
        }
        var tempSubformId = currComponent.getClientId();
        colonIndex = tempSubformId.lastIndexOf(":");
        var currCompSubformId = null;
        while(colonIndex > 0) {
          tempSubformId = tempSubformId.substring(0, colonIndex);
          var ancestor = this.findComponent(tempSubformId);
          if(ancestor != null && ancestor instanceof AdfRichSubform) {
            currCompSubformId = tempSubformId;
            break
          }
          colonIndex = tempSubformId.lastIndexOf(":")
        }
        var shouldValidate = true;
        if(currCompSubformId != null) {
          var numSubforms = eventSourceSubformIds.length;
          if(numSubforms > 0) {
            for(subformIdIndex = 0;subformIdIndex < numSubforms;subformIdIndex++) {
              if(currCompSubformId == eventSourceSubformIds[subformIdIndex]) {
                break
              }else {
                if(subformIdIndex == numSubforms - 1) {
                  shouldValidate = false
                }
              }
            }
          }else {
            if(this.findComponent(currCompSubformId).getDefault() == false) {
              shouldValidate = false
            }
          }
        }
        if(shouldValidate) {
          if(currComponent.getValid() == true) {
            if(currComponent.getRequired()) {
              var currDomElement = AdfRichUIPeer.getDomElementForComponent(currComponent);
              if(AdfDomUtils.isInVisibleSubtree(currDomElement)) {
                currComponent.validate();
                if(currComponent.getValid() == false) {
                  isValid = false
                }
              }
            }
          }else {
            var currDomElement = AdfRichUIPeer.getDomElementForComponent(currComponent);
            if(AdfDomUtils.isInVisibleSubtree(currDomElement)) {
              var currClientId = currComponent.getClientId();
              if(this.hasMessages(currClientId)) {
                isValid = false
              }else {
                currComponent.validate();
                if(!currComponent.getValid()) {
                  if(this.hasMessages(currClientId)) {
                    isValid = false
                  }else {
                    AdfLogger.LOGGER.severe("AdfDhtmlPage._processValidators: Ignoring that the component with the id '" + currClientId + "' is invalid because there are no messages to show the user.")
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  return isValid
};
AdfDhtmlPage._timerDeliverEvents = function() {
  var instance = AdfPage.PAGE;
  instance._eventDispatcherID = undefined;
  instance._eventDispatcherTargetTime = undefined;
  if(instance._inHandleRichResponse || instance._inDeliverQueuedEvents || instance._inDeliverQueuedServerEvents) {
    instance._updateDeliveryTimer()
  }else {
    instance._deliverAllQueuedEvents();
    var timeout = instance._serverQueue.getWaitingTimeout();
    if(timeout >= 0) {
      instance._updateDeliveryTimer(timeout)
    }
  }
};
AdfDhtmlPage.prototype._updateDeliveryTimer = function(timeout) {
  if(timeout === undefined || timeout < 50) {
    timeout = 50
  }
  var alreadySet = false;
  var targetTime = (new Date).getTime() + timeout;
  if(this._eventDispatcherID !== undefined) {
    AdfAssert.assert(this._eventDispatcherTargetTime !== undefined);
    if(this._eventDispatcherTargetTime > targetTime) {
      this.cancelTimer(this._eventDispatcherID)
    }else {
      alreadySet = true
    }
  }
  if(!alreadySet) {
    this._eventDispatcherTargetTime = targetTime;
    var options = {};
    if(timeout <= 15E3) {
      options = {"isSynchronized":"true"}
    }
    this._eventDispatcherID = this.scheduleTimer(this, AdfDhtmlPage._timerDeliverEvents, null, timeout, options)
  }
};
AdfDhtmlPage.prototype._eventLoopDeliverEvents = function() {
  this._deliverAllQueuedEvents();
  var timeout = this._serverQueue.getWaitingTimeout();
  if(timeout >= 0) {
    this._updateDeliveryTimer(timeout)
  }else {
    if(this._eventDispatcherID !== undefined) {
      this.cancelTimer(this._eventDispatcherID);
      this._eventDispatcherID = undefined;
      this._eventDispatcherTargetTime = undefined
    }
  }
};
AdfDhtmlPage.prototype._deliverAllQueuedEvents = function() {
  this._deliverQueuedEvents();
  var dts = this.getDataTransferService();
  if(dts.getDTSState() == AdfDataTransferService.STATE_READY) {
    this._deliverQueuedServerEvents()
  }
};
AdfDhtmlPage.prototype._deliverQueuedEvents = function() {
  if(this._inDeliverQueuedEvents) {
    return
  }
  var eventQueue = this._eventQueue;
  try {
    this._inDeliverQueuedEvents = true;
    do {
      var event = eventQueue.shift();
      if(!event) {
        break
      }
      if(!(event instanceof AdfUIInputEvent)) {
        AdfLogger.LOGGER.fine("Broadcasting:", event)
      }
      event.getSource().broadcast(event)
    }while(true)
  }finally {
    this._inDeliverQueuedEvents = false
  }
};
AdfDhtmlPage.prototype._findFirstAdfForm = function() {
  var forms = this.getDomDocument().forms;
  var n = forms.length;
  for(var i = 0;i < n;i++) {
    var fe = forms[i];
    var feId = fe.id;
    if(feId && this.findComponent(feId)) {
      return fe
    }
  }
  return null
};
AdfDhtmlPage.prototype._deliverQueuedServerEvents = function(checkEventAndDelta, pageUnloading) {
  if(this.isAttachmentMode()) {
    return
  }
  if(this._partialRequestRedirect) {
    return
  }
  if(this.isPerformingFullSubmit()) {
    return
  }
  if(this._inDeliverQueuedServerEvents == true) {
    return
  }
  this._inDeliverQueuedServerEvents = true;
  var hasNoActiveComponents = this.isActiveDataSupported() ? AdfCollections.isEmpty(this.getActiveDataSupport().getActiveComponents()) : true;
  var partialTargets = this._scrubPartialTargets(this._partialTargets);
  var hasActiveDataStart = this._startADSClientIdCount > 0 && this._canReceiveActiveDataCount > 0;
  var hasActiveDataRestart = !hasNoActiveComponents && this._restartAllADSComponents && this._canReceiveActiveDataCount > 0;
  var stopADSClientIds = this._stopADSClientIds;
  var hasActiveDataStartStop = hasActiveDataStart || hasActiveDataRestart || stopADSClientIds.length > 0;
  var hasWindowEvent = this._windowEventHeaderMap != null;
  this._serverQueue.validate();
  var hasEvents = this._serverQueue.hasEventsToDeliver();
  var hasNonEventPayload = partialTargets != null || hasActiveDataStartStop || hasWindowEvent;
  var responseAnnounced = false;
  if(!hasEvents && !hasNonEventPayload && !checkEventAndDelta) {
    this._inDeliverQueuedServerEvents = false;
    return
  }
  var params = {};
  var eventProperties = {};
  var doPartialSubmit = true;
  var formElement = null;
  var formElementFunc = AdfDhtmlPage._getFormElement;
  var commaString = ",";
  var forcePprForActions = 0 != (this.getPPRNavigationOptions() & AdfDhtmlPage.PPR_NAVIGATION_FORCE_PPR);
  var fullSubmitChanged = false;
  if(this.isUserActivityMonitoringOn() && hasNoActiveComponents) {
    var userActivityInfo = AdfUserActivityInfo.getInstance(AdfUserActivityInfo.PRIMARY)
  }
  if(partialTargets != null) {
    var partialTargetsString = partialTargets.join(commaString);
    params[AdfDhtmlPage.PARTIAL_TARGETS_PARAM] = partialTargetsString;
    if(this.isUserActivityMonitoringOn() && hasNoActiveComponents) {
      userActivityInfo.setPprTargets(partialTargetsString)
    }
    formElement = formElementFunc(this.findComponent(partialTargets[0]));
    this._partialTargets = null
  }
  var shouldClearDelta = hasEvents || params[AdfDhtmlPage.PARTIAL_TARGETS_PARAM] != null;
  var deltas = this._getAndClearDeltas(shouldClearDelta);
  if(deltas) {
    params["oracle.adf.view.rich.DELTAS"] = deltas
  }else {
    if(!hasEvents && !hasNonEventPayload) {
      this._inDeliverQueuedServerEvents = false;
      return
    }
  }
  var isUserInputPrevented = false;
  var clientEventsSet = new Object;
  var eventQueue = this._serverQueue.shiftEvents(hasNonEventPayload, deltas);
  var noResponseEvent = null;
  var discreteEvent = null;
  var eventCount = eventQueue.length;
  if(eventCount == 1) {
    var evt = eventQueue[0];
    if(!evt.isResponseExpected()) {
      noResponseEvent = discreteEvent = evt
    }else {
      if(evt.isDeliveryDiscrete()) {
        discreteEvent = evt
      }
    }
  }
  var eventTargets = [];
  var onlyProcess = [];
  var isUserActivityInfoEventSet = false;
  for(var c = eventCount - 1;c >= 0;c--) {
    var currEvent = eventQueue[c];
    var type = currEvent.getType();
    clientEventsSet[type] = type;
    var eventComponent = currEvent.getSource();
    var clientId = eventComponent.getClientId();
    if(!responseAnnounced) {
      responseAnnounced = currEvent.isResponseAnnounced()
    }
    var currFormElement = formElementFunc(eventComponent);
    if(formElement == null) {
      formElement = currFormElement
    }
    if(formElement == currFormElement) {
      if(clientId) {
        if(!(clientId in eventProperties)) {
          eventTargets.push(clientId)
        }
        var eventProps = currEvent.getProperties();
        var list = eventProperties[clientId];
        if(!list) {
          list = [];
          eventProperties[clientId] = list
        }else {
          if(list[type]) {
            continue
          }
        }
        list[type] = true;
        var extraServerParams = currEvent["_adfServerParams"];
        if(extraServerParams) {
          params = AdfCollections.copyInto(extraServerParams, params)
        }
        list.unshift(eventProps);
        if(this.isUserActivityMonitoringOn() && hasNoActiveComponents && !isUserActivityInfoEventSet) {
          userActivityInfo.setEventInfo(currEvent.getType(), clientId, eventComponent.getComponentType(), eventComponent.getAccessibleName())
        }
      }else {
        AdfLogger.LOGGER.severe("Can not post events for ", component, " because it has no clientId")
      }
      var currPartial = currEvent.isPartial() && !currEvent.isFullSubmitForced();
      isUserInputPrevented = isUserInputPrevented || currEvent.IsUserInputPrevented();
      if(forcePprForActions && !currPartial && type == AdfActionEvent.ACTION_EVENT_TYPE && !currEvent.isFullSubmitForced()) {
        currPartial = true;
        fullSubmitChanged = true
      }
      doPartialSubmit &= currPartial
    }else {
      AdfLogger.LOGGER.severe("Only submits to a single form are currently supported")
    }
    var eventRoots = eventComponent.getEventRoots(currEvent);
    if(eventRoots) {
      if(!(onlyProcess === null)) {
        var hasClientId = false;
        for(index = 0;index < eventRoots.length;index++) {
          var eventRootComponent = eventRoots[index];
          var eventRootClientId = eventRootComponent.getClientId();
          hasClientId = hasClientId || clientId == eventRootClientId;
          onlyProcess.push(eventRootClientId)
        }
        if(!hasClientId) {
          onlyProcess.push(clientId)
        }
      }
    }else {
      onlyProcess = null
    }
    if(this.isUserActivityMonitoringOn() && hasNoActiveComponents && !isUserActivityInfoEventSet) {
      var currStartTime = (new Date).getTime().toString();
      userActivityInfo.setClientStartTime(currStartTime);
      AdfUserActivityInfo.saveToSessionStorageByType(AdfUserActivityInfo.PRIMARY);
      params["oracle.adf.view.rich.monitoring.UserActivityInfo"] = AdfUserActivityInfo.getMarshaledObject();
      isUserActivityInfoEventSet = true
    }
  }
  if(eventTargets.length > 0) {
    params["event"] = eventTargets.join(commaString)
  }
  for(var id in eventProperties) {
    params["event." + id] = this._marshallMultipleEventParameters(eventProperties[id])
  }
  var headerParams = null;
  if(hasActiveDataStartStop) {
    headerParams = new Object;
    if(hasActiveDataStart || hasActiveDataRestart) {
      var startADSClientIds;
      if(hasActiveDataRestart) {
        startADSClientIds = this.getActiveDataSupport().getActiveComponents()
      }else {
        startADSClientIds = this._startADSClientIds
      }
      this._startADSClientIds = new Object;
      this._startADSClientIdCount = 0;
      this._restartAllADSComponents = false;
      var startActiveDataArray = new Array;
      var startActiveDataEventIdArray = new Array;
      for(currClientId in startADSClientIds) {
        if(formElement == null) {
          formElement = formElementFunc(this.findComponent(currClientId))
        }
        this.getActiveDataSupport().populateStartActiveDataArray(startActiveDataArray, startActiveDataEventIdArray, currClientId)
      }
      params["oracle.adf.view.rich.START_ACTIVE_DATA"] = startActiveDataArray.join(commaString);
      params["oracle.adf.view.rich.START_ACTIVE_DATA_EVENT_IDS"] = startActiveDataEventIdArray.join(commaString)
    }
    if(stopADSClientIds.length > 0) {
      this._stopADSClientIds = new Array;
      params["oracle.adf.view.rich.STOP_ACTIVE_DATA"] = stopADSClientIds.join(commaString)
    }
  }
  if(formElement == null) {
    formElement = this._findFirstAdfForm();
    if(!formElement) {
      this._inDeliverQueuedServerEvents = false;
      return
    }
  }
  AdfAssert.assert(formElement, "No form found;  cannot postback");
  if(hasWindowEvent) {
    if(!headerParams) {
      headerParams = new Object
    }
    headerParams = AdfCollections.copyInto(headerParams, this._windowEventHeaderMap);
    delete this._windowEventHeaderMap;
    if(formElement && headerParams["Adf-Window-Opened"] == "true") {
      formElement.action = this.getDomWindow().location.href
    }
  }
  var isMultipartForm = AdfDomUtils.isMultiPartForm(formElement);
  if(isMultipartForm) {
    var actionUrl = formElement.action;
    var windowId = this.getWindowId();
    var pageStateId = this.getPageStateId();
    actionUrl = AdfXmlHttpDataTransferService.__encodeWindowIdOnUrl(actionUrl, windowId);
    formElement.action = AdfXmlHttpDataTransferService.__encodePageIdOnUrl(actionUrl, pageStateId);
    if(pageUnloading) {
      formElement.setAttribute("enctype", "application/x-www-form-urlencoded")
    }
  }
  headerParams = this._addPageId(headerParams);
  if(this.isPortlet() && AdfDomUtils.getInputFileForm(formElement)) {
    doPartialSubmit = false
  }
  var processParam = null;
  if(noResponseEvent != null) {
    processParam = noResponseEvent.getSource().getClientId()
  }else {
    if(doPartialSubmit && onlyProcess && onlyProcess.length) {
      processParam = onlyProcess.join(commaString)
    }
  }
  if(processParam != null) {
    params["oracle.adf.view.rich.PROCESS"] = processParam
  }
  if(doPartialSubmit && fullSubmitChanged) {
    params["oracle.adf.view.rich.PPR_FORCED"] = "true"
  }
  var context = new Object;
  context._discreteEvent = discreteEvent;
  context._responseAnnounced = responseAnnounced;
  context._clientEventsSet = clientEventsSet;
  context.__isSynchronous = this._synchronousUnloadedNotify ? true : false;
  delete this._synchronousUnloadedNotify;
  if(noResponseEvent != null) {
    isUserInputPrevented = false;
    context._noResponseExpected = true
  }else {
    if(this._serverQueue.hasEventsToDeliver()) {
      isUserInputPrevented = true
    }
  }
  if(doPartialSubmit) {
    this._doRichPostback(formElement, params, headerParams, isUserInputPrevented, context, eventTargets);
    this.__perfTimings(false, false, true, "deliver PPR request. Event: ", params.event);
    this._haveOutstandingPPRRequest = true
  }else {
    this.__perfTimings(false, false, true, "deliver full postback request. Event: ", params.event);
    this._doFullPostback(formElement, params, isUserInputPrevented, noResponseEvent == null)
  }
  this._inDeliverQueuedServerEvents = false
};
AdfDhtmlPage.prototype._sendRichPayload = function(params, context) {
  AdfAssert.assert(params, "Attempting to send null payload");
  var formElement = this.getDomDocument().forms[0];
  AdfAssert.assert(formElement, "No form found;  cannot postback");
  var headerParams = this._addPageId(null);
  AdfDhtmlPage._addStateParameter(formElement, params);
  AdfDhtmlPage._addPageStateIdParameter(formElement, params);
  this._doRichPostback(formElement, params, headerParams, false, context, null, null)
};
AdfDhtmlPage.prototype._addPageId = function(headerParams) {
  if(!headerParams) {
    headerParams = new Object
  }
  if(this.getPageId() != null) {
    headerParams["Adf-Ads-Page-Id"] = this.getPageId()
  }
  return headerParams
};
AdfDhtmlPage.__addServerParamsToEvent = function(event, params) {
  if(params) {
    event["_adfServerParams"] = params
  }
};
AdfDhtmlPage.prototype.__getLastDomEvent = function() {
  return this._lastDomEvent
};
AdfDhtmlPage.prototype.deliverEventToNewWindow = function(event) {
  var eventComponent = event.getSource();
  var clientId = eventComponent.getClientId();
  var params = {event:clientId};
  params["event." + clientId] = this._marshallMultipleEventParameters(new Array(event.getProperties()));
  var deltas = this._getAndClearDeltas(false);
  if(deltas) {
    params["oracle.adf.view.rich.DELTAS"] = deltas
  }
  var formElement = AdfDhtmlPage._getFormElement(eventComponent);
  var oldTarget = formElement.hasAttribute("target") ? formElement.getAttribute("target") : "";
  formElement.setAttribute("target", AdfDhtmlPage._PRINTABLE_WINDOW_NAME);
  var oldActionUrl;
  var oldEnctype;
  var isMultipartForm = AdfDomUtils.isMultiPartForm(formElement);
  if(isMultipartForm) {
    var windowId = this.getWindowId();
    oldActionUrl = formElement.getAttribute("action");
    formElement.setAttribute("action", AdfXmlHttpDataTransferService.__encodeWindowIdOnUrl(oldActionUrl, windowId));
    oldEnctype = formElement.getAttribute("enctype");
    formElement.setAttribute("enctype", "application/x-www-form-urlencoded")
  }
  this._doFullPostback(formElement, params, false, false);
  formElement.setAttribute("target", oldTarget);
  if(isMultipartForm) {
    formElement.setAttribute("action", oldActionUrl);
    formElement.setAttribute("enctype", oldEnctype)
  }
};
AdfDhtmlPage.prototype._marshallMultipleEventParameters = function(paramList) {
  var agent = AdfAgent.AGENT;
  var doc = agent.createXmlDocument();
  var parentNode = doc.createElement("TEMP");
  if(agent.getPlatform() == AdfAgent.IE_PLATFORM) {
    doc.documentElement = parentNode
  }else {
    doc.appendChild(parentNode)
  }
  var params;
  if(paramList.length > 1) {
    params = paramList
  }else {
    params = paramList[0]
  }
  var node = AdfMarshalingService.getDefault().marshal(parentNode, params, null);
  return agent.getNodeXml(node)
};
AdfDhtmlPage.prototype.removeComponentsInSubtree = function(targetDomElement) {
  var currComponent;
  var currClientId;
  try {
    if(targetDomElement.id == AdfDhtmlPage._NAVIGATION_WRAPPER_ID) {
      this.clearAllMessages();
      for(currClientId in this._clientIdToComponentMap) {
        currComponent = this._clientIdToComponentMap[currClientId];
        if(currComponent != null) {
          currComponent.RemoveNotify()
        }
      }
    }else {
      var depthArrays = new Array;
      this._postOrderPopulate(targetDomElement, 0, depthArrays, false);
      for(var currDepth = depthArrays.length - 1;currDepth >= 0;currDepth--) {
        var currDepthArray = depthArrays[currDepth];
        if(currDepthArray != null) {
          var removeCount = currDepthArray.length;
          for(var removeIndex = 0;removeIndex < removeCount;removeIndex++) {
            currClientId = currDepthArray[removeIndex];
            currComponent = this.findComponent(currClientId);
            if(currComponent != null) {
              currComponent.RemoveNotify()
            }
          }
        }
      }
    }
  }catch(e) {
    AdfLogger.LOGGER.logErrorAsSevere(e, "remove components in subtree")
  }
};
AdfDhtmlPage.prototype.ComponentsInSubtreeCallback = function(targetDomElement, callback, callbackParameters) {
  var depthArrays = new Array;
  this._postOrderPopulate(targetDomElement, 0, depthArrays, false);
  for(var currDepth = depthArrays.length - 1;currDepth >= 0;currDepth--) {
    var currDepthArray = depthArrays[currDepth];
    if(currDepthArray != null) {
      var count = currDepthArray.length;
      for(var index = 0;index < count;index++) {
        var currClientId = currDepthArray[index];
        var currComponent = this.findComponent(currClientId);
        if(currComponent != null) {
          callback(currComponent, callbackParameters)
        }
      }
    }
  }
};
AdfDhtmlPage.cancelAllPopupsCallback = function(currComponent, callbackParameters) {
  var peer = currComponent.getPeer();
  if(peer) {
    peer.cancelAllPopups(currComponent, true)
  }
};
AdfDhtmlPage.prototype._postOrderPopulateComponent = function(clientId, depth, depthArrays) {
  if(clientId && this.findComponent(clientId) != null) {
    var ourArray = depthArrays[depth];
    if(ourArray == null) {
      ourArray = new Array(clientId);
      depthArrays[depth] = ourArray
    }else {
      ourArray.push(clientId)
    }
  }
};
AdfDhtmlPage.prototype._postOrderPopulate = function(targetNode, depth, depthArrays, ignoreHidden) {
  AdfAssert.assertDomElement(targetNode);
  if(!ignoreHidden || AdfDomUtils.isVisible(targetNode)) {
    var currChild = targetNode.firstChild;
    if(currChild != null) {
      var childDepth = depth + 1;
      do {
        var nodeType = currChild.nodeType;
        if(nodeType == 1) {
          this._postOrderPopulate(currChild, childDepth, depthArrays, ignoreHidden)
        }else {
          if(nodeType == 8) {
            clientId = this._getClientIdFromComment(currChild);
            if(clientId) {
              this._postOrderPopulateComponent(clientId, childDepth, depthArrays)
            }
          }
        }
        currChild = currChild.nextSibling
      }while(currChild != null)
    }
    var clientId = targetNode.id;
    this._postOrderPopulateComponent(clientId, depth, depthArrays)
  }
};
AdfDhtmlPage.prototype.__checkRichResponseDirty = function() {
  var pprDirty = this._isRichResponseDirty();
  if(pprDirty) {
    this.getDomWindow().location.reload(true);
    return true
  }
  return false
};
AdfDhtmlPage._removeFrameBusting = function() {
  var styleNode = document.getElementById("adfFrameBustStyle");
  if(styleNode) {
    styleNode.parentNode.removeChild(styleNode)
  }
};
AdfDhtmlPage._handleMessage = function(event) {
  if("_adfShowBody" === event.data) {
    var origin = event.origin;
    var page = AdfPage.PAGE;
    var allowedOrigins = page._allowedOrigins;
    var originCount = allowedOrigins.length;
    for(var i = 0;i < originCount;i++) {
      var originMatcher = allowedOrigins[i];
      if(originMatcher.test(origin)) {
        AdfDhtmlPage._removeFrameBusting();
        AdfDhtmlPage._doResizeNotify(page._resizeNotifyTree);
        break
      }
    }
  }
};
AdfDhtmlPage.prototype.__setUpFrameBusting = function(whiteListPatterns) {
  if(self == top) {
    AdfDhtmlPage._removeFrameBusting()
  }else {
    if(whiteListPatterns) {
      window.addEventListener("message", AdfDhtmlPage._handleMessage);
      var patternCount = whiteListPatterns.length;
      var whiteListRegExps = new Array;
      for(var i = 0;i < patternCount;i++) {
        whiteListRegExps[i] = new RegExp(whiteListPatterns[i], "i")
      }
      this._allowedOrigins = whiteListRegExps
    }
  }
};
AdfDhtmlPage.prototype.__onLoad = function() {
  var domWindow = this.getDomWindow();
  var agent = AdfAgent.AGENT;
  try {
    if(this._perfProfileEnabled) {
      domWindow._afrTimingOnLoadEnd = (new Date).getTime()
    }
    var loadId = AdfDhtmlPage._LOAD_CHECKPOINT.start();
    var domDocument = this.getDomDocument();
    var redistributeEvents = this.createCallback(this._redistribute);
    agent.addEventBubbles(domDocument, redistributeEvents);
    this._redistributeEventsCallback = redistributeEvents;
    this._touchContextMenuManager = agent.createContextMenuEventGenerator();
    agent.addKeyEventListener(domDocument, AdfDhtmlPage._keyEventCallback);
    this._onBeforeUnloadCallback = this.createCallback(this._handleBeforeUnload);
    agent.addBubbleEventListener(domWindow, "beforeunload", this._onBeforeUnloadCallback);
    if(this._perfProfileEnabled) {
      domWindow._afrTimingResizeStart = (new Date).getTime()
    }
    AdfDhtmlPage._doResizeNotify(this._resizeNotifyTree);
    if(this._perfProfileEnabled) {
      domWindow._afrTimingResizeEnd = (new Date).getTime()
    }
    this._loadedCss = this._collectCss();
    if(this._preloadImages) {
      this._forcePreloadOfAllImages()
    }
    this._replaceJsfAjaxFunctions();
    var onLoadCallback = this._onLoadCallback;
    if(onLoadCallback) {
      var callbackId = AdfDhtmlPage._CALLBACK_CHECKPOINT.start();
      onLoadCallback();
      AdfDhtmlPage._CALLBACK_CHECKPOINT.stop(callbackId)
    }
  }finally {
    var splashScreenElement = agent.getElementById("afr::Splash");
    if(splashScreenElement) {
      splashScreenElement.style.display = "none"
    }
    this.SetPhase(AdfPage.WAITING_FOR_USER_INPUT_PHASE)
  }
  this._initializationComplete = true;
  this._startGlobalActiveData();
  this._inAppNavigationFlag = false;
  AdfDhtmlPage._LOAD_CHECKPOINT.stop(loadId);
  this._restorePreviousUserActivityData();
  this._partialRequestRedirect = false;
  var navAgent = AdfNavigationHistoryAgent.getInstance();
  navAgent.startTrackingURI(this);
  this._onLoadPerfTimings();
  this._checkForHighContrastInBrowser();
  AdfLogger.LOGGER.getLogWriter().flush()
};
AdfDhtmlPage.prototype.getFacesPath = function() {
  return this._facesPath
};
AdfDhtmlPage.prototype.setFacesPath = function(path) {
  this._facesPath = path;
  AdfNavigationHistoryAgent.getInstance().setFacesPath(path)
};
AdfDhtmlPage.prototype.loadView = function(viewId, params, loadId, pageId) {
  var uri = this._facesPath + viewId;
  if(params != null) {
    uri += params
  }
  var headerParams = null;
  if(pageId != null) {
    headerParams = new Object;
    headerParams[AdfDhtmlPage._PAGE_STATE_ID] = pageId
  }
  this._blockUI(true);
  this.getDataTransferService().sendRequest({_loadId:loadId}, uri, headerParams, "_", [this])
};
AdfDhtmlPage.prototype._onLoadPerfTimings = function() {
  if(this._perfProfileEnabled) {
    var domWindow = this.getDomWindow();
    var preLoadStart = domWindow._afrTimingPreLoadStart;
    var loadEnd = (new Date).getTime();
    var coreLibraryPartitionLoadStart = domWindow._afrTimingCoreLibraryPartitionLoadStart;
    var coreLibraryPartitionLoadEnd = domWindow._afrTimingCoreLibraryPartitionLoadEnd;
    var coreLibraryPartitionLoadTime = coreLibraryPartitionLoadEnd - coreLibraryPartitionLoadStart;
    var bootstrapLibraryPartitionLoadStart = domWindow._afrTimingBootstrapLibraryPartitionLoadStart;
    var bootstrapLibraryPartitionLoadEnd = domWindow._afrTimingBootstrapLibraryPartitionLoadEnd;
    var bootstrapLibraryPartitionLoadTime = bootstrapLibraryPartitionLoadEnd - bootstrapLibraryPartitionLoadStart;
    var libraryPartitionsLoadStart = domWindow._afrTimingLibraryPartitionsLoadStart;
    var libraryPartitionsLoadEnd = domWindow._afrTimingLibraryPartitionsLoadEnd;
    var libraryPartitionsLoadTime = libraryPartitionsLoadEnd - libraryPartitionsLoadStart;
    var skinLoadStart = domWindow._afrTimingSkinLoadStart;
    var skinLoadEnd = domWindow._afrTimingSkinLoadEnd;
    var skinLoadTime = skinLoadEnd - skinLoadStart;
    var coreLibraryLoadStart = domWindow._afrTimingCoreLibraryLoadStart;
    var coreLibraryLoadEnd = domWindow._afrTimingCoreLibraryLoadEnd;
    var coreLibraryLoadTime = coreLibraryLoadEnd - coreLibraryLoadStart;
    var profilerLibraryLoadStart = domWindow._afrTimingProfilerLibraryLoadStart;
    var profilerLibraryLoadEnd = domWindow._afrTimingProfilerLibraryLoadEnd;
    var profilerLibraryLoadTime = profilerLibraryLoadEnd - profilerLibraryLoadStart;
    var preludeStart = domWindow._afrTimingPreludeStart;
    var preludeEnd = domWindow._afrTimingPreludeEnd;
    var preludeTime = preludeEnd - preludeStart;
    var profilerScriptLoadStart = domWindow._afrTimingProfilerScriptLoadStart;
    var profilerScriptLoadEnd = domWindow._afrTimingProfilerScriptLoadEnd;
    var profilerScriptLoadTime = profilerScriptLoadEnd - profilerScriptLoadStart;
    var translationsLoadStart = domWindow._afrTimingTranslationsLoadStart;
    var translationsLoadEnd = domWindow._afrTimingTranslationsLoadEnd;
    var translationsLibraryLoadTime = translationsLoadEnd - translationsLoadStart;
    var elementsAddedStart = domWindow._afrTimingElementsAddedStart;
    var elementsAddedEnd = domWindow._afrTimingElementsAddedEnd;
    var elementsAddedTime = elementsAddedEnd - elementsAddedStart;
    var encodeComponentsStart = domWindow._afrTimingEncodeComponentsStart;
    var encodeComponentsEnd = domWindow._afrTimingEncodeComponentsEnd;
    var encodeComponentsTime = encodeComponentsEnd - encodeComponentsStart;
    var renderSkinPropertiesStart = domWindow._afrTimingRenderSkinPropertiesStart;
    var renderSkinPropertiesEnd = domWindow._afrTimingRenderSkinPropertiesEnd;
    var renderSkinPropertiesTime = renderSkinPropertiesEnd - renderSkinPropertiesStart;
    var addComponentsStart = domWindow._afrTimingAddComponentsStart;
    var addComponentsEnd = domWindow._afrTimingAddComponentsEnd;
    var addComponentsTime = addComponentsEnd - addComponentsStart;
    var extendedScriptsExecuteStart = domWindow._afrTimingExtendedScriptsExecuteStart;
    var extendedScriptsExecuteEnd = domWindow._afrTimingExtendedScriptsExecuteEnd;
    var extendedScriptsExecuteTime = extendedScriptsExecuteEnd - extendedScriptsExecuteStart;
    var loadScriptLoadStart = domWindow._afrTimingLoadScriptLoadStart;
    var loadScriptLoadEnd = domWindow._afrTimingLoadScriptLoadEnd;
    var loadScriptLoadTime = loadScriptLoadEnd - loadScriptLoadStart;
    var extendedScriptsLoadStart = domWindow._afrTimingExtendedScriptsLoadStart;
    var extendedScriptsLoadEnd = domWindow._afrTimingExtendedScriptsLoadEnd;
    var extendedScriptsLoadTime = extendedScriptsLoadEnd - extendedScriptsLoadStart;
    var pprScriptsLoadStart = domWindow._afrTimingPPRNavInitScriptStart;
    var pprScriptsLoadEnd = domWindow._afrTimingPPRNavInitScriptEnd;
    var pprScriptsLoadTime = pprScriptsLoadEnd - pprScriptsLoadStart;
    var createComponentsTime = encodeComponentsTime - addComponentsTime;
    var htmlLayoutTime = libraryPartitionsLoadStart - translationsLoadEnd;
    var onloadHandlerTime = elementsAddedStart - extendedScriptsLoadEnd;
    var preLoadTime = domWindow._afrTimingOnLoadEnd - preLoadStart;
    var resizeStart = domWindow._afrTimingResizeStart;
    var resizeEnd = domWindow._afrTimingResizeEnd;
    var resizeTotal = resizeEnd - resizeStart;
    AdfLogger.PROFILER_LOGGER.info("initial page load started;", preLoadStart);
    AdfLogger.PROFILER_LOGGER.info("CSS skin load time;;", skinLoadTime);
    AdfLogger.PROFILER_LOGGER.info("JS Trinidad library load time;;", coreLibraryLoadTime);
    AdfLogger.PROFILER_LOGGER.info("JS profiler library load time;;", profilerLibraryLoadTime);
    AdfLogger.PROFILER_LOGGER.info("JS bootstrap library partition load time;;", bootstrapLibraryPartitionLoadTime);
    AdfLogger.PROFILER_LOGGER.info("JS prelude script time;;", preludeTime);
    AdfLogger.PROFILER_LOGGER.info("JS profiler script load time;;", profilerScriptLoadTime);
    AdfLogger.PROFILER_LOGGER.info("JS core library partition load time;;", coreLibraryPartitionLoadTime);
    AdfLogger.PROFILER_LOGGER.info("JS translations library load time;;", translationsLibraryLoadTime);
    AdfLogger.PROFILER_LOGGER.info("HTML layout time;;", htmlLayoutTime);
    AdfLogger.PROFILER_LOGGER.info("JS library partitions load time;;", libraryPartitionsLoadTime);
    AdfLogger.PROFILER_LOGGER.info("JS load script time;;", loadScriptLoadTime);
    AdfLogger.PROFILER_LOGGER.info("JS load extended scripts;;", extendedScriptsLoadTime);
    AdfLogger.PROFILER_LOGGER.info("onload handler time;;", onloadHandlerTime);
    AdfLogger.PROFILER_LOGGER.info("JS elements added time;;", elementsAddedTime);
    AdfLogger.PROFILER_LOGGER.info("JS render skin properties time;;", renderSkinPropertiesTime);
    AdfLogger.PROFILER_LOGGER.info("JS create components time;;", createComponentsTime);
    AdfLogger.PROFILER_LOGGER.info("JS add components time;;", addComponentsTime);
    AdfLogger.PROFILER_LOGGER.info("JS execute extended scripts time;;", extendedScriptsExecuteTime);
    AdfLogger.PROFILER_LOGGER.info("JS execute ppr init script time;;", pprScriptsLoadTime);
    AdfLogger.PROFILER_LOGGER.info("pre-load total time;;", preLoadTime);
    AdfLogger.PROFILER_LOGGER.info("resize time;;", resizeTotal);
    AdfLogger.PROFILER_LOGGER.info("initial page load done;", loadEnd, ";", loadEnd - preLoadStart);
    var perfTimingsEnd = (new Date).getTime();
    this._logOffset = perfTimingsEnd - loadEnd;
    this._perfProfileLogClosed = false
  }else {
    if(this._perfProfileTimingEnabled) {
      var domWindow = this.getDomWindow();
      var preLoadStart = domWindow._afrTimingPreLoadTimingStart;
      var loadEnd = (new Date).getTime();
      AdfLogger.PROFILER_LOGGER.info("initial page load started;", preLoadStart);
      AdfLogger.PROFILER_LOGGER.info("initial page load done;", loadEnd, ";", loadEnd - preLoadStart);
      var perfTimingsEnd = (new Date).getTime();
      this._logOffset = perfTimingsEnd - loadEnd;
      this._perfProfileLogClosed = false
    }
  }
};
AdfDhtmlPage.prototype.__perfTimings = function(closeRecord, closeBefore, timing, str1, str2) {
  AdfAssert.assertBoolean(closeRecord);
  AdfAssert.assertBoolean(closeRecord, closeBefore);
  AdfAssert.assertBoolean(timing);
  if(this._perfProfileEnabled || timing && this._perfProfileTimingEnabled) {
    var domWindow = this.getDomWindow();
    var preLoadStart = this._perfProfileEnabled ? domWindow._afrTimingPreLoadStart : domWindow._afrTimingPreLoadTimingStart;
    if(str2) {
      str1 += str2
    }
    var startTime = (new Date).getTime();
    if(this._logOffset === undefined) {
      this._logOffset = 0
    }
    var accTime = startTime - this._logOffset;
    if(closeRecord) {
      var logger = AdfLogger.PROFILER_LOGGER.getLogWriter();
      var filelogger = AdfClientFileLogWriter.prototype.isPrototypeOf(logger);
      if(filelogger && closeBefore) {
        logger.closeRecord();
        accTime = (new Date).getTime();
        this._logOffset = 0;
        AdfLogger.PROFILER_LOGGER.info(str1, ";", accTime);
        this._perfProfileLogClosed = false
      }else {
        if(filelogger && !closeBefore) {
          if(this._perfProfileLogClosed) {
            AdfLogger.PROFILER_LOGGER.info(str1, ";", accTime)
          }else {
            AdfLogger.PROFILER_LOGGER.info(str1, ";", accTime, ";", accTime - preLoadStart)
          }
          logger.closeRecord();
          this._perfProfileLogClosed = true;
          var endTime = (new Date).getTime();
          this._logOffset += endTime - startTime
        }
      }
      if(this._perfProfileEnabled) {
        domWindow._afrTimingPreLoadStart = accTime
      }else {
        domWindow._afrTimingPreLoadTimingStart = accTime
      }
    }else {
      if(this._perfProfileLogClosed) {
        AdfLogger.PROFILER_LOGGER.info(str1, ";", accTime);
        if(this._perfProfileEnabled) {
          domWindow._afrTimingPreLoadStart = accTime
        }else {
          domWindow._afrTimingPreLoadTimingStart = accTime
        }
      }else {
        AdfLogger.PROFILER_LOGGER.info(str1, ";", accTime, ";", accTime - preLoadStart)
      }
      this._perfProfileLogClosed = false
    }
  }
};
AdfDhtmlPage.prototype._checkForHighContrastInBrowser = function() {
  var doc = this.getDomDocument();
  var div = doc.createElement("div");
  div.setAttribute("id", "hiContrastTestEl");
  doc.body.appendChild(div);
  var cs = window.getComputedStyle(div);
  var bki = cs.backgroundImage;
  var hiContrast = false;
  hiContrast = cs.borderTopColor == cs.borderRightColor || bki != null && (bki == "none" || bki == "url (invalid-url:)");
  if(hiContrast) {
    this.scheduleTimer(this, this.setHighContrast, true, 100)
  }
  doc.body.removeChild(div)
};
AdfDhtmlPage.prototype.setHighContrast = function(state) {
  var doc = this.getDomDocument();
  this._isHighContrast = state;
  if(state == true) {
    AdfDomUtils.addCSSClassName(doc.body, "p_AFHighContrast")
  }else {
    AdfDomUtils.removeCSSClassName(doc.body, "p_AFHighContrast")
  }
};
AdfDhtmlPage.prototype.isHighContrast = function() {
  return this._isHighContrast
};
AdfDhtmlPage._getFormElement = function(component) {
  AdfAssert.assertPrototype(component, AdfUIComponent);
  var peer = component.getPeer();
  if(peer) {
    var currComponentDomNode = AdfRichUIPeer.getDomNodeForComponent(component);
    return currComponentDomNode ? AdfDomUtils.getFormElement(currComponentDomNode) : null
  }
  return null
};
AdfDhtmlPage.prototype._getParameterElement = function(form, name) {
  AdfAssert.assertString(name);
  var agent = AdfAgent.AGENT;
  var input = agent.getFormElement(form, name);
  if(!input) {
    input = this.getDomDocument().createElement("input");
    input.type = "hidden";
    input.name = name;
    form.appendChild(input)
  }
  return input
};
AdfDhtmlPage.prototype._setParameter = function(form, name, value) {
  this._getParameterElement(form, name).value = value
};
AdfDhtmlPage.prototype._appendParameter = function(form, name, value) {
  var inputElement = this._getParameterElement(form, name);
  var inputValue = inputElement.value;
  if(inputValue) {
    value = inputValue + "," + value
  }
  inputElement.value = value
};
AdfDhtmlPage._removeAllFormElements = function(formObject) {
  AdfAssert.assert(formObject, "Invalid form;  cannot remove elements");
  var inputs = formObject.elements;
  if(inputs) {
    var curElement = null;
    for(var j = inputs.length - 1;j >= 0;j--) {
      curElement = inputs.item(0);
      if(curElement) {
        curElement.parentNode.removeChild(curElement)
      }
    }
  }
};
AdfDhtmlPage.prototype._getPublicAncestor = function(component) {
  var publicComponent = component;
  while(publicComponent != null) {
    if(!publicComponent.satisfiesUsage(AdfUIComponent.USAGE_PRIVATE_CHILD)) {
      return publicComponent
    }else {
      publicComponent = publicComponent.getParent()
    }
  }
};
AdfDhtmlPage.prototype._redistribute = function(event) {
  var dndContext = this.getDnDContext();
  if(dndContext && dndContext.isDragging()) {
    return
  }
  var agent = AdfAgent.AGENT;
  if(agent.getPlatform() == AdfAgent.GECKO_PLATFORM && event && event.type == "keypress" && event.keyCode == 27) {
    event.preventDefault()
  }
  this.SetPhase(AdfPage.DELIVER_EVENTS_PHASE);
  try {
    if(!event) {
      event = this.getDomWindow().event
    }
    var userInactivityTimeoutHelper = this.__getUserInactivityTimeoutHelper();
    if(userInactivityTimeoutHelper) {
      userInactivityTimeoutHelper.__resetTimeoutHandler(event)
    }
    var sessionTimeoutHelper = this.__getSessionTimeoutHelper();
    if(sessionTimeoutHelper) {
      sessionTimeoutHelper.__recordUserActivity(event)
    }
    this._lastDomEvent = event;
    var eventTarget = agent.getEventTarget(event);
    if(eventTarget == null || eventTarget.nodeType == null) {
      return
    }
    var prevComponent = this.getActiveComponent();
    var component = AdfRichUIPeer.getFirstAncestorComponent(eventTarget);
    var domEventType = event.type;
    var compEventType = agent.mapNativeToComponentEventType(domEventType);
    if(domEventType == "click") {
      this._fixupLinkOnClick(eventTarget)
    }else {
      if(compEventType == "focus") {
        if(this._blurTimer) {
          this.cancelTimer(this._blurTimer);
          this._blurTimer = null
        }
        if(!this.__setActiveDomNodeInfo(eventTarget, component ? component.getClientId() : null)) {
          agent.eatEvent(event);
          return
        }
      }else {
        if(compEventType == "blur") {
          this._blurTimer = this.scheduleTimer(this, this._setActiveTimeout, {"activeElement":document.activeElement}, 1, {"isSynchronized":true})
        }
      }
    }
    if(component != null) {
      var peer = component.getPeer();
      if(!peer) {
        AdfLogger.LOGGER.severe("Peer null during event redistribution for component id: " + component.getClientId());
        return
      }
      if(compEventType == AdfComponentEvent.FOCUS_EVENT_TYPE || compEventType == AdfComponentEvent.BLUR_EVENT_TYPE) {
        if(peer.needsFocusTargetStyleClass()) {
          var styleComponent = this._getPublicAncestor(component);
          if(styleComponent) {
            var focusDomElement = AdfRichUIPeer.getDomContentElementForComponent(styleComponent);
            if(focusDomElement) {
              if(compEventType == AdfComponentEvent.FOCUS_EVENT_TYPE) {
                AdfDomUtils.addCSSClassName(focusDomElement, AdfRichUIPeer.FOCUS_TARGET_STYLECLASS)
              }else {
                AdfDomUtils.removeCSSClassName(focusDomElement, AdfRichUIPeer.FOCUS_TARGET_STYLECLASS)
              }
            }
          }
        }
      }else {
        if(domEventType == "mouseover" || domEventType == "mouseout") {
          if(agent.supportsTransientStyleClasses() && !agent.isTouchFirstDevice()) {
            var styleComponent = this._getPublicAncestor(component);
            if(styleComponent) {
              var stylePeer = styleComponent.getPeer();
              stylePeer.bind(styleComponent);
              var hoverDomElement = AdfRichUIPeer.getDomContentElementForComponent(styleComponent);
              var activeHoverDomElement = this._activeHoverDomElement;
              if(domEventType == "mouseover") {
                if(hoverDomElement && hoverDomElement != activeHoverDomElement) {
                  if(activeHoverDomElement) {
                    delete this._activeHoverDomElement;
                    AdfDomUtils.removeCSSClassName(activeHoverDomElement, AdfRichUIPeer.HOVER_TARGET_STYLECLASS)
                  }
                  this._activeHoverDomElement = hoverDomElement;
                  AdfDomUtils.addCSSClassName(hoverDomElement, AdfRichUIPeer.HOVER_TARGET_STYLECLASS)
                }
              }else {
                if(domEventType == "mouseout" && activeHoverDomElement) {
                  var clearStyles = true;
                  var nextElement = agent.getEventToElement(event);
                  if(nextElement && nextElement.nodeType != null) {
                    if(activeHoverDomElement == nextElement) {
                      clearStyles = false
                    }else {
                      var nextComp = AdfRichUIPeer.getFirstAncestorComponent(nextElement);
                      nextComp = this._getPublicAncestor(nextComp);
                      if(nextComp) {
                        var nextPeer = nextComp.getPeer();
                        nextPeer.bind(nextComp);
                        var nextHoverDomElement = nextPeer.getDomElement();
                        if(nextHoverDomElement == activeHoverDomElement) {
                          clearStyles = false
                        }
                      }
                    }
                  }else {
                    clearStyles = false
                  }
                  if(clearStyles) {
                    AdfDomUtils.removeCSSClassName(activeHoverDomElement, AdfRichUIPeer.HOVER_TARGET_STYLECLASS);
                    delete this._activeHoverDomElement
                  }
                }
              }
            }
          }else {
            AdfLogger.LOGGER.info("The skinning's hover-target pseudo class is not supported on this configuration.")
          }
        }
      }
      peer._dispatchDomEvent(agent, component, event);
      var componentEvent = peer.createComponentEvent(component, event, prevComponent);
      if(componentEvent) {
        AdfAssert.assert(componentEvent.getSource() === component, "event generation can't change event source");
        var eventType = componentEvent.getType();
        switch(eventType) {
          case AdfComponentEvent.FOCUS_EVENT_TYPE:
            AdfLogger.LOGGER.fine("Focus: ", component);
            delete this._restorePprFocusIndex;
            this.__setActiveDomNodeInfo(eventTarget, component.getClientId());
            this._notifyComponentEventListeners(componentEvent);
            break;
          case AdfComponentEvent.BLUR_EVENT_TYPE:
            this._notifyComponentEventListeners(componentEvent);
            break
        }
        if(dndContext && AdfUIInputEvent.prototype.isPrototypeOf(componentEvent)) {
          dndContext.__handleInputEvent(componentEvent)
        }
        component.queueEvent(componentEvent);
        var touchContextMenuManager = this._touchContextMenuManager;
        var derivedEvent = touchContextMenuManager.deriveContextMenuEvent(componentEvent);
        if(derivedEvent) {
          component.queueEvent(derivedEvent)
        }
        this._eventLoopDeliverEvents()
      }
      if(this._descendantResizeNotifyQueue) {
        var dts = this.getDataTransferService();
        if(dts.getDTSState() == AdfDataTransferService.STATE_READY) {
          this.__doDescendantResizeNotify()
        }
      }
    }
  }finally {
    this.SetPhase(AdfPage.WAITING_FOR_USER_INPUT_PHASE);
    AdfLogger.LOGGER.getLogWriter().flush()
  }
};
AdfDhtmlPage.prototype._notifyComponentEventListeners = function(componentEvent) {
  var clientListeners = this._clientListeners;
  if(clientListeners != null) {
    var componentType = componentEvent.getType();
    var eventListeners = clientListeners[componentType];
    if(eventListeners != null) {
      AdfEventUtils.deliverEventToListeners(eventListeners, componentEvent)
    }
  }
};
AdfDhtmlPage.prototype._setActiveTimeout = function(argObj) {
  this._blurTimer = null;
  var activeElement = argObj.activeElement;
  var component = null;
  if(activeElement == document.activeElement) {
    if(AdfAgent.AGENT.getNodeType(activeElement)) {
      component = AdfRichUIPeer.getFirstAncestorComponent(activeElement)
    }
    var clientId = component ? component.getClientId() : null;
    if(this.getActiveComponentId() != clientId) {
      this._setActiveComponentId(clientId)
    }
  }else {
    AdfLogger.LOGGER.fine("activeElement not equal document.activeElement in AdfDhtmlPage.prototype._setActiveTimeout")
  }
};
AdfDhtmlPage.prototype.createFloatingDiv = function(parent, zIndex, className) {
  AdfAssert.assertDomElement(parent);
  AdfAssert.assertNumber(zIndex);
  AdfAssert.assertString(className);
  var domDocument = parent.ownerDocument;
  var floatingDiv = domDocument.createElement("DIV");
  var divStyle = floatingDiv.style;
  divStyle.zIndex = zIndex;
  divStyle.position = "absolute";
  divStyle.visibility = "hidden";
  var contentSpan = domDocument.createElement("SPAN");
  contentSpan.style.display = "block";
  contentSpan.className = className;
  floatingDiv.appendChild(contentSpan);
  parent.appendChild(floatingDiv);
  return floatingDiv
};
AdfDhtmlPage.prototype.showFloatingDiv = function(floatingDiv, floatingContent) {
  this._clearFloatingDiv(floatingDiv);
  var floatingHolder = floatingDiv.firstChild;
  floatingHolder.appendChild(floatingContent);
  var floatingStyle = floatingDiv.style;
  floatingStyle.visibility = "visible"
};
AdfDhtmlPage.prototype.hideFloatingDiv = function(floatingDiv) {
  AdfAssert.assertDomElement(floatingDiv);
  var floatingStyle = floatingDiv.style;
  floatingStyle.visibility = "hidden";
  floatingStyle.top = "-100px";
  floatingStyle.left = "-100px";
  this._clearFloatingDiv(floatingDiv)
};
AdfDhtmlPage.prototype._clearFloatingDiv = function(floatingDiv) {
  AdfAssert.assertDomElement(floatingDiv);
  var removeParent = floatingDiv.firstChild;
  var currChild = removeParent.firstChild;
  var nextChild;
  while(currChild) {
    nextChild = currChild.nextSibling;
    removeParent.removeChild(currChild);
    currChild = nextChild
  }
};
AdfDhtmlPage.prototype.prepareMaskingFrame = function(element) {
  var zOrderManager = this.getZOrderManager();
  zOrderManager.prepareMaskingFrame(element)
};
AdfDhtmlPage.prototype.createMaskingFrame = function(element) {
  var zOrderManager = this.getZOrderManager();
  var maskFrame = zOrderManager.createMaskingFrame(element);
  this.moveMaskingFrame(element, maskFrame);
  return maskFrame
};
AdfDhtmlPage.prototype.moveMaskingFrame = function(element, maskFrame) {
  var maskFrameStyle = maskFrame.style;
  var agent = AdfAgent.AGENT;
  var pos = agent.getElementPosition(element);
  maskFrameStyle.top = pos.y + "px";
  maskFrameStyle.left = pos.x + "px";
  maskFrameStyle.width = element.offsetWidth + "px";
  maskFrameStyle.height = element.offsetHeight + "px";
  maskFrameStyle.visibility = "visible"
};
AdfDhtmlPage.prototype.removeMaskingFrame = function(maskFrame) {
  var zOrderManager = this.getZOrderManager();
  zOrderManager.removeMaskingFrame(maskFrame)
};
AdfDhtmlPage.prototype.getDocument = function() {
  return this._document
};
AdfDhtmlPage.prototype.getDomDocument = function() {
  return this._document
};
AdfDhtmlPage.prototype.getDomWindow = function() {
  return this._window
};
AdfDhtmlPage.prototype.showGlassPane = function(listenerMap, cursor) {
  AdfLogger.LOGGER.finest("Show glasspane");
  AdfAssert.assert(listenerMap);
  AdfAssert.assertString(cursor);
  var glassPane = this.getGlassPane();
  this._positionGlassPane(true);
  glassPane.style.visibility = "visible";
  var agent = AdfAgent.AGENT;
  agent.startMouseEventCapture(listenerMap);
  agent.setCursor(glassPane, agent.getCursor(cursor));
  var captureElement = agent.getPlatform() == AdfAgent.IE_PLATFORM ? this._document.documentElement : glassPane;
  this._keyCaptureState = agent.startDocumentKeyEventCapture(listenerMap, captureElement)
};
AdfDhtmlPage.prototype.hideGlassPane = function(listenerMap) {
  AdfAssert.assert(listenerMap);
  AdfLogger.LOGGER.finest("Hide glasspane");
  var agent = AdfAgent.AGENT;
  var glassPane = this.getGlassPane();
  agent.setCursor(glassPane, "auto");
  agent.stopMouseEventCapture(listenerMap);
  var captureElement = agent.getPlatform() == AdfAgent.IE_PLATFORM ? this._document.documentElement : glassPane;
  agent.endDocumentKeyEventCapture(listenerMap, captureElement, this._keyCaptureState);
  this._keyCaptureState = null;
  var glassPaneStyle = glassPane.style;
  glassPaneStyle.cursor = "auto";
  glassPaneStyle.visibility = "hidden";
  glassPaneStyle.height = "1px";
  glassPaneStyle.width = "1px";
  agent.forceCursorChange(this.getDomDocument())
};
AdfDhtmlPage.prototype.getDnDContext = function() {
  var dndContext = this._dndContext;
  if(dndContext === undefined) {
    dndContext = this.getDomWindow()["AdfDhtmlDnDContext"] ? new AdfDhtmlDnDContext : null;
    this._dndContext = dndContext
  }
  return dndContext
};
AdfDhtmlPage.prototype.__clearDnDContext = function() {
  delete this._dndContext
};
AdfDhtmlPage.prototype.getGlassPane = function() {
  var glassPane = this._glassPane;
  if(!glassPane) {
    glassPane = this._createGlassPane(this.getDomDocument());
    this._glassPane = glassPane
  }
  return glassPane
};
AdfDhtmlPage.prototype._createGlassPane = function(ownerDocument) {
  var glassPaneDiv = ownerDocument.createElement("div");
  glassPaneDiv.className = "AFBlockingGlassPane";
  var divStyle = glassPaneDiv.style;
  divStyle.position = "absolute";
  divStyle.left = "0px";
  divStyle.top = "0px";
  if(AdfDhtmlZOrderManager) {
    divStyle.zIndex = AdfDhtmlZOrderManager.getMaxZIndex() + 1
  }
  divStyle.visibility = "hidden";
  divStyle.tabIndex = -1;
  var agent = AdfAgent.AGENT;
  if(agent.getPlatform() == AdfAgent.OPERA_PLATFORM) {
    glassPaneDiv.onmousedown = function() {
      return false
    }
  }
  agent.disableUserSelect(glassPaneDiv);
  ownerDocument.body.appendChild(glassPaneDiv);
  agent.setOpacity(glassPaneDiv, 0);
  return glassPaneDiv
};
AdfDhtmlPage.prototype._positionGlassPane = function(assumeVisible) {
  var glassPane = this._glassPane;
  if(glassPane) {
    var glassPaneStyle = glassPane.style;
    if(assumeVisible || glassPaneStyle.visibility == "visible") {
      var bodyElem = this.getDomDocument().body;
      var height = Math.max(bodyElem.offsetHeight, bodyElem.scrollHeight);
      var width = Math.max(bodyElem.offsetWidth, bodyElem.scrollWidth);
      glassPaneStyle.height = height + "px";
      glassPaneStyle.width = width + "px"
    }
  }
};
AdfDhtmlPage.prototype._positionBlockingGlassPane = function(assumeVisible) {
  var document = this.getDomDocument();
  var glassPane = this.getGlassPane();
  var agent = AdfAgent.AGENT;
  if(glassPane) {
    var glassPaneStyle = glassPane.style;
    if(assumeVisible || glassPaneStyle.visibility == "visible") {
      var domWindow = agent.getDomWindow();
      var height = agent.getWindowScrollHeight(domWindow);
      var width = agent.getWindowScrollWidth(domWindow);
      glassPaneStyle.height = height + "px";
      glassPaneStyle.width = width + "px";
      var maskFrame = this._uiMaskingFrame;
      if(maskFrame) {
        this.moveMaskingFrame(glassPane, maskFrame)
      }
    }
  }
};
AdfDhtmlPage.prototype._installBlockingHandler = function(ownerDocument) {
  var agent = AdfAgent.AGENT;
  var agentIsIE = agent.getPlatform() == AdfAgent.IE_PLATFORM;
  var uiBlockingDiv = this.getGlassPane();
  uiBlockingDiv.onkeydown = AdfAgent.eatEventCallback;
  uiBlockingDiv.onkeyup = AdfAgent.eatEventCallback;
  uiBlockingDiv.onkeypress = AdfAgent.eatEventCallback;
  uiBlockingDiv.onmousedown = AdfAgent.eatEventCallback;
  uiBlockingDiv.onmouseup = AdfAgent.eatEventCallback;
  uiBlockingDiv.onmouseover = AdfAgent.eatEventCallback;
  uiBlockingDiv.onmouseout = AdfAgent.eatEventCallback;
  uiBlockingDiv.onclick = AdfAgent.eatEventCallback;
  agent.disableBrowserContextMenu(uiBlockingDiv, true);
  var maskFrame = this._uiMaskingFrame = this.createMaskingFrame(uiBlockingDiv);
  AdfDomUtils.addCSSClassName(maskFrame, "AFBlockingMaskingFrame");
  var maskFrameDocument = maskFrame.document;
  if(maskFrameDocument != null) {
    agent.disableBrowserContextMenu(maskFrameDocument, true)
  }
  if(agentIsIE) {
    AdfFocusUtils.focusElement(uiBlockingDiv)
  }else {
    agent.installKeyboardBlocker(ownerDocument, true)
  }
  var activeElementBeforeBlocking = this.getActiveDomElement();
  if(activeElementBeforeBlocking) {
    this._activeIDBeforeBlocking = activeElementBeforeBlocking.id
  }
  var domWindow = agent.getDomWindow();
  var positionBlockingGlassPaneCallback = this._positionBlockingGlassPaneCallback;
  agent.addBubbleEventListener(domWindow, "resize", positionBlockingGlassPaneCallback);
  agent.setOpacity(uiBlockingDiv, AdfDhtmlPage._BLOCKING_OPACITY);
  agent.setOpacity(maskFrame, AdfDhtmlPage._BLOCKING_OPACITY);
  var divStyle = uiBlockingDiv.style;
  this._positionBlockingGlassPane(true);
  divStyle.visibility = "visible"
};
AdfDhtmlPage.prototype._removeBlockingHandler = function(ownerDocument) {
  var agent = AdfAgent.AGENT;
  var agentIsIE = agent.getPlatform() == AdfAgent.IE_PLATFORM;
  agent.disableBrowserContextMenu(ownerDocument, false);
  var maskingFrame = this._uiMaskingFrame;
  delete this._uiMaskingFrame;
  var maskFrameDocument = maskingFrame.document;
  if(maskFrameDocument != null) {
    agent.disableBrowserContextMenu(maskFrameDocument, false)
  }
  AdfDomUtils.removeCSSClassName(maskingFrame, "AFBlockingMaskingFrame");
  this.removeMaskingFrame(maskingFrame);
  var uiBlockingDiv = this.getGlassPane();
  uiBlockingDiv.onkeydown = null;
  uiBlockingDiv.onkeyup = null;
  uiBlockingDiv.onkeypress = null;
  var glassPaneStyle = uiBlockingDiv.style;
  glassPaneStyle.cursor = "auto";
  glassPaneStyle.visibility = "hidden";
  glassPaneStyle.height = "0px";
  glassPaneStyle.width = "0px";
  var activeIDBeforeBlocking = this._activeIDBeforeBlocking;
  delete this._activeIDBeforeBlocking;
  if(activeIDBeforeBlocking) {
    var doc = this.getDomDocument();
    var activeElement = doc.activeElement;
    if(!activeElement) {
      activeElement = this.getActiveDomElement()
    }
    var focusElem = agent.getDomDocument().getElementById(activeIDBeforeBlocking);
    if(focusElem && uiBlockingDiv == activeElement || focusElem && !activeElement) {
      AdfFocusUtils.focusElement(focusElem)
    }
  }
  if(agent.getPlatform() != AdfAgent.IE_PLATFORM || agent.getPlatform() == AdfAgent.IE_PLATFORM && agent.getVersion() > 10) {
    agent.installKeyboardBlocker(ownerDocument, false)
  }
  var domWindow = agent.getDomWindow();
  var positionBlockingGlassPaneCallback = this._positionBlockingGlassPaneCallback;
  agent.removeBubbleEventListener(domWindow, "resize", positionBlockingGlassPaneCallback)
};
AdfDhtmlPage.prototype._blockUI = function(block, reason) {
  if(!reason) {
    reason = AdfDhtmlPage._UI_BLOCK_REASON_PPR
  }
  var agent = AdfAgent.AGENT;
  var ownerDocument = this.getDomDocument();
  if(block) {
    if(this._uiBlocks.length == 0) {
      this._installBlockingHandler(ownerDocument);
      agent.showBusyCursor(ownerDocument, block);
      this._broadcastBusyStateEvent(true)
    }
    this._uiBlocks.push(reason)
  }else {
    var index = AdfCollections.lastIndexOf(this._uiBlocks, reason);
    AdfAssert.assert(index > -1);
    this._uiBlocks.splice(index, 1);
    if(this._uiBlocks.length == 0) {
      agent.showBusyCursor(ownerDocument, block);
      this._broadcastBusyStateEvent(false);
      this._removeBlockingHandler(ownerDocument)
    }
  }
};
AdfDhtmlPage.prototype._isUIBlocked = function(reason) {
  var blocks = this._uiBlocks;
  return reason ? AdfCollections.indexOf(blocks, reason) > -1 : blocks.length > 0
};
AdfDhtmlPage.prototype.showPageProcessingIndicator = function(show) {
  if(null == this._pageProcessingIndicator) {
    this._pageProcessingIndicator = AdfDhtmlPageProcessingIndicator.getInstance()
  }
  this._pageProcessingIndicator.display(show, this.getDomDocument());
  if(show) {
    AdfAgent.AGENT.setOpacity(this._uiBlockingDiv, 50);
    this._uiBlockingDiv.style.backgroundColor = this._pageProcessingIndicator.getBackgroundColor()
  }else {
    AdfAgent.AGENT.setOpacity(this._uiBlockingDiv, 0);
    this._uiBlockingDiv.style.backgroundColor = ""
  }
};
AdfDhtmlPage.prototype.isProcessingIndicatorDisplayed = function() {
  return null != this._pageProcessingIndicator && this._pageProcessingIndicator.isDisplayed()
};
AdfDhtmlPage.prototype.requestStatusChanged = function(requestEvent) {
  if(requestEvent.getStatus() == AdfDataTransferRequestEvent.STATUS_COMPLETE) {
    var reqContext = requestEvent.getContext();
    var noNavigationRedirect = false;
    if(reqContext) {
      var requestBusyCounts = reqContext.busyCounts;
      var currBusyCounts = this._busyCounts;
      for(var busyClientId in requestBusyCounts) {
        var newBusyCount = currBusyCounts[busyClientId] - requestBusyCounts[busyClientId];
        AdfAssert.assert(newBusyCount >= 0);
        if(newBusyCount == 0) {
          delete currBusyCounts[busyClientId];
          var nonBusyComponent = this.findComponent(busyClientId);
          if(nonBusyComponent) {
            nonBusyComponent.getPeer().setBusy(nonBusyComponent, false)
          }
        }else {
          currBusyCounts[busyClientId] = newBusyCount
        }
      }
    }
    var statusCode = requestEvent.getResponseStatusCode();
    this._sendJsfAjaxEvent("complete", {"context":reqContext, "event":requestEvent});
    if(statusCode == 200) {
      var newWindowId;
      var isRedirect;
      if(requestEvent.getResponseHeader) {
        newWindowId = requestEvent.getResponseHeader("Adf-Window-Id")
      }
      if(newWindowId) {
        AdfPage.PAGE.getDomWindow().name = newWindowId
      }
      if(requestEvent.isRichResponse()) {
        this.__perfTimings(false, false, true, "PPR response from server received");
        var responseDocument = requestEvent.getResponseXML();
        isRedirect = this._handleRichResponse(responseDocument, reqContext);
        if(this._richPostbackHasErrors) {
          this._sendJsfAjaxEvent("error", {"context":reqContext, "event":requestEvent})
        }else {
          this._sendJsfAjaxEvent("success", {"context":reqContext, "event":requestEvent})
        }
        if(isRedirect && reqContext && reqContext._noResponseExpected) {
          this._partialRequestRedirect = false
        }
      }else {
        this._handleInvalidPprResponse(requestEvent.getResponseText(), reqContext, requestEvent);
        return
      }
      if(newWindowId && !isRedirect) {
        AdfPage.PAGE._startGlobalActiveData()
      }
      if(this.isUserActivityMonitoringOn() && !isRedirect) {
        prevActInfo = AdfUserActivityInfo.getInstance(AdfUserActivityInfo.PREVIOUS);
        prevActInfo.setClientEndTime((new Date).getTime().toString());
        AdfUserActivityInfo.saveToSessionStorageByType(AdfUserActivityInfo.PREVIOUS);
        AdfUserActivityInfo.removeFromSessionStorageByType(AdfUserActivityInfo.PRIMARY)
      }
    }else {
      this._handleInvalidPprResponse(null, reqContext, requestEvent);
      return
    }
    var postbackCheckpointId = null;
    if(reqContext) {
      postbackCheckpointId = reqContext.__checkPointId
    }
    if(postbackCheckpointId) {
      AdfDhtmlPage._POSTBACK_CHECKPOINT.stop(postbackCheckpointId)
    }
    this.__perfTimings(false, false, true, "PPR response processing done");
    this._haveOutstandingPPRRequest = false;
    if(this._isUIBlocked(AdfDhtmlPage._UI_BLOCK_REASON_PPR)) {
      this._blockUI(false)
    }
  }
};
AdfDhtmlPage._keyEventCallback = function(event) {
  AdfPage.PAGE._handleKey(event)
};
AdfDhtmlPage.prototype.registerKeyStroke = function(keystroke, callback, callbackContext) {
  AdfAssert.assertPrototype(keystroke, AdfKeyStroke);
  AdfAssert.assertFunction(callback);
  var clientId = null;
  if(callbackContext && callbackContext.clientId) {
    clientId = callbackContext.clientId
  }
  var keyStrokeString = keystroke.toMarshalledString();
  if(keyStrokeString in this._keyStrokeToCallbackMap) {
    var conflict = true;
    if(clientId) {
      var mapping = this._keyStrokeToCallbackMap[keyStrokeString];
      if(mapping.multipleAllowed) {
        conflict = false;
        mapping.callbacks[clientId] = callback;
        mapping.callbackContexts[clientId] = callbackContext;
        AdfLogger.LOGGER.finest("RP.registerKSAdditional, keystroke:callback:clientId ", keystroke, " : ", callback, " : ", clientId)
      }
    }
    if(conflict) {
      AdfLogger.LOGGER.warning("Conflicting shortcut mapping: The keystroke ", keystroke, " has already been registered on the RichPage.")
    }
  }else {
    if(clientId) {
      var multipleMapping = {multipleAllowed:true, callbacks:{}, callbackContexts:{}};
      multipleMapping.callbacks[clientId] = callback;
      multipleMapping.callbackContexts[clientId] = callbackContext;
      AdfLogger.LOGGER.finest("RP.registerKS, keystroke:callback:clientId ", keystroke, " : ", callback, " : ", clientId);
      this._keyStrokeToCallbackMap[keyStrokeString] = multipleMapping
    }else {
      AdfLogger.LOGGER.finest("RP.registerKS, keystroke:callback ", keystroke, " : ", callback);
      this._keyStrokeToCallbackMap[keyStrokeString] = callback;
      this._keyStrokeToCallbackContextMap[keyStrokeString] = callbackContext
    }
  }
};
AdfDhtmlPage.prototype.unregisterKeyStroke = function(keystroke, clientId) {
  AdfAssert.assertPrototype(keystroke, AdfKeyStroke);
  var keyStrokeString = keystroke.toMarshalledString();
  if(clientId) {
    var mapping = this._keyStrokeToCallbackMap[keyStrokeString];
    if(mapping.callbacks && mapping.callbacks.length <= 1) {
      delete this._keyStrokeToCallbackMap[keyStrokeString]
    }else {
      delete mapping.callbacks[clientId];
      delete mapping.callbackContexts[clientId]
    }
  }else {
    delete this._keyStrokeToCallbackMap[keyStrokeString];
    delete this._keyStrokeToCallbackContextMap[keyStrokeString]
  }
};
AdfDhtmlPage.prototype.pageIdNotSavedWithURI = function() {
  this._notSavingPageId = true
};
AdfDhtmlPage.prototype.setPageStateId = function(id) {
  this._addPageStateIdField(id);
  this._pageStateId = id;
  if(!this.isPortlet() && !this._notSavingPageId && !this._pprNavPending) {
    AdfNavigationHistoryAgent.getInstance().setPageId(id)
  }
};
AdfDhtmlPage.prototype.getPageStateId = function() {
  return this._pageStateId
};
AdfDhtmlPage.prototype._addPageStateIdField = function(id) {
  var doc = this.getDomDocument();
  var forms = doc.forms;
  var count = forms.length;
  for(var i = 0;i < count;i++) {
    var form = doc.forms[i];
    AdfAssert.assertDomElement(form);
    if(this._isAdfForm(form)) {
      var elem = form.elements[AdfDhtmlPage._PAGE_STATE_ID];
      var newId = id == null ? "" : id;
      var oldId = elem == null ? "" : elem.value;
      if(newId != oldId) {
        if(elem == null) {
          elem = doc.createElement("input");
          elem.id = elem.name = AdfDhtmlPage._PAGE_STATE_ID;
          elem.type = "hidden";
          elem.autocomplete = "off";
          form.appendChild(elem)
        }
        elem.value = newId
      }
    }
  }
};
AdfDhtmlPage.prototype._handleKey = function(event) {
  var agent = AdfAgent.AGENT;
  var keyCode = agent.getKeyCode(event);
  var modifiers = event.shiftKey * AdfKeyStroke.SHIFT_MASK | event.ctrlKey * AdfKeyStroke.CTRL_MASK | event.altKey * AdfKeyStroke.ALT_MASK;
  if(event.metaKey) {
    modifiers |= AdfKeyStroke.META_MASK
  }
  var keyStroke = AdfKeyStroke.getKeyStroke(keyCode, modifiers);
  var keyStrokeString = keyStroke.toMarshalledString();
  var callback = this._keyStrokeToCallbackMap[keyStrokeString];
  if(callback != null) {
    var skipKey = keyStrokeString in AdfDhtmlPage._KEYSTROKE_OVERRIDES;
    if(skipKey) {
      var eventTarget = agent.getEventTarget(event);
      var nodeName = agent.getNodeName(eventTarget).toLowerCase();
      if(nodeName != "textarea") {
        if(nodeName == "input") {
          var type = eventTarget.type.toLowerCase();
          skipKey = type == "text" || type == "password"
        }else {
          skipKey = false
        }
      }
    }
    if(!skipKey) {
      var callbackContext = this._keyStrokeToCallbackContextMap[keyStrokeString];
      if(callback.multipleAllowed) {
        var callbacks = callback.callbacks;
        var callbackContexts = callback.callbackContexts;
        callback = null;
        var found = false;
        var callbackCount = 0;
        for(clientId in callbacks) {
          callbackCount++
        }
        if(callbackCount > 1) {
          var doc = this.getDomDocument();
          var activeElement = doc.activeElement;
          if(!activeElement) {
            activeElement = this.getActiveDomElement()
          }
          if(!activeElement) {
            AdfLogger.LOGGER.finest("No known activeElement available for _handleKey.");
            activeElement = doc.documentElement
          }
          var bestDistance = Number.POSITIVE_INFINITY;
          for(clientId in callbacks) {
            var component = this.findComponent(clientId);
            if(component) {
              var domElement = AdfRichUIPeer.getDomElementForComponent(component);
              if(domElement) {
                var distance = AdfDomUtils.getNodeDistance(domElement, activeElement);
                if(distance == 0) {
                  found = true;
                  callback = callbacks[clientId];
                  callbackContext = callbackContexts[clientId];
                  break
                }else {
                  if(distance < bestDistance) {
                    bestDistance = distance;
                    found = true;
                    callback = callbacks[clientId];
                    callbackContext = callbackContexts[clientId]
                  }
                }
              }else {
                AdfLogger.LOGGER.warning("Unable to locate domElement for clientId \x3d " + clientId + " in _handleKey.")
              }
            }else {
              AdfLogger.LOGGER.warning("Unable to locate component for clientId \x3d " + clientId + " in _handleKey.")
            }
          }
          if(!found) {
            AdfLogger.LOGGER.warning("Unable to locate a match for clientId \x3d " + clientId + " in _handleKey.")
          }
        }
        if(!found && callbackCount == 1) {
          for(clientId in callbacks) {
            callback = callbacks[clientId];
            callbackContext = callbackContexts[clientId]
          }
        }
      }
      var handledEvent = callback.call(callbackContext, keyStroke) !== false;
      if(handledEvent) {
        agent.eatEvent(event)
      }
    }
  }
};
AdfDhtmlPage.prototype._doFullPostback = function(formElement, params, blockUI, responseExpected) {
  this._waitingForDocumentUnload = responseExpected;
  if(!responseExpected) {
    params["oracle.adf.view.rich.RESPONSE_EXPECTED"] = "no"
  }
  var newSessionURL = this._newSessionURL;
  if(newSessionURL) {
    params["oracle.adf.view.rich.NEW_SESSION_URL"] = newSessionURL
  }
  this._resetUncommittedIds();
  if(!formElement.target || formElement.target.length == 0 || formElement.target == "_self") {
    this._inAppNavigationFlag = true;
    if(blockUI) {
      this._blockUI(true)
    }
    if(responseExpected) {
      this._disableUncommittedWarnings()
    }else {
      this.scheduleTimer(this, this._resetPerformingFullSubmit, null, 3E3)
    }
  }
  var combinedParams = {};
  this._collectProtectionKeys(combinedParams, formElement);
  AdfCollections.copyInto(combinedParams, params);
  for(var param in combinedParams) {
    this._setParameter(formElement, param, combinedParams[param])
  }
  AdfAgent.AGENT.autoCompleteForm(formElement);
  try {
    formElement.submit()
  }catch(e) {
    var multiPartForm = AdfDomUtils.getInputFileForm(formElement);
    if(multiPartForm != null) {
      AdfInputFileUtils.addUploadErrorMessage()
    }
    AdfLogger.LOGGER.logErrorAsInfo(e, "doFullPostback form.submit()")
  }
  formElement.action = formElement.action;
  for(var param in params) {
    var input = this._getParameterElement(formElement, param);
    AdfAssert.assertDomElement(input);
    input.parentNode.removeChild(input)
  }
};
AdfDhtmlPage.prototype._doRichPostback = function(formElement, params, headerParams, blockUI, context, eventTargets) {
  AdfAssert.assertDomElement(formElement, "FORM");
  AdfAssert.assertObject(params);
  this._sendJsfAjaxEvent("begin", {"context":context});
  if(blockUI) {
    this._blockUI(true)
  }
  var postbackCheckpointId = AdfDhtmlPage._POSTBACK_CHECKPOINT.start();
  var requestBusyCounts = AdfCollections.copyInto({}, this._busyCounts);
  if(!context) {
    context = new Object
  }
  context.richPostback = true;
  context.busyCounts = requestBusyCounts;
  context.__checkPointId = postbackCheckpointId;
  context.retryParams = params;
  context.formId = formElement.id;
  var dts = this.getDataTransferService();
  var multiPartForm = null;
  var targetForm = formElement;
  if(AdfDomUtils.isMultiPartForm(formElement)) {
    multiPartForm = AdfDomUtils.getInputFileForm(formElement);
    if(multiPartForm) {
      targetForm = multiPartForm
    }
  }
  var combinedParams = {};
  this._collectProtectionKeys(combinedParams, multiPartForm != null ? multiPartForm : formElement);
  AdfCollections.copyInto(combinedParams, params);
  var pprURL = this._getPPRURL(targetForm);
  if(multiPartForm != null) {
    dts.sendMultiPartRequest(context, pprURL, headerParams, multiPartForm, combinedParams, [this], null)
  }else {
    var content = this._getPostbackContent(formElement, combinedParams, eventTargets);
    AdfAgent.AGENT.autoCompleteForm(formElement);
    dts.sendRequest(context, pprURL, headerParams, content, [this])
  }
};
AdfDhtmlPage.prototype._getDefaultPostbackURL = function() {
  var doc = this.getDomDocument();
  var actionURL = null;
  var form = doc.forms[0];
  if(form) {
    actionURL = this._getPPRURL(form)
  }
  if(!actionURL || actionURL.indexOf("j_security_check") != -1) {
    actionURL = doc.location.href;
    var hashIndex = actionURL.indexOf("#");
    if(hashIndex > 0) {
      actionURL = actionURL.substring(0, hashIndex)
    }
  }
  return actionURL
};
AdfDhtmlPage.prototype._appendResponseId = function(url) {
  var urlWithResponseId = url;
  var ecid = this.getResponseIdentifier();
  if(ecid != null) {
    urlWithResponseId += url.indexOf("?") < 0 ? "?" : "\x26";
    urlWithResponseId += AdfDhtmlPage._ECID;
    urlWithResponseId += "\x3d";
    urlWithResponseId += encodeURIComponent(ecid)
  }
  return urlWithResponseId
};
AdfDhtmlPage.prototype._getPPRURL = function(element) {
  var agent = AdfAgent.AGENT;
  var attribute = agent.getAttribute(element, AdfDhtmlPage._CUSTOM_PPR_URL_EXPANDO);
  var actionURL = attribute != null ? attribute : element.action;
  if(!actionURL || actionURL == "") {
    var domDocument = this.getDomDocument();
    actionURL = domDocument[AdfDhtmlPage._CUSTOM_PPR_URL_EXPANDO] ? domDocument[AdfDhtmlPage._CUSTOM_PPR_URL_EXPANDO] : domDocument.location.href
  }
  if(!this.isPortlet() && this.shouldTracePPRRequestId()) {
    actionURL = this._appendResponseId(actionURL)
  }
  return actionURL
};
AdfDhtmlPage.prototype._getPostbackContent = function(actionForm, params, eventTargets) {
  AdfAssert.assertDomElementOrNull(actionForm, "FORM");
  AdfAssert.assertObjectOrNull(params);
  var formParams = this._collectPostbackParams(actionForm, eventTargets);
  AdfCollections.copyInto(formParams, params);
  return this._toUrlEncodedForm(formParams)
};
AdfDhtmlPage.prototype._collectPostbackParams = function(actionForm, eventTargets) {
  var formParams = {};
  var tokenizeParams = {};
  var editableEventTargetComponents = this._getEditableEventTargetComponents(eventTargets);
  if(actionForm != null) {
    var formElements = actionForm.elements;
    if(formElements) {
      for(var elementIndex = 0;elementIndex < formElements.length;elementIndex++) {
        var input = formElements[elementIndex];
        var inputName = input.name;
        if(input.name && !input.disabled && this._shouldPostbackValue(input, editableEventTargetComponents)) {
          if(input.options) {
            formParams[input.name] = new Array;
            for(var j = 0;j < input.options.length;j++) {
              var option = input.options[j];
              if(option.selected) {
                var optionValueAttr = option.attributes["value"];
                var optionValue = optionValueAttr != null && optionValueAttr.value != null ? optionValueAttr.value : option.text;
                formParams[inputName].push(optionValue)
              }
            }
          }else {
            var inputValue = input.value;
            if(this._isUncheckedInput(input)) {
              AdfAssert.assert(this._isTrackingDirtyData());
              inputValue = ""
            }
            formParams[inputName] = this._mergeFormParamValues(formParams[inputName], inputValue)
          }
          var component = this._mapInputElementToComponent(input);
          if(!this._isDirtyDataRetainPPRDisabled() && null != component) {
            var peer = component.getPeer();
            if(peer) {
              peer.bind(component);
              if(peer.setLastSubmittedValue) {
                var lastSubmittedValue = formParams[inputName];
                if(AdfCollections.isArray(formParams[inputName])) {
                  lastSubmittedValue = component.getSubmittedValue()
                }
                peer.setLastSubmittedValue(component, lastSubmittedValue)
              }
            }
          }
        }
      }
    }
  }
  return formParams
};
AdfDhtmlPage.prototype._collectProtectionKeys = function(formParams, actionForm) {
  var tokenizeParams = {};
  if(actionForm != null) {
    var formElements = actionForm.elements;
    if(formElements) {
      for(var elementIndex = 0;elementIndex < formElements.length;elementIndex++) {
        var input = formElements[elementIndex];
        var protectionKey = input.getAttribute("protectionKey");
        if(protectionKey) {
          tokenizeParams[input.name] = protectionKey
        }
      }
    }
  }
  if(!AdfCollections.isEmpty(tokenizeParams)) {
    formParams["oracle.adf.view.rich.TOKENIZED"] = JSON.stringify(tokenizeParams)
  }
};
AdfDhtmlPage.prototype._getEditableEventTargetComponents = function(eventTargets) {
  AdfAssert.assertArrayOrNull(eventTargets);
  var editableEventTargetComponents = [];
  if(eventTargets != null) {
    for(var i = 0;i < eventTargets.length;i++) {
      var eventTarget = eventTargets[i];
      this._pushEditableComponent(editableEventTargetComponents, eventTarget);
      var containerEventTarget = this._stripSubId(eventTarget);
      if(containerEventTarget != eventTarget) {
        this._pushEditableComponent(editableEventTargetComponents, containerEventTarget)
      }
    }
  }
  return editableEventTargetComponents
};
AdfDhtmlPage.prototype._pushEditableComponent = function(editableComponents, clientId) {
  var component = this.findComponent(clientId);
  if(component instanceof AdfUIEditableValue) {
    editableComponents.push(component)
  }
};
AdfDhtmlPage.prototype._mergeFormParamValues = function(oldValue, newValue) {
  if(oldValue == null || oldValue == "" && newValue != null) {
    return newValue
  }
  if(newValue == null || newValue == "") {
    return oldValue
  }
  var list = null;
  if(AdfCollections.isArray(oldValue)) {
    list = oldValue
  }else {
    list = new Array;
    list.push(oldValue)
  }
  list.push(newValue);
  return list
};
AdfDhtmlPage.prototype._toUrlEncodedForm = function(formParams) {
  var content = "";
  for(var key in formParams) {
    var paramValue = formParams[key];
    if(AdfCollections.isArray(paramValue)) {
      var array = paramValue;
      for(var i = 0;i < array.length;i++) {
        content = AdfDhtmlPage._appendUrlFormEncoded(content, key, array[i])
      }
    }else {
      if(paramValue != undefined) {
        content = AdfDhtmlPage._appendUrlFormEncoded(content, key, paramValue)
      }
    }
  }
  return content
};
AdfDhtmlPage.prototype._isRichResponseDirty = function() {
  var hidden = this.getDomDocument().getElementById(AdfDhtmlPage._RICH_UPDATE_FLAG);
  if(hidden && hidden.value == "dirty") {
    return true
  }
  return false
};
AdfDhtmlPage.prototype._setRichResponseDirty = function(isDirty) {
  var hidden = this.getDomDocument().getElementById(AdfDhtmlPage._RICH_UPDATE_FLAG);
  if(hidden) {
    hidden.value = isDirty ? "dirty" : ""
  }
};
AdfDhtmlPage.prototype._waitingForDescendantResize = function() {
  var waiting = this._inDescendentResizeNotify;
  return waiting
};
AdfDhtmlPage.prototype._waitingForIncompleteImages = function() {
  var waiting = this._incompleteImageCount != null && this._incompleteImageCount > 0;
  return waiting
};
AdfDhtmlPage.prototype._waitingForAnimation = function() {
  var waiting = this._incompleteAnimationCount != null && this._incompleteAnimationCount > 0;
  return waiting
};
AdfDhtmlPage.prototype.incrementPendingAnimation = function() {
  if(this._incompleteAnimationCount == null) {
    this._incompleteAnimationCount = 0
  }
  ++this._incompleteAnimationCount
};
AdfDhtmlPage.prototype.decrementPendingAnimation = function() {
  if(this._incompleteAnimationCount == null) {
    AdfAssert.assert(false, "Unable to decrement the pending animation count when it was never incremented in the first place")
  }else {
    --this._incompleteAnimationCount;
    AdfAssert.assert(this._incompleteAnimationCount >= 0, "More pending animation decrements than increments")
  }
};
AdfDhtmlPage.prototype._prepareForIncompleteImages = function() {
  var imgElements = this.getDocument().getElementsByTagName("img");
  var imgElementCount = imgElements.length;
  var incompleteImageCount = 0;
  for(var i = 0;i < imgElementCount;i++) {
    var imgElement = imgElements[i];
    if(imgElement && !imgElement.complete) {
      var computedStyle = AdfAgent.AGENT.getComputedStyle(imgElement);
      var computedWidth = computedStyle.width;
      var computedHeight = computedStyle.height;
      if(computedWidth == "0px" || computedWidth == "auto" || computedHeight == "0px" || computedHeight == "auto") {
        AdfLogger.LOGGER.finer("An incompletly-loaded image was detected with src \x3d ", imgElement.src, imgElement);
        incompleteImageCount++;
        AdfDomUtils.addCSSClassName(imgElement, AdfDhtmlPage._INCOMPLETE_IMAGE_CLASS_NAME)
      }
    }
    var logger = AdfLogger.LOGGER;
    if(logger.getLevel() == AdfLogger.FINEST && imgElement != null) {
      AdfLogger.LOGGER.finest("Image load details:", imgElement, imgElement.getAttribute("src"), ", w\x3d", imgElement.width, ", h\x3d", imgElement.height, ", sW\x3d", imgElement.style.width, ", sH\x3d", imgElement.style.height, ", cmpW\x3d", computedWidth, ", cmpH\x3d", computedHeight, imgElement.complete ? ", COMPLETE" : ", INCOMPLETE", ", className\x3d", imgElement.className)
    }
  }
  if(incompleteImageCount > 0) {
    AdfLogger.LOGGER.fine("Number of incomplete images: ", incompleteImageCount);
    if(this._incompleteImageTimer != null) {
      this.cancelTimer(this._incompleteImageTimer)
    }
    this._incompleteImageTimerAttempts = 1;
    this._incompleteImageTimer = this.scheduleTimer(this, this._attemptToRelayoutForNewlyCompleteImages, null, 500)
  }
  this._incompleteImageCount = incompleteImageCount
};
AdfDhtmlPage.prototype._attemptToRelayoutForNewlyCompleteImages = function() {
  this._incompleteImageTimer = null;
  var previouslyIncompleteImages = [];
  var agent = AdfAgent.AGENT;
  var document = this.getDocument();
  if(agent.getPlatform() != AdfAgent.IE_PLATFORM && document.getElementsByClassName) {
    previouslyIncompleteImages = AdfCollections.cloneArray(document.getElementsByClassName(AdfDhtmlPage._INCOMPLETE_IMAGE_CLASS_NAME))
  }else {
    var imgElements = document.getElementsByTagName("img");
    var imgElementCount = imgElements.length;
    for(var elemNum = 0;elemNum < imgElementCount;elemNum++) {
      var img = imgElements[elemNum];
      if(AdfDomUtils.containsCSSClassName(img, AdfDhtmlPage._INCOMPLETE_IMAGE_CLASS_NAME)) {
        previouslyIncompleteImages.push(img)
      }
    }
  }
  var stillIncompleteImageCount = 0;
  for(var i = 0;i < previouslyIncompleteImages.length;i++) {
    var imgElement = previouslyIncompleteImages[i];
    if(imgElement && imgElement.complete) {
      AdfDomUtils.removeCSSClassName(imgElement, AdfDhtmlPage._INCOMPLETE_IMAGE_CLASS_NAME);
      var componentThatOwnsThisImage = AdfRichUIPeer.getFirstAncestorComponent(imgElement);
      if(componentThatOwnsThisImage != null) {
        this.__queueDescendantResizeNotifySource(componentThatOwnsThisImage);
        var peer = componentThatOwnsThisImage.getPeer();
        if(peer && peer.__preferredSizeChangeNotify) {
          peer.__preferredSizeChangeNotify(componentThatOwnsThisImage)
        }
      }
      AdfLogger.LOGGER.finer("A previously incompletly-loaded image is now complete with src \x3d ", imgElement.src, ", nearestClientComponent \x3d ", componentThatOwnsThisImage, ", imgElement \x3d ", imgElement)
    }else {
      stillIncompleteImageCount++
    }
  }
  AdfLogger.LOGGER.fine("Number of remaining incomplete images (at attempt #", this._incompleteImageTimerAttempts, "): ", stillIncompleteImageCount);
  if(stillIncompleteImageCount > 0 && this._incompleteImageTimerAttempts < 10) {
    this._incompleteImageTimerAttempts++;
    this._incompleteImageTimer = this.scheduleTimer(this, this._attemptToRelayoutForNewlyCompleteImages, null, 500);
    this._incompleteImageCount = stillIncompleteImageCount
  }else {
    if(stillIncompleteImageCount > 0) {
      AdfLogger.LOGGER.fine("Gave up trying to wait for images to load.")
    }
    this.__doDescendantResizeNotify();
    this._incompleteImageCount = 0
  }
};
AdfDhtmlPage.prototype._handleRichResponse = function(responseDocument, reqContext) {
  this._inHandleRichResponse = true;
  try {
    var agent = AdfAgent.AGENT;
    var root = responseDocument.documentElement;
    AdfAssert.assert("partial-response" == agent.getNodeName(root));
    var child = AdfDomUtils.getFirstChildElement(root);
    AdfAssert.assert(child != null && child.nodeType == 1);
    var isRedirect = this._applyRichResponse(child, false, false, reqContext);
    this._resetPendingStreamingIDs();
    if(!isRedirect) {
      this.__doDescendantResizeNotify();
      this.flushToAssistiveTechnology();
      if(reqContext && reqContext._responseAnnounced) {
        var laf = this.getLookAndFeel();
        var message = laf.getTranslatedString("AFResponseCompleteStatus");
        this.announceToAssistiveTechnology(message)
      }
    }else {
      this._handleRedirect(responseDocument)
    }
  }finally {
    this._inHandleRichResponse = false
  }
  return isRedirect
};
AdfDhtmlPage.prototype._handleRedirect = function(responseDocument) {
  var root = responseDocument.documentElement;
  var agent = AdfAgent.AGENT;
  var changesElement = AdfDomUtils.getFirstDescendentElement(root, "changes");
  if(changesElement != null) {
    var ext = AdfDomUtils.getFirstDescendentElement(changesElement, "extension");
    if(ext != null && ext.getAttribute("id") == "adf-redirect-ext") {
      var childNodes = ext.childNodes;
      for(var i = 0;i < childNodes.length;i++) {
        var childNode = childNodes[i];
        var childNodeName = agent.getNodeName(childNode);
        if("contextId" == childNodeName) {
          if(this.isUserActivityMonitoringOn()) {
            var contextId = agent.getTextContent(childNode);
            if(contextId) {
              var prevActInfo = AdfUserActivityInfo.getInstance(AdfUserActivityInfo.PREVIOUS);
              prevActInfo.setContextId(contextId);
              AdfUserActivityInfo.saveToSessionStorage()
            }
          }
        }else {
          if("redirectCookie" == childNodeName) {
            var cookie = agent.getTextContent(childNode);
            if(cookie) {
              var d = new Date;
              d.setTime(d.getTime() + 3E4);
              cookie = cookie.replace(/\$exp\$/g, d.toUTCString());
              var cookies = cookie.split("$$");
              for(c = 0;c < cookies.length;c++) {
                this.getDomDocument().cookie = cookies[c]
              }
            }
          }
        }
      }
    }
  }
};
AdfDhtmlPage.prototype._richResponseComplete = function(reqContext) {
  var service = this._getScriptLoadingService();
  service.addCallbackScript(this, this._richResponseCompleteCallback, reqContext)
};
AdfDhtmlPage.prototype._richResponseCompleteCallback = function(reqContext) {
  this._resetPendingStreamingIDs();
  this.__doDescendantResizeNotify();
  this.flushToAssistiveTechnology();
  if(reqContext && reqContext._responseAnnounced) {
    var laf = this.getLookAndFeel();
    var message = laf.getTranslatedString("AFResponseCompleteStatus");
    this.announceToAssistiveTechnology(message)
  }
};
AdfDhtmlPage.prototype._getFocusPath = function() {
  var activeDomNode = this._activeDomNode;
  var savedFocusPath = [];
  if(activeDomNode != null) {
    var currDomNode = activeDomNode;
    while(currDomNode) {
      var currId = currDomNode.id;
      if(currId) {
        savedFocusPath[currId] = savedFocusPath.push(currDomNode) - 1
      }
      currDomNode = currDomNode.parentNode
    }
  }
  return savedFocusPath
};
AdfDhtmlPage.prototype._restoreFocusPath = function(focusPath, maxIndex) {
  AdfAssert.assertArray(focusPath);
  AdfAssert.assertNumberOrNull(maxIndex);
  var pathCount = focusPath.length;
  if(maxIndex >= pathCount) {
    maxIndex = pathCount - 1
  }
  var agent = AdfAgent.AGENT;
  var context = new Object;
  for(var restoreFocusIndex = 0;restoreFocusIndex <= maxIndex;restoreFocusIndex++) {
    var originalFocusDom = focusPath[restoreFocusIndex];
    var restoreFocusId = originalFocusDom.id;
    var newFocusDom = agent.getElementById(restoreFocusId);
    if(newFocusDom != null) {
      var focusElement = AdfDomUtils.getFirstFilteredElement(newFocusDom, false, AdfFocusUtils.acceptFocusableNode, context);
      if(!focusElement) {
        focusElement = AdfDomUtils.getNextFilteredElement(newFocusDom, newFocusDom.parentNode, true, AdfFocusUtils.acceptFocusableNode, context);
        if(!focusElement) {
          focusElement = AdfDomUtils.getPreviousFilteredElement(newFocusDom, newFocusDom.parentNode, AdfFocusUtils.acceptFocusableNode, context)
        }
      }
      if(focusElement) {
        AdfFocusUtils.focusElement(focusElement);
        break
      }
    }
  }
};
AdfDhtmlPage.prototype._getProcessedRootsInfo = function(documentElement) {
  var processedRootsInfo;
  var processedRootsElement = AdfDomUtils.getFirstDescendentElement(documentElement, "extension");
  if(processedRootsElement && "adf-processed-roots-ext" === processedRootsElement.getAttribute("id")) {
    processedRootsInfo = {processedClientIds:null, immediateOnly:false};
    if(processedRootsElement.hasAttribute === undefined || processedRootsElement.hasAttribute && processedRootsElement.hasAttribute("processed")) {
      var processed = processedRootsElement.getAttribute("processed");
      if(processed) {
        processedRootsInfo.processedClientIds = processed.split(" ")
      }
    }
    var immediateOnly = processedRootsElement.getAttribute("immediateOnly");
    processedRootsInfo.immediateOnly = "true" === immediateOnly
  }
  return processedRootsInfo
};
AdfDhtmlPage.prototype._removeProcessedRootsFromDirtyValues = function(processedRoots, immediateOnly, replacedDirtyValues, oldValues) {
  var agent = AdfAgent.AGENT;
  for(var dirtyClientId in replacedDirtyValues) {
    var dirtyElement = agent.getElementById(dirtyClientId);
    if(!dirtyElement) {
      delete replacedDirtyValues[dirtyClientId];
      continue
    }
    if(!AdfUIUtils.compareValues(oldValues[dirtyClientId], AdfPage.PAGE.findComponent(dirtyClientId).getSubmittedValue())) {
      if(!immediateOnly || this._isImmediateEditableValueComponent(dirtyClientId)) {
        if(!processedRoots) {
          delete replacedDirtyValues[dirtyClientId];
          continue
        }
        var processedRootsCount = processedRoots.length;
        for(var i = 0;i < processedRootsCount;i++) {
          var processedClientId = processedRoots[i];
          if(processedClientId == "") {
            continue
          }
          var inProcessedRoot = this._isAncestorOrSelf(processedClientId, dirtyElement);
          if(inProcessedRoot) {
            delete replacedDirtyValues[dirtyClientId]
          }
        }
      }
    }
  }
};
AdfDhtmlPage.prototype._isAncestorOrSelf = function(ancestorClientId, node) {
  var bIsAncestorOrSelf = false;
  var ancestorPopupInfos = this._poppedUpComponentInfo[ancestorClientId];
  if(ancestorPopupInfos) {
    for(var popupId in ancestorPopupInfos) {
      var currPopupInfo = ancestorPopupInfos[popupId];
      bIsAncestorOrSelf = AdfDhtmlPopupWindow.isAncestorOrSelf(currPopupInfo.contentDom, node);
      if(bIsAncestorOrSelf) {
        return true
      }
    }
  }else {
    var ancestorNode = AdfAgent.AGENT.getElementById(ancestorClientId);
    bIsAncestorOrSelf = AdfDomUtils.isAncestorOrSelf(ancestorNode, node)
  }
  if(!bIsAncestorOrSelf && node.id.indexOf(ancestorClientId) == 0) {
    var page = AdfPage.PAGE;
    var ancestorComp = page.findComponent(ancestorClientId);
    var childComp = page.findComponent(node.id);
    if(ancestorComp && childComp) {
      bIsAncestorOrSelf = childComp.isDescendant(ancestorComp)
    }
  }
  return bIsAncestorOrSelf
};
AdfDhtmlPage.prototype._applyRichResponse = function(documentElement, needsUnescape, isStreaming, reqContext) {
  var processedRootsInfo = this._getProcessedRootsInfo(documentElement);
  if(this._isTrackingDirtyData()) {
    this._trackErrors = true
  }
  this._richPostbackHasErrors = false;
  var isRedirect = false;
  try {
    var oldActiveComponents;
    var isScreenReaderMode = this.isScreenReaderMode();
    if(isScreenReaderMode && this.isActiveDataSupported()) {
      oldActiveComponents = new Object;
      AdfCollections.copyInto(oldActiveComponents, this.getActiveDataSupport().getActiveComponents())
    }
    var agent = AdfAgent.AGENT;
    var rootNodeName = agent.getNodeName(documentElement);
    if(rootNodeName == "changes") {
      var pprNavParams = null;
      var resizeDomNodes = [];
      var domReplacedIds = [];
      var savedFocusPath = this._getFocusPath();
      var childNodes = documentElement.childNodes;
      var length = childNodes.length;
      var pendingEditableSubtrees;
      var eventsSet;
      if(reqContext != null) {
        eventsSet = reqContext._clientEventsSet
      }
      if(eventsSet && eventsSet[AdfPollEvent.POLL_EVENT_TYPE]) {
        this._componentsUpdatedByPollEvent = new Array
      }
      var replacedDirtyValues = {};
      var replacedTableState = {};
      var oldValues = {};
      for(var i = 0;i < length;i++) {
        var childNode = childNodes[i];
        var childNodeName = agent.getNodeName(childNode);
        if(childNodeName == "update") {
          var fragmentValues = this._handleRichResponseFragment(childNode, resizeDomNodes, domReplacedIds, needsUnescape, savedFocusPath, isStreaming, replacedDirtyValues, oldValues, replacedTableState);
          if(fragmentValues != null) {
            var isIOSSafariMobile = agent.getDomWindow().AdfSafariMobileAgent && agent instanceof AdfSafariMobileAgent && agent.getOS() != AdfAgent.ANDROID_OS;
            if(fragmentValues["restoreFocusIndex"] != null && !isIOSSafariMobile) {
              this._restorePprFocusIndex = fragmentValues["restoreFocusIndex"]
            }
            if(fragmentValues["pprNavParams"] != null) {
              pprNavParams = fragmentValues["pprNavParams"];
              this._pprNavPending = true
            }
            if(fragmentValues["pendingEditableSubtree"]) {
              if(!pendingEditableSubtrees) {
                pendingEditableSubtrees = []
              }
              pendingEditableSubtrees.push(fragmentValues["pendingEditableSubtree"])
            }
          }
        }else {
          if(childNodeName == "eval") {
            this._handleRichResponseScript(childNode)
          }else {
            if(childNodeName == "extension" && childNode.getAttribute("id") == "adf-script-library") {
              this._handleRichResponseLibrary(childNode, childNode.getAttribute("background") === "true")
            }
          }
        }
      }
      if(this._isTrackingDirtyData() && processedRootsInfo) {
        var processedRoots = processedRootsInfo.processedClientIds;
        if(!this._isDirtyDataRetainPPRDisabled()) {
          this._removeProcessedRootsFromDirtyValues(processedRoots, processedRootsInfo.immediateOnly, replacedDirtyValues, oldValues)
        }
        var ids = processedRoots ? processedRoots : [];
        this._setProcessedRoots(ids, processedRootsInfo.immediateOnly)
      }
      this._richUpdateComplete(resizeDomNodes, domReplacedIds, pprNavParams, reqContext, savedFocusPath, pendingEditableSubtrees, oldActiveComponents, replacedDirtyValues, replacedTableState)
    }else {
      if(rootNodeName == "redirect") {
        var url = documentElement.getAttribute("url");
        AdfAssert.assert(url, "Could not get redirect URL");
        isRedirect = true;
        this._disableUncommittedWarnings();
        this.__perfTimings(true, true, true, "redirect to ", url);
        var documentComponent = this.findComponent(this._documentClientId);
        this._partialRequestRedirect = true;
        var noNavigationRedirect = reqContext ? reqContext["_noNavigation"] : false;
        (new AdfRedirectEvent(documentComponent, url, noNavigationRedirect)).queue(false)
      }else {
        if(rootNodeName == "error") {
          this._richPostbackHasErrors = true;
          var nodeText = null;
          for(var n = 0;n < documentElement.childNodes.length;n++) {
            var node = documentElement.childNodes[n];
            if(agent.getNodeName(node) == "error-message") {
              nodeText = agent.getTextContent(node);
              break
            }
          }
          if(nodeText == null || nodeText.length == 0) {
            nodeText = "Unknown error during PPR"
          }
          alert(nodeText);
          if("true" == documentElement.getAttribute("redirect")) {
            this._disableUncommittedWarnings();
            document.location.href = this._getDefaultPostbackURL()
          }
        }else {
          if(rootNodeName == "noop") {
          }else {
            if(rootNodeName == "retry") {
              var formId = reqContext.formId;
              var formElement;
              if(formId) {
                formElement = Agent.AGENT.getElementById(formId)
              }
              if(!formElement) {
                formElement = this.getDomDocument().forms[0]
              }
              this._doFullPostback(formElement, reqContext.retryParams, false, true)
            }else {
              AdfAssert.assert(false, "invalid root node in rich response")
            }
          }
        }
      }
    }
  }finally {
    this._trackErrors = false
  }
  return isRedirect
};
AdfDhtmlPage.prototype.getDocumentClientId = function() {
  return this._documentClientId
};
AdfDhtmlPage.prototype._richUpdateComplete = function(resizeDomNodes, domReplacedIds, pprNavParams, reqContext, savedFocusPath, pendingEditableSubtrees, oldActiveComponents, replacedDirtyValues, replacedTableState) {
  var state = new Object;
  state["resizeDomNodes"] = resizeDomNodes;
  state["domReplacedIds"] = domReplacedIds;
  state["pprNavParams"] = pprNavParams;
  state["reqContext"] = reqContext;
  state["savedFocusPath"] = savedFocusPath;
  state["pendingEditableSubtrees"] = pendingEditableSubtrees;
  state["oldActiveComponents"] = oldActiveComponents;
  state["replacedDirtyValues"] = replacedDirtyValues;
  state["replacedTableState"] = replacedTableState;
  var service = this._getScriptLoadingService();
  service.addCallbackScript(this, this._richUpdateCompleteCallback, state)
};
AdfDhtmlPage.prototype._richUpdateCompleteCallback = function(state) {
  var resizeDomNodes = state["resizeDomNodes"];
  var domReplacedIds = state["domReplacedIds"];
  var pprNavParams = state["pprNavParams"];
  var reqContext = state["reqContext"];
  var savedFocusPath = state["savedFocusPath"];
  var pendingEditableSubtrees = state["pendingEditableSubtrees"];
  var oldActiveComponents = state["oldActiveComponents"];
  var replacedDirtyValues = state["replacedDirtyValues"];
  var replacedTableState = state["replacedTableState"];
  if(!this._isDirtyDataRetainPPRDisabled()) {
    this._restoreDirtyValues(replacedDirtyValues);
    this._restoreScrollPositionsForTable(replacedTableState)
  }
  this._restoreHeaderFocusForTables(replacedTableState);
  var agent = AdfAgent.AGENT;
  if(agent.getPlatform() == AdfAgent.IE_PLATFORM && Math.floor(agent.getVersion()) <= 8) {
    this.scheduleTimer(this, this._prepareForIncompleteImages, null, 10)
  }else {
    this._prepareForIncompleteImages()
  }
  if(resizeDomNodes.length > 0) {
    this._doResizeNotify(resizeDomNodes);
    this._checkResizeNotifyDelayed()
  }
  if(domReplacedIds.length > 0) {
    var clientListeners = this._clientListeners;
    var propListeners = clientListeners ? clientListeners[AdfDomReplacedEvent.EVENT_TYPE] : null;
    if(propListeners != null) {
      AdfEventUtils.deliverEventToListeners(propListeners, new AdfDomReplacedEvent(this, domReplacedIds))
    }
  }
  if(pprNavParams != null) {
    this._pprNavPending = false;
    var navAgent = AdfNavigationHistoryAgent.getInstance();
    if(navAgent) {
      var loadId = reqContext ? reqContext._loadId : null;
      navAgent.setCurrentPage(pprNavParams["viewId"], pprNavParams["queryParams"], loadId);
      if(!this._notSavingPageId) {
        navAgent.setPageId(this._pageStateId)
      }
    }
    this._restorePreviousUserActivityData()
  }
  if(this._restorePprFocusIndex != undefined) {
    this._restoreFocusPath(savedFocusPath, this._restorePprFocusIndex);
    delete this._restorePprFocusIndex
  }
  this._reattachInlineEditing(pendingEditableSubtrees);
  this._replaceJsfAjaxFunctions()
};
AdfDhtmlPage.prototype._reattachInlineEditing = function(pendingEditableSubtrees) {
  if(!pendingEditableSubtrees) {
    return
  }
  for(var n = 0;n < pendingEditableSubtrees.length;n++) {
    var sourceNode = pendingEditableSubtrees[n];
    this._filterEditableSubtree(sourceNode, this._editableCallback, this._editableCallbackContext);
    break
  }
};
AdfDhtmlPage.prototype.addEventListener = function(eventType, listener, instance) {
  this._clientListeners = AdfEventUtils.addEventListener(this._clientListeners, eventType, listener, instance)
};
AdfDhtmlPage.prototype.removeEventListener = function(eventType, listener, instance) {
  this._clientListeners = AdfEventUtils.removeEventListener(this._clientListeners, eventType, listener, instance)
};
AdfDhtmlPage.prototype.setDocumentClientId = function(documentClientId) {
  this._documentClientId = documentClientId
};
AdfDhtmlPage.prototype.doRedirect = function(url, noNavigation) {
  AdfLogger.LOGGER.info("Redirecting to : ", url);
  var win = this.getDomWindow();
  if(win.adfpp_handleLocationChange != undefined) {
    win.adfpp_handleLocationChange(url)
  }else {
    var loc = win.location;
    var oldUrl = loc.href;
    var oldHash = null;
    var hashIndex = oldUrl.indexOf("#");
    if(hashIndex >= 0) {
      oldHash = oldUrl.substring(hashIndex);
      oldUrl = oldUrl.substring(0, hashIndex)
    }
    var newUrl = url;
    var newHash = null;
    hashIndex = newUrl.indexOf("#");
    if(hashIndex >= 0) {
      newHash = newUrl.substring(hashIndex);
      newUrl = newUrl.substring(0, hashIndex)
    }
    if(newUrl == oldUrl && newHash != null) {
      if(oldHash != newHash) {
        if(noNavigation) {
          loc.replace(newHash)
        }else {
          loc.href = newHash
        }
      }
      loc.reload(true)
    }else {
      if(noNavigation) {
        loc.replace(url)
      }else {
        loc.href = url
      }
    }
  }
};
AdfDhtmlPage.prototype.streamingResponseComplete = function() {
  this._resetPendingStreamingIDs();
  this.getDataTransferService().notifyStreamingRequestComplete();
  if(this.isUserActivityMonitoringOn()) {
    var currentTime = (new Date).getTime().toString();
    var prevActInfo = AdfUserActivityInfo.getInstance(AdfUserActivityInfo.PREVIOUS);
    prevActInfo.setClientEndTime(currentTime);
    AdfUserActivityInfo.saveToSessionStorageByType(AdfUserActivityInfo.PREVIOUS);
    var secUserActInfo = AdfUserActivityInfo.getInstance(AdfUserActivityInfo.SECONDARY);
    secUserActInfo.setClientEndTime(currentTime);
    AdfUserActivityInfo.removeFromSessionStorageByType(AdfUserActivityInfo.PRIMARY);
    AdfUserActivityInfo.removeFromSessionStorageByType(AdfUserActivityInfo.SECONDARY)
  }
  this._addDelayedMessages(true);
  if(this._streamingStatus == AdfDhtmlPage._STREAMING_REQUEST_SENT) {
    this._handleInvalidPprResponse(null, null, null)
  }else {
    if(this._streamingStatus == AdfDhtmlPage._STREAMING_COMPLETE) {
      this.scheduleTimer(this, this._startGlobalActiveData, null, 500)
    }else {
      var laf = this.getLookAndFeel();
      alert(laf.getTranslatedString("af_document.UNKNOWN_STREAMING_ERROR"))
    }
  }
};
AdfDhtmlPage.prototype.streamingResponseWritten = function() {
  this.__perfTimings(false, false, true, "streaming response processing done");
  this._streamingStatus = AdfDhtmlPage._STREAMING_COMPLETE;
  if(this.isUserActivityMonitoringOn()) {
    AdfUserActivityInfo.setResponseReceivedTime(AdfUserActivityInfo.SECONDARY)
  }
};
AdfDhtmlPage.prototype.streamingResponseStarted = function() {
  if(this._perfProfileEnabled || this._perfProfileTimingEnabled) {
    AdfLogger.PROFILER_LOGGER.info("streaming request sent;", this.getDomWindow()._afrTimingStreamingRequestStart);
    this.__perfTimings(false, false, true, "streaming response received. The ECID is: ", AdfDhtmlPage._ECID)
  }
  this._streamingStatus = AdfDhtmlPage._STREAMING_STARTED
};
AdfDhtmlPage.prototype._resetPendingStreamingIDs = function() {
  this._pendingStreamingIDs = new Object
};
AdfDhtmlPage.prototype.handleStreamingResponse = function(doc, id, needsUnescape) {
  if(this._perfProfileEnabled) {
    this.__perfTimings(false, false, false, "streaming response segment received")
  }
  var root = doc.getElementById(id);
  AdfAssert.assert(root);
  this._applyRichResponse(root.firstChild, needsUnescape, true, null);
  if(this._perfProfileEnabled) {
    this.__perfTimings(false, false, false, "streaming response segment processed")
  }
};
AdfDhtmlPage.prototype.updateStreamingViewState = function(doc, id) {
  var root = doc.getElementById(id);
  AdfAssert.assert(root);
  var input = root.getElementsByTagName("input")[0];
  AdfAssert.assert(input);
  var form = this.getDomDocument().forms[0];
  AdfAssert.assertDomElement(form);
  var field = form.elements[AdfDhtmlPage._STATE_PARAM_NAME];
  AdfAssert.assertDomElement(field);
  field.parentNode.innerHTML = "\x3cinput type\x3d'hidden' name\x3d'" + AdfDhtmlPage._STATE_PARAM_NAME + "' value\x3d'" + input.getAttribute("value") + "' /\x3e"
};
AdfDhtmlPage.prototype.__handleReload = function() {
  this._partialRequestRedirect = true;
  var url = this._getDefaultPostbackURL();
  this.getDomWindow().location.replace(url)
};
AdfDhtmlPage.prototype.__validateWindowId = function(id) {
  try {
    var win = this.getDomWindow();
    if(win === parent && !win.name) {
      var savedId = sessionStorage.getItem("Adf-Window-Id");
      if(savedId === id) {
        win.name = savedId
      }
    }
  }catch(e) {
  }
  if(id != this.getDomWindow().name) {
    this.__handleReload();
    return false
  }
  return true
};
AdfDhtmlPage.prototype.__handleRichResponseAction = function(action, pprAction) {
  if(action) {
    var doc = this.getDomDocument();
    doc.forms[0].action = action
  }
  if(pprAction) {
    AdfAgent.AGENT.setAttribute(doc.forms[0], AdfDhtmlPage._CUSTOM_PPR_URL_EXPANDO, pprAction)
  }
};
AdfDhtmlPage.prototype.__loadJavaScriptInBackground = function(scripts) {
  var numArgs = arguments.length;
  if(numArgs > 0) {
    var scriptLoadingService = this._getScriptLoadingService();
    for(var a = 0;a < numArgs;++a) {
      var scriptUri = arguments[a];
      this._loadBackgroundScript(scriptUri)
    }
  }
};
AdfDhtmlPage.prototype._saveDirtyValueForComponent = function(dirtyComponent, replacedDirtyValues, oldValues) {
  if(dirtyComponent instanceof AdfUIEditableValue) {
    var dirtyClientId = dirtyComponent.getClientId();
    var dirtyValue = dirtyComponent.getSubmittedValue();
    if(dirtyValue != null) {
      replacedDirtyValues[dirtyClientId] = dirtyValue;
      var oldValue = dirtyComponent.getPeer().getLastSubmittedValue(dirtyComponent);
      oldValues[dirtyClientId] = oldValue
    }
  }
};
AdfDhtmlPage.prototype._saveValuesOfDirtyComponentsBeingReplaced = function(targetNode, replacedDirtyValues, oldValues) {
  var dirtyComponents = this._dirtyStateService.getDirtyComponentsForElement(targetNode);
  var dirtyCount = dirtyComponents.length;
  for(var i = 0;i < dirtyCount;i++) {
    this._saveDirtyValueForComponent(dirtyComponents[i], replacedDirtyValues, oldValues)
  }
};
AdfDhtmlPage.prototype._saveTableState = function(targetNode, replacedTableState) {
  var tableComp = this.findComponent(targetNode.id);
  if(tableComp && tableComp.getComponentType() == "oracle.adf.RichTable") {
    var scrollLeft = tableComp.getProperty("scrollLeft");
    var scrollTop = tableComp.getProperty("scrollTop");
    var focusItem = tableComp.getProperty("currentlySelectedHeaderId");
    var state = new Object;
    state["scrollLeft"] = scrollLeft;
    state["scrollTop"] = scrollTop;
    state["selectedHeader"] = focusItem;
    replacedTableState[targetNode.id] = state
  }
};
AdfDhtmlPage.prototype._restoreHeaderFocusForTables = function(replacedTableState) {
  for(var clientId in replacedTableState) {
    var comp = this.findComponent(clientId);
    if(comp && comp.getComponentType() == "oracle.adf.RichTable") {
      var state = replacedTableState[clientId];
      var focusItemId = state["selectedHeader"];
      var agent = AdfAgent.AGENT;
      var target = agent.getElementById(focusItemId);
      var peer = comp.getPeer();
      if(peer && target) {
        peer._setHeaderCellFocus(target)
      }
    }
  }
};
AdfDhtmlPage.prototype._restoreScrollPositionsForTable = function(replacedTableState) {
  for(var clientId in replacedTableState) {
    var comp = this.findComponent(clientId);
    if(comp && comp.getComponentType() == "oracle.adf.RichTable") {
      var state = replacedTableState[clientId];
      comp.setProperty("scrollLeft", state["scrollLeft"], true, AdfUIComponent.PROPAGATE_NEVER);
      comp.setProperty("scrollTop", state["scrollTop"], true, AdfUIComponent.PROPAGATE_NEVER)
    }
  }
};
AdfDhtmlPage.prototype._restoreDirtyValues = function(replacedDirtyValues) {
  for(var clientId in replacedDirtyValues) {
    var comp = this.findComponent(clientId);
    if(comp) {
      this.clearMessages(comp.getClientId());
      var restoredValue = replacedDirtyValues[clientId];
      var peer = comp.getPeer();
      if(peer instanceof AdfDhtmlEditableValuePeer) {
        try {
          AdfDhtmlEditableValuePeer.__restoreDisplayValue(comp, peer, restoredValue)
        }catch(e) {
          AdfLogger.LOGGER.fine("component does not support SetDisplayValue")
        }
      }
    }
  }
};
AdfDhtmlPage.prototype._handleRichResponseFragment = function(fragmentNode, resizeDomNodes, domReplacedIds, needsUnescape, savedFocusPath, isStreaming, replacedDirtyValues, oldValues, replacedTableState) {
  if(fragmentNode.getAttribute("id") == AdfDhtmlPage._STATE_PARAM_NAME) {
    this._updateViewState(fragmentNode);
    return null
  }
  var sourceNode = this._getFirstElementFromFragment(fragmentNode, needsUnescape);
  if(sourceNode == null) {
    AdfLogger.LOGGER.warning("Unable to locate content in partial page response fragment.  " + "If you are adding a partial target programmatically, try setting " + 'clientComponent\x3d"true" on the partial target component.');
    return null
  }
  var fragmentValues = {"restoreFocusIndex":null, "pprNavParams":null, "pendingEditableSubtree":null};
  var id = sourceNode.getAttribute("id");
  AdfAssert.assert(id != null, "null id in response fragment");
  if(this._componentsUpdatedByPollEvent != null) {
    this._componentsUpdatedByPollEvent.push(id)
  }
  var agent = AdfAgent.AGENT;
  var targetNode = agent.getElementById(id);
  if(targetNode == null) {
    AdfLogger.LOGGER.severe("unable to locate target node: " + id)
  }else {
    var isStyleHolder = sourceNode.getAttribute(AdfDhtmlPage._DOCUMENT_STYLE_HOLDER);
    if(isStyleHolder == "true") {
      var body = this.getDomDocument().body;
      var theme = sourceNode.getAttribute("theme");
      body.setAttribute("theme", theme ? theme : "");
      sourceNode.removeAttribute("theme");
      var className = sourceNode.className;
      var oldClassName = body.className;
      if(className != oldClassName) {
        body.className = className ? className : "";
        this.setHighContrast(this._isHighContrast)
      }
      sourceNode.className = "";
      var style = sourceNode.style.cssText;
      body.style.cssText = style ? style : "";
      sourceNode.style.cssText = ""
    }
    var oldQueryParams = this._getQueryParamsFromActionUrl();
    var affectedIndex = savedFocusPath[id];
    var component = AdfRichUIPeer.getFirstAncestorComponent(targetNode.parentNode);
    var peer = component ? component.getPeer() : null;
    var isPPRNavigation = sourceNode.id == AdfDhtmlPage._NAVIGATION_WRAPPER_ID;
    if(isPPRNavigation) {
      this._navResetPage()
    }
    this._saveValuesOfDirtyComponentsBeingReplaced(targetNode, replacedDirtyValues, oldValues);
    this._saveTableState(targetNode, replacedTableState);
    if(peer != null) {
      peer.replaceDomElement(component, sourceNode, targetNode);
      domReplacedIds.push(component.getClientId())
    }else {
      this.__replaceDomElement(sourceNode, targetNode)
    }
    if(affectedIndex != null && !isPPRNavigation) {
      fragmentValues["restoreFocusIndex"] = affectedIndex
    }
    var resizeDomNode = null;
    if(component) {
      resizeDomNode = peer.domReplaceNotify(component, sourceNode);
      this.__queueDescendantResizeNotifySource(component)
    }else {
      resizeDomNode = sourceNode
    }
    if(resizeDomNode) {
      resizeDomNodes.push(resizeDomNode)
    }
    if(isPPRNavigation) {
      var viewId = agent.getAttribute(sourceNode, AdfDhtmlPage._NAVIGATION_VIEW_ROOT);
      var queryParams = agent.getAttribute(sourceNode, AdfDhtmlPage._NAVIGATION_QUERY_PARAMS);
      queryParams = queryParams != null ? queryParams : oldQueryParams;
      fragmentValues["pprNavParams"] = {"viewId":viewId, "queryParams":queryParams}
    }else {
      if(!isStreaming) {
        this._setRichResponseDirty(true)
      }
    }
    var editableSubtreeId = this._editableSubtreeId;
    if(editableSubtreeId) {
      var editableSubtrees = this._getEditableSubtrees(editableSubtreeId, true);
      for(var i = 0;i < editableSubtrees.length;i++) {
        if(AdfDhtmlPopupWindow.isAncestorOrSelf(editableSubtrees[i], sourceNode)) {
          fragmentValues["pendingEditableSubtree"] = sourceNode;
          break
        }
      }
    }
  }
  return fragmentValues
};
AdfDhtmlPage.prototype._restorePreviousUserActivityData = function() {
  if(this.isUserActivityMonitoringOn()) {
    var prevActInfo = null;
    prevActInfo = AdfUserActivityInfo.getInstance(AdfUserActivityInfo.PREVIOUS);
    if(prevActInfo && prevActInfo.getContextId() != null) {
      AdfUserActivityInfo.restoreFromSessionStorage();
      prevActInfo.setClientEndTime((new Date).getTime().toString())
    }
  }
};
AdfDhtmlPage.prototype.__replaceDomElement = function(newElement, oldElement) {
  var agent = AdfAgent.AGENT;
  this.removeComponentsInSubtree(oldElement);
  var removingAll = oldElement.id == AdfDhtmlPage._NAVIGATION_WRAPPER_ID;
  if(!removingAll) {
    agent.elementsRemoved(oldElement)
  }
  oldElement.parentNode.replaceChild(newElement, oldElement);
  if(removingAll) {
    agent.allElementsRemoved()
  }
  if(agent.getPlatform() == AdfAgent.IE_PLATFORM) {
    var div = agent.getElementById(AdfDhtmlPage._PARSER_DIV_ID);
    div.appendChild(oldElement);
    div.innerHTML = ""
  }
  agent.elementsAdded(newElement)
};
AdfDhtmlPage.prototype._getFirstElementFromFragment = function(fragmentNode, needsUnescape) {
  var fragmentChildNodes = fragmentNode.childNodes;
  var outerHTML;
  var fragChildCount = fragmentChildNodes.length;
  AdfAssert.assert(fragChildCount >= 1, "invalid fragment child count");
  if(fragChildCount > 1) {
    var data = new Array(fragChildCount);
    for(var n = 0;n < fragChildCount;n++) {
      var cdataNode = fragmentChildNodes[n];
      AdfAssert.assert(cdataNode.nodeType == 4, "invalid fragment content");
      AdfAssert.assert(cdataNode.data, "null fragment content");
      data.push(cdataNode.data)
    }
    outerHTML = data.join("")
  }else {
    var cdataNode = fragmentChildNodes[0];
    AdfAssert.assert(cdataNode.nodeType == 4, "invalid fragment content");
    AdfAssert.assert(cdataNode.data, "null fragment content");
    outerHTML = cdataNode.data
  }
  if(needsUnescape) {
    outerHTML = outerHTML.replace(/__AFR_XML_ELEM/g, "xml")
  }
  var doc = this.getDomDocument();
  var div = null;
  var agent = AdfAgent.AGENT;
  div = agent.getElementById(AdfDhtmlPage._PARSER_DIV_ID);
  if(!div) {
    div = doc.createElement("div");
    div.style.display = "none";
    div.id = AdfDhtmlPage._PARSER_DIV_ID;
    doc.body.appendChild(div);
    agent.elementsAdded(div)
  }
  if(agent.getPlatform() == AdfAgent.IE_PLATFORM) {
    div.innerHTML = "\x3cdiv\x3eie\x3c/div\x3e" + outerHTML;
    div.removeChild(div.firstChild)
  }else {
    div.innerHTML = outerHTML
  }
  var elem = AdfDhtmlPage._getFirstElementWithId(div);
  if(elem) {
    elem.parentNode.removeChild(elem)
  }
  return elem
};
AdfDhtmlPage._getFirstElementWithId = function(domNode) {
  var childNodes = domNode.childNodes;
  var length = childNodes.length;
  for(var i = 0;i < length;i++) {
    var childNode = childNodes[i];
    if(childNode.nodeType == 1) {
      if(childNode.id) {
        return childNode
      }
      return AdfDhtmlPage._getFirstElementWithId(childNode)
    }
  }
  return null
};
AdfDhtmlPage.prototype._loadScript = function(source) {
  var service = this._getScriptLoadingService();
  service.addLibraryScript(source, AdfScriptLoadingService.METHOD_ANY)
};
AdfDhtmlPage.prototype._loadSynchronousScript = function(source) {
  var service = this._getScriptLoadingService();
  service.addLibraryScript(source, AdfScriptLoadingService.METHOD_SYNCHRONOUS)
};
AdfDhtmlPage.prototype._loadBackgroundScript = function(source) {
  var service = this._getScriptLoadingService();
  service.addLibraryScript(source, AdfScriptLoadingService.METHOD_BACKGROUND)
};
AdfDhtmlPage.prototype.setScriptLoadingPolicy = function(policy) {
  this._scriptLoadingPolicy = policy
};
AdfDhtmlPage.prototype._getScriptLoadingService = function() {
  var service = this._scriptLoadingService;
  if(service == null) {
    var domWindow = this.getDomWindow();
    var domDocument = this.getDomDocument();
    service = new AdfScriptLoadingService(domWindow, domDocument, this._scriptLoadingPolicy);
    var listener = this.createCallback(this._scriptLoadingStatusChange);
    service.addLoadListener(listener);
    this._scriptLoadingService = service;
    this._scriptLoadingListener = listener
  }
  return service
};
AdfDhtmlPage.prototype._scriptLoadingStatusChange = function(status) {
  var blockReason = AdfDhtmlPage._UI_BLOCK_REASON_SCRIPT_LOADING;
  var dts = this.getDataTransferService();
  if(status == AdfScriptLoadingService.STATUS_LOADING) {
    dts.suspend();
    this._blockUI(true, blockReason)
  }else {
    this._blockUI(false, blockReason);
    dts.resume()
  }
};
AdfDhtmlPage.prototype._createStyle = function(content) {
  return AdfAgent.AGENT.createStyle(content)
};
AdfDhtmlPage.prototype._nodeListToArray = function(nodeList) {
  if(nodeList) {
    var size = nodeList.length;
    var array = new Array(size);
    for(var i = 0;i < size;i++) {
      array[i] = nodeList[i]
    }
    return array
  }else {
    return nodelist
  }
};
AdfDhtmlPage.prototype._getHead = function() {
  return AdfDomUtils.getFirstDescendentElement(this.getDocument().documentElement, "HEAD")
};
AdfDhtmlPage.prototype._getLinkChildren = function(ancestor) {
  if(ancestor) {
    return this._nodeListToArray(ancestor.getElementsByTagName("LINK"))
  }else {
    return[]
  }
};
AdfDhtmlPage.prototype._loadCss = function(source) {
  var loadedCss = this._loadedCss;
  AdfAssert.assert(loadedCss != null, "Unexpected loadedCss ", loadedCss);
  var head = this._getHead();
  if(loadedCss[source]) {
    var headLinks = this._getLinkChildren(head);
    var count = headLinks.length;
    for(var i = count - 1;i >= 0;--i) {
      var elem = headLinks[i];
      if(elem.getAttribute("href") == source) {
        return elem
      }
    }
  }else {
    loadedCss[source] = true
  }
  var link = this._createLink(source);
  head.appendChild(link);
  return link
};
AdfDhtmlPage.prototype._createLink = function(href, extraProps) {
  var link = this.getDocument().createElement("link");
  link.setAttribute("type", "text/css");
  link.setAttribute("rel", "stylesheet");
  link.setAttribute("href", href);
  if(extraProps) {
    for(var key in extraProps) {
      link.setAttribute(key, extraProps[key])
    }
  }
  return link
};
AdfDhtmlPage.prototype._handleRichResponseScript = function(scriptNode) {
  var source = scriptNode.getAttribute("src");
  if(source) {
    this._loadScript(source)
  }else {
    var agent = AdfAgent.AGENT;
    var nodeText = agent.getTextContent(scriptNode);
    if(nodeText) {
      var scriptLoadingService = this._getScriptLoadingService();
      scriptLoadingService.addInlineScript(nodeText)
    }
  }
};
AdfDhtmlPage.prototype._handleRichResponseLibrary = function(scriptNode, loadInTheBackground) {
  var nodeText = AdfAgent.AGENT.getTextContent(scriptNode);
  if(loadInTheBackground) {
    this._loadBackgroundScript(nodeText)
  }else {
    this._loadScript(nodeText)
  }
};
AdfDhtmlPage.prototype._doResizeNotify = function(domNodes) {
  for(var i = 0;i < domNodes.length;i++) {
    var domNode = domNodes[i];
    this.doResizeNotifyDom(domNode, true)
  }
};
AdfDhtmlPage.prototype._forcePreloadOfAllImages = function() {
  var allImages = document.getElementsByTagName("IMG");
  for(var i = 0;i < allImages.length;i++) {
    var clone = new Image(1, 1);
    clone.src = allImages[i].getAttribute("src")
  }
};
AdfDhtmlPage.prototype.__setWindowDetectionStrategy = function(option) {
  this._windowDetectionStrategy = option
};
AdfDhtmlPage.prototype.notifyWindowUnloaded = function() {
  var windowDetectionStrategy = this._windowDetectionStrategy;
  if("none" === windowDetectionStrategy) {
    return
  }
  var windowId = this.getDomWindow().name;
  if(!windowId || this.isPerformingFullSubmit() || this._partialRequestRedirect || this._isPrintablePage() || this._returnFromDialog || this.isAttachmentMode()) {
    return
  }
  var agentName = navigator.userAgent;
  if(agentName.indexOf("Chrome") != -1 && AdfAgent.AGENT.getVersion() >= 73) {
    this._synchronousUnloadedNotify = false
  }else {
    this._synchronousUnloadedNotify = "aggressive" == windowDetectionStrategy
  }
  if(this._getAndClearDeltas(false)) {
    var headerMap = this._windowEventHeaderMap;
    if(!headerMap) {
      headerMap = this._windowEventHeaderMap = {}
    }
    headerMap["Adf-Window-Unloaded"] = "with-property-delta";
    headerMap["Adf-Window-Id"] = windowId;
    if(this._notifyOfUnloadUrl) {
      headerMap["Adf-Window-Url"] = this._notifyOfUnloadUrl
    }
    this._deliverQueuedServerEvents(true, true)
  }else {
    var content = AdfDhtmlPage._appendUrlFormEncoded("", "Adf-Window-Id", windowId);
    if(this._pageStateId != null && this._pageStateId !== "") {
      content = AdfDhtmlPage._appendUrlFormEncoded(content, AdfDhtmlPage._PAGE_STATE_ID, this._pageStateId)
    }
    var actionURL = this._getDefaultPostbackURL();
    var xmlr = new AdfXMLRequest;
    xmlr.setSynchronous(this._synchronousUnloadedNotify);
    delete this._synchronousUnloadedNotify;
    xmlr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    xmlr.setRequestHeader("Adf-Window-Unloaded", true);
    xmlr.setRequestHeader("Adf-Window-Id", windowId);
    if(this._notifyOfUnloadUrl) {
      xmlr.setRequestHeader("Adf-Window-Url", this._notifyOfUnloadUrl)
    }
    xmlr.send(actionURL, content);
    xmlr.cleanup();
    delete xmlr
  }
};
AdfDhtmlPage.prototype.__notifyWindowClose = function(returnId) {
  var windowDetectionStrategy = this._windowDetectionStrategy;
  if("none" === windowDetectionStrategy) {
    return
  }
  var headerMap = this._windowEventHeaderMap;
  if(!headerMap) {
    headerMap = this._windowEventHeaderMap = {}
  }
  headerMap["Adf-Window-Closed"] = "joined";
  headerMap["Adf-Window-Id"] = this.getWindowId();
  if(headerMap["Adf-Dialog-Return-Id"]) {
    headerMap["Adf-Dialog-Return-Id"] += "," + returnId
  }else {
    headerMap["Adf-Dialog-Return-Id"] = returnId
  }
};
AdfDhtmlPage.prototype.__notifyWindowCloseImmediately = function(windowClosed, returnId) {
  if(this._inAppNavigationFlag == false) {
    var windowDetectionStrategy = this._windowDetectionStrategy;
    if("none" === windowDetectionStrategy) {
      return
    }
    var xmlHttp = new AdfXMLRequest;
    var isSync = "aggressive" == windowDetectionStrategy;
    xmlHttp.setSynchronous(isSync);
    if(windowClosed) {
      xmlHttp.setRequestHeader("Adf-Window-Closed", "discrete");
      xmlHttp.setRequestHeader("Adf-Window-Id", this.getWindowId());
      xmlHttp.setRequestHeader("Adf-Dialog-Return-Id", returnId)
    }else {
      xmlHttp.setRequestHeader("Adf-Window-Unregistered", "true");
      xmlHttp.setRequestHeader("Adf-Window-Unregistered-Id", this.getWindowId());
      xmlHttp.setRequestHeader("Adf-Page-Unregistered-Id", this.getPageId())
    }
    if(this._pageStateId != null && this._pageStateId !== "") {
      xmlHttp.setRequestHeader(AdfDhtmlPage._PAGE_STATE_ID, this._pageStateId)
    }
    var actionURL = this._getDefaultPostbackURL();
    var body = "windowClosed";
    xmlHttp.send(actionURL, body)
  }
};
AdfDhtmlPage.prototype.__ensureCoreBackgroundLoaded = function() {
  this._checkCoreBackgroundLoaded(true)
};
AdfDhtmlPage.prototype.isCoreBackgroundScriptLoaded = function() {
  return this.getDomWindow()["AdfDhtmlPopupWindow"] != null
};
AdfDhtmlPage.prototype._checkCoreBackgroundLoaded = function(forceLoad) {
  var loaded = this.isCoreBackgroundScriptLoaded();
  if(forceLoad && !loaded) {
    var uri = this._coreBackgroundURI;
    AdfAssert.assert(uri != null, "Unxexpected null coreBackgroundURI");
    this._loadSynchronousScript(uri)
  }
  return loaded
};
AdfDhtmlPage.prototype.__loadCoreBackgroundScript = function(url) {
  this._coreBackgroundURI = url;
  this._loadBackgroundScript(url)
};
AdfDhtmlPage._doResizeNotify = function(node, forceResize, checkAll) {
  if(node) {
    var component = node.component;
    if(component) {
      var domElement = AdfRichUIPeer.getDomElementForComponent(component);
      var newClientWidth = domElement.clientWidth;
      var newClientHeight = domElement.clientHeight;
      var oldClientWidth = node.clientWidth;
      var oldClientHeight = node.clientHeight;
      if(newClientWidth == 0 || newClientHeight == 0 || newClientWidth == oldClientWidth && newClientHeight == oldClientHeight && !forceResize) {
        node.clientWidth = newClientWidth;
        node.clientHeight = newClientHeight;
        if(!checkAll) {
          return
        }
      }else {
        node.clientWidth = newClientWidth;
        node.clientHeight = newClientHeight;
        component.resizeNotify(oldClientWidth, oldClientHeight, newClientWidth, newClientHeight)
      }
    }
    var children = node.children;
    if(children) {
      var length = children.length;
      for(var i = 0;i < length;i++) {
        AdfDhtmlPage._doResizeNotify(children[i], false, checkAll)
      }
    }
  }
};
AdfDhtmlPage.prototype._checkResizeNotifyDelayed = function() {
  var timeout = 500;
  var timer = this._checkResizeNotifyTimer;
  if(timer) {
    this.rescheduleTimer(timer, timeout)
  }else {
    this._checkResizeNotifyTimer = this.scheduleTimer(this, this._checkResizeNotifyCallback, null, timeout)
  }
};
AdfDhtmlPage.prototype._checkResizeNotifyCallback = function() {
  this._checkResizeNotifyTimer = null;
  this.__perfTimings(false, true, false, "_checkResizeNotifyCallback", "(start)");
  AdfDhtmlPage._doResizeNotify(this._resizeNotifyTree, false, true);
  this.__perfTimings(false, false, false, "_checkResizeNotifyCallback", "(end)")
};
AdfDhtmlPage._appendUrlFormEncoded = function(buffer, key, value) {
  if(buffer.length > 0) {
    buffer = buffer + "\x26"
  }
  return buffer + key + "\x3d" + encodeURIComponent(value).replace(/\'/g, "%27").replace(/%20/g, "+")
};
AdfDhtmlPage.prototype._setSelectedEditingComponents = function(newSelection) {
  AdfAssert.assertArrayOrNull(newSelection);
  var oldSelection = this.getSelectedEditingComponents();
  if(newSelection == oldSelection) {
    return
  }
  var selectedStyleClass = "p_AFInlineSelected";
  var selectionIndex;
  if(oldSelection != null) {
    var oldSelectionCount = oldSelection.length;
    for(selectionIndex = 0;selectionIndex < oldSelectionCount;selectionIndex++) {
      AdfDomUtils.removeCSSClassName(AdfRichUIPeer.getDomContentElementForComponent(oldSelection[selectionIndex]), selectedStyleClass)
    }
  }
  var newSelectionCount = newSelection ? newSelection.length : 0;
  var newSelectedClientIds;
  if(newSelectionCount) {
    newSelectedClientIds = [];
    for(selectionIndex = 0;selectionIndex < newSelectionCount;selectionIndex++) {
      newSelectedClientIds.push(newSelection[selectionIndex].getClientId())
    }
  }else {
    newSelectedClientIds = null
  }
  this._selectedEditingComponents = newSelectedClientIds;
  if(newSelectionCount) {
    for(selectionIndex = 0;selectionIndex < newSelectionCount;selectionIndex++) {
      AdfDomUtils.addCSSClassName(AdfRichUIPeer.getDomContentElementForComponent(newSelection[selectionIndex]), selectedStyleClass)
    }
  }
  var editedComponent = this.getEditedComponent();
  if(editedComponent && AdfCollections.indexOf(newSelection, editedComponent) == -1) {
    this.setEditedComponent(null)
  }
  AdfEventUtils.firePropertyChangeEvent(this._propertyChangeListeners, this, AdfPage.SELECTED_EDITING_COMPONENTS_PROPERTY, oldSelection, newSelection)
};
AdfDhtmlPage.prototype._isAncestorComponentOrSelf = function(possibleAncestor, possibleChild) {
  if(possibleAncestor === possibleChild) {
    return true
  }else {
    return this._isAncestorComponent(possibleAncestor, possibleChild)
  }
};
AdfDhtmlPage.prototype._isAncestorComponent = function(possibleAncestor, possibleChild) {
  AdfAssert.assertPrototype(possibleAncestor, AdfUIComponent);
  AdfAssert.assertPrototype(possibleChild, AdfUIComponent);
  var ancestorContent = AdfRichUIPeer.getDomContentElementForComponent(possibleAncestor);
  var currDom = AdfRichUIPeer.getDomNodeForComponent(possibleChild).parentNode;
  while(currDom) {
    if(currDom === ancestorContent) {
      return true
    }
    currDom = currDom.parentNode
  }
  return false
};
AdfDhtmlPage.prototype._intersectSelectionWithEditableSubtree = function(editableSubtree, selection) {
  AdfAssert.assertPrototypeOrNull(editableSubtree, AdfUIComponent);
  AdfAssert.assertArrayOrNull(selection);
  if(editableSubtree == null) {
    return null
  }
  return this._intersectSelectionWithEditableSubtreeDom(editableSubtree.getPeer().getDomNode(), selection)
};
AdfDhtmlPage.prototype._intersectSelectionWithEditableSubtreeDom = function(editableSubtreeDom, selection) {
  if(editableSubtreeDom == null) {
    return null
  }
  AdfAssert.assertDomNode(editableSubtreeDom);
  AdfAssert.assertArrayOrNull(selection);
  var selectionCount = selection != null ? selection.length : 0;
  if(selectionCount == 0) {
    return null
  }
  var newSelection = [];
  for(var i = 0;i < selectionCount;i++) {
    var currSelectedComponent = selection[i];
    var peer = currSelectedComponent.getPeer();
    peer.bind(currSelectedComponent);
    var currSelectedComponentDom = peer.getDomNode();
    if(AdfDhtmlPopupWindow.isAncestorOrSelf(editableSubtreeDom, currSelectedComponentDom)) {
      newSelection.push(currSelectedComponent)
    }
  }
  if(newSelection.length == selectionCount) {
    newSelection = selection
  }
  return newSelection
};
AdfDhtmlPage.prototype._isComponentInlineSelectable = function(componentDomElement) {
  return AdfDomUtils.containsCSSClassName(componentDomElement, AdfDhtmlPage._EDITABLE_STYLE) || AdfDomUtils.containsCSSClassName(componentDomElement, AdfDhtmlPage._SELECTABLE_STYLE)
};
AdfDhtmlPage.prototype._inlineSelectionListener = function(event) {
  var agent = AdfAgent.AGENT;
  var domEventType = event.type;
  var preventDefault = true;
  var isMouseMove = domEventType === "mousemove";
  if(isMouseMove || domEventType == "mouseover" || domEventType == "mousedown" || domEventType == "mouseout") {
    if(isMouseMove || domEventType == "mousedown") {
      preventDefault = !agent.isChromeEvent(event);
      if(!preventDefault) {
        return
      }
    }
    if(!isMouseMove) {
      var eventTarget = agent.getEventTarget(event);
      var component = AdfRichUIPeer.getFirstAncestorComponent(eventTarget);
      var editableSubtree = this.getEditableSubtree();
      var contentDomElement;
      while(component != null) {
        contentDomElement = AdfRichUIPeer.getDomContentElementForComponent(component);
        if(this._isComponentInlineSelectable(contentDomElement)) {
          break
        }else {
          if(component != editableSubtree) {
            component = component.getParent()
          }else {
            component = null
          }
        }
      }
      if(component && (domEventType == "mouseover" || domEventType == "mouseout")) {
        var isIE = agent.getPlatform() == AdfAgent.IE_PLATFORM;
        var isRTL = AdfPage.PAGE.getLocaleContext().isRightToLeft();
        if(!(isIE && isRTL)) {
          var hoverStyle = AdfRichUIPeer.HOVER_TARGET_STYLECLASS;
          if(domEventType == "mouseover") {
            var oldHoverClientId = this._hoverComponentId;
            var newHoverClientId = component.getClientId();
            if(oldHoverClientId !== newHoverClientId) {
              if(oldHoverClientId) {
                this._removeStyleFromComponent(oldHoverClientId, hoverStyle)
              }
              this._hoverComponentId = newHoverClientId;
              AdfDomUtils.addCSSClassName(contentDomElement, hoverStyle)
            }
          }else {
            if(domEventType == "mouseout") {
              oldHoverClientId = this._hoverComponentId;
              if(oldHoverClientId) {
                this._removeStyleFromComponent(oldHoverClientId, hoverStyle);
                this._hoverComponentId = null
              }
            }
          }
        }else {
          AdfLogger.LOGGER.info("Due to a bug in IE, skinning's hover-target pseudo class not supported on IE in right to left mode.")
        }
      }else {
        if(component && domEventType == "mousedown") {
          var filterFunction = this._editableCallback;
          var filterContext = this._editableCallbackContext;
          if(!this._getFilterResult(component, filterFunction, filterContext)) {
            var prevSibling = contentDomElement.previousSibling;
            component = null;
            while(prevSibling) {
              var nodeType = prevSibling.nodeType;
              if(nodeType == 8) {
                var commentComponent = this._getComponentFromComment(prevSibling);
                if(commentComponent && this._getFilterResult(commentComponent, filterFunction, filterContext)) {
                  component = commentComponent;
                  break
                }
              }else {
                if(nodeType == 1) {
                  break
                }
              }
              prevSibling = prevSibling.previousSibling
            }
          }
          if(component) {
            this.setEditedComponent(component, event)
          }
        }
      }
    }
  }
  var currInlineEditor = this._inlineEditor;
  if(currInlineEditor != null) {
    currInlineEditor.handleEvent(event)
  }
  if(preventDefault) {
    agent.eatEvent(event)
  }else {
    agent.stopPropagation(event)
  }
};
AdfDhtmlPage.prototype._removeStyleFromComponent = function(clientId, styleClass) {
  var removeComponent = this.findComponent(clientId);
  if(removeComponent) {
    var removeDomElement = AdfRichUIPeer.getDomContentElementForComponent(removeComponent);
    return AdfDomUtils.removeCSSClassName(removeDomElement, styleClass)
  }else {
    return false
  }
};
AdfDhtmlPage._inlineSelectionStub = function(event) {
  AdfPage.PAGE._inlineSelectionListener(event)
};
AdfDhtmlPage.prototype.setDefaultMessageHandlerComponentId = function(id, slaveId) {
  if(id != null) {
    this._defaultMessageKey = id
  }
  this._messageSlaveKey = slaveId
};
AdfDhtmlPage.prototype.getDefaultMessageHandlerComponentId = function() {
  return this._defaultMessageKey
};
AdfDhtmlPage.prototype.getMessageHandlerSlaveComponentId = function() {
  return this._messageSlaveKey
};
AdfDhtmlPage.prototype.addMessage = function(componentId, facesMessage, toBeRemoved) {
  var messageId = this._resolveMessageComponentId(componentId, false);
  if(this.findComponent(messageId) == null) {
    for(var streamingId in this._pendingStreamingIDs) {
      if(messageId.indexOf(streamingId) == 0) {
        this._delayMessageForComponent(messageId, facesMessage, toBeRemoved);
        AdfLogger.LOGGER.info("A message for client id '" + messageId + "' is being added as delayed messages");
        return
      }
    }
    if(AdfAssert.DEBUG) {
      AdfAssert.assert(false, "A message for client id '" + messageId + "' is being added. No client component with that id can be found. ")
    }
  }
  messageId = this._resolveMessageComponentId(componentId, true);
  var array = this._messages[messageId];
  if(!array) {
    array = [];
    array.sorted = [];
    array.maxType = 0;
    array.compId = messageId;
    array.title = toBeRemoved;
    this._messages[messageId] = array
  }
  var type = AdfFacesMessage.getTypeFromMessage(facesMessage);
  if(this._trackErrors && type >= AdfFacesMessage.TYPE_ERROR) {
    this._richPostbackHasErrors = true
  }
  if(!array.sorted[type]) {
    array.sorted[type] = []
  }
  array.push(facesMessage);
  array.sorted[type].push(facesMessage);
  if(type > array.maxType) {
    array.maxType = type
  }
  var slaveMessagesClientId = this.getMessageHandlerSlaveComponentId();
  var msgComp = this.findComponent(slaveMessagesClientId != null ? slaveMessagesClientId : this.getDefaultMessageHandlerComponentId());
  var displayGlobalMsgsOnly = msgComp.getGlobalOnly ? msgComp.getGlobalOnly() : false;
  var globalType = this._global_max_msg_type;
  if(!globalType || type > globalType) {
    if(type == null) {
      delete this._global_max_msg_type
    }else {
      var globalMessageKey = this._resolveMessageComponentId(null, false);
      var isGlobalMsg = componentId == null || componentId == globalMessageKey;
      if(isGlobalMsg || !isGlobalMsg && !displayGlobalMsgsOnly) {
        this._global_max_msg_type = type
      }
    }
  }
  this._notifyComponentMessaging(messageId, array)
};
AdfDhtmlPage.prototype.showMessages = function(componentId) {
  componentId = this._resolveMessageComponentId(componentId, true);
  var allMessages = this.getAllMessages();
  var messageArray = allMessages[componentId];
  var component = this.findComponent(componentId);
  if(component != null) {
    var peer = component.getPeer();
    peer.bind(component);
    if(messageArray != null) {
      peer.messageShow(component, messageArray.maxType, messageArray)
    }else {
      peer.messageShow(component)
    }
  }
};
AdfDhtmlPage.prototype.getMessages = function(componentId) {
  componentId = this._resolveMessageComponentId(componentId, true);
  return this._messages[componentId]
};
AdfDhtmlPage.prototype.getAllMessages = function() {
  var allMessages = this._messages;
  var defaultMsgCompId = this.getDefaultMessageHandlerComponentId();
  var visibleMessages = {};
  for(messageId in allMessages) {
    var currComponent = this.findComponent(messageId);
    if(currComponent == null) {
      AdfLogger.LOGGER.info("AdfDhtmlPage.getAllMessages: ignoring messages for non-existing component: ", currComponent);
      continue
    }
    if(defaultMsgCompId == messageId) {
      visibleMessages[messageId] = allMessages[messageId]
    }else {
      var currDomElement = AdfRichUIPeer.getDomElementForComponent(currComponent);
      if(AdfDomUtils.isInVisibleSubtree(currDomElement)) {
        visibleMessages[messageId] = allMessages[messageId]
      }else {
        AdfLogger.LOGGER.info("AdfDhtmlPage.getAllMessages: ignoring messages for hidden component: ", currComponent)
      }
    }
  }
  return visibleMessages
};
AdfDhtmlPage.prototype.getClientIdsWithMessages = function(rootId) {
  var ids = [];
  var messages = this._messages;
  var defaultId = this._defaultMessageKey;
  var rootNode;
  if(rootId != null) {
    rootNode = this._getSubtreeRootNode(rootId)
  }
  for(var clientId in messages) {
    if(!rootNode && clientId == defaultId) {
      ids.push(null)
    }else {
      var currComponent = this.findComponent(clientId);
      if(currComponent == null) {
        continue
      }
      var currDomElement = AdfRichUIPeer.getDomElementForComponent(currComponent);
      if(AdfDomUtils.isInVisibleSubtree(currDomElement)) {
        if(rootNode == null || rootId == clientId || AdfDomUtils.isAncestor(rootNode, currDomElement)) {
          ids.push(clientId)
        }
      }
    }
  }
  return ids
};
AdfDhtmlPage.prototype.__setGlobalMessagesResetStrategy = function(strategy) {
  this._globalMessagesResetStrategy = strategy
};
AdfDhtmlPage.prototype.clearMessages = function(componentId) {
  componentId = this._resolveMessageComponentId(componentId, false);
  var messages = this._messages[componentId];
  if(messages != null) {
    delete this._messages[componentId];
    delete this._global_max_msg_type;
    this._notifyComponentMessaging(componentId, null)
  }
  this._clearDelayedMessages(componentId)
};
AdfDhtmlPage.prototype.clearAllMessages = function() {
  var toBlank = [];
  for(var id in this._messages) {
    toBlank.push(id)
  }
  this._messages = {};
  this._messages = {dirtyComponentsToRender:[]};
  delete this._global_max_msg_type;
  for(var index in toBlank) {
    this._notifyComponentMessaging(toBlank[index], null)
  }
  this._clearAllDelayedMessages()
};
AdfDhtmlPage.prototype.hasMessages = function(componentId) {
  return this.getMessages(componentId) != null
};
AdfDhtmlPage.prototype._getSubtreeRootNode = function(rootId) {
  var rootComp = AdfPage.PAGE.findComponent(rootId);
  var rootNode;
  if(rootComp && rootComp instanceof AdfRichPopup) {
    rootNode = AdfDhtmlPopupPeer.getContentDom(rootComp)
  }else {
    rootNode = AdfAgent.AGENT.getElementById(rootId)
  }
  return rootNode
};
AdfDhtmlPage.prototype.clearSubtreeMessages = function(rootId) {
  var messageIds = this.getClientIdsWithMessages();
  if(messageIds) {
    var agent = AdfAgent.AGENT;
    var rootNode = this._getSubtreeRootNode(rootId);
    if(rootNode) {
      for(var i = 0;i < messageIds.length;i++) {
        var messageId = messageIds[i];
        if(messageId != null) {
          var messageNode = agent.getElementById(messageId);
          if(!messageNode || rootId == messageId || AdfDomUtils.isAncestor(rootNode, messageNode)) {
            this.clearMessages(messageId)
          }
        }
      }
    }
  }
};
AdfDhtmlPage.prototype._resolveMessageComponentId = function(componentId, useDefaultAsFallback) {
  if(!useDefaultAsFallback) {
    return componentId == null ? this.getDefaultMessageHandlerComponentId() : componentId
  }
  if(componentId != null) {
    var component = this.findComponent(componentId);
    if(component instanceof AdfUIEditableValue) {
      return componentId
    }
    var overrideElemId = AdfDhtmlPage._FOR_CONTAINER_PREFIX + componentId;
    var overrideElem = AdfAgent.AGENT.getElementById(overrideElemId);
    if(overrideElem != null) {
      return componentId
    }
  }
  return this._defaultMessageKey
};
AdfDhtmlPage.prototype._getMaxType = function() {
  var maxType = this._global_max_msg_type;
  if(!maxType) {
    var defaultMessagesClientId = this.getDefaultMessageHandlerComponentId();
    var slaveMessagesClientId = this.getMessageHandlerSlaveComponentId();
    var msgComp = this.findComponent(slaveMessagesClientId != null ? slaveMessagesClientId : defaultMessagesClientId);
    var displayGlobalMsgsOnly = msgComp.getGlobalOnly ? msgComp.getGlobalOnly() : false;
    var globalMessageKey = this._resolveMessageComponentId(null, false);
    for(var f in this._messages) {
      if(displayGlobalMsgsOnly && f != globalMessageKey) {
        continue
      }
      var message = this._messages[f];
      if(message != null && (maxType == null || message.maxType > maxType)) {
        maxType = message.maxType
      }
    }
    if(maxType != null) {
      this._global_max_msg_type = maxType
    }
  }
  return maxType
};
AdfDhtmlPage.prototype._notifyComponentMessaging = function(componentId) {
  var messageArray = this._messages[componentId];
  if(componentId != this._defaultMessageKey) {
    var overrideElementId = AdfDhtmlPage._FOR_CONTAINER_PREFIX + componentId;
    var overrideElement = AdfAgent.AGENT.getElementById(overrideElementId);
    if(overrideElement != null) {
      if(messageArray != null) {
        messageArray["overridden"] = true
      }
      var dirtyComps = this._messages.dirtyComponentsToRender;
      if(dirtyComps.indexOf(componentId) < 0) {
        dirtyComps.push(componentId)
      }
      if(!this._messageNotifyTimeOut) {
        this._messageNotifyTimeOut = this.scheduleTimer(this, this._flushMessageComponentNotifications, null, 200, {"isSynchronized":true})
      }
    }
    var component = this.findComponent(componentId);
    if(component != null) {
      var peer = component.getPeer();
      peer.bind(component);
      if(messageArray != null) {
        peer.messageNotify(component, messageArray.maxType, messageArray)
      }else {
        peer.messageNotify(component)
      }
      var keepPropagating = !component.dontPropagateDescendantMessageChanges();
      var ancestor = component.getParent();
      while(ancestor && keepPropagating) {
        peer = ancestor.getPeer();
        if(peer) {
          peer.descendantMessageChanged(ancestor)
        }
        keepPropagating = !ancestor.dontPropagateDescendantMessageChanges();
        ancestor = ancestor.getParent()
      }
    }
  }
  this._updateCombinedMessageHandler(messageArray)
};
AdfDhtmlPage.prototype._updateCombinedMessageHandler = function(messageArray) {
  var component = this.findComponent(this._defaultMessageKey);
  if(component != null) {
    peer = component.getPeer();
    peer.bind(component);
    peer.messageNotify(component, this._getMaxType(), messageArray)
  }
};
AdfDhtmlPage.prototype._flushMessageComponentNotifications = function() {
  var dirtyCompList = this._messages.dirtyComponentsToRender;
  var len = dirtyCompList && dirtyCompList.length || 0;
  for(var index = 0;index < len;index++) {
    var componentId = dirtyCompList[index];
    var messageArray = this._messages && this._messages[componentId] || null;
    var overrideElementId = AdfDhtmlPage._FOR_CONTAINER_PREFIX + componentId;
    var overrideElement = AdfAgent.AGENT.getElementById(overrideElementId);
    if(!overrideElement) {
      continue
    }
    if(messageArray == null) {
      AdfDomUtils.removeAllNodes(overrideElement)
    }else {
      AdfDomUtils.removeAllNodes(overrideElement);
      AdfMessageUtils.appendComponentMessageInlineDom(overrideElement, messageArray)
    }
  }
  this._messages.dirtyComponentsToRender = [];
  delete this._messageNotifyTimeOut
};
AdfDhtmlPage.prototype._addDelayedMessages = function(showMessages) {
  var delayedMessages = this._delayedMessages;
  var addDelayedMessage = false;
  for(var messageId in delayedMessages) {
    if(this.findComponent(messageId) == null) {
      continue
    }
    var messagesArray = delayedMessages[messageId];
    var count = messagesArray.length;
    for(var i = 0;i < count;i++) {
      var messsageEntry = messagesArray[i];
      var title = messsageEntry.pop();
      var facesMessage = messsageEntry.pop();
      this.addMessage(messageId, facesMessage, title);
      addDelayedMessage = true
    }
    this._clearDelayedMessages(messageId)
  }
  if(showMessages && addDelayedMessage) {
    this.showMessages()
  }
};
AdfDhtmlPage.prototype._delayMessageForComponent = function(componentId, facesMessage, title) {
  var messageId = componentId;
  var array = this._delayedMessages[messageId];
  if(!array) {
    array = [];
    this._delayedMessages[messageId] = array
  }
  var messsageEntryArray = [];
  messsageEntryArray.push(facesMessage);
  messsageEntryArray.push(title);
  array.push(messsageEntryArray)
};
AdfDhtmlPage.prototype._clearDelayedMessages = function(componentId) {
  var messages = this._delayedMessages[componentId];
  if(messages != null) {
    delete this._delayedMessages[componentId]
  }
};
AdfDhtmlPage.prototype._clearAllDelayedMessages = function() {
  this._delayedMessages = {}
};
AdfDhtmlPage.prototype.getActiveDataSupport = function() {
  if(this._ads == null) {
    this._ads = new AdfDhtmlActiveData
  }
  return this._ads
};
AdfDhtmlPage.prototype.isActiveDataSupported = function() {
  if(this._ads == null) {
    return false
  }else {
    return true
  }
};
AdfDhtmlPage.prototype.updateStartActiveDataStateChange = function(modelChanged, clientId) {
  var startADSClientIds = this._startADSClientIds;
  var stopADSClientIds = this._stopADSClientIds;
  var hasStop = stopADSClientIds.hasOwnProperty(clientId);
  if(hasStop) {
    delete stopADSClientIds[clientId];
    AdfCollections.removeArrayValue(stopADSClientIds, clientId)
  }
  if(modelChanged || !hasStop) {
    startADSClientIds[clientId] = true;
    this._startADSClientIdCount++;
    AdfLogger.LOGGER.fine("Request start of active data on ", clientId, " startRefCount:", this._canReceiveActiveDataCount);
    if(this._canReceiveActiveDataCount > 0) {
      this._updateDeliveryTimer()
    }
  }
};
AdfDhtmlPage.prototype.__restartAllADSComponents = function() {
  this._restartAllADSComponents = true;
  if(this._canReceiveActiveDataCount > 0) {
    this._updateDeliveryTimer()
  }
};
AdfDhtmlPage.prototype.updateStopActiveDataStateChange = function(clientId) {
  var startADSClientIds = this._startADSClientIds;
  if(clientId in startADSClientIds) {
    delete startADSClientIds[clientId];
    this._startADSClientIdCount--
  }else {
    var stopADSClientIds = this._stopADSClientIds;
    if(!(clientId in stopADSClientIds)) {
      AdfLogger.LOGGER.fine("Queue ADS stop on clientID:", clientId);
      stopADSClientIds[clientId] = true;
      stopADSClientIds.push(clientId);
      this._updateDeliveryTimer()
    }
  }
};
AdfDhtmlPage.prototype._startGlobalActiveData = function() {
  this._canReceiveActiveDataCount++;
  if(this._canReceiveActiveDataCount == 1 && this.isActiveDataSupported()) {
    this.getActiveDataSupport().initActivePage();
    this._updateDeliveryTimer()
  }
};
AdfDhtmlPage.prototype._stopGlobalActiveData = function() {
  this._canReceiveActiveDataCount--
};
AdfDhtmlPage.prototype.stopActiveData = function() {
};
AdfDhtmlPage.prototype.startActiveData = function() {
};
AdfDhtmlPage.PushChannelStates = {CONNECTED:0, CONNECTING:1, DISCONNECTED:2, RECONNECTING:3};
AdfDhtmlPage.prototype.getWindowId = function() {
  if(this._windowId == null) {
    try {
      this._windowId = this.getDomWindow().name
    }catch(e) {
      AdfLogger.LOGGER.logErrorAsInfo(e, "Could not get the window Id.")
    }
  }
  return this._windowId
};
AdfDhtmlPage.prototype.setWindowId = function(windowId) {
  this._windowId = windowId
};
AdfDhtmlPage.prototype.getPageId = function() {
  return this._pageId
};
AdfDhtmlPage.prototype.setPageId = function(pageId) {
  this._pageId = pageId
};
AdfDhtmlPage.prototype.updateAutoPPRComponents = function(pageId, clientIds) {
  this.setPageId(pageId);
  var autoPPRComponents = this._autoPPRComponents;
  var argCount = arguments.length;
  var stopADSClientIds = this._stopADSClientIds;
  for(var i = 1;i < argCount;i++) {
    var clientId = arguments[i];
    AdfAssert.assertString(clientId);
    if(clientId in stopADSClientIds) {
      delete stopADSClientIds[clientId];
      AdfCollections.removeArrayValue(stopADSClientIds, clientId)
    }
    autoPPRComponents[clientId] = true
  }
};
AdfDhtmlPage.prototype._stopAutoPPR = function(clientId) {
  AdfAssert.assertString(clientId);
  delete this._autoPPRComponents[clientId];
  AdfLogger.LOGGER.fine("Stop autoPPR active data on ", clientId);
  this.updateStopActiveDataStateChange(clientId, null)
};
AdfDhtmlPage.prototype._handleBeforeUnload = function(evt) {
  AdfLogger.LOGGER.getLogWriter().flush();
  if(this.isPerformingFullSubmit() && !this._waitingForDocumentUnload) {
    return
  }
  var warningDisplayed = false;
  var message = undefined;
  var documentComponent = this.findComponent(this._documentClientId);
  if(documentComponent) {
    var beforeUnloadEvent = new AdfBeforeUnloadEvent(documentComponent);
    documentComponent.broadcast(beforeUnloadEvent);
    message = beforeUnloadEvent.getWarningMessage();
    if(message !== undefined) {
      warningDisplayed = true
    }
  }
  var hasOpenModalDialogs = AdfDhtmlRichDialogService.hasModalDialogsOpen();
  var trackingRegions = this._isTrackingRegionUncommittedData();
  if(!warningDisplayed && (this._isTrackingDocumentUncommittedData() || trackingRegions || this._checkDirtyDataComponents() || hasOpenModalDialogs)) {
    if(!this._dirtyStateService.__isPotentiallyDirty() && this.getDomWindow()["AdfDhtmlInputBasePeer"] != undefined) {
      var peer = null;
      var comp = this.getActiveComponent();
      if(comp) {
        peer = comp.getPeer()
      }
      if(peer && peer instanceof AdfDhtmlInputBasePeer) {
        peer.__simulateBlur(comp)
      }
    }
    var displayRegionsMessage = false;
    var displayGlobalMessage = this._isTrackingDocumentUncommittedData() && (this._dataDirty || this._dirtyStateService.__isPotentiallyDirty()) || this._checkDirtyDataComponents();
    if(!displayGlobalMessage) {
      var dirtyRegions = this._getDirtyRegionIds();
      displayRegionsMessage = dirtyRegions != null && dirtyRegions.length > 0
    }
    if(displayGlobalMessage || displayRegionsMessage || hasOpenModalDialogs) {
      warningDisplayed = true;
      var laf = this.getLookAndFeel();
      var msgKey = !hasOpenModalDialogs ? "af_document.MSG_UNCOMMITTED_DATA" : "af_document.MSG_DEPENDENT_DIALOGS";
      message = laf.getTranslatedString(msgKey);
      evt.returnValue = message
    }
  }
  this._beforeUnloadDelayed = false;
  if(!warningDisplayed) {
    this._unloading = true;
    this.notifyWindowUnloaded();
    if(this.isActiveDataSupported()) {
      this.getActiveDataSupport().onBeforeUnload()
    }
    if(this.isUserActivityMonitoringOn()) {
      if(this._partialRequestRedirect) {
        AdfUserActivityInfo.saveToSessionStorage()
      }
    }
  }else {
    this._beforeUnloadDelayed = true;
    if(this.isActiveDataSupported()) {
      var page = this;
      window.setTimeout(function() {
        window.setTimeout(function() {
          page.getActiveDataSupport().__checkAdsConnection()
        }, 1E3)
      }, 1)
    }
    evt.returnValue = message;
    return message
  }
};
AdfDhtmlPage.prototype._fixupLinkOnClick = function(element) {
  delete this._notifyOfUnloadUrl;
  while(element != null) {
    if(element.nodeName == "A") {
      break
    }
    element = element.parentNode
  }
  if(element != null) {
    var linkHref = element.href;
    if(linkHref == null) {
      return
    }
    var hrefAttr = element.getAttribute("href");
    if(hrefAttr && hrefAttr.indexOf("#") == 0) {
      return
    }
    this._notifyOfUnloadUrl = linkHref
  }
};
AdfDhtmlPage.prototype.setStreamingDisabled = function(disabled) {
  this._streamingDisabled = disabled
};
AdfDhtmlPage.prototype.isStreamingDisabled = function() {
  return this._streamingDisabled
};
AdfDhtmlPage.prototype.sendStreamingRequest = function(pageStateId, iDs) {
  var formElem = this.getDomDocument().forms[0];
  AdfAssert.assert(formElem, "No form found;  cannot stream data. Make sure that data components are placed within a form");
  var uri = this._getPPRURL(formElem);
  var params = new Object;
  this._addPendingStreamingIDs(iDs, params);
  if(pageStateId != null) {
    params[AdfDhtmlPage._PAGE_STATE_ID] = pageStateId
  }
  AdfDhtmlPage._addStateParameter(formElem, params);
  this._streamingStatus = AdfDhtmlPage._STREAMING_REQUEST_SENT;
  this._stopGlobalActiveData();
  if(this.isUserActivityMonitoringOn()) {
    var secUserActInfo = AdfUserActivityInfo.getInstance(AdfUserActivityInfo.SECONDARY);
    secUserActInfo.setClientStartTime((new Date).getTime().toString());
    AdfUserActivityInfo.saveToSessionStorageByType(AdfUserActivityInfo.SECONDARY)
  }
  this.getDataTransferService().sendStreamingRequest(uri, params);
  if(this._perfProfileEnabled || this._perfProfileTimingEnabled) {
    this.getDomWindow()._afrTimingStreamingRequestStart = (new Date).getTime()
  }
};
AdfDhtmlPage._addStateParameter = function(formElem, params) {
  var stateParam = AdfDhtmlPage._STATE_PARAM_NAME;
  var state = formElem.elements[stateParam];
  AdfAssert.assert(state, "No view state token for postback");
  params[stateParam] = state.value
};
AdfDhtmlPage._addPageStateIdParameter = function(formElem, params) {
  var pageStateParam = AdfDhtmlPage._PAGE_STATE_ID;
  var pageState = formElem.elements[pageStateParam];
  if(pageState != null && pageState.value !== "") {
    params[pageStateParam] = pageState.value
  }
};
AdfDhtmlPage.prototype.getLazyFetchURI = function(id) {
  AdfAssert.assertString(id, "invalid Id for the lazy fetch URI");
  var formElem = this.getDomDocument().forms[0];
  AdfAssert.assert(formElem, "No form found;  cannot perform lazy fetch");
  var uri = formElem.action;
  if(uri.indexOf("?") == -1) {
    uri += "?unique\x3d"
  }else {
    uri += "\x26unique\x3d"
  }
  uri += (new Date).getTime();
  var stateParam = AdfDhtmlPage._STATE_PARAM_NAME;
  uri += "\x26" + stateParam + "\x3d";
  var state = formElem[stateParam];
  AdfAssert.assert(state, "No view state token for lazy fetch");
  uri += state.value;
  var pageStateParam = AdfDhtmlPage._PAGE_STATE_ID;
  var pageState = formElem.elements[pageStateParam];
  if(pageState != null && pageState.value !== "") {
    uri += "\x26" + pageStateParam + "\x3d" + pageState.value
  }
  uri += "\x26" + AdfDhtmlPage._LAZY_FETCH_ID_PARAM + "\x3d" + id;
  uri += AdfXmlHttpDataTransferService.__encodeWindowIdOnUrl(uri, this.getWindowId());
  return uri
};
AdfDhtmlPage.prototype.isStreamingRequestPending = function(id) {
  return this._pendingStreamingIDs[id]
};
AdfDhtmlPage.prototype._addPendingStreamingIDs = function(arr, params) {
  var separator = ",";
  var streamedIDs = "";
  var visibleIDs = new Array;
  var hiddenIDs = new Array;
  for(var i = 0;i < arr.length;i++) {
    var id = arr[i];
    var elem = this.getDomDocument().getElementById(id);
    if(AdfDomUtils.isInVisibleSubtree(elem)) {
      this._pendingStreamingIDs[id] = true;
      visibleIDs.push(id)
    }else {
      hiddenIDs.push(id)
    }
  }
  if(visibleIDs.length > 0) {
    streamedIDs = visibleIDs.join(separator)
  }
  params[AdfDhtmlPage._STREAMING_IDS_PARAM] = streamedIDs;
  if(hiddenIDs.length > 0) {
    params[AdfDhtmlPage._REMOVED_STREAMING_IDS_PARAM] = hiddenIDs.join(separator)
  }
};
AdfDhtmlPage._getCookie = function(domDocument, name) {
  if(domDocument.cookie.length > 0) {
    var begin = domDocument.cookie.indexOf(name + "\x3d");
    if(begin != -1) {
      var end = domDocument.cookie.indexOf(";", begin);
      if(end == -1) {
        end = domDocument.cookie.length
      }
      return domDocument.cookie.substring(begin + name.length + 1, end)
    }
  }
  return null
};
AdfDhtmlPage._setCookie = function(domDocument, name, value, expiresAfter, path) {
  AdfAssert.assertNumeric(expiresAfter);
  var expires = "";
  if(expiresAfter) {
    var date = new Date;
    date.setTime(date.getTime() + expiresAfter);
    expires = "expires\x3d" + date.toGMTString() + ";"
  }
  if(path) {
    path = "path\x3d" + path + ";"
  }else {
    path = "path\x3d/;"
  }
  domDocument.cookie = name + "\x3d" + value + ";" + expires + path
};
AdfDhtmlPage._eraseCookie = function(domDocument, name) {
  this.setCookie(domDocument, name, "", -99999)
};
AdfDhtmlPage.prototype._dtsStateChanged = function() {
  var dts = this.getDataTransferService();
  var dtsState = dts.getDTSState();
  var isServerBusy = dtsState != AdfDataTransferService.STATE_READY;
  if(this._serverBusy != isServerBusy) {
    this._serverBusy = isServerBusy;
    AdfAgent.AGENT.showBusyCursor(this.getDomDocument(), isServerBusy);
    this._broadcastBusyStateEvent(isServerBusy)
  }
  if(!isServerBusy) {
    this._deliverQueuedServerEvents()
  }
};
AdfDhtmlPage.prototype.setLastFocusedElement = function(element) {
  this._lastFocusedElement = element
};
AdfDhtmlPage.prototype.getLastFocusedElement = function(element) {
  return this._lastFocusedElement
};
AdfDhtmlPage.prototype.setPPRNavigationOptions = function(options) {
  this._pprNavOptions = options
};
AdfDhtmlPage.prototype.getPPRNavigationOptions = function() {
  return this._pprNavOptions != undefined ? this._pprNavOptions : 0
};
AdfDhtmlPage.prototype._collectCss = function() {
  var obj = new Object;
  var elems = document.getElementsByTagName("link");
  for(var i = 0, size = elems.length;i < size;++i) {
    var href = elems[i].getAttribute("href");
    if(href) {
      obj[href] = true
    }
  }
  return obj
};
AdfDhtmlPage.prototype.flushToAssistiveTechnology = function() {
  var flushInput = AdfAgent.AGENT.getElementById("afr::ATFlush");
  if(flushInput) {
    var oldValue = flushInput.value;
    flushInput.value = oldValue == "1" ? "0" : "1"
  }
};
AdfDhtmlPage.prototype.announceToAssistiveTechnology = function(message, onlyIfChanged) {
  var statusRegion = AdfAgent.AGENT.getElementById("afr::ATStatus");
  if(statusRegion) {
    if(onlyIfChanged && message == this._lastStatusMessage) {
      return
    }
    statusRegion.innerHTML = message;
    this._lastStatusMessage = message;
    var timer = this._clearStatusMessageTimer;
    var delay = 2E3;
    if(timer) {
      this.rescheduleTimer(timer, delay)
    }else {
      this._clearStatusMessageTimer = this.scheduleTimer(this, this._clearStatusRegion, null, delay)
    }
  }
};
AdfDhtmlPage.prototype._clearStatusRegion = function() {
  var statusRegion = AdfAgent.AGENT.getElementById("afr::ATStatus");
  if(statusRegion) {
    statusRegion.innerHTML = "";
    this.flushToAssistiveTechnology()
  }
  this._clearStatusMessageTimer = null
};
AdfDhtmlPage.prototype.setDataDirty = function(isDirty) {
  this._dataDirty = isDirty
};
AdfDhtmlPage.prototype.registerDirtyDataComponent = function(component, level) {
  this._dirtyStateService.__registerDirtyDataComponent(component, level)
};
AdfDhtmlPage.prototype._checkDirtyDataComponents = function() {
  return this._dirtyStateService.__alwaysDisplayDirtyDataWarning()
};
AdfDhtmlPage.prototype._setProcessedRoots = function(ids, immediateOnly) {
  if(!this._richPostbackHasErrors) {
    this._dirtyStateService.__dataCommitted(ids, immediateOnly === true)
  }
};
AdfDhtmlPage.prototype.confirmNavigation = function(token, isPartial) {
  var result = this._displayUncommittedDataWarning(null);
  var params = new Object;
  params["oracle.adfinternal.view.faces.rich.navigationToken"] = token;
  params["oracle.adfinternal.view.faces.rich.confirmNavigation"] = result;
  var context = {"_noNavigation":!isPartial};
  this._sendRichPayload(params, context)
};
AdfDhtmlPage.prototype._navResetPage = function() {
  AdfDhtmlRichDialogService.getInstance().cancelAll();
  this._pageProperties = new Object;
  this._setRichResponseDirty(false);
  this._resizeNotifyMap = new Object;
  this._resizeNotifyTree = new Object;
  this._descendantResizeNotifyList = new Array;
  this._serverQueue = new AdfServerEventQueue;
  this._partialTargets = null;
  this._autoPPRComponents = new Object;
  if(this.isActiveDataSupported()) {
    this._canReceiveActiveDataCount = 1;
    this.getActiveDataSupport().reset()
  }
  this._dirtyServerRegions = null;
  this._trackedRegions = null;
  this._dirtyStateService.__resetState()
};
AdfDhtmlPage._removeResourcesByTagName = function(tagName, head) {
  var elems = head.getElementsByTagName(tagName);
  var count = elems.length;
  for(var i = count - 1;i >= 0;--i) {
    var elem = elems[i];
    if(elem.hasAttribute("afrres")) {
      head.removeChild(elem)
    }
  }
};
AdfDhtmlPage.prototype.removePageResources = function() {
  var head = this._getHead();
  AdfDhtmlPage._removeResourcesByTagName("LINK", head);
  AdfDhtmlPage._removeResourcesByTagName("STYLE", head)
};
AdfDhtmlPage.prototype._handleInvalidPprResponse = function(responseText, requestContext, requestEvent) {
  if(responseText) {
    var xmlDoc = AdfDhtmlPage._extractInstructionXML(responseText, "partial-response");
    if(xmlDoc && xmlDoc.documentElement && xmlDoc.documentElement.firstChild) {
      var name = AdfAgent.AGENT.getNodeName(xmlDoc.documentElement.firstChild);
      if(name == "error") {
        this._handleRichResponse(xmlDoc, null);
        if(requestContext) {
          this._sendJsfAjaxEvent("error", {"context":requestContext, "responseCode":requestEvent.getResponseStatusCode(), "responseText":responseText, "responseXML":xmlDoc})
        }
        return
      }
      if(name == "redirect") {
        this._handleRichResponse(xmlDoc, null);
        return
      }
    }
  }else {
    if(requestContext) {
      this._sendJsfAjaxEvent("error", {"context":requestContext, "event":requestEvent})
    }
  }
  if(AdfAssert.DEBUG) {
    AdfLogger.LOGGER.severe("Unexpected non-rich response")
  }else {
    AdfLogger.LOGGER.warning("Unexpected non-rich response")
  }
  if(!this._unloading) {
    this.getDomWindow().location.reload(true)
  }
};
AdfDhtmlPage._extractInstructionXML = function(responseText, element) {
  var len = responseText.length;
  if(len <= 1) {
    return null
  }
  if(responseText.charAt(len - 1) != "\x3e") {
    return null
  }
  var doc = null;
  var elementClose = "\x3c/" + element;
  var elemLen = elementClose.length;
  if(len > elemLen + 1) {
    if(elementClose == responseText.substr(len - elemLen - 1, elemLen)) {
      var start = responseText.lastIndexOf("\x3c?xml");
      if(start >= 0) {
        doc = AdfAgent.AGENT.parseXML(responseText.substring(start))
      }
    }
  }
  return doc
};
AdfDhtmlPage.prototype.__initUncommittedDataWarningForDocument = function(enabled) {
  this._warnUncommitted = enabled;
  this._resetUncommittedIds()
};
AdfDhtmlPage.prototype.__enableDirtyPostbackPayloads = function() {
  this._dirtyPostbackPayloads = true;
  this._resetUncommittedIds()
};
AdfDhtmlPage.prototype.__isDirtyPostbackPayloadsEnabled = function() {
  return this._dirtyPostbackPayloads
};
AdfDhtmlPage.prototype._isTrackingDirtyData = function() {
  return true
};
AdfDhtmlPage.prototype._shouldPostbackValue = function(inputElement, editableEventTargetComponents) {
  if(this._dirtyPostbackPayloads) {
    var component = this._mapInputElementToComponent(inputElement);
    return component == null || component.getProperty("_afrFullPost") != null || !(component instanceof AdfUIEditableValue) || !component.isConvertible() || !component.getValid() || this._dirtyStateService.isDirty(component) || this._dirtyStateService.__isInputValueDirty(this, component, inputElement) || AdfCollections.indexOf(editableEventTargetComponents, component) > -1
  }else {
    return!this._isUncheckedInput(inputElement)
  }
};
AdfDhtmlPage.prototype.__disableDirtyDataRetainPPR = function() {
  this._disableDirtyDataRetainPPR = true
};
AdfDhtmlPage.prototype._isDirtyDataRetainPPRDisabled = function() {
  return this._disableDirtyDataRetainPPR
};
AdfDhtmlPage.prototype._mapInputElementToComponent = function(inputElement) {
  var component = AdfRichUIPeer.getFirstAncestorComponent(inputElement);
  if(!component) {
    return null
  }
  var clientId = component.getClientId();
  return clientId == this._stripSubId(inputElement.name) || clientId == this._stripSubId(inputElement.id) ? component : null
};
AdfDhtmlPage.prototype._stripSubId = function(id) {
  var lastSubId = id == null ? -1 : id.lastIndexOf("::");
  return lastSubId > -1 ? id.substr(0, lastSubId) : id
};
AdfDhtmlPage.prototype._resetUncommittedIds = function() {
  this._dirtyStateService.__resetState()
};
AdfDhtmlPage.prototype._isUncheckedInput = function(inputElement) {
  return(inputElement.type == "checkbox" || inputElement.type == "radio") && !inputElement.checked
};
AdfDhtmlPage.prototype._disableUncommittedWarnings = function() {
  this._warnUncommitted = false;
  this._trackedRegions = null;
  this._dirtyServerRegions = null
};
AdfDhtmlPage.prototype._isTrackingDocumentUncommittedData = function() {
  return this._warnUncommitted
};
AdfDhtmlPage.prototype._isTrackingRegionClientUncommittedData = function() {
  if(this._trackedRegions == null) {
    return false
  }
  return!AdfCollections.isEmpty(this._trackedRegions)
};
AdfDhtmlPage.prototype._isTrackingRegionUncommittedData = function() {
  if(this._dirtyServerRegions != null) {
    return true
  }
  return this._isTrackingRegionClientUncommittedData()
};
AdfDhtmlPage.prototype._getDirtyRegionIds = function() {
  var ids = null;
  if(this._dirtyServerRegions != null) {
    ids = new Array;
    for(var s in this._dirtyServerRegions) {
      ids.push(s)
    }
  }
  if(this._isTrackingRegionClientUncommittedData()) {
    for(var id in this._trackedRegions) {
      if(this._dirtyServerRegions != null && this._dirtyServerRegions[id]) {
        continue
      }
      if(this._dirtyStateService.isNamingContainerDirty(id)) {
        if(ids == null) {
          ids = new Array
        }
        ids.push(id)
      }
    }
  }
  return ids
};
AdfDhtmlPage.prototype.__initializeSessionTimeoutTimer = function(timeout, warningBeforeTimeout, newSessionURL) {
  var hasNoADSComponents = this.isActiveDataSupported() ? AdfCollections.isEmpty(this.getActiveDataSupport().getActiveComponents()) : true;
  var userInactivityTimeoutHelper = this.__getUserInactivityTimeoutHelper();
  var adsInactive = hasNoADSComponents || userInactivityTimeoutHelper && userInactivityTimeoutHelper.hasTimedOut();
  if(adsInactive) {
    if(!this._sessionTimeoutHelper) {
      this._sessionTimeoutHelper = new AdfSessionTimeoutHelper
    }
    this._sessionTimeoutHelper.__initializeSessionTimeoutTimer(timeout, warningBeforeTimeout, newSessionURL)
  }else {
    if(this._sessionTimeoutHelper) {
      this._sessionTimeoutHelper.__cancelSessionTimeoutTimer()
    }
  }
};
AdfDhtmlPage.prototype.__getSessionTimeoutHelper = function() {
  return this._sessionTimeoutHelper
};
AdfDhtmlPage.prototype.__initUserInactivityTimeout = function(userInactivityTimeout) {
  var timeoutHelper = this.__getUserInactivityTimeoutHelper();
  if(timeoutHelper) {
    timeoutHelper.initializeTimeout(userInactivityTimeout)
  }
};
AdfDhtmlPage.prototype.__getUserInactivityTimeoutHelper = function() {
  var helperInstance = this._userInactivityTimeoutHelper;
  if(!helperInstance) {
    var domWindow = this.getDomWindow();
    var helperClass = domWindow["AdfUserInactivityTimeoutHelper"];
    if(helperClass) {
      helperInstance = new helperClass;
      this._userInactivityTimeoutHelper = helperInstance
    }
  }
  return helperInstance
};
AdfDhtmlPage.prototype.getComponentIdsUpdatedByPollEvent = function() {
  return this._componentsUpdatedByPollEvent
};
AdfDhtmlPage.prototype.__handleNavigation = function(url, target) {
  AdfAssert.assertNonEmptyString(url);
  this._registerGetRequestNavigationTracking();
  var domWindow = this.getDomWindow();
  var targetWindow = AdfDhtmlPage._getTargetWindow(target, domWindow);
  var isPPRNavSupported = this.isPPRNavigationEnabled();
  var isLocalNavigation = false;
  if(isPPRNavSupported && target != "_blank") {
    isLocalNavigation = this._isDestinationLocal(url)
  }
  if(!isPPRNavSupported || !isLocalNavigation || !targetWindow || !targetWindow.AdfPage || !targetWindow.AdfPage.PAGE) {
    if(targetWindow == self) {
      targetWindow.location.href = url
    }else {
      var newWindow = domWindow.open(url, target);
      if(newWindow) {
        newWindow.focus()
      }
      delete this._inGetRequestNavigation
    }
    return
  }
  targetWindow.AdfPage.PAGE.localNavigate(url)
};
AdfDhtmlPage._getTargetWindow = function(target, domWindow) {
  var targetWindow;
  if(!target || target == "null" || target == "_self") {
    targetWindow = self
  }else {
    if(target == "_blank") {
      targetWindow = null
    }else {
      if(target == "_top") {
        targetWindow = top
      }else {
        if(target == "_parent") {
          targetWindow = parent
        }else {
          targetWindow = domWindow.frames[target]
        }
      }
    }
  }
  return targetWindow
};
AdfDhtmlPage.prototype._isDestinationLocal = function(destinationUri) {
  var isLocal;
  var facesPath = this.getFacesPath();
  if(destinationUri.indexOf("org.apache.myfaces.trinidad.agent.email\x3dtrue") > 0) {
    isLocal = false
  }else {
    if(destinationUri.indexOf(":") != -1) {
      var currentLocation = document.location;
      var origin = currentLocation.origin;
      if(!origin) {
        var currentHref = currentLocation.href;
        origin = currentHref.slice(0, currentHref.length - (currentLocation.pathname.length + currentLocation.search.length + currentLocation.hash.length))
      }
      origin = origin + facesPath;
      if(destinationUri.indexOf(origin) == 0) {
        isLocal = true
      }else {
        isLocal = false
      }
    }else {
      if(destinationUri.charAt(0) == "/") {
        if(destinationUri.indexOf(facesPath) == 0) {
          isLocal = true
        }else {
          isLocal = false
        }
      }else {
        isLocal = true
      }
    }
  }
  return isLocal
};
AdfDhtmlPage.prototype._sendJsfAjaxEvent = function(type, params) {
  if(this._jsfAjaxInit !== true || params.context == null || params.context._discreteEvent == null || !(params.context._discreteEvent instanceof AdfJsfAjaxRequestEvent)) {
    return
  }
  var onevent = params.context._discreteEvent._options[type == "error" ? "onerror" : "onevent"];
  var source = params.context._discreteEvent._sourceElement;
  var payload = {"type":"event", "status":type, "source":source};
  if(type != "begin") {
    if(params.event) {
      payload.responseCode = params.event.getResponseStatusCode();
      payload.responseXML = params.event.getResponseXML();
      payload.responseText = params.event.getResponseText()
    }else {
      payload.responseCode = params.responseCode;
      payload.responseXML = params.responseXML;
      payload.responseText = params.responseText
    }
    if(type == "error") {
      payload.description = null;
      payload.errorName = null;
      payload.errorMessage = null;
      var laf = this.getLookAndFeel();
      if(payload.responseXML == null || payload.responseXML.documentElement == null) {
        payload.description = laf.getTranslatedString("AFPprEmptyResponse")
      }else {
        var parserErrorNodes = payload.responseXML.getElementsByTagName("parsererror");
        if(parserErrorNodes.length > 0) {
          payload.description = AdfAgent.AGENT.getTextContent(parserErrorNodes[0])
        }else {
          payload.description = laf.getTranslatedString("AFPprUnknownError")
        }
      }
      if(payload.responseXML && payload.responseXML.documentElement && payload.responseXML.documentElement.tagName == "partial-response" && payload.responseXML.documentElement.firstChild && payload.responseXML.documentElement.firstChild.tagName == "error") {
        var node = payload.responseXML.documentElement.firstChild;
        payload.errorName = node.firstChild.firstChild.nodeValue;
        payload.errorMessage = node.firstChild.nextSibling.firstChild.nodeValue
      }
    }
  }
  var listeners = this._jsfAjaxListeners[type == "error" ? "error" : "event"];
  for(var i = 0, size = listeners.length;i < size;++i) {
    var listener = listeners[i];
    try {
      listener(payload)
    }catch(e) {
      AdfLogger.LOGGER.severe("AJAX listener threw exception:", e)
    }
  }
  if(onevent) {
    try {
      onevent(payload)
    }catch(e) {
      AdfLogger.LOGGER.severe("AJAX listener threw exception:", e)
    }
  }
};
AdfDhtmlPage.prototype._jsfAjaxRequest = function(source, event, options) {
  AdfJsfAjaxRequestEvent.queue(source, event, options)
};
AdfDhtmlPage.prototype._jsfAjaxAddOnEvent = function(callback) {
  this._jsfAjaxListeners.event.push(callback)
};
AdfDhtmlPage.prototype._jsfAjaxAddOnError = function(callback) {
  this._jsfAjaxListeners.error.push(callback)
};
AdfDhtmlPage.prototype._replaceJsfAjaxFunctions = function() {
  if(this._jsfAjaxInit || typeof this._window.jsf == "undefined" || typeof this._window.jsf.ajax == "undefined") {
    return
  }
  var a = jsf.ajax;
  a._origRequest = a.request;
  a._origAddOnEvent = a.addOnEvent;
  a._origAddOnError = a.addOnError;
  this._jsfAjaxListeners = {"event":[], "error":[]};
  a.request = this.createCallback(this._jsfAjaxRequest);
  a.addOnEvent = this.createCallback(this._jsfAjaxAddOnEvent);
  a.addOnError = this.createCallback(this._jsfAjaxAddOnError);
  this._jsfAjaxInit = true
};
AdfDhtmlPage.prototype.__confirm = function(title, message, callback, timeout, disableCancel) {
  AdfAssert.assertString(title, "confirm title");
  AdfAssert.assertString(message, "confirm message");
  AdfAssert.assertFunction(callback, "confirm callback");
  if(timeout) {
    AdfAssert.assertNumber(timeout, "confirm timeout")
  }
  var documentComponent = this.findComponent(this._documentClientId);
  var documentPeer = documentComponent.getPeer();
  documentPeer.bind(documentComponent);
  return documentPeer.__showAlertConfirm(disableCancel, title, message, callback, timeout)
};
AdfDhtmlPage.prototype.__alert = function(title, message, callback) {
  AdfAssert.assertString(title, "alert title");
  AdfAssert.assertString(message, "alert message");
  AdfAssert.assertFunction(callback, "alert callback");
  var documentClientId = this._documentClientId;
  var documentComponent = this.findComponent(documentClientId);
  var documentPeer = documentComponent.getPeer();
  documentPeer.bind(documentComponent);
  return documentPeer.__showAlertConfirm(true, title, message, callback)
};
AdfDhtmlPage.prototype._updateViewState = function(fragmentNode) {
  var doc = this.getDomDocument();
  var agent = AdfAgent.AGENT;
  var forms = doc.forms;
  var count = forms.length;
  AdfAssert.assert(count > 0);
  for(var i = 0;i < count;i++) {
    var form = doc.forms[i];
    AdfAssert.assertDomElement(form);
    if(count == 1 || this._isAdfForm(form)) {
      var value = agent.getTextContent(fragmentNode);
      var input = form.elements[AdfDhtmlPage._STATE_PARAM_NAME];
      if(!input) {
        var span = doc.createElement("span");
        span.innerHTML = "\x3cinput type\x3d'hidden' name\x3d'" + AdfDhtmlPage._STATE_PARAM_NAME + "' value\x3d'" + value + "' /\x3e";
        form.appendChild(span)
      }else {
        input.value = value
      }
    }
  }
};
AdfDhtmlPage.prototype._isAdfForm = function(form) {
  var id = form.id;
  if(id != null) {
    return AdfAgent.AGENT.getElementById(id + AdfDhtmlPage._POSTSCRIPT_ID_SUFFIX) != null
  }
  return false
};
AdfDhtmlPage.prototype._displayUncommittedDataWarning = function(message) {
  if(message == null) {
    message = this.getLookAndFeel().getTranslatedString("af_document.MSG_CONFIRM_NAVIGATION")
  }
  return confirm(message)
};
AdfDhtmlPage.prototype._displayRegionUncommittedDataWarning = function(message) {
  if(message == null) {
    message = this.getLookAndFeel().getTranslatedString("af_region.MSG_CONFIRM_CLOSE")
  }
  return confirm(message)
};
AdfDhtmlPage.prototype._logAsGlobalError = function(e) {
  if(window.onerror != undefined) {
    this.__handleGlobalError(e.message, e.fileName, e.lineNumber)
  }
};
AdfDhtmlPage.prototype.logAsGlobalError = function(e) {
  this._logAsGlobalError(e)
};
AdfDhtmlPage.prototype.__handleGlobalError = function(msg, url, line) {
  if(!this._savedErrors) {
    this._savedErrors = new Array
  }
  var ignoreError = false;
  if(msg == "setting a property that has only a getter" && url == "" && line == 0) {
    ignoreError = true
  }
  if(AdfAgent.AGENT.getPlatform() == AdfAgent.GECKO_PLATFORM && msg != undefined) {
    if(url == "" && line == 0 && msg.match(/Permission denied for </) && msg.match(/> to call method Location.toString on </)) {
      ignoreError = true
    }else {
      if(url != "" && msg.match(/Permission denied to get property Location.toString/)) {
        ignoreError = true
      }
    }
  }
  if(ignoreError) {
    return false
  }
  this._savedErrors.push({"msg":msg, "url":url, "line":line});
  return false
};
AdfDhtmlPage.prototype._throwSavedErrors = function() {
  if(this._savedErrors && this._savedErrors.length > 0) {
    var msg = "Javascript error(s): ";
    for(var i = 0;i < this._savedErrors.length;i++) {
      if(i > 0) {
        msg += ";"
      }
      var info = this._savedErrors[i];
      msg += info["msg"];
      if(info["url"]) {
        msg += " in " + info["url"]
      }
      if(info["line"] !== undefined && info["line"] !== null) {
        msg += ":" + info["line"]
      }
    }
    throw msg;
  }
};
AdfDhtmlPage.prototype._getQueryParamsFromActionUrl = function() {
  var queryParams = null;
  var formElem = this.getDomDocument().forms[0];
  var uri = formElem.action;
  var queryIndex = uri.indexOf("?");
  if(queryIndex >= 0) {
    queryParams = uri.substring(queryIndex)
  }
  return queryParams
};
AdfDhtmlPage.prototype._isPrintablePage = function() {
  var body = this.getDomDocument().body;
  return AdfDomUtils.containsCSSClassName(body, AdfDhtmlPage._PRINTABLE_STATE)
};
AdfDhtmlPage.prototype.__setDirtyRegions = function() {
  this._dirtyServerRegions = null;
  var len = arguments.length;
  if(len > 0) {
    this._dirtyServerRegions = new Object
  }
  for(var i = 0;i < arguments.length;i++) {
    this._dirtyServerRegions[arguments[i]] = true
  }
};
AdfDhtmlPage.prototype.__registerRegionClientUncommittedDataTracking = function(clientId) {
  if(this._trackedRegions == null) {
    this._trackedRegions = new Object
  }
  this._trackedRegions[clientId] = true
};
AdfDhtmlPage.prototype.__unregisterRegionClientUncommittedDataTracking = function(clientId) {
  if(this._trackedRegions != null && this._trackedRegions[clientId] != null) {
    delete this._trackedRegions[clientId]
  }
};
AdfDhtmlPage.prototype._registerGetRequestNavigationTracking = function() {
  this._inGetRequestNavigation = true;
  this.scheduleTimer(this, this._unregisterGetRequestNavigationTracking, null, 500)
};
AdfDhtmlPage.prototype._unregisterGetRequestNavigationTracking = function() {
  delete this._inGetRequestNavigation
};
AdfDhtmlPage.prototype.__markSeleniumRC = function() {
  if(!this._seleniumRC) {
    this._seleniumRC = true
  }
};
AdfDhtmlPage.prototype.__isSeleniumRC = function() {
  return this._seleniumRC
};
AdfDhtmlPage.prototype._detectSeleniumRC = function() {
  var domWindow = this.getDomWindow();
  while(domWindow) {
    if(this._isSeleniumRCWindow(domWindow)) {
      return true
    }
    if(domWindow == domWindow.parent && domWindow == domWindow.opener) {
      return false
    }
    domWindow = domWindow.parent == domWindow ? domWindow.opener : domWindow.parent
  }
  return false
};
AdfDhtmlPage.prototype._isSeleniumRCWindow = function(domWindow) {
  var windowName;
  try {
    windowName = domWindow.name
  }catch(e) {
    return false
  }
  return windowName && windowName.indexOf("selenium") == 0
};
AdfDhtmlPage.prototype._throwAndClearSavedErrors = function() {
  if(this._savedErrors && this._savedErrors.length > 0) {
    var msg = "Javascript error(s): ";
    for(var i = 0;i < this._savedErrors.length;i++) {
      if(i > 0) {
        msg += ";"
      }
      msg += AdfAutomationHelper.errorToString(this._savedErrors[i])
    }
    this._savedErrors = new Array;
    throw msg;
  }
};
AdfDhtmlPage.prototype.simulateMouse = function(locator, mouseEvent) {
  var componentLocator = locator;
  var subId;
  var startIndex = locator.indexOf("#");
  if(startIndex > -1) {
    componentLocator = locator.substring(0, startIndex);
    subId = locator.substring(startIndex + 1)
  }
  AdfLogger.LOGGER.fine("SimulateMouse, locator: " + locator + ", compLocator: " + componentLocator + ", subId: " + subId);
  var component = this.findComponentByAbsoluteLocator(componentLocator);
  if(component) {
    component.simulateMouse(subId, mouseEvent)
  }else {
    AdfLogger.LOGGER.warning("During simulateMouse, unable to find a component for the provided locator: " + locator)
  }
};
AdfDhtmlPage.prototype.simulateDomMouse = function(domElement, mouseEvent) {
  var agent = AdfAgent.AGENT;
  if(mouseEvent == null) {
    mouseEvent = {}
  }
  if(mouseEvent.type == null) {
    mouseEvent.type = "click"
  }
  if(mouseEvent.canBubble == null) {
    mouseEvent.canBubble = true
  }
  if(mouseEvent.cancelable == null) {
    mouseEvent.cancelable = true
  }
  if(mouseEvent.view == null) {
    mouseEvent.view = window
  }
  if(mouseEvent.detail == null) {
    mouseEvent.detail = 1
  }
  if(mouseEvent.screenX == null) {
    mouseEvent.screenX = 0
  }
  if(mouseEvent.screenY == null) {
    mouseEvent.screenY = 0
  }
  if(mouseEvent.clientX == null) {
    mouseEvent.clientX = agent.getElementLeft(domElement) + (domElement.offsetWidth > 0 ? domElement.offsetWidth / 2 : 0)
  }
  if(mouseEvent.clientY == null) {
    mouseEvent.clientY = agent.getElementTop(domElement) + (domElement.offsetHeight > 0 ? domElement.offsetHeight / 2 : 0)
  }
  if(mouseEvent.ctrlKey == null) {
    mouseEvent.ctrlKey = false
  }
  if(mouseEvent.altKey == null) {
    mouseEvent.altKey = false
  }
  if(mouseEvent.shiftKey == null) {
    mouseEvent.shiftKey = false
  }
  if(mouseEvent.metaKey == null) {
    mouseEvent.metaKey = false
  }
  if(mouseEvent.button == null) {
    mouseEvent.button = 0
  }
  if(mouseEvent.relatedTarget == null) {
    mouseEvent.relatedTarget = null
  }
  AdfLogger.LOGGER.fine("simulateDomMouse, domElement id: " + domElement.id + ", type: " + mouseEvent.type);
  var testEngine = AdfDhtmlTestEngine.getEngine();
  testEngine.simulateDomMouse(domElement, mouseEvent)
};
