I'm trying to make a new module, just like the xtracker.module, only including a cut-and-paste javascript at the top of the page body. The javascript displays a clickable map of the US with tooltips showing the states' names when you hover over the states. No database functions or changes are needed.
I copied the xtracker.module as a starting point, and renamed it xtracker_map.module. Inside the module I renamed all instances of xtracker to xtracker_map and tested it. Everything works just fine.
Now I want to add the javascript, which includes a .js file, a .css file, and some HTML on the page. I've got the javascript working fine on a static webpage, separate from my drupal site. It even works fine just putting all of the code (HTML, CSS and Javascript) on the same static HTML page.
This topic almost got me there: http://drupal.org/node/40352
From that page and studying the API docs on this site I gathered that:
1. hook_view can be used inside of a module (as in node_example.module) to add something extra onto the pages rendered by (only) that module.
2. hook_nodeapi can be used inside any module to add something extra to the pages rendered by any module(s), on a selective basis.
3. Drupal 4.7 has some built-in javascript and some instructions in the handbooks on incorporating javascripts and ajax in drupal 4.7, but I assume it doesn't apply to 4.6.