broke up long chains of javascript function in menu-creation code to address issue raised in http://article.gmane.org/gmane.comp.lib.boost.devel/171201