Elaborated with some comments, and changed the code that used the html id attribute to store the elid key of the lookup table.  Might have a problem somewhere due to firefox's 'no element found' error I'm getting, but it seems to have no effect.