So far, I've put the js references and function call in the head section of a master page:
Did you add the script in the <head> section or in the header of the master page? I suggest that you create a header in the master page and add the code there. That will let RoboHelp create relative paths to the file from the different topics when you generate.
Clever, very clever, Willam. That seems to work quite well. I appreciate your simple and effective answer!