fixed offset for firefox

Onmouse event doesn't work for firefox - offsetX returns undefined. Here's the fix