Load JavaScript using wp_enqueue_scripts. This keeps the JS from embedding in the HTML (messy) and improves compatibility with WordPress minifiers that use the list of scripts passed to that function.