Even more work on the javascript.  There is still a problem with the onload() calls after a page change.