Added onclick handers to the javascript code