I'm adding this for posterity; There's an easier way that doesn't involve writing more JS. Using the amazing firebug addon for firefox,
- Right click on the element and select 'Inspect element with Firebug'
- In the sidebar panels (shown in the screenshot), navigate to the events tab using the tiny > arrow
- The events tab shows the events and corresponding functions for each event
- The text next to it shows the function location