Fix IE8 issues, such as "attachEvent" not being a "function"