Use hook_page_build instead of hook_init for JS inclusion.