Added document.readyState check in EventUtils.js