function AdfIE9Agent(version, domWindow) {
  this.Init(version, domWindow);
  AdfIEAgent.assertBrowserMode(this)
}
AdfObject.createSubclass(AdfIE9Agent, AdfIE8Agent);
AdfIE9Agent.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.addEventListener(events[eventIndex], listener, true)
  }
};
AdfIE9Agent.prototype.cloneEvent = function(event, newTarget) {
  if(this.isMouseEvent(event)) {
    var eventType = event.type;
    newEvent = this._copyMouseEvent(event, eventType, newTarget);
    var targetNode = newTarget ? newTarget : event.target;
    var targetDocument = targetNode.ownerDocument;
    targetDocument.addEventListener(eventType, this.stopPropagation, true);
    try {
      targetNode.dispatchEvent(newEvent)
    }finally {
      targetDocument.removeEventListener(eventType, this.stopPropagation, true)
    }
    return newEvent
  }else {
    if(this.isKeyboardEvent(event)) {
      return AdfAgent.prototype.cloneEvent.call(AdfAgent.prototype, event, newTarget)
    }else {
      return event
    }
  }
};
AdfIE9Agent.prototype.copyEvent = function(event) {
  if(this.isMouseEvent(event) || event.type == "contextmenu") {
    var eventType = event.type;
    newEvent = this._copyMouseEvent(event, eventType);
    return newEvent
  }else {
    return event
  }
};
AdfIE9Agent.prototype._copyMouseEvent = function(event, eventType, newTarget) {
  var targetNode = newTarget ? newTarget : event.target;
  var targetDocument = targetNode.ownerDocument;
  var newEvent = targetDocument.createEvent("MouseEvents");
  newEvent.initMouseEvent(eventType, event.bubbles, event.cancelable, event.view, event.detail, event.screenX, event.screenY, event.clientX, event.clientY, event.ctrlKey, event.altKey, event.shiftKey, event.metaKey, event.button, event.relatedTarget);
  return newEvent
};
AdfIE9Agent._getBoxObjectFor = function(elem) {
  var doc = elem.ownerDocument;
  if(doc.getBoxObjectFor) {
    return doc.getBoxObjectFor(elem)
  }
  var boundingRect = elem.getBoundingClientRect();
  var elemTop = Math.round(boundingRect.top);
  var elemLeft = Math.round(boundingRect.left);
  var elemWidth = Math.round(boundingRect.width);
  var elemHeight = Math.round(boundingRect.height);
  return{x:elemLeft, y:elemTop, width:elemWidth, height:elemHeight}
};
AdfIE9Agent.prototype.getComponentEvent = function(component, nativeEvent, prevComponent) {
  return AdfAgent.prototype.getComponentEvent.apply(this, arguments)
};
AdfIE9Agent.prototype.stopPropagation = function(evt) {
  if(evt.stopPropagation) {
    evt.stopPropagation()
  }else {
    AdfIE9Agent.superclass.stopPropagation.call(this, evt)
  }
};
AdfIE9Agent.prototype.preventDefault = function(evt) {
  if(evt.preventDefault) {
    evt.preventDefault()
  }else {
    AdfIE9Agent.superclass.preventDefault.call(this, evt)
  }
};
AdfIE9Agent.prototype.isLeftButton = function(evt) {
  return evt.button == 0
};
AdfIE9Agent.prototype.isDefaultPrevented = function(evt) {
  if(evt["defaultPrevented"]) {
    return evt.defaultPrevented
  }else {
    return AdfIE9Agent.superclass.isDefaultPrevented.call(this, evt)
  }
};
AdfIE9Agent.prototype.dispatchEvent = function(targetElement, event) {
  return targetElement.dispatchEvent(event)
};
AdfIE9Agent.prototype.getEventTarget = function(evt) {
  var eventTarget = evt.target;
  if(!eventTarget) {
    return AdfIE9Agent.superclass.getEventTarget.call(this, evt)
  }
  return eventTarget
};
AdfIE9Agent.prototype.setEventTarget = function(event, eventTarget) {
  event.target = eventTarget
};
AdfIE9Agent.prototype.getTextContent = function(node) {
  AdfAssert.assertDomNode(node);
  switch(node.nodeType) {
    case 1:
      var textContent = node.textContent;
      if(textContent == undefined) {
        return AdfIE9Agent.superclass.getTextContent.call(this, node)
      }
      return textContent;
    default:
      return AdfIE9Agent.superclass.getTextContent.call(this, node)
  }
};
AdfIE9Agent.prototype.addBubbleEventListener = function(nodeOrWindow, eventType, listener) {
  AdfAssert.assertString(eventType);
  AdfAssert.assertFunction(listener);
  nodeOrWindow.addEventListener(eventType, listener, false)
};
AdfIE9Agent.prototype.removeBubbleEventListener = function(nodeOrWindow, eventType, listener) {
  AdfAssert.assertString(eventType);
  AdfAssert.assertFunction(listener);
  nodeOrWindow.removeEventListener(eventType, listener, false)
};
AdfIE9Agent.prototype.addKeyEventListener = function(element, listener) {
  element.addEventListener("keydown", listener, false)
};
AdfIE9Agent.prototype.removeKeyEventListener = function(element, listener) {
  element.removeEventListener("keydown", listener, false)
};
AdfIE9Agent.prototype.setOpacity = function(element, opacityPercent) {
  AdfIE9Agent.superclass.setOpacity.call(this, element, opacityPercent);
  element.style.opacity = opacityPercent / 100
};
AdfIE9Agent.prototype.CreateUIInputEvent = function(component, type, nativeEvent) {
  return new AdfIE9UIInputEvent(component, type, nativeEvent)
};
AdfIE9Agent.prototype.GetResizeEvents = function() {
  return AdfIE9Agent._RESIZE_EVENTS
};
AdfIE9Agent.prototype.supportsTransientStyleClasses = function() {
  var documentElement = this.getDomDocument().documentElement;
  return documentElement.scrollTop <= 0
};
AdfIE9Agent._RESIZE_EVENTS = ["DOMAttrModified", "DOMSubtreeModified"];
