Changed HTMLDocument to Document for IE