12
I got HVMenu working on my site by inserting it all within the head section, and it has a lag on my site, too.
However, to really make it useful I had to modify header.php to include a program I wrote called topmenu.php, which generates the menu dynamically (so that users logged in get a different menu than someone who isn't logged in, and admins get a still different menu). Then it returns the javascript/etc code back to the theme as a <{$variable}> thingy.
Check out how it works on my site at
VarLinuxIMO, the XOOPS team should put a generic "include generic.php" at the end of header.php, so that people don't have to modify XOOPS files in order to do this sort of thing. I don't know any other way to use PHP to dynamically generate something that gets put in the head section of the HTML page via the theme.