Don't rely on a global event object

That doesn't work in Firefox