please goto this url as that may help u
as the code in dynamicmenu.js has been derived from above site.
I read "Custom JSP Tag Library for Dynamic Menus" and used menu.zip, menu-example.war.But on using it & clicking on the Menu items i got the result page in the same frame, but i was using html frames and wanted to load the new page in another frame so after referring to website above & looking i just added target = "main" (main is the name of the target frame where the new page must get displayed), i just added that line in the function
'<a id="mi_' + this.container.id + '_'
+ this.id +'" class="m' + this.container.id + 'l' + this.depth
+'o" href="' + this.fields + '" target="main" style="position: absolute; top: '
hope some help to u