a more reliable solution for e.offsetX/Y in Firefox

see http://stackoverflow.com/q/12704686/559676

this also fixes the bug reported by Greg D: https://groups.google.com/forum/#!topic/shiny-discuss/E6oYvyvx0oU

I have tested it in Chrome and Firefox.

@jcheng5 please check if you see any problems