Fail gracefully when browser does not support document.createEvent (as in IE8)