fix typeof attachEvent, detachEvent