docs: function(topLevelApplicationWindow) {
      this.topWindow = topLevelApplicationWindow;
      this.topFrame = this.topWindow;
      this.baseUrl=window.location.href;
  
      // the buttonWindow is the Selenium window
      // it contains the Run/Pause buttons... this should *not* be the AUT window
      this.buttonWindow = window;
      this.currentWindow = this.topWindow;
      this.currentWindowName = null;
      this.allowNativeXpath = true;
      this.xpathEvaluator = new XPathEvaluator('ajaxslt');  // change to "javascript-xpath" for the newer, faster engine
  
      // We need to know this in advance, in case the frame closes unexpectedly
      this.isSubFrameSelected = false;
  
      this.altKeyDown = false;
      this.controlKeyDown = false;
      this.shiftKeyDown = false;
      this.metaKeyDown = false;
  
      this.modalDialogTest = null;
      this.recordedAlerts = new Array();
      this.recordedConfirmations = new Array();
      this.recordedPrompts = new Array();
      this.openedWindows = {};
      this.nextConfirmResult = true;
      this.nextPromptResult = '';
      this.newPageLoaded = false;
      this.pageLoadError = null;
  
      this.ignoreResponseCode = false;
      this.xhr = null;
      this.abortXhr = false;
      this.isXhrSent = false;
      this.isXhrDone = false;
      this.xhrOpenLocation = null;
      this.xhrResponseCode = null;
      this.xhrStatusText = null;
  
      this.shouldHighlightLocatedElement = false;
  
      this.uniqueId = "seleniumMarker" + new Date().getTime();
      this.pollingForLoad = new Object();
      this.permDeniedCount = new Object();
      this.windowPollers = new Array();
      // DGF for backwards compatibility
      this.browserbot = this;
  
      var self = this;
  
      objectExtend(this, PageBot.prototype);
      this._registerAllLocatorFunctions();
  
      this.recordPageLoad = function(elementOrWindow) {
          LOG.debug("Page load detected");
          try {
              if (elementOrWindow.location && elementOrWindow.location.href) {
                  LOG.debug("Page load location=" + elementOrWindow.location.href);
              } else if (elementOrWindow.contentWindow && elementOrWindow.contentWindow.location && elementOrWindow.contentWindow.location.href) {
                  LOG.debug("Page load location=" + elementOrWindow.contentWindow.location.href);
              } else {
                  LOG.debug("Page load location unknown, current window location=" + self.getCurrentWindow(true).location);
              }
          } catch (e) {
              LOG.error("Caught an exception attempting to log location; this should get noticed soon!");
              LOG.exception(e);
              self.pageLoadError = e;
              return;
          }
          self.newPageLoaded = true;
      };
  
      this.isNewPageLoaded = function() {
          var e;
  
          if (this.pageLoadError) {
              LOG.error("isNewPageLoaded found an old pageLoadError: " + this.pageLoadError);
              if (this.pageLoadError.stack) {
                LOG.warn("Stack is: " + this.pageLoadError.stack);
              }
              e = this.pageLoadError;
              this.pageLoadError = null;
              throw e;
          }
  
          if (self.ignoreResponseCode) {
              return self.newPageLoaded;
          } else {
              if (self.isXhrSent && self.isXhrDone) {
                  if (!((self.xhrResponseCode >= 200 && self.xhrResponseCode <= 399) || self.xhrResponseCode == 0)) {
                       // TODO: for IE status like: 12002, 12007, ... provide corresponding statusText messages also.
                       LOG.error("XHR failed with message " + self.xhrStatusText);
                       e = "XHR ERROR: URL = " + self.xhrOpenLocation + " Response_Code = " + self.xhrResponseCode + " Error_Message = " + self.xhrStatusText;
                       self.abortXhr = false;
                       self.isXhrSent = false;
                       self.isXhrDone = false;
                       self.xhrResponseCode = null;
                       self.xhrStatusText = null;
                       throw new SeleniumError(e);
                  }
             }
            return self.newPageLoaded && (self.isXhrSent ? (self.abortXhr || self.isXhrDone) : true);
          }
      };
  
      this.setAllowNativeXPath = function(allow) {
          this.xpathEvaluator.setAllowNativeXPath(allow);
      };
  
      this.setIgnoreAttributesWithoutValue = function(ignore) {
          this.xpathEvaluator.setIgnoreAttributesWithoutValue(ignore);
      };
  
      this.setXPathEngine = function(engineName) {
          this.xpathEvaluator.setCurrentEngine(engineName);
      };
  
      this.getXPathEngine = function() {
          return this.xpathEvaluator.getCurrentEngine();
      };
  }