Stop relying on event being a global variable for IE compatibility