/**
   * Adds a new item to the list (optionally) at the specified index in IE way.
   *
   * @param newOptionObject the DomNode to insert
   * @param index (optional) the index where the node should be inserted
   */
  protected void add_IE(final HTMLOptionElement newOptionObject, final Object index) {
    final HtmlSelect select = getHtmlSelect();
    final HtmlOption beforeOption;
    if (Context.getUndefinedValue().equals(index)) {
      beforeOption = null;
    } else {
      final int intIndex = ((Integer) Context.jsToJava(index, Integer.class)).intValue();
      if (intIndex >= select.getOptionSize()) {
        beforeOption = null;
      } else {
        beforeOption = select.getOption(intIndex);
      }
    }

    addBefore(newOptionObject, beforeOption);
  }