function AdfIEAgent(version, domWindow) {
  this.Init(version, domWindow);
  AdfIEAgent.assertBrowserMode(this)
}
AdfIEAgent.assertBrowserMode = function(agent) {
  if(AdfIEAgent._isIllegalBrowserDetected(agent)) {
    if(typeof checkBrowserMode != "undefined" && checkBrowserMode != null) {
      if(checkBrowserMode == "alert") {
        alert(AdfAgent._UNSUPPORTED_BROWSER_MODE_ALERT)
      }
      window.setTimeout('try{AdfLogger.LOGGER.warning(unescape("' + escape(AdfAgent._UNSUPPORTED_BROWSER_MODE_ALERT) + '"));}catch(problem){}', 1E3)
    }
  }
};
AdfIEAgent._isIllegalBrowserDetected = function(agent) {
  var agentVersion = agent.getVersion();
  var documentMode = document.documentMode;
  if(agentVersion < 8) {
    if(agentVersion < 7) {
      return true
    }else {
      if(documentMode == null) {
        return false
      }else {
        return true
      }
    }
  }
  if(documentMode < 8) {
    return true
  }
  var absoluteAgentVersion = Math.abs(agentVersion);
  var absoluteDocumentMode = Math.abs(documentMode);
  if(absoluteAgentVersion != absoluteDocumentMode) {
    return true
  }
  return false
};
AdfObject.createSubclass(AdfIEAgent, AdfAgent);
AdfIEAgent.__getAgentVersion = function(userAgent) {
  var agentVersion = null;
  var matches = matches = userAgent.match(/Trident\/(\d+[.]\d+)/);
  if(matches) {
    agentVersion = parseFloat(matches[1]);
    agentVersion += 4
  }else {
    matches = userAgent.match(/MSIE (\d+\.\d+);/);
    if(!matches) {
      matches = userAgent.match(/MSIE (\d+\.\d+)b;/)
    }
    agentVersion = parseFloat(matches[1])
  }
  return agentVersion
};
AdfIEAgent.__getSupported = function(userAgent, version) {
  var supported = true;
  if(version < AdfAgent._MIN_IE_VERSION) {
    supported = false
  }
  return supported
};
AdfIEAgent.__getSpecificAgentClassName = function(userAgent, version) {
  var majorVersion = Math.floor(version);
  switch(majorVersion) {
    case 11:
      return"AdfIEAgent";
    case 10:
      return"AdfIE9Agent";
    case 9:
      return"AdfIE9Agent";
    case 8:
      return"AdfIE8Agent";
    case 7:
      return"AdfIEAgentLegacy";
    default:
      return"AdfIE6Agent"
  }
};
AdfIEAgent.prototype.Init = function(version, domWindow) {
  AdfIEAgent.superclass.Init.call(this, AdfAgent.IE_PLATFORM, AdfAgent.guessOS(), version, domWindow)
};
AdfIEAgent.prototype.CreateNativeLogWriter = function() {
  var domWindow = this.getDomWindow();
  return domWindow.console ? new AdfIEConsoleLogWriter(domWindow, new AdfAlertLogWriter) : new AdfAlertLogWriter
};
AdfIEAgent.prototype._getSessionStorageKey = function(propKey) {
  var domWindow = this.getDomWindow();
  var protocol = domWindow.location.protocol;
  if(protocol) {
    return protocol + "_" + propKey
  }
  return propKey
};
AdfIEAgent.prototype.getDescendantComponentsForNode = function(node, children) {
  if(!children) {
    children = new Array
  }
  var elements = AdfIEAgent._getAllChildElements(node);
  var elementCount = elements.length;
  var page = AdfPage.PAGE;
  for(var i = 0;i < elementCount;i++) {
    var currElement = elements[i];
    var currId = currElement.id;
    if(currId) {
      var comp = page.findComponent(currId);
      if(comp) {
        children.push(comp)
      }
    }
  }
  return children
};
AdfIEAgent.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 += docElement.clientWidth - docElement.scrollWidth
  }
  elemLeft -= docElement.clientLeft - scrollLeft;
  return elemLeft
};
AdfIEAgent.prototype.getElementPageBounds = function(domElement) {
  AdfAssert.assertDomElement(domElement);
  var boundingRect = domElement.getBoundingClientRect();
  var docElement = domElement.ownerDocument.documentElement;
  var scrollLeft = docElement.scrollLeft;
  if(AdfPage.PAGE.getLocaleContext().isRightToLeft()) {
    scrollLeft += docElement.clientWidth - docElement.scrollWidth
  }
  deltaX = docElement.clientLeft - scrollLeft;
  deltaY = docElement.clientTop - docElement.scrollTop;
  return{top:boundingRect.top - deltaY, left:boundingRect.left - deltaX, bottom:boundingRect.bottom - deltaY, right:boundingRect.right - deltaX}
};
AdfIEAgent.prototype.pointInElementBounds = function(element, pageX, pageY) {
  var boundingRect = element.getBoundingClientRect();
  var documentElement = element.ownerDocument.documentElement;
  var clientX = pageX - documentElement.scrollLeft - 2;
  var clientY = pageY - documentElement.scrollTop - 2;
  return clientY >= boundingRect.top && clientY <= boundingRect.bottom && clientX >= boundingRect.left && clientX <= boundingRect.right
};
AdfIEAgent.prototype.getOverrideStyle = function(element) {
  return element.runtimeStyle
};
AdfIEAgent.prototype.getComputedStyle = function(element) {
  return element.currentStyle
};
AdfIEAgent.prototype.getStyleProperty = function(style, propertyName) {
  return style[propertyName]
};
AdfIEAgent.prototype.setCssFloat = function(element, value) {
  element.style.styleFloat = value
};
AdfIEAgent.prototype.getEventToElement = function(nativeEvent) {
  return nativeEvent.toElement
};
AdfIEAgent.prototype.getEventFromElement = function(nativeEvent) {
  return nativeEvent.fromElement
};
AdfIEAgent.prototype.elementFromPagePoint = function(pageX, pageY, hintElement, exclusionContext, exclusionCallback) {
  if(exclusionCallback) {
    return AdfIEAgent.superclass.elementFromPagePoint.call(this, pageX, pageY, hintElement, exclusionContext, exclusionCallback)
  }
  return this.getDomDocument().elementFromPoint(pageX, pageY)
};
AdfIEAgent.prototype.checkMouseOutEvent = function(element, evt) {
  var inside = false;
  var toElem = evt.toElement;
  while(toElem != null) {
    if(toElem == element) {
      inside = true;
      break
    }
    toElem = toElem.parentNode
  }
  return!inside
};
AdfIEAgent.prototype.getMousePosition = function(evt) {
  var domDocument = this.getDomDocument();
  var docElement = domDocument.documentElement;
  return{x:evt.clientX + docElement.scrollLeft - docElement.clientLeft, y:evt.clientY + docElement.scrollTop - docElement.clientTop}
};
AdfIEAgent.prototype.getFormElement = function(form, elementName) {
  var element = null;
  for(var i = 0;i < form.elements.length;i++) {
    var field = form.elements[i];
    if(field.name == elementName) {
      element = field;
      break
    }
  }
  return element
};
AdfIEAgent.prototype.getWindowHeight = function() {
  return this.getDomDocument().documentElement.clientHeight
};
AdfIEAgent.prototype.getWindowWidth = function() {
  return this.getDomDocument().documentElement.clientWidth
};
AdfIEAgent.prototype.getIntAttribute = function(element, attrName, defaultValue) {
  AdfAssert.assert(element);
  if(element.attributes == null) {
    return defaultValue
  }
  var value = element.getAttribute(attrName);
  if(value == undefined) {
    return defaultValue
  }
  if(typeof value == "string") {
    value = parseInt(value)
  }
  return value
};
AdfIEAgent.prototype.getBooleanAttribute = function(element, attrName, defaultValue) {
  AdfAssert.assert(element);
  var value = element.getAttribute(attrName);
  if(value == true || value == false) {
    return value
  }
  return AdfIEAgent.superclass.getBooleanAttribute.call(this, element, attrName, defaultValue)
};
AdfIEAgent.prototype.isFunctionKey = function(keyEvent) {
  var keyCode = keyEvent.keyCode;
  return keyCode >= 112 && keyCode <= 123
};
AdfIEAgent.prototype.isDisabledOptionSupported = function() {
  return false
};
AdfIEAgent.prototype.isEqualIcon = function(firstIcon, secondIcon) {
  var innerHTMLComparison = firstIcon.parentNode.innerHTML == secondIcon.parentNode.innerHTML;
  if(innerHTMLComparison) {
    return true
  }
  var isFirstIconImg = AdfAgent.AGENT.getNodeName(firstIcon) == "IMG";
  var isSecondIconImg = AdfAgent.AGENT.getNodeName(secondIcon) == "IMG";
  if(isFirstIconImg && isSecondIconImg) {
    var firstIconAlt = firstIcon.getAttribute("ALT");
    var secondIconAlt = secondIcon.getAttribute("ALT");
    if(firstIcon.src != secondIcon.src || firstIconAlt != secondIconAlt) {
      return false
    }else {
      return true
    }
  }else {
    return innerHTMLComparison
  }
};
AdfIEAgent.prototype.addOption = function(element, label, value, selected, disabled, description, index) {
  if(!disabled) {
    var optionElement = this.getDomDocument().createElement("option");
    element.options.add(optionElement, index);
    if(value != null) {
      optionElement.value = value
    }
    if(label) {
      AdfAgent.AGENT.setTextContent(optionElement, label)
    }
    optionElement.selected = selected;
    if(description) {
      optionElement.title = description
    }
  }
};
AdfIEAgent.prototype.removeIdsFromDomSubTree = function(subTreeRoot) {
  var id = subTreeRoot.id;
  if(id != null && id != "") {
    subTreeRoot.id = ""
  }
  var elements = AdfIEAgent._getAllChildElements(subTreeRoot);
  var elementCount = elements.length;
  for(var i = 0;i < elementCount;i++) {
    var element = elements[i];
    id = element.getAttribute("id");
    if(id != null && id != "") {
      element.id = ""
    }
  }
};
AdfIEAgent.prototype.removeStyleProperty = function(element, styleProperty) {
  element.style.removeAttribute(styleProperty)
};
AdfIEAgent.prototype.setTableRowHeight = function(row, height) {
  row.style.height = height + "px"
};
AdfIEAgent.prototype.autoCompleteForm = function(htmlForm) {
  AdfAssert.assertDomElement(htmlForm, "FORM");
  var theExternal = this.getDomWindow().external;
  if(theExternal && typeof theExternal.AutoCompleteSaveForm != "undefined") {
    try {
      theExternal.AutoCompleteSaveForm(htmlForm)
    }catch(e) {
      AdfLogger.LOGGER.info("window.external autocomplete failed")
    }
  }else {
    AdfLogger.LOGGER.info("window.external property null, autocomplete disabled")
  }
};
AdfIEAgent.prototype.clearSubtreeIds = function(element) {
  if(element.id) {
    if(typeof element.uniqueID != undefined && element.uniqueID != undefined) {
      element.id = element.uniqueID
    }else {
      element.id = ""
    }
  }
  if(element.name) {
    if(typeof element.uniqueID != undefined && element.uniqueID != undefined) {
      element.name = element.name + element.uniqueID
    }else {
      element.name = ""
    }
  }
  var currChild = element.firstChild;
  while(currChild) {
    if(currChild.nodeType == 1) {
      this.clearSubtreeIds(currChild)
    }
    currChild = currChild.nextSibling
  }
};
AdfIEAgent.prototype.IsComputedWidthAuto = function() {
  return true
};
AdfIEAgent._getAllChildElements = function(parentElement) {
  allNodes = [];
  var childNodes = parentElement.getElementsByTagName("*");
  if(childNodes) {
    var length = childNodes.length;
    for(var i = 0;i < length;i++) {
      var child = childNodes[i];
      if(child.nodeType != 1) {
        continue
      }
      allNodes.push(child)
    }
  }
  return allNodes
};
AdfIEAgent.prototype.slice = function(file, startByte, stopByte) {
  if(file == null) {
    return null
  }
  if(file.slice) {
    return file.slice(startByte, stopByte)
  }
  return undefined
};
