Use the jquery event rather than the global one. Fix for Firefox

Firefox doesn't support a global event object on the window. This changes this code to use the one passed to the event. Turns, out this isn't the real event. Its a jquery wrapped event, but it holds a reference to the original.