use addEventListener instead of onclick

Also use attachEvent as a fallback. This page will only works with
everything but old IE so this fallback will only be useful to display
error messages in IE 8 :)