Fixed for Firefox.

`e.offsetX` and `e.offsetY` don't work in Firefox, so I've spliced in a fix from http://nickthecoder.wordpress.com/2013/02/26/offsetx-and-offsety-in-firefox/. It works in Firefox for me now.