Changes to help support Content Security Poilicy

I have enabled Content Security Policy on my application (blocks inline JavaScript), this stopped the onclick handler from working in modified code.  I've modified the code to use a event handler instead which works for me on JQuery 1.10.2.