manually write javascript rather than including it

not sure why drupal_add_js() wasn't working
minor edits