A better method of doing this is to specify JS event handlers via a separate file in drupal_add_js() using Drupal.behaviors. I don't know of go-to documentation for this off of the top of my head, but do some searching and look at examples in other core modules.
Carl Wiedemann Website design and development consulting [email protected] | skype: c4rlww
