home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 May / CHIPCD200305.iso / super / altn / md_en.exe / WHTOPIC.JS < prev    next >
Encoding:
JavaScript  |  2003-04-14  |  15.9 KB  |  723 lines

  1. //    WebHelp 5.10.003
  2. var gsPPath = "";
  3. var gaPaths = new Array();
  4. var gaAvenues = new Array();
  5.  
  6. var goFrame = null;
  7. var gsStartPage = "";
  8. var gsRelCurPagePath = "";
  9. var gsSearchFormHref  = "";
  10. var gnTopicOnly = -1;
  11. var gnOutmostTopic = -1;
  12.  
  13. var BTN_TEXT=1;
  14. var BTN_IMG=2;
  15.  
  16. var goSync = null;
  17.  
  18. var goShow = null;
  19. var goHide = null;
  20.  
  21. var goPrev = null;
  22. var goNext = null;
  23. var gnForm = 0;
  24. var goShowNav = null;
  25. var goHideNav = null;
  26.  
  27. var goWebSearch = null;
  28.  
  29. var gsBtnStyle = "";
  30. var gaButtons = new Array();
  31. var gaTypes = new Array();
  32. var whtopic_foldUnload = null;
  33. var gbWhTopic=false;
  34. var gbCheckSync=false;
  35. var gbSyncEnabled=false;
  36.  
  37. function setButtonFont(sType, sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration)
  38. {
  39.     var vFont=new whFont(sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration);
  40.     gsBtnStyle += ".whtbtn" + sType + "{"+getFontStyle(vFont) + "}";
  41. }
  42.  
  43. function writeBtnStyle()
  44. {
  45.     if (gaButtons.length > 0)
  46.     {
  47.         if (gsBtnStyle.length > 0)
  48.         {
  49.             var sStyle = "<style type='text/css'>";
  50.             sStyle+= gsBtnStyle + "</style>";
  51.             document.write(sStyle);
  52.         }
  53.     }
  54. }
  55.  
  56. function button(sText, nWidth, nHeight)
  57. {
  58.     this.sText = sText;
  59.     this.nWidth = nWidth;
  60.     this.nHeight = nHeight;
  61.     
  62.     this.aImgs = new Array();
  63.     var i = 0;
  64.     while (button.arguments.length > i + 3)
  65.     {
  66.         this.aImgs[i] = button.arguments[3 + i];
  67.         i ++;
  68.     }
  69. }
  70.  
  71. // project info
  72. function setRelStartPage(sPath)
  73. {
  74.     if (gsPPath.length == 0)
  75.     {
  76.         gsPPath = _getFullPath(_getPath(document.location.href),  _getPath(sPath));
  77.         gsStartPage = _getFullPath(_getPath(document.location.href), sPath);
  78.         gsRelCurPagePath = _getRelativeFileName(gsStartPage, document.location.href);
  79.     }
  80. }
  81.  
  82. function getImage(oImage, sType)
  83. {
  84.     var sImg="";
  85.     if (oImage && oImage.aImgs && (oImage.aImgs.length > 0))
  86.     {
  87.         sImg+="<img alt=\""+ sType + "\" src=\"" + oImage.aImgs[0] + "\"";
  88.         if (oImage.nWidth > 0)
  89.             sImg+=" width=" + oImage.nWidth;
  90.         if (oImage.nHeight > 0)
  91.             sImg+=" height=" + oImage.nHeight;
  92.         sImg+=" border=0>";
  93.     }
  94.     return sImg;
  95. }
  96.  
  97. function addTocInfo(sTocPath)
  98. {
  99.     gaPaths[gaPaths.length] = sTocPath;
  100. }
  101.  
  102. function addAvenueInfo(sName, sPrev, sNext)
  103. {
  104.     gaAvenues[gaAvenues.length] = new avenueInfo(sName, sPrev, sNext);    
  105. }
  106.  
  107. function addButton(sType, nStyle, sText, sHref, sOnClick, sOnMouseOver, sOnLoad, nWidth, nHeight, sImg1, sImg2, sImg3)
  108. {
  109.     var sButton = "";
  110.     var nBtn=gaButtons.length;
  111.     if (sType == "prev")
  112.     {
  113.         if (canGo(false))
  114.         {
  115.             var sTitle = "Previous Topic";
  116.             goPrev = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3);
  117.             sButton = "<a title=\"" + sTitle + "\" class=\"whtbtnprev\" href=\"javascript:void(0);\" onclick=\"goAvenue(false);return false;\">";
  118.             if (nStyle == BTN_TEXT)
  119.                 sButton += goPrev.sText;
  120.             else
  121.                 sButton += getImage(goPrev, sTitle);
  122.             sButton += "</a>";
  123.         }
  124.     }
  125.     else if (sType == "next")
  126.     {
  127.         if (canGo(true))
  128.         {
  129.             var sTitle = "Next Topic";
  130.             goNext = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3);
  131.             sButton = "<a title=\"" + sTitle + "\" class=\"whtbtnnext\" href=\"javascript:void(0);\" onclick=\"goAvenue(true);return false;\">";
  132.             if (nStyle == BTN_TEXT)
  133.                 sButton += goNext.sText;
  134.             else
  135.                 sButton += getImage(goNext, sTitle);
  136.             sButton += "</a>";
  137.         }
  138.     }
  139.     else if (sType == "show")
  140.     {
  141.         if (isTopicOnly())
  142.         {
  143.             var sTitle = "Show Navigation Component";
  144.             goShow = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3);
  145.             sButton = "<a title=\"" + sTitle + "\" class=\"whtbtnshow\" href=\"javascript:void(0);\" onclick=\"show();return false;\">";
  146.             if (nStyle == BTN_TEXT)
  147.                 sButton += goShow.sText;
  148.             else
  149.                 sButton += getImage(goShow, sTitle);
  150.             sButton += "</a>";
  151.         }
  152.     }
  153.     else if (sType == "hide")
  154.     {
  155.         if (!isTopicOnly())
  156.         {
  157.             var sTitle = "Hide Navigation Component";
  158.             goHide = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3);
  159.             sButton = "<a title=\"" + sTitle + "\" class=\"whtbtnhide\" href=\"javascript:void(0);\" onclick=\"hide();return false;\">";
  160.             if (nStyle == BTN_TEXT)
  161.                 sButton += goHide.sText;
  162.             else
  163.                 sButton += getImage(goHide, sTitle);
  164.             sButton += "</a>";
  165.         }
  166.     }
  167.     else if (sType == "shownav")
  168.     {
  169.         
  170.         if (isShowHideEnable())
  171.         {
  172.             var sTitle = "Show Navigation Component";
  173.             goShowNav = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3);
  174.             sButton = "<a title=\"" + sTitle + "\" class=\"whtbtnshownav\" href=\"javascript:void(0);\" onclick=\"showHidePane(true);return false;\">";
  175.             if (nStyle == BTN_TEXT)
  176.                 sButton += goShowNav.sText;
  177.             else
  178.                 sButton += getImage(goShowNav, sTitle);
  179.             sButton += "</a>";
  180.         }
  181.     }
  182.     else if (sType == "hidenav")
  183.     {
  184.         if (isShowHideEnable())
  185.         {
  186.             var sTitle = "Hide Navigation Component";
  187.             goHideNav = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3);
  188.             sButton = "<a title=\"" + sTitle + "\" class=\"whtbtnhidenav\" href=\"javascript:void(0);\" onclick=\"showHidePane(false);return false;\">";
  189.             if (nStyle == BTN_TEXT)
  190.                 sButton += goHideNav.sText;
  191.             else
  192.                 sButton += getImage(goHideNav, sTitle);
  193.             sButton += "</a>";
  194.         }
  195.     }
  196.     else if (sType == "synctoc")
  197.     {
  198.         if (gaPaths.length > 0)
  199.         {
  200.             var sTitle = "Sync TOC";
  201.             goSync = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3);
  202.             sButton = "<a title=\""+ sTitle + "\" class=\"whtbtnsynctoc\" href=\"javascript:void(0);\" onclick=\"syncWithShow();return false;\">";
  203.             if (nStyle == BTN_TEXT)
  204.                 sButton += goSync.sText;
  205.             else
  206.                 sButton += getImage(goSync, sTitle);
  207.             sButton += "</a>";
  208.         }
  209.     }
  210.     else if (sType == "websearch")
  211.     {
  212.         if (gsSearchFormHref.length > 0)
  213.         {
  214.             var sTitle = "WebSearch";
  215.             goWebSearch = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3);
  216.             sButton = "<a title=\""+ sTitle + "\" class=\"whtbtnwebsearch\" href=\"" + gsSearchFormHref + "\">";
  217.             if (nStyle == BTN_TEXT)
  218.                 sButton += goWebSearch.sText;
  219.             else
  220.                 sButton += getImage(goWebSearch, sTitle);
  221.             sButton += "</a>";
  222.         }
  223.     }
  224.     else if (sType == "searchform")
  225.     {
  226.         gaButtons[nBtn] = "NeedSearchForm";
  227.         gaTypes[nBtn] = sType;
  228.     }
  229.     if (sButton.length != 0)
  230.     {
  231.         if (nStyle == BTN_TEXT)
  232.             sButton += " ";
  233.         gaButtons[nBtn] = "<td>" + sButton + "</td>";
  234.         gaTypes[nBtn] = sType;
  235.     }
  236. }
  237.  
  238. function isSyncEnabled()
  239. {
  240.     if (!gbCheckSync)
  241.     {
  242.         var oMsg=new whMessage(WH_MSG_ISSYNCSSUPPORT,this,1,null);
  243.         if(SendMessage(oMsg))
  244.         {
  245.             gbSyncEnabled=oMsg.oParam;
  246.         }
  247.         gbCheckSync=true;
  248.     }
  249.     return gbSyncEnabled;
  250. }
  251.  
  252. function isInPopup()
  253. {
  254.     return (window.name.indexOf("BSSCPopup") != -1);
  255. }
  256.  
  257. function getIntopicBar(sAlign)
  258. {
  259.     var sHTML = "";
  260.     if (gaButtons.length > 0)
  261.     {
  262.         sHTML += "<div align="+ sAlign + ">";
  263.  
  264.         sHTML += "<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\"><tr>";
  265.         for (var i = 0; i < gaButtons.length; i++)
  266.         {
  267.             if (gaTypes[i]!="synctoc" || isSyncEnabled())
  268.             {
  269.                 if (gaButtons[i] == "NeedSearchForm")
  270.                     sHTML += getSearchFormHTML();
  271.                 else
  272.                     sHTML += gaButtons[i];
  273.             }
  274.         }
  275.         sHTML += "</tr></table>";
  276.  
  277.         sHTML += "</div>";
  278.     }
  279.     return sHTML;
  280. }
  281.  
  282.  
  283. function writeIntopicBar(nAligns)
  284. {
  285.     if (isInPopup()) return;
  286.     if (gaButtons.length > 0)
  287.     {
  288.         var sHTML = "";
  289.         if (nAligns != 0)
  290.         {
  291.             sHTML += "<table width=100%><tr>"
  292.             if (nAligns & 1)
  293.                 sHTML += "<td width=33%>" + getIntopicBar("left") + "</td>";
  294.             if (nAligns & 2)
  295.                 sHTML += "<td width=34%>" + getIntopicBar("center") + "</td>";
  296.             if (nAligns & 4)
  297.                 sHTML += "<td width=33%>" + getIntopicBar("right") + "</td>";
  298.             sHTML += "</tr></table>";
  299.             document.write(sHTML);
  300.         }
  301.     }
  302. }
  303.  
  304. function sendAveInfoOut()
  305. {
  306.     if (!isInPopup())
  307.         setTimeout("sendAveInfo();", 100);
  308. }
  309.  
  310. function sendAveInfo()
  311. {
  312.     var oMsg = new whMessage(WH_MSG_AVENUEINFO, this, 1, gaAvenues);
  313.     SendMessage(oMsg);
  314. }
  315.  
  316.  
  317. function onNext()
  318. {
  319.     var oMsg = new whMessage(WH_MSG_NEXT, this, 1, null);
  320.     SendMessage(oMsg);
  321. }
  322.  
  323. function onPrev()
  324. {
  325.     var oMsg = new whMessage(WH_MSG_PREV, this, 1, null);
  326.     SendMessage(oMsg);
  327. }
  328.  
  329. function createSyncInfo()
  330. {
  331.     var oParam = new Object();
  332.     if (gsPPath.length == 0)
  333.         gsPPath = _getPath(document.location.href);
  334.     oParam.sPPath = gsPPath;
  335.     oParam.sTPath = document.location.href;
  336.     oParam.aPaths = gaPaths;
  337.     return oParam;
  338. }
  339.  
  340. function syncWithShow()
  341. {
  342.     if (isTopicOnly())
  343.         show();
  344.     else 
  345.     {
  346.         sync();
  347.         showTocPane();
  348.     }
  349. }
  350.  
  351. function showTocPane()
  352. {
  353.     var oMsg = new whMessage(WH_MSG_SHOWTOC, this, 1, null);
  354.     SendMessage(oMsg);
  355. }
  356.  
  357. function sendSyncInfo()
  358. {
  359.     if (!isInPopup())
  360.     {
  361.         var oParam = null;
  362.         if (gaPaths.length > 0)
  363.         {
  364.             oParam = createSyncInfo();
  365.         }
  366.         var oMsg = new whMessage(WH_MSG_SYNCINFO, this, 1, oParam);
  367.         SendMessage(oMsg);
  368.     }
  369. }
  370.  
  371. function sendInvalidSyncInfo()
  372. {
  373.     if (!isInPopup())
  374.     {
  375.         var oMsg = new whMessage(WH_MSG_SYNCINFO, this, 1, null);
  376.         SendMessage(oMsg);
  377.     }
  378. }
  379.  
  380. function enableWebSearch(bEnable)
  381. {
  382.     if (!isInPopup())
  383.     {
  384.         var oMsg = new whMessage(WH_MSG_ENABLEWEBSEARCH, this, 1, bEnable);
  385.         SendMessage(oMsg);
  386.     }
  387. }
  388.  
  389. function autoSync(nSync)
  390. {
  391.     if (nSync == 0) return;
  392.     if (isInPopup()) return;
  393.     if (isOutMostTopic())
  394.         sync();
  395. }
  396.  
  397. function isOutMostTopic()
  398. {
  399.     if (gnOutmostTopic == -1)
  400.     {
  401.         var oMessage = new whMessage(WH_MSG_ISINFRAMESET, this, 1 , null);
  402.         if (SendMessage(oMessage))
  403.             gnOutmostTopic = 0;
  404.         else
  405.             gnOutmostTopic = 1;
  406.     }
  407.     return (gnOutmostTopic == 1);
  408. }
  409.  
  410. function sync()
  411. {
  412.     if (gaPaths.length > 0)
  413.     {
  414.         var oParam = createSyncInfo();
  415.         var oMessage = new whMessage(WH_MSG_SYNCTOC, this, 1, oParam);
  416.         SendMessage(oMessage);
  417.     }
  418. }
  419.  
  420.  
  421. function avenueInfo(sName, sPrev, sNext)
  422. {
  423.     this.sName = sName;
  424.     this.sPrev = sPrev;
  425.     this.sNext = sNext;
  426. }
  427.  
  428. function getCurrentAvenue()
  429. {
  430.     var oParam = new Object();
  431.     oParam.sAvenue = null;
  432.     var oMessage = new whMessage(WH_MSG_GETCURRENTAVENUE, this, 1, oParam);
  433.     SendMessage(oMessage);
  434.     return oParam.sAvenue;
  435. }
  436.  
  437. function unRegisterListener()
  438. {
  439.     sendInvalidSyncInfo();
  440.     enableWebSearch(false);
  441.     if (whtopic_foldUnload)
  442.         whtopic_foldUnload();
  443. }
  444.  
  445. function onSendMessage(oMsg)
  446. {
  447.     var nMsgId = oMsg.nMessageId;
  448.     if (nMsgId == WH_MSG_GETAVIAVENUES)
  449.     {
  450.         oMsg.oParam.aAvenues = gaAvenues;
  451.         return false;
  452.     }
  453.     else if (nMsgId == WH_MSG_GETTOCPATHS)
  454.     {
  455.         if (isOutMostTopic())
  456.         {
  457.             oMsg.oParam.oTocInfo = createSyncInfo();
  458.             return false;        
  459.         }
  460.         else
  461.             return true;
  462.     }
  463.     else if (nMsgId == WH_MSG_NEXT)
  464.     {
  465.         goAvenue(true);
  466.     }
  467.     else if (nMsgId == WH_MSG_PREV)
  468.     {
  469.         goAvenue(false);
  470.     }
  471.     else if (nMsgId == WH_MSG_WEBSEARCH)
  472.     {
  473.         websearch();
  474.     }
  475.     return true;
  476. }
  477.  
  478. function goAvenue(bNext)
  479. {
  480.     var sTopic = null;
  481.     var sAvenue = getCurrentAvenue();
  482.     var nAvenue = -1;
  483.     if (sAvenue != null && sAvenue != "")
  484.     {
  485.         for (var i = 0; i < gaAvenues.length ; i ++)
  486.         {
  487.             if (gaAvenues[i].sName == sAvenue)
  488.             {
  489.                 nAvenue = i;
  490.                 break;
  491.             }
  492.         }
  493.         if (nAvenue != -1)
  494.         {
  495.             if (bNext)
  496.                 sTopic = gaAvenues[nAvenue].sNext;
  497.             else
  498.                 sTopic = gaAvenues[nAvenue].sPrev;
  499.         }
  500.     }
  501.     else
  502.     { 
  503.         for (var i = 0; i < gaAvenues.length ; i ++)
  504.         {
  505.             if (gaAvenues[i].sNext != null && gaAvenues[i].sNext.length > 0 && bNext)
  506.             {
  507.                 sTopic = gaAvenues[i].sNext;
  508.                 break;
  509.             }
  510.             else if (gaAvenues[i].sPrev != null && gaAvenues[i].sPrev.length > 0 && !bNext)
  511.             {
  512.                 sTopic = gaAvenues[i].sPrev;
  513.                 break;
  514.             }
  515.         }
  516.     }
  517.     
  518.     if (sTopic != null && sTopic != "")
  519.     {
  520.         if (gsPPath != null && gsPPath != "")
  521.         {
  522.             sFullTopicPath = _getFullPath(gsPPath, sTopic);
  523.             document.location = sFullTopicPath;
  524.         }
  525.     }
  526. }
  527.  
  528. function canGo(bNext)
  529. {
  530.     for (var i = 0; i < gaAvenues.length ; i ++)
  531.     {
  532.         if ((gaAvenues[i].sNext != null && gaAvenues[i].sNext.length > 0 && bNext) ||
  533.             (gaAvenues[i].sPrev != null && gaAvenues[i].sPrev.length > 0 && !bNext))
  534.             return true;
  535.     }
  536.     return false;
  537. }
  538.  
  539. function show()
  540. {
  541.     if (gsStartPage != "")
  542.         window.location =  gsStartPage + "#" + gsRelCurPagePath;
  543. }
  544.  
  545. function hide()
  546. {
  547.     if (goFrame != null)
  548.     {
  549.         goFrame.location = window.location;
  550.     }
  551. }
  552.  
  553. function isTopicOnly()
  554. {
  555.     if (gnTopicOnly == -1)
  556.     {
  557.         var oParam = new Object();
  558.         oParam.oFrame = null;
  559.         var oMsg = new whMessage(WH_MSG_GETSTARTFRAME, this, 1, oParam);
  560.         if (SendMessage(oMsg))
  561.         {
  562.             goFrame = oParam.oFrame;
  563.             gnTopicOnly = 0;
  564.         }
  565.         else
  566.             gnTopicOnly = 1;
  567.     }
  568.     if (gnTopicOnly == 1)
  569.         return true;
  570.     else
  571.         return false;
  572. }
  573.  
  574. function websearch()
  575. {
  576.     if (gbNav4)
  577.     {
  578.         if (document.ehelpform)
  579.             document.ehelpform.submit();
  580.     }
  581.     else
  582.     {
  583.         if (window.ehelpform)
  584.             window.ehelpform.submit();
  585.     }
  586. }
  587.  
  588. function addSearchFormHref(sHref)
  589. {
  590.     gsSearchFormHref = sHref;
  591.     enableWebSearch(true);
  592. }
  593.  
  594. function searchB(nForm)
  595. {
  596.     var sValue = eval("document.searchForm" + nForm + ".searchString.value");
  597.     var oMsg = new whMessage(WH_MSG_SEARCHTHIS, this, 1, sValue);
  598.     SendMessage(oMsg);
  599. }
  600.  
  601. function getSearchFormHTML()
  602. {
  603.     var sHTML = "";
  604.     gnForm ++;
  605.     var sFormName = "searchForm" + gnForm;
  606.     var sButton = "<form name=\"" + sFormName + "\" method=\"POST\" action=\"javascript:searchB("+ gnForm + ")\">"
  607.     sButton += "<input type=\"text\" name=\"searchString\" value=\"- Full Text search -\" size=\"20\"/>";
  608.     if ("" == "text")
  609.     {
  610.         sButton+="<a class=\"searchbtn\" href=\"javascript:void(0);\" onclick=\"" + sFormName + ".submit(); return false;\"></a>";
  611.     }
  612.     else if ("" == "image")
  613.     {
  614.         sButton+="<a class=\"searchbtn\" href=\"javascript:void(0);\" onclick=\"" + sFormName + ".submit(); return false;\">"
  615.         sButton+="<img src=\"\" border=0></a>";
  616.     }
  617.     sButton += "</form>";
  618.     sHTML ="<td align=\"center\">" + sButton + "</td>";
  619.     return sHTML;
  620. }
  621.  
  622. function showHidePane(bShow)
  623. {
  624.     var oMsg=null;
  625.     if (bShow)
  626.         oMsg=new whMessage(WH_MSG_SHOWPANE, this, 1, null);
  627.     else
  628.          oMsg=new whMessage(WH_MSG_HIDEPANE, this, 1, null);
  629.     SendMessage(oMsg);
  630. }
  631.  
  632. function isShowHideEnable()
  633. {
  634.     if (gbIE4)
  635.         return true;
  636.     else
  637.         return false;
  638. }
  639.  
  640.  
  641. function PickupDialog_Invoke()
  642. {
  643.     if (!gbIE4 || gbMac)
  644.     {
  645.         if (typeof(_PopupMenu_Invoke)=="function")
  646.             return _PopupMenu_Invoke(PickupDialog_Invoke.arguments);
  647.     }
  648.     else
  649.     {
  650.         if (PickupDialog_Invoke.arguments.length > 2)
  651.         {
  652.             var sPickup = "whskin_pickup.htm";
  653.             var sPickupPath=gsPPath+sPickup; 
  654.             if (gbIE4)
  655.             {
  656.                 var sFrame = PickupDialog_Invoke.arguments[1];
  657.                 var aTopics = new Array();
  658.                 for (var i = 2; i< PickupDialog_Invoke.arguments.length; i+=2)
  659.                 {
  660.                     var j=aTopics.length;
  661.                     aTopics[j] = new Object();
  662.                     aTopics[j].m_sName=PickupDialog_Invoke.arguments[i];
  663.                     aTopics[j].m_sURL=PickupDialog_Invoke.arguments[i+1];
  664.                 }
  665.  
  666.                 if (aTopics.length > 1)
  667.                 {
  668.                     var nWidth = 300;
  669.                     var nHeight =180;
  670.                     var    nScreenWidth=screen.width;
  671.                     var    nScreenHeight=screen.height;
  672.                     var nLeft=(nScreenWidth-nWidth)/2;
  673.                     var nTop=(nScreenHeight-nHeight)/2;
  674.                     if (gbIE4)
  675.                     {
  676.                         var vRet = window.showModalDialog(sPickupPath,aTopics,"dialogHeight:"+nHeight+"px;dialogWidth:"+nWidth+"px;resizable:yes;status:no;scroll:no;help:no;center:yes;");
  677.                         if (vRet)
  678.                         {
  679.                             var sURL = vRet.m_url;
  680.                             if (sFrame)
  681.                                 window.open(sURL, sFrame);
  682.                             else
  683.                                 window.open(sURL, "_self");
  684.                         }
  685.                     }
  686.                 }
  687.                 else if (aTopics.length == 1)
  688.                 {
  689.                     var sURL =     aTopics[0].m_sURL
  690.                     if (sFrame)
  691.                         window.open(sURL, sFrame);
  692.                     else
  693.                         window.open(sURL, "_self");
  694.                 }
  695.             }
  696.         }
  697.     }
  698. }
  699.  
  700. if(window.gbWhUtil&&window.gbWhMsg&&window.gbWhVer&&window.gbWhProxy)
  701. {
  702.     RegisterListener("bsscright", WH_MSG_GETAVIAVENUES);
  703.     RegisterListener("bsscright", WH_MSG_GETTOCPATHS);
  704.     RegisterListener("bsscright", WH_MSG_NEXT);
  705.     RegisterListener("bsscright", WH_MSG_PREV);
  706.     RegisterListener("bsscright", WH_MSG_WEBSEARCH);
  707.     if (gbMac && gbIE4)
  708.     {
  709.         if (typeof(window.onunload) != "unknown")
  710.             whtopic_foldUnload = window.onunload;
  711.     }
  712.     else
  713.     {
  714.         if (window.onunload)
  715.             whtopic_foldUnload = window.onunload;
  716.     }
  717.     window.onunload = unRegisterListener;
  718.     setButtonFont("show","","10pt","","","","");
  719.  
  720.     gbWhTopic=true;
  721. }
  722. else
  723.     document.location.reload();