home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 January / Gamestar_80_2006-01_dvd.iso / Utility / 5-11_xp-2k_dd_ccc_wdm_enu_27345.exe / Data1.cab / _6A71AA5BB85141B6B789E9939E24CB4E < prev    next >
Text File  |  2003-09-15  |  23KB  |  824 lines

  1. // Copyright (c) 2000-2003 Quadralay Corporation.  All rights reserved.
  2. //
  3.  
  4. function  WWHControlEntry_Object(ParamControlName,
  5.                                  bParamEnabled,
  6.                                  bParamStatus,
  7.                                  ParamLabel,
  8.                                  ParamIconEnabled,
  9.                                  ParamIconDisabled,
  10.                                  ParamAnchorMethod,
  11.                                  ParamFrameName)
  12. {
  13.   this.mControlName  = ParamControlName;
  14.   this.mbEnabled     = bParamEnabled;
  15.   this.mbStatus      = bParamStatus;
  16.   this.mLabel        = ParamLabel;
  17.   this.mIconEnabled  = ParamIconEnabled;
  18.   this.mIconDisabled = ParamIconDisabled;
  19.   this.mAnchorMethod = ParamAnchorMethod;
  20.   this.mFrameName    = ParamFrameName;
  21.  
  22.   this.fSetStatus  = WWHControlEntry_SetStatus;
  23.   this.fGetIconURL = WWHControlEntry_GetIconURL;
  24.   this.fGetHTML    = WWHControlEntry_GetHTML;
  25.   this.fGetLabel   = WWHControlEntry_GetLabel;
  26.   this.fUpdateIcon = WWHControlEntry_UpdateIcon;
  27. }
  28.  
  29. function  WWHControlEntry_SetStatus(bParamStatus)
  30. {
  31.   if (this.mbEnabled)
  32.   {
  33.     this.mbStatus = bParamStatus;
  34.   }
  35.   else
  36.   {
  37.     this.mbStatus = false;
  38.   }
  39. }
  40.  
  41. function  WWHControlEntry_GetIconURL()
  42. {
  43.   var  VarIconURL = "";
  44.  
  45.  
  46.   if (this.mbEnabled)
  47.   {
  48.     // Create absolute path to icon
  49.     //
  50.     VarIconURL += WWHFrame.WWHHelp.mHelpURLPrefix;
  51.     VarIconURL += "wwhelp/wwhimpl/common/images/";
  52.  
  53.     // Determine which icon to return
  54.     //
  55.     if (this.mbStatus)
  56.     {
  57.       VarIconURL += this.mIconEnabled;
  58.     }
  59.     else
  60.     {
  61.       VarIconURL += this.mIconDisabled;
  62.     }
  63.   }
  64.  
  65.   return VarIconURL;
  66. }
  67.  
  68. function  WWHControlEntry_GetHTML()
  69. {
  70.   var  VarHTML = "";
  71.   var  VarLabel;
  72.  
  73.  
  74.   if (this.mbEnabled)
  75.   {
  76.     // Set label
  77.     //
  78.     VarLabel = this.mLabel;
  79.     if (WWHFrame.WWHHelp.mbAccessible)
  80.     {
  81.       if ( ! this.mbStatus)
  82.       {
  83.         VarLabel = WWHStringUtilities_FormatMessage(WWHFrame.WWHHelp.mMessages.mAccessibilityDisabledNavigationButton, this.mLabel);
  84.         VarLabel = WWHStringUtilities_EscapeHTML(VarLabel);
  85.       }
  86.     }
  87.     VarLabel = WWHStringUtilities_EscapeHTML(VarLabel);
  88.  
  89.     // Display control
  90.     //
  91.     VarHTML += "  <td width=\"23\">";
  92.     VarHTML += "<a name=\"" + this.mControlName + "\" href=\"javascript:WWHFrame.WWHControls." + this.mAnchorMethod + "();\" title=\"" + VarLabel + "\">";
  93.     VarHTML += "<img name=\"" + this.mControlName + "\" alt=\"" + VarLabel + "\" border=\"0\" src=\"" + this.fGetIconURL() + "\" width=\"23\" height=\"21\">";
  94.     VarHTML += "</a>";
  95.     VarHTML += "</td>\n";
  96.   }
  97.  
  98.   return VarHTML;
  99. }
  100.  
  101. function  WWHControlEntry_GetLabel()
  102. {
  103.   var  VarLabel = "";
  104.  
  105.  
  106.   if (this.mbEnabled)
  107.   {
  108.     // Set label
  109.     //
  110.     VarLabel = this.mLabel;
  111.   }
  112.  
  113.   return VarLabel;
  114. }
  115.  
  116. function  WWHControlEntry_UpdateIcon()
  117. {
  118.   var  VarControlDocument;
  119.  
  120.  
  121.   if (this.mbEnabled)
  122.   {
  123.     // Access control document
  124.     //
  125.     VarControlDocument = eval(WWHFrame.WWHHelp.fGetFrameReference(this.mFrameName) + ".document");
  126.  
  127.     // Update icon
  128.     //
  129.     VarControlDocument.images[this.mControlName].src = this.fGetIconURL();
  130.   }
  131. }
  132.  
  133. function  WWHControlEntries_Object()
  134. {
  135. }
  136.  
  137. function  WWHControls_Object()
  138. {
  139.   this.mControls      = new WWHControlEntries_Object();
  140.   this.mSyncPrevNext  = new Array(null, null, null);
  141.   this.mFocusedFrame  = "";
  142.   this.mFocusedAnchor = "";
  143.  
  144.   this.fReloadControls        = WWHControls_ReloadControls;
  145.   this.fControlsLoaded        = WWHControls_ControlsLoaded;
  146.   this.fAddControl            = WWHControls_AddControl;
  147.   this.fGetControl            = WWHControls_GetControl;
  148.   this.fInitialize            = WWHControls_Initialize;
  149.   this.fSansNavigation        = WWHControls_SansNavigation;
  150.   this.fCanSyncTOC            = WWHControls_CanSyncTOC;
  151.   this.fLeftHTML              = WWHControls_LeftHTML;
  152.   this.fRightHTML             = WWHControls_RightHTML;
  153.   this.fLeftFrameTitle        = WWHControls_LeftFrameTitle;
  154.   this.fRightFrameTitle       = WWHControls_RightFrameTitle;
  155.   this.fUpdateHREF            = WWHControls_UpdateHREF;
  156.   this.fRecordFocus           = WWHControls_RecordFocus;
  157.   this.fRestoreFocus          = WWHControls_RestoreFocus;
  158.   this.fSwitchToNavigation    = WWHControls_SwitchToNavigation;
  159.   this.fClickedShowNavigation = WWHControls_ClickedShowNavigation;
  160.   this.fClickedSyncTOC        = WWHControls_ClickedSyncTOC;
  161.   this.fClickedPrevious       = WWHControls_ClickedPrevious;
  162.   this.fClickedNext           = WWHControls_ClickedNext;
  163.   this.fClickedRelatedTopics  = WWHControls_ClickedRelatedTopics;
  164.   this.fClickedEmail          = WWHControls_ClickedEmail;
  165.   this.fClickedPrint          = WWHControls_ClickedPrint;
  166.   this.fClickedBookmark       = WWHControls_ClickedBookmark;
  167.   this.fShowNavigation        = WWHControls_ShowNavigation;
  168.   this.fSyncTOC               = WWHControls_SyncTOC;
  169.   this.fPrevious              = WWHControls_Previous;
  170.   this.fNext                  = WWHControls_Next;
  171.   this.fRelatedTopics         = WWHControls_RelatedTopics;
  172.   this.fEmail                 = WWHControls_Email;
  173.   this.fPrint                 = WWHControls_Print;
  174.   this.fBookmark              = WWHControls_Bookmark;
  175.   this.fBookmarkData          = WWHControls_BookmarkData;
  176.   this.fBookmarkLink          = WWHControls_BookmarkLink;
  177.   this.fProcessAccessKey      = WWHControls_ProcessAccessKey;
  178. }
  179.  
  180. function  WWHControls_ReloadControls()
  181. {
  182.   // Load the left frame it it will cascade and load the other frames
  183.   //
  184.   WWHFrame.WWHHelp.fReplaceLocation("WWHControlsLeftFrame", WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/controll.htm");
  185. }
  186.  
  187. function  WWHControls_ControlsLoaded(ParamDescription)
  188. {
  189.   if (ParamDescription == "left")
  190.   {
  191.     WWHFrame.WWHHelp.fReplaceLocation("WWHControlsRightFrame", WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/controlr.htm");
  192.   }
  193.   else if (ParamDescription == "right")
  194.   {
  195.     WWHFrame.WWHHelp.fReplaceLocation("WWHTitleFrame", WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/title.htm");
  196.   }
  197.   else  // (ParamDescription == "title")
  198.   {
  199.     if ( ! WWHFrame.WWHHelp.mbInitialized)
  200.     {
  201.       // All control frames are now loaded
  202.       //
  203.       WWHFrame.WWHHelp.fInitStage(5);
  204.     }
  205.     else
  206.     {
  207.       // Restore previous focus
  208.       //
  209.       this.fRestoreFocus();
  210.     }
  211.   }
  212. }
  213.  
  214. function  WWHControls_AddControl(ParamControlName,
  215.                                  bParamEnabled,
  216.                                  bParamStatus,
  217.                                  ParamLabel,
  218.                                  ParamIconEnabled,
  219.                                  ParamIconDisabled,
  220.                                  ParamAnchorMethod,
  221.                                  ParamFrameName)
  222. {
  223.   var  VarControlEntry;
  224.  
  225.  
  226.   VarControlEntry = new WWHControlEntry_Object(ParamControlName,
  227.                                                bParamEnabled,
  228.                                                bParamStatus,
  229.                                                ParamLabel,
  230.                                                ParamIconEnabled,
  231.                                                ParamIconDisabled,
  232.                                                ParamAnchorMethod,
  233.                                                ParamFrameName);
  234.  
  235.   this.mControls[ParamControlName + "~"] = VarControlEntry;
  236. }
  237.  
  238. function  WWHControls_GetControl(ParamControlName)
  239. {
  240.   var  VarControlEntry;
  241.  
  242.  
  243.   VarControlEntry = this.mControls[ParamControlName + "~"];
  244.   if (typeof(VarControlEntry) == "undefined")
  245.   {
  246.     VarControlEntry = null;
  247.   }
  248.  
  249.   return VarControlEntry;
  250. }
  251.  
  252. function  WWHControls_Initialize()
  253. {
  254.   var  VarSettings;
  255.   var  VarDocumentFrame;
  256.  
  257.  
  258.   // Access settings
  259.   //
  260.   VarSettings = WWHFrame.WWHHelp.mSettings;
  261.  
  262.   // Confirm Sync TOC can be enabled
  263.   //
  264.   if (this.fSansNavigation())
  265.   {
  266.     VarSettings.mbSyncContentsEnabled = false;
  267.   }
  268.  
  269.   // Confirm E-mail can be enabled
  270.   //
  271.   if (VarSettings.mbEmailEnabled)
  272.   {
  273.     VarSettings.mbEmailEnabled = ((typeof(VarSettings.mEmailAddress) == "string") &&
  274.                                   (VarSettings.mEmailAddress.length > 0));
  275.   }
  276.  
  277.   // Confirm Print can be enabled
  278.   //
  279.   if (VarSettings.mbPrintEnabled)
  280.   {
  281.     VarDocumentFrame = eval(WWHFrame.WWHHelp.fGetFrameReference("WWHTitleFrame"));
  282.     VarSettings.mbPrintEnabled = ((typeof(VarDocumentFrame.focus) != "undefined") &&
  283.                                   (typeof(VarDocumentFrame.print) != "undefined"))
  284.   }
  285.  
  286.   // Create control entries
  287.   //
  288.   this.fAddControl("WWHFrameSetIcon", this.fSansNavigation(), this.fSansNavigation(),
  289.                    WWHFrame.WWHHelp.mMessages.mShowNavigationIconLabel,
  290.                    "frameset.gif", "frameset.gif", "fClickedShowNavigation", "WWHControlsLeftFrame");
  291.   this.fAddControl("WWHSyncTOCIcon", VarSettings.mbSyncContentsEnabled, false,
  292.                    WWHFrame.WWHHelp.mMessages.mSyncIconLabel,
  293.                    "sync.gif", "syncx.gif", "fClickedSyncTOC", "WWHControlsLeftFrame");
  294.   this.fAddControl("WWHPrevIcon", VarSettings.mbPrevEnabled, false,
  295.                    WWHFrame.WWHHelp.mMessages.mPrevIconLabel,
  296.                    "prev.gif", "prevx.gif", "fClickedPrevious", "WWHControlsLeftFrame");
  297.   this.fAddControl("WWHNextIcon", VarSettings.mbNextEnabled, false,
  298.                    WWHFrame.WWHHelp.mMessages.mNextIconLabel,
  299.                    "next.gif", "nextx.gif", "fClickedNext", "WWHControlsLeftFrame");
  300.   this.fAddControl("WWHRelatedTopicsIcon", VarSettings.mbRelatedTopicsEnabled, false,
  301.                    WWHFrame.WWHHelp.mMessages.mRelatedTopicsIconLabel,
  302.                    "related.gif", "relatedx.gif", "fClickedRelatedTopics", "WWHControlsRightFrame");
  303.   this.fAddControl("WWHEmailIcon", VarSettings.mbEmailEnabled, false,
  304.                    WWHFrame.WWHHelp.mMessages.mEmailIconLabel,
  305.                    "email.gif", "emailx.gif", "fClickedEmail", "WWHControlsRightFrame");
  306.   this.fAddControl("WWHPrintIcon", VarSettings.mbPrintEnabled, false,
  307.                    WWHFrame.WWHHelp.mMessages.mPrintIconLabel,
  308.                    "print.gif", "printx.gif", "fClickedPrint", "WWHControlsRightFrame");
  309.   this.fAddControl("WWHBookmarkIcon", VarSettings.mbBookmarkEnabled, false,
  310.                    WWHFrame.WWHHelp.mMessages.mBookmarkIconLabel,
  311.                    "bkmark.gif", "bkmarkx.gif", "fClickedBookmark", "WWHControlsRightFrame");
  312.  
  313.   // Load control frames
  314.   //
  315.   this.fReloadControls();
  316. }
  317.  
  318. function  WWHControls_SansNavigation()
  319. {
  320.   var  bSansNavigation = false;
  321.  
  322.  
  323.   if (WWHFrame.WWHHelp.fSingleTopic())
  324.   {
  325.     bSansNavigation = true;
  326.   }
  327.  
  328.   return bSansNavigation;
  329. }
  330.  
  331. function  WWHControls_CanSyncTOC()
  332. {
  333.   var  bVarCanSyncTOC = false;
  334.  
  335.  
  336.   if (this.mSyncPrevNext[0] != null)
  337.   {
  338.     bVarCanSyncTOC = true;
  339.   }
  340.  
  341.   return bVarCanSyncTOC;
  342. }
  343.  
  344. function  WWHControls_LeftHTML()
  345. {
  346.   var  VarHTML = "";
  347.  
  348.  
  349.   // Confirm user did not reload the frameset
  350.   //
  351.   if (this.fGetControl("WWHFrameSetIcon") != null)
  352.   {
  353.     VarHTML += "<table border=\"0\">\n";
  354.     VarHTML += " <tr>\n";
  355.  
  356.     VarHTML += this.fGetControl("WWHFrameSetIcon").fGetHTML();
  357.     VarHTML += this.fGetControl("WWHSyncTOCIcon").fGetHTML();
  358.     VarHTML += this.fGetControl("WWHPrevIcon").fGetHTML();
  359.     VarHTML += this.fGetControl("WWHNextIcon").fGetHTML();
  360.  
  361.     VarHTML += " </tr>\n";
  362.     VarHTML += "</table>\n";
  363.   }
  364.  
  365.   return VarHTML;
  366. }
  367.  
  368. function  WWHControls_RightHTML()
  369. {
  370.   var  VarHTML = "";
  371.  
  372.  
  373.   // Confirm user did not reload the frameset
  374.   //
  375.   if (this.fGetControl("WWHRelatedTopicsIcon") != null)
  376.   {
  377.     VarHTML += "<table border=\"0\">\n";
  378.     VarHTML += " <tr>\n";
  379.  
  380.     VarHTML += this.fGetControl("WWHRelatedTopicsIcon").fGetHTML();
  381.     VarHTML += this.fGetControl("WWHEmailIcon").fGetHTML();
  382.     VarHTML += this.fGetControl("WWHPrintIcon").fGetHTML();
  383.     VarHTML += this.fGetControl("WWHBookmarkIcon").fGetHTML();
  384.  
  385.     VarHTML += " </tr>\n";
  386.     VarHTML += "</table>\n";
  387.   }
  388.  
  389.   return VarHTML;
  390. }
  391.  
  392. function  WWHControls_LeftFrameTitle()
  393. {
  394.   var  VarTitle = "";
  395.  
  396.  
  397.   if (this.fGetControl("WWHFrameSetIcon").fGetLabel().length > 0)
  398.   {
  399.     if (VarTitle.length > 0)
  400.     {
  401.       VarTitle += WWHFrame.WWHHelp.mMessages.mAccessibilityListSeparator + " ";
  402.     }
  403.     VarTitle += this.fGetControl("WWHFrameSetIcon").fGetLabel();
  404.   }
  405.  
  406.   if (this.fGetControl("WWHSyncTOCIcon").fGetLabel().length > 0)
  407.   {
  408.     if (VarTitle.length > 0)
  409.     {
  410.       VarTitle += WWHFrame.WWHHelp.mMessages.mAccessibilityListSeparator + " ";
  411.     }
  412.     VarTitle += this.fGetControl("WWHSyncTOCIcon").fGetLabel();
  413.   }
  414.  
  415.   if (this.fGetControl("WWHPrevIcon").fGetLabel().length > 0)
  416.   {
  417.     if (VarTitle.length > 0)
  418.     {
  419.       VarTitle += WWHFrame.WWHHelp.mMessages.mAccessibilityListSeparator + " ";
  420.     }
  421.     VarTitle += this.fGetControl("WWHPrevIcon").fGetLabel();
  422.   }
  423.  
  424.   if (this.fGetControl("WWHNextIcon").fGetLabel().length > 0)
  425.   {
  426.     if (VarTitle.length > 0)
  427.     {
  428.       VarTitle += WWHFrame.WWHHelp.mMessages.mAccessibilityListSeparator + " ";
  429.     }
  430.     VarTitle += this.fGetControl("WWHNextIcon").fGetLabel();
  431.   }
  432.  
  433.   return VarTitle;
  434. }
  435.  
  436. function  WWHControls_RightFrameTitle()
  437. {
  438.   var  VarTitle = "";
  439.  
  440.  
  441.   if (this.fGetControl("WWHRelatedTopicsIcon").fGetLabel().length > 0)
  442.   {
  443.     if (VarTitle.length > 0)
  444.     {
  445.       VarTitle += WWHFrame.WWHHelp.mMessages.mAccessibilityListSeparator + " ";
  446.     }
  447.     VarTitle += this.fGetControl("WWHRelatedTopicsIcon").fGetLabel();
  448.   }
  449.  
  450.   if (this.fGetControl("WWHEmailIcon").fGetLabel().length > 0)
  451.   {
  452.     if (VarTitle.length > 0)
  453.     {
  454.       VarTitle += WWHFrame.WWHHelp.mMessages.mAccessibilityListSeparator + " ";
  455.     }
  456.     VarTitle += this.fGetControl("WWHEmailIcon").fGetLabel();
  457.   }
  458.  
  459.   if (this.fGetControl("WWHPrintIcon").fGetLabel().length > 0)
  460.   {
  461.     if (VarTitle.length > 0)
  462.     {
  463.       VarTitle += WWHFrame.WWHHelp.mMessages.mAccessibilityListSeparator + " ";
  464.     }
  465.     VarTitle += this.fGetControl("WWHPrintIcon").fGetLabel();
  466.   }
  467.  
  468.   if (this.fGetControl("WWHBookmarkIcon").fGetLabel().length > 0)
  469.   {
  470.     if (VarTitle.length > 0)
  471.     {
  472.       VarTitle += WWHFrame.WWHHelp.mMessages.mAccessibilityListSeparator + " ";
  473.     }
  474.     VarTitle += this.fGetControl("WWHBookmarkIcon").fGetLabel();
  475.   }
  476.  
  477.   return VarTitle;
  478. }
  479.  
  480. function  WWHControls_UpdateHREF(ParamHREF)
  481. {
  482.   // Update sync/prev/next array
  483.   //
  484.   this.mSyncPrevNext = WWHFrame.WWHHelp.fGetSyncPrevNext(ParamHREF);
  485.  
  486.   // Update status
  487.   //
  488.   this.fGetControl("WWHFrameSetIcon").fSetStatus(this.fSansNavigation());
  489.   this.fGetControl("WWHSyncTOCIcon").fSetStatus(this.fCanSyncTOC());
  490.   this.fGetControl("WWHPrevIcon").fSetStatus(this.mSyncPrevNext[1] != null);
  491.   this.fGetControl("WWHNextIcon").fSetStatus(this.mSyncPrevNext[2] != null);
  492.   this.fGetControl("WWHRelatedTopicsIcon").fSetStatus(WWHFrame.WWHRelatedTopics.fHasRelatedTopics());
  493.   this.fGetControl("WWHEmailIcon").fSetStatus(this.fCanSyncTOC());
  494.   this.fGetControl("WWHPrintIcon").fSetStatus(this.fCanSyncTOC());
  495.   this.fGetControl("WWHBookmarkIcon").fSetStatus(this.fCanSyncTOC());
  496.  
  497.   // Update controls
  498.   //
  499.   if (WWHFrame.WWHHelp.mbAccessible)
  500.   {
  501.     // Reload control frames
  502.     //
  503.     this.fReloadControls();
  504.   }
  505.   else
  506.   {
  507.     // Update icons in place
  508.     //
  509.     this.fGetControl("WWHFrameSetIcon").fUpdateIcon();
  510.     this.fGetControl("WWHSyncTOCIcon").fUpdateIcon();
  511.     this.fGetControl("WWHPrevIcon").fUpdateIcon();
  512.     this.fGetControl("WWHNextIcon").fUpdateIcon();
  513.     this.fGetControl("WWHRelatedTopicsIcon").fUpdateIcon();
  514.     this.fGetControl("WWHEmailIcon").fUpdateIcon();
  515.     this.fGetControl("WWHPrintIcon").fUpdateIcon();
  516.     this.fGetControl("WWHBookmarkIcon").fUpdateIcon();
  517.  
  518.     // Restore previous focus
  519.     //
  520.     this.fRestoreFocus();
  521.   }
  522. }
  523.  
  524. function  WWHControls_RecordFocus(ParamFrameName,
  525.                                   ParamAnchorName)
  526. {
  527.   this.mFocusedFrame  = ParamFrameName;
  528.   this.mFocusedAnchor = ParamAnchorName;
  529. }
  530.  
  531. function  WWHControls_RestoreFocus()
  532. {
  533.   if ((this.mFocusedFrame.length > 0) &&
  534.       (this.mFocusedAnchor.length > 0))
  535.   {
  536.     WWHFrame.WWHHelp.fFocus(this.mFocusedFrame, this.mFocusedAnchor);
  537.   }
  538.  
  539.   this.mFocusedFrame  = "";
  540.   this.mFocusedAnchor = "";
  541. }
  542.  
  543. function  WWHControls_SwitchToNavigation(ParamTabName)
  544. {
  545.   var  VarDocumentFrame;
  546.   var  VarDocumentURL;
  547.   var  VarSwitchURL;
  548.  
  549.  
  550.   // Switch to navigation
  551.   //
  552.   VarDocumentFrame = eval(WWHFrame.WWHHelp.fGetFrameReference("WWHDocumentFrame"));
  553.   VarDocumentURL = WWHFrame.WWHBrowser.fNormalizeURL(VarDocumentFrame.location.href);
  554.   VarDocumentURL = WWHFrame.WWHHelp.fGetBookFileHREF(VarDocumentURL);
  555.   VarSwitchURL = WWHFrame.WWHHelp.mHelpURLPrefix + "/wwhelp/wwhimpl/common/html/switch.htm?href=" + WWHFrame.WWHBrowser.fRestoreEscapedSpaces(VarDocumentURL);
  556.   if (WWHFrame.WWHHelp.mbAccessible)
  557.   {
  558.     VarSwitchURL += "&accessible=true";
  559.   }
  560.   if ((typeof(ParamTabName) != "undefined") &&
  561.       (ParamTabName != null))
  562.   {
  563.     VarSwitchURL += "&tab=" + ParamTabName;
  564.   }
  565.   WWHFrame.WWHSwitch.fExec(false, VarSwitchURL);
  566. }
  567.  
  568. function  WWHControls_ClickedShowNavigation()
  569. {
  570.   this.fShowNavigation();
  571. }
  572.  
  573. function  WWHControls_ClickedSyncTOC()
  574. {
  575.   this.fSyncTOC();
  576. }
  577.  
  578. function  WWHControls_ClickedPrevious()
  579. {
  580.   // Record focused icon
  581.   //
  582.   this.fRecordFocus("WWHControlsLeftFrame", "WWHPrevIcon");
  583.  
  584.   this.fPrevious();
  585. }
  586.  
  587. function  WWHControls_ClickedNext()
  588. {
  589.   // Record focused icon
  590.   //
  591.   this.fRecordFocus("WWHControlsLeftFrame", "WWHNextIcon");
  592.  
  593.   this.fNext();
  594. }
  595.  
  596. function  WWHControls_ClickedRelatedTopics()
  597. {
  598.   this.fRelatedTopics();
  599. }
  600.  
  601. function  WWHControls_ClickedEmail()
  602. {
  603.   this.fEmail();
  604. }
  605.  
  606. function  WWHControls_ClickedPrint()
  607. {
  608.   this.fPrint();
  609. }
  610.  
  611. function  WWHControls_ClickedBookmark()
  612. {
  613.   this.fBookmark();
  614. }
  615.  
  616. function  WWHControls_ShowNavigation()
  617. {
  618.   var  VarDocumentFrame;
  619.   var  VarDocumentURL;
  620.  
  621.  
  622.   if (WWHFrame.WWHHandler.fIsReady())
  623.   {
  624.     this.fSwitchToNavigation();
  625.   }
  626. }
  627.  
  628. function  WWHControls_SyncTOC()
  629. {
  630.   if (this.fCanSyncTOC())
  631.   {
  632.     if (WWHFrame.WWHHandler.fIsReady())
  633.     {
  634.       WWHFrame.WWHHelp.fSyncTOC(this.mSyncPrevNext[0]);
  635.     }
  636.   }
  637. }
  638.  
  639. function  WWHControls_Previous()
  640. {
  641.   if (this.mSyncPrevNext[1] != null)
  642.   {
  643.     WWHFrame.WWHHelp.fSetDocumentHREF(this.mSyncPrevNext[1], false);
  644.   }
  645. }
  646.  
  647. function  WWHControls_Next()
  648. {
  649.   if (this.mSyncPrevNext[2] != null)
  650.   {
  651.     WWHFrame.WWHHelp.fSetDocumentHREF(this.mSyncPrevNext[2], false);
  652.   }
  653. }
  654.  
  655. function  WWHControls_RelatedTopics()
  656. {
  657.   var  VarDocumentFrame;
  658.   var  VarDocumentURL;
  659.  
  660.  
  661.   if (WWHFrame.WWHRelatedTopics.fHasRelatedTopics())
  662.   {
  663.     if (WWHFrame.WWHBrowser.mbSupportsPopups)
  664.     {
  665.       WWHFrame.WWHRelatedTopics.fShow();
  666.     }
  667.     else
  668.     {
  669.       VarDocumentFrame = eval(WWHFrame.WWHHelp.fGetFrameReference("WWHDocumentFrame"));
  670.  
  671.       VarDocumentURL = WWHFrame.WWHBrowser.fNormalizeURL(VarDocumentFrame.location.href);
  672.       VarDocumentURL = WWHStringUtilities_GetURLFilePathOnly(VarDocumentURL);
  673.  
  674.       WWHFrame.WWHHelp.fSetLocation("WWHDocumentFrame", VarDocumentURL + "#WWHRelatedTopics");
  675.     }
  676.   }
  677. }
  678.  
  679. function  WWHControls_Email()
  680. {
  681.   var  VarLocation;
  682.   var  VarMessage;
  683.   var  VarMailTo;
  684.  
  685.  
  686.   if (this.fCanSyncTOC())
  687.   {
  688.     VarLocation = escape(this.mSyncPrevNext[0]);
  689.     VarMessage = "Feedback: " + VarLocation;
  690.     VarMailTo = "mailto:" + WWHFrame.WWHHelp.mSettings.mEmailAddress + "?subject=" + VarMessage + "&body=" + VarMessage;
  691.  
  692.     WWHFrame.WWHHelp.fSetLocation("WWHDocumentFrame", VarMailTo);
  693.   }
  694. }
  695.  
  696. function  WWHControls_Print()
  697. {
  698.   var  VarDocumentFrame;
  699.  
  700.  
  701.   if (this.fCanSyncTOC())
  702.   {
  703.     VarDocumentFrame = eval(WWHFrame.WWHHelp.fGetFrameReference("WWHDocumentFrame"));
  704.  
  705.     VarDocumentFrame.focus();
  706.     VarDocumentFrame.print();
  707.   }
  708. }
  709.  
  710. function  WWHControls_Bookmark()
  711. {
  712.   var  BookmarkData;
  713.   var  VarWindow;
  714.  
  715.  
  716.   if (this.fCanSyncTOC())
  717.   {
  718.     BookmarkData = this.fBookmarkData();
  719.     if ((BookmarkData[0] != null) &&
  720.         (BookmarkData[1] != null))
  721.     {
  722.       if ((WWHFrame.WWHBrowser.mBrowser == 2) &&  // Shorthand for IE
  723.           ( ! WWHFrame.WWHBrowser.mbMacIE45))
  724.       {
  725.         window.external.AddFavorite(BookmarkData[1], BookmarkData[0]);
  726.       }
  727.       else
  728.       {
  729.         VarWindow = window.open(WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/bookmark.htm", "WWHBookmarkLinkWindow", "width=400,height=20");
  730.       }
  731.     }
  732.   }
  733. }
  734.  
  735. function  WWHControls_BookmarkData()
  736. {
  737.   var  BookmarkData = new Array(null, null);
  738.   var  DocumentURL;
  739.   var  DocumentTitle;
  740.   var  ResetEverything;
  741.   var  DocumentBookmarkURL;
  742.  
  743.  
  744.   if (this.fCanSyncTOC())
  745.   {
  746.     // Determine bookmark link
  747.     //
  748.     DocumentURL = WWHFrame.WWHHelp.fGetBookFileHREF(this.mSyncPrevNext[0]);
  749.     if (DocumentURL != null)
  750.     {
  751.       DocumentTitle = WWHFrame.WWHHelp.fHREFToTitle(this.mSyncPrevNext[0]);
  752.  
  753.       if ((WWHFrame.WWHBrowser.mBrowser == 1) ||  // Shorthand for Netscape
  754.           (WWHFrame.WWHBrowser.mBrowser == 4))    // Shorthand for Netscape 6.0
  755.       {
  756.         ResetEverything = "y=eval("document.open();document.writeln('<a href=\\""+x+"\\">"+x+"</a>');document.close();")";
  757.       }
  758.       else
  759.       {
  760.         ResetEverything = "location=x";
  761.       }
  762.  
  763.       DocumentBookmarkURL = WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/api.htm?href=" + WWHFrame.WWHBrowser.fRestoreEscapedSpaces(DocumentURL);
  764.       if (this.fSansNavigation())
  765.       {
  766.         DocumentBookmarkURL += "&single=true"
  767.       }
  768.       DocumentBookmarkURL = "javascript:x=unescape('" + escape(DocumentBookmarkURL) + "');if(typeof(window.WWHFrame)!='undefined'){window.WWHFrame.WWHHelp.fSetContextDocument(x);}else{" + ResetEverything + ";}";
  769.  
  770.       // Set bookmark data
  771.       //
  772.       BookmarkData[0] = DocumentTitle;
  773.       BookmarkData[1] = DocumentBookmarkURL;
  774.     }
  775.   }
  776.  
  777.   return BookmarkData;
  778. }
  779.  
  780. function  WWHControls_BookmarkLink()
  781. {
  782.   var  BookmarkLink = "";
  783.   var  BookmarkData = this.fBookmarkData();
  784.  
  785.  
  786.   if ((BookmarkData[0] != null) &&
  787.       (BookmarkData[1] != null))
  788.   {
  789.     BookmarkLink = "<a href=\"" + BookmarkData[1] + "\">" + BookmarkData[0] + "</a>";
  790.   }
  791.  
  792.   return BookmarkLink;
  793. }
  794.  
  795. function  WWHControls_ProcessAccessKey(ParamAccessKey)
  796. {
  797.   switch (ParamAccessKey)
  798.   {
  799.     case 4:
  800.       this.fClickedPrevious();
  801.       break;
  802.  
  803.     case 5:
  804.       this.fClickedNext();
  805.       break;
  806.  
  807.     case 6:
  808.       this.fClickedRelatedTopics();
  809.       break;
  810.  
  811.     case 7:
  812.       this.fClickedEmail();
  813.       break;
  814.  
  815.     case 8:
  816.       this.fClickedPrint();
  817.       break;
  818.  
  819.     case 9:
  820.       this.fClickedBookmark();
  821.       break;
  822.   }
  823. }
  824.