Updated a few things: check for attachEvent/detachEvent, . . .