--- /dev/null
+// this value should be identical to the value used in whproxy.js\r
+window.whname = "wh_stub";\r
+\r
+// this file will be used by Topic and NavBar and NavPane and other components\r
+// and this file is used in child frame html.\r
+// and the whstub.js will be used in the start page.\r
+// see reference in whstub.js.\r
+// Internal Area\r
+var gbInited = false;\r
+var gWndStubPage = null;\r
+function getStubPage()\r
+{\r
+ if (!gbInited)\r
+ {\r
+ gWndStubPage = getStubPage_inter(window);\r
+ gbInited = true;\r
+ }\r
+ return gWndStubPage;\r
+}\r
+\r
+function getStubPage_inter(wCurrent) {\r
+ if (null == wCurrent.parent || wCurrent.parent == wCurrent)\r
+ return null;\r
+\r
+ if (wCurrent.parent.whname && "wh_stub" == wCurrent.parent.whname) \r
+ return wCurrent.parent;\r
+ else\r
+ if (wCurrent.parent.frames.length != 0 && wCurrent.parent != wCurrent)\r
+ return getStubPage_inter(wCurrent.parent);\r
+ else \r
+ return null;\r
+}\r
+\r
+// Public interface begin here................\r
+function RegisterListener(framename, nMessageId)\r
+{\r
+ var wStartPage = getStubPage();\r
+ if (wStartPage && wStartPage != this) {\r
+ return wStartPage.RegisterListener(framename, nMessageId);\r
+ }\r
+ else \r
+ return false;\r
+}\r
+\r
+function RegisterListener2(oframe, nMessageId)\r
+{\r
+ var wStartPage = getStubPage();\r
+ if (wStartPage && wStartPage != this) {\r
+ return wStartPage.RegisterListener2(oframe, nMessageId);\r
+ }\r
+ else \r
+ return false;\r
+}\r
+\r
+function UnRegisterListener2(oframe, nMessageId)\r
+{\r
+ var wStartPage = getStubPage();\r
+ if (wStartPage && wStartPage != this && wStartPage.UnRegisterListener2) {\r
+ return wStartPage.UnRegisterListener2(oframe, nMessageId);\r
+ }\r
+ else \r
+ return false;\r
+}\r
+\r
+function SendMessage(oMessage)\r
+{\r
+ var nMsgId = oMessage.nMessageId;\r
+ if (nMsgId == WH_MSG_ISINFRAMESET && oMessage.wSender != this)\r
+ return true;\r
+ var wStartPage = getStubPage();\r
+ if (wStartPage && wStartPage != this && wStartPage.SendMessage) \r
+ {\r
+ return wStartPage.SendMessage(oMessage);\r
+ }\r
+ else \r
+ return false;\r
+}\r
+var gbWhProxy=true;
\ No newline at end of file