function RightMenu() 

this.AddItem=AddItem; 
this.GetMenu=GetMenu; 
this.I_OnMouseOver=I_OnMouseOver; A_rbpm = new Array(); 
HTMLstr = ""; 
HTMLstr += "<!-- RightButton PopMenu -->\n"; 
HTMLstr += "\n"; 
HTMLstr += "<!-- PopMenu Starts -->\n"; 
HTMLstr += "<div id='E_rbpm' class='rm_div'>\n"; 
// rbpm = right button pop menu 
HTMLstr += "<table width='140' border='0' cellspacing='0'>\n"; //width参数可以设置菜单宽度
HTMLstr += "<tr><td height='200' width='100%' valign='bottom' bgcolor='#000000' onclick=window.event.cancelBubble=true; class=info>版权<br>:恩优科技<br>:<br>请勿侵权\n"; 
HTMLstr += "</td><td height='200' width='100%' style='padding: 1' valign='bottom'>\n"; 
HTMLstr += "<table width='100%' border='0' cellspacing='0'>\n"; 
HTMLstr += "<!-- Insert A Extend Menu or Item On Here For E_rbpm -->\n"; 
HTMLstr += "</table></td></tr></table>\n"; 
HTMLstr += "</div>\n"; 
HTMLstr += "<!-- Insert A Extend_Menu Area on Here For E_rbpm -->"; 
HTMLstr += "\n"; 
HTMLstr += "<!-- PopMenu Ends -->\n"; 
}var menu = new RightMenu();//AddItem参数(id,img,wh,name,parent,location) 
menu.AddItem("update","start_update","1","查看酒店<font class=w2kfont>(<u>V</u>)</font>","rbpm",document.cookie); 
menu.AddItem("sperator","","","","rbpm",null); 
menu.AddItem("program","start_pro","2","&nbsp;&nbsp;&nbsp;团体预定<font class=w2kfont>(<u>P</u>)</font>","rbpm",document.cookie); 
menu.AddItem("doc","start_doc","3","&nbsp;&nbsp;&nbsp;散客入住<font class=w2kfont>(<u>D</u>)</font>","rbpm",document.cookie); 
menu.AddItem("fav","start_fav","4","&nbsp;&nbsp;团体入住<font class=w2kfont>(<u>A</u>)</font>","rbpm","aa"); 
menu.AddItem("sperator","","","","rbpm",null); 
menu.AddItem("setting","start_set","a","&nbsp;酒店特色<font class=w2kfont>(<u>S</u>)</font>","rbpm","aa"); 
menu.AddItem("find","start_find","v","&nbsp;&nbsp;最新活动<font class=w2kfont>(<u>F</u>)","rbpm","aa"); 
menu.AddItem("sperator","","","","rbpm",null); 
menu.AddItem("refresh","start_help","7"," &nbsp;&nbsp;刷新<font class=w2kfont>(<u>H</u>)</font>","rbpm",null); 
menu.AddItem("back","start_logoff","+"," &nbsp;后退<font class=w2kfont>(<u>L</u>)</font>","rbpm",null); 
menu.AddItem("exit","start_shut","x","&nbsp;&nbsp;退出<font class=w2kfont>(<u>U</u>)</font>","rbpm",null); 
document.writeln(menu.GetMenu()); 
想请问一下高手,能不能把上面两段代码整合在一个函数function Test() 下,方便我后面直接调用这个函数,现在这样子我好像调用不了??
我JS不太熟悉,试着尝试过,但没有成功,哎,希望高手指点下