function AdfIE8Agent(version, domWindow) {
  this.Init(version, domWindow);
  AdfIEAgent.assertBrowserMode(this)
}
AdfObject.createSubclass(AdfIE8Agent, AdfIEAgentLegacy);
AdfIE8Agent.prototype.getElementPosition = function(element) {
  AdfAssert.assertDomElement(element);
  var boundingRect = element.getBoundingClientRect();
  var elemTop = boundingRect.top;
  var elemLeft = boundingRect.left;
  var docElement = element.ownerDocument.documentElement;
  var scrollLeft = docElement.scrollLeft;
  if(AdfPage.PAGE.getLocaleContext().isRightToLeft()) {
    scrollLeft = -scrollLeft
  }
  elemLeft -= docElement.clientLeft - scrollLeft;
  elemTop -= docElement.clientTop - docElement.scrollTop;
  return{"x":elemLeft, "y":elemTop}
};
AdfIE8Agent.prototype.getElementLeft = function(element) {
  AdfAssert.assertDomElement(element);
  var boundingRect = element.getBoundingClientRect();
  var elemLeft = boundingRect.left;
  var docElement = element.ownerDocument.documentElement;
  var scrollLeft = docElement.scrollLeft;
  if(AdfPage.PAGE.getLocaleContext().isRightToLeft()) {
    scrollLeft = -scrollLeft
  }
  elemLeft -= docElement.clientLeft - scrollLeft;
  return elemLeft
};
AdfIE8Agent.prototype.getTableRows = function(tableElement) {
  var rows = [];
  var currTableChild = tableElement.firstChild;
  while(currTableChild) {
    if(currTableChild.nodeType == 1) {
      var currSectionChild = currTableChild.firstChild;
      while(currSectionChild) {
        if(currSectionChild.nodeType == 1) {
          rows.push(currSectionChild)
        }
        currSectionChild = currSectionChild.nextSibling
      }
    }
    currTableChild = currTableChild.nextSibling
  }
  return rows
};
AdfIE8Agent.prototype.getTableRow = function(tableElement, rowIndex) {
  if(rowIndex === undefined) {
    rowIndex = 0
  }
  var currTableChild = tableElement.firstChild;
  while(currTableChild != null) {
    if(currTableChild.nodeType == 1) {
      var currSectionChild = currTableChild.firstChild;
      while(currSectionChild) {
        if(currSectionChild.nodeType == 1) {
          if(rowIndex == 0) {
            return currSectionChild
          }else {
            rowIndex--
          }
        }
        currSectionChild = currSectionChild.nextSibling
      }
    }
    currTableChild = currTableChild.nextSibling
  }
  return null
};
AdfIE8Agent.prototype.getTableRowCells = function(tableRow) {
  var cells = [];
  var currRowChild = tableRow.firstChild;
  while(currRowChild) {
    if(currRowChild.nodeType == 1) {
      cells.push(currRowChild)
    }
    currRowChild = currRowChild.nextSibling
  }
  return cells
};
AdfIE8Agent.prototype.isSessionStorageEnabled = function() {
  if(this._isSessionStorageEnabled === undefined) {
    try {
      sessionStorage.setItem("_adfTestKey", "on");
      sessionStorage.removeItem("_adfTestKey");
      this._isSessionStorageEnabled = true
    }catch(e) {
      AdfLogger.LOGGER.logErrorAsInfo(e, "userdata monitoring has been disabled because an error " + "occurred accessing the DOM sessionStorage. Please ensure that 'DOM Storage' is enabled in " + "your IE browser settings.");
      this._isSessionStorageEnabled = false
    }
  }
  return this._isSessionStorageEnabled
};
AdfIE8Agent.prototype.getSessionStorageProperty = function(propKey) {
  AdfAssert.assertString(propKey);
  try {
    return sessionStorage.getItem(propKey)
  }catch(e) {
    AdfLogger.LOGGER.logErrorAsInfo(e, "An error occurred trying to access DOM sessionStorage.");
    throw e;
  }
};
AdfIE8Agent.prototype.removeSessionStorageProperty = function(propKey) {
  AdfAssert.assertString(propKey);
  try {
    sessionStorage.removeItem(propKey)
  }catch(e) {
    AdfLogger.LOGGER.logErrorAsInfo(e, "An error occurred trying to access DOM sessionStorage.");
    throw e;
  }
};
AdfIE8Agent.prototype.setSessionStorageProperty = function(propKey, propValue) {
  AdfAssert.assertString(propKey);
  AdfAssert.assertString(propValue);
  try {
    sessionStorage.setItem(propKey, propValue)
  }catch(e) {
    AdfLogger.LOGGER.logErrorAsInfo(e, "An error occurred trying to access DOM sessionStorage.");
    throw e;
  }
};
AdfIE8Agent.prototype.setTableRowHeight = function(row, height) {
  row.style.height = height + "px"
};
AdfIE8Agent.prototype.setOpacity = function(element, opacityPercent) {
  var filters = null;
  try {
    filters = element.filters
  }catch(problem) {
    filters = null
  }
  var filter = filters ? filters["alpha"] : null;
  if(filter == null) {
    if(opacityPercent != 100) {
      element.style.filter += "alpha(opacity\x3d" + opacityPercent + ")"
    }
  }else {
    filter.opacity = opacityPercent;
    filter.enabled = opacityPercent < 100
  }
};
AdfIE8Agent.prototype.elementsRemoved = function(node) {
  var idToDomMap = this._ID_TO_DOM_MAP;
  var targetId = node.id;
  if(targetId != null) {
    delete idToDomMap[targetId]
  }
  var elements = node.all;
  var elementCount = elements.length;
  for(var i = 0;i < elementCount;i++) {
    var currElement = elements(i);
    var currId = currElement.getAttribute("id");
    if(currId) {
      delete idToDomMap[currId]
    }
  }
};
AdfIE8Agent.prototype.elementsAdded = function(node) {
  var idToDomMap = this._ID_TO_DOM_MAP;
  var targetId = node.id;
  if(targetId != null) {
    idToDomMap[targetId] = node
  }
  var elements = node.all;
  var elementCount = elements.length;
  for(var i = 0;i < elementCount;i++) {
    var currElement = elements(i);
    var currId = currElement.getAttribute("id");
    if(currId) {
      idToDomMap[currId] = currElement
    }
  }
};
AdfIE8Agent.prototype.addEventCaptures = function(node, listener) {
  AdfAssert.assertDomNode(node);
  AdfAssert.assertFunction(listener);
  var events = AdfAgent.REDISTRIBUTE_EVENTS;
  var eventCount = events.length;
  for(var eventIndex = 0;eventIndex < eventCount;eventIndex++) {
    node.attachEvent("on" + events[eventIndex], listener, true)
  }
};
AdfIE8Agent.prototype.removeEventCaptures = function(node, listener) {
  AdfAssert.assertDomNode(node);
  AdfAssert.assertFunction(listener);
  var events = AdfAgent.REDISTRIBUTE_EVENTS;
  var eventCount = events.length;
  for(var eventIndex = 0;eventIndex < eventCount;eventIndex++) {
    node.detachEvent("on" + events[eventIndex], listener, true)
  }
};
AdfIE8Agent.prototype.getBoxSizing = function(element, currentStyle) {
  if(!currentStyle) {
    currentStyle = this.getComputedStyle(element)
  }
  return currentStyle.getAttribute("-ms-box-sizing")
};
AdfIE8Agent.prototype.CreateDefaultLogWriter = function(nativeLogWriter) {
  if(AdfAssert.DEBUG) {
    var window = this.getDomWindow();
    var console = window.console;
    if(console && console.log) {
      return nativeLogWriter
    }else {
      return new AdfConsoleLogWriter(window, nativeLogWriter)
    }
  }else {
    return nativeLogWriter
  }
};
AdfIE8Agent.prototype.cloneNode = function(domNode) {
  return domNode.cloneNode(true)
};
AdfIE8Agent.prototype.hasAttribute = function(element, attribute) {
  AdfAssert.assertDomElement(element);
  return element.hasAttribute(attribute.name)
};
