home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 August / 08_02.iso / software / cb5 / files / Bryce5TrialVersion.exe / data1.cab / HelpFiles / wwhelp / js / scripts / outlinef.js < prev    next >
Encoding:
JavaScript  |  2001-07-16  |  22.2 KB  |  735 lines

  1. function  OutlineEntry_Object(ParamOutline,
  2.                               ParamHREF,
  3.                               ParamText)
  4. {
  5.   if ((ParamHREF != null) &&
  6.       (ParamHREF.length > 0))
  7.   {
  8.     this.mHREF = ParamHREF;
  9.   }
  10.   else
  11.   {
  12.     this.mHREF = "";
  13.   }
  14.  
  15.   if ((ParamText != null) &&
  16.       (ParamText.length > 0))
  17.   {
  18.     this.mText = ParamText;
  19.   }
  20.   else
  21.   {
  22.     this.mText = "";
  23.   }
  24.  
  25.   this.mOutline = ParamOutline;
  26.   this.mID = 0;
  27.   this.mParent = null;
  28.   this.mChildren = null;
  29.   this.mbExpanded = false;
  30.   this.mLevel = 0;
  31.  
  32.   this.fPopupActionString = OutlineEntry_PopupActionString;
  33.   this.fNewChild          = OutlineEntry_NewChild;
  34.   this.fLinkEntry         = OutlineEntry_LinkEntry;
  35. }
  36.  
  37. function  OutlineEntry_PopupActionString()
  38. {
  39.   var  EventString;
  40.   var  ActionString;
  41.  
  42.  
  43.   if ((this.mOutline.mWWHelp.mBrowser == 1) ||  // Shorthand for Netscape
  44.       (this.mOutline.mWWHelp.mBrowser == 2))    // Shorthand for IE
  45.   {
  46.     EventString = "event";
  47.   }
  48.   else
  49.   {
  50.     EventString = "null";
  51.   }
  52.  
  53.   ActionString = "onMouseOver=\"WWHelpTopFrame.WWHelp.mContents.mPopup.fShow(" + this.mID + ", " + EventString + ");\" onMouseOut=\"WWHelpTopFrame.WWHelp.mContents.mPopup.fHide();\"";
  54.  
  55.   return ActionString;
  56. }
  57.  
  58. function  OutlineEntry_NewChild(ParamText,
  59.                                 ParamHREF)
  60. {
  61.   var  NewEntry;
  62.  
  63.  
  64.   NewEntry = this.mOutline.mWWHelp.mContents.fNewEntry(ParamText, ParamHREF);
  65.   this.mOutline.mWWHelp.mContents.fAddChild(this, NewEntry);
  66.  
  67.   return NewEntry;
  68. }
  69.  
  70. function  OutlineEntry_LinkEntry(ParamPrefixText)
  71. {
  72.   var  Prefix;
  73.   var  Link;
  74.  
  75.  
  76.   if (ParamPrefixText != null)
  77.   {
  78.     Prefix = ParamPrefixText;
  79.   }
  80.   else
  81.   {
  82.     Prefix = "";
  83.   }
  84.  
  85.   if (this.mHREF.length > 0)
  86.   {
  87.     Link = "<a href=\"javascript:WWHelpTopFrame.WWHelp.mContents.fDisplayDoc(" + this.mID + ");\" " + this.fPopupActionString() + ">" + Prefix + this.mText + "</a>";
  88.   }
  89.   else
  90.   {
  91.     Link = Prefix + this.mText;
  92.   }
  93.  
  94.   return Link;
  95. }
  96.  
  97. function  Outline_Object(ParamWWHelp)
  98. {
  99.   var  bBeFast = false;
  100.  
  101.  
  102.   this.mWWHelp = ParamWWHelp;
  103.  
  104.   this.mEntries    = new Array();
  105.   this.mTop        = null;
  106.   this.mMaxLevel   = 0;
  107.   this.mbStoreHTML = false;
  108.   this.mStoredHTML = "";
  109.   this.mImgSrcDir  = "../";
  110.   this.mPopup      = new Popup_Object("WWHelpTopFrame.WWHelp.mContents.mPopup",
  111.                                       "WWHelpTopFrame.WWHNavigation.WWHSync.document",
  112.                                       Outline_PopupTranslate, Outline_PopupFormat,
  113.                                       "OutlinePopupDIV", "OutlinePopupText", 1000, 12, 20, 150);
  114.  
  115.   this.fHead              = Outline_Head;
  116.   this.fBody              = Outline_Body;
  117.   this.fNewBook           = Outline_NewBook;
  118.   this.fNewEntry          = Outline_NewEntry;
  119.   this.fAddChild          = Outline_AddChild;
  120.   this.fDisplayDoc        = Outline_DisplayDoc;
  121.   this.fExpand            = Outline_Expand;
  122.   this.fCollapse          = Outline_Collapse;
  123.   this.fDumpHTML          = Outline_DumpHTML;
  124.   this.fFindClosedParents = Outline_FindClosedParents;
  125.   this.fSync              = Outline_Sync;
  126.   this.fDisplayEntry      = Outline_DisplayEntrySafe;
  127.   this.fDisplayOutline    = Outline_DisplayOutlineSafe;
  128.   this.fGenerateStyles    = Outline_GenerateStylesSafe;
  129.   this.fUpdateOutline     = Outline_UpdateOutlineSafe;
  130.   this.fRevealEntry       = Outline_RevealEntrySafe;
  131.  
  132.   // Create top level entry to hold everything else
  133.   //
  134.   this.mTop = this.fNewEntry("Top Level", "");
  135.   this.mTop.mbExpanded = true;
  136.  
  137.   // Determine display method based on browser type
  138.   //
  139.   if ((this.mWWHelp.mBrowser == 2) ||  // Shorthand for IE
  140.       (this.mWWHelp.mBrowser == 3))    // Shorthand for iCab
  141.   {
  142.     bBeFast = true;
  143.   }
  144.  
  145.   // Determine img src reference based on browser type and platform
  146.   //
  147.   if ((this.mWWHelp.mBrowser == 2) &&  // Shorthand for IE
  148.       (this.mWWHelp.mPlatform == 2))   // Shorthand for Macintosh
  149.   {
  150.     this.mImgSrcDir = this.mWWHelp.mBaseURL + "wwhelp/js/";
  151.   }
  152.  
  153.   // Set display methods
  154.   //
  155.   if (bBeFast)
  156.   {
  157.     this.fDisplayEntry   = Outline_DisplayEntryFast;
  158.     this.fDisplayOutline = Outline_DisplayOutlineFast;
  159.     this.fGenerateStyles = Outline_GenerateStylesFast;
  160.     this.fUpdateOutline  = Outline_UpdateOutlineFast;
  161.     this.fRevealEntry    = Outline_RevealEntryFast;
  162.   }
  163. }
  164.  
  165. function  Outline_Head()
  166. {
  167.   // Write formatting styles
  168.   //
  169.   this.fGenerateStyles();
  170. }
  171.  
  172. function  Outline_Body()
  173. {
  174.   // Write the outline data
  175.   //
  176.   this.fDisplayOutline();
  177.  
  178.   // Write the DIV tag for outline popups
  179.   //
  180.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("<div id=\"OutlinePopupDIV\" style=\"position: absolute ; z-index: 1 ; visibility: hidden ; top: 0px ; left: 0px\">");
  181.   if (this.mWWHelp.mBrowser != 1)  // Shorthand for Netscape
  182.   {
  183.     WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln(this.mPopup.fFormat("Popup"));
  184.   }
  185.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("</div>");
  186. }
  187.  
  188. function  Outline_PopupTranslate(ParamEntryID)
  189. {
  190.   var  Translation = "";
  191.  
  192.  
  193.   if (ParamEntryID != null)
  194.   {
  195.     Translation = WWHelpTopFrame.WWHelp.mContents.mEntries[ParamEntryID].mText;
  196.   }
  197.  
  198.   return Translation;
  199. }
  200.  
  201. function  Outline_PopupFormat(ParamText)
  202. {
  203.   var  FormattedText = "";
  204.   var  BorderColor   = "#999999";
  205.   var  ImageDir      = WWHelpTopFrame.WWHelp.mBaseURL + "wwhelp/common/images";
  206.  
  207.  
  208.   FormattedText += "<table width=\"" + this.mWidth + "\" border=0 cellspacing=0 cellpadding=0 width=\"100%\" bgcolor=\"#FFFFCC\">";
  209.   FormattedText += " <tr>";
  210.   FormattedText += "  <td colspan=5 bgcolor=\"" + BorderColor + "\"><img src=\"" + ImageDir + "/spc1w2h.gif\" width=1 height=2></td>";
  211.   FormattedText += " </tr>";
  212.  
  213.   FormattedText += " <tr>";
  214.   FormattedText += "  <td bgcolor=\"" + BorderColor + "\"><img src=\"" + ImageDir + "/spc2w1h.gif\" width=2 height=1></td>";
  215.   FormattedText += "  <td colspan=3><img src=\"" + ImageDir + "/spc1w7h.gif\" width=1 height=7></td>";
  216.   FormattedText += "  <td bgcolor=\"" + BorderColor + "\"><img src=\"" + ImageDir + "/spc2w1h.gif\" width=2 height=1></td>";
  217.   FormattedText += " </tr>";
  218.  
  219.   FormattedText += " <tr>";
  220.   FormattedText += "  <td bgcolor=\"" + BorderColor + "\"><img src=\"" + ImageDir + "/spc2w1h.gif\" width=2 height=1></td>";
  221.   FormattedText += "  <td><img src=\"" + ImageDir + "/spc5w1h.gif\" width=5 height=1></td>";
  222.   FormattedText += "  <td width=\"100%\" id=\"OutlinePopupText\">" + ParamText + "</td>";
  223.   FormattedText += "  <td><img src=\"" + ImageDir + "/spc5w1h.gif\" width=5 height=1></td>";
  224.   FormattedText += "  <td bgcolor=\"" + BorderColor + "\"><img src=\"" + ImageDir + "/spc2w1h.gif\" width=2 height=1></td>";
  225.   FormattedText += " </tr>";
  226.  
  227.   FormattedText += " <tr>";
  228.   FormattedText += "  <td bgcolor=\"" + BorderColor + "\"><img src=\"" + ImageDir + "/spc2w1h.gif\" width=2 height=1></td>";
  229.   FormattedText += "  <td colspan=3><img src=\"" + ImageDir + "/spc1w7h.gif\" width=1 height=7></td>";
  230.   FormattedText += "  <td bgcolor=\"" + BorderColor + "\"><img src=\"" + ImageDir + "/spc2w1h.gif\" width=2 height=1></td>";
  231.   FormattedText += " </tr>";
  232.  
  233.   FormattedText += " <tr>";
  234.   FormattedText += "  <td colspan=5 bgcolor=\"" + BorderColor + "\"><img src=\"" + ImageDir + "/spc1w2h.gif\" width=1 height=2></td>";
  235.   FormattedText += " </tr>";
  236.   FormattedText += "</table>";
  237.  
  238.   return FormattedText;
  239. }
  240.  
  241. function  Outline_NewBook(ParamBookID,
  242.                           ParamBookTitle)
  243. {
  244.   var  NewEntry;
  245.  
  246.  
  247.   NewEntry = this.fNewEntry(ParamBookTitle, "");
  248.  
  249.   NewEntry.mBookID = ParamBookID;
  250.  
  251.   if (this.mMaxLevel < NewEntry.mLevel)
  252.   {
  253.     this.mMaxLevel = NewEntry.mLevel;
  254.   }
  255.  
  256.   // Expand first book
  257.   //
  258.   if (this.mTop.mChildren == null)
  259.   {
  260.     NewEntry.mbExpanded = true;
  261.   }
  262.  
  263.   // Add to tree at top level
  264.   //
  265.   this.fAddChild(this.mTop, NewEntry);
  266.  
  267.   return NewEntry;
  268. }
  269.  
  270. function  Outline_NewEntry(ParamText,
  271.                            ParamHREF)
  272. {
  273.   var  NewEntry;
  274.  
  275.  
  276.   // Create new object
  277.   //
  278.   NewEntry = new OutlineEntry_Object(this, ParamHREF, ParamText);
  279.  
  280.   // Set unique ID
  281.   //
  282.   NewEntry.mID = this.mEntries.length;
  283.   this.mEntries.length++;
  284.   this.mEntries[NewEntry.mID] = NewEntry;
  285.  
  286.   return NewEntry;
  287. }
  288.  
  289. function  Outline_AddChild(ParamParent,
  290.                            ParamChild)
  291. {
  292.   if (ParamParent.mChildren == null)
  293.   {
  294.     ParamParent.mChildren = new Array(ParamChild);
  295.   }
  296.   else
  297.   {
  298.     ParamParent.mChildren.length++;
  299.     ParamParent.mChildren[ParamParent.mChildren.length - 1] = ParamChild;
  300.   }
  301.  
  302.   ParamChild.mParent = ParamParent;
  303.   ParamChild.mLevel  = ParamParent.mLevel + 1;
  304.  
  305.   if (ParamChild.mLevel > this.mMaxLevel)
  306.   {
  307.     this.mMaxLevel = ParamChild.mLevel;
  308.   }
  309. }
  310.  
  311. function  Outline_DisplayDoc(ParamID)
  312. {
  313.   var  Entry;
  314.   var  Parent;
  315.   var  NewHREF;
  316.  
  317.  
  318.   Entry = this.mEntries[ParamID];
  319.  
  320.   // Expand if folder
  321.   //
  322.   if (( ! Entry.mbExpanded) &&
  323.       (Entry.mChildren != null))
  324.   {
  325.     this.fExpand(ParamID);
  326.   }
  327.  
  328.   // Determine which book this document belongs to
  329.   //
  330.   Parent = Entry;
  331.   while ((Parent.mParent != null) &&
  332.          (Parent.mBookID == null))
  333.   {
  334.     Parent = Parent.mParent;
  335.   }
  336.  
  337.   NewHREF = this.mWWHelp.mBaseURL + this.mWWHelp.mBookList[Parent.mBookID].mBookDir + this.mEntries[ParamID].mHREF;
  338.  
  339.   WWHelpTopFrame.WWHDocument.location.href = NewHREF;
  340. }
  341.  
  342. function  Outline_Expand(ParamID)
  343. {
  344.   this.mEntries[ParamID].mbExpanded = true;
  345.  
  346.   this.fUpdateOutline(ParamID);
  347. }
  348.  
  349. function  Outline_Collapse(ParamID)
  350. {
  351.   this.mEntries[ParamID].mbExpanded = false;
  352.  
  353.   this.fUpdateOutline(ParamID);
  354. }
  355.  
  356. function  Outline_DumpHTML(ParamHTML)
  357. {
  358.   if (this.mbStoreHTML)
  359.   {
  360.     this.mStoredHTML += ParamHTML;
  361.   }
  362.   else
  363.   {
  364.     WWHelpTopFrame.WWHNavigation.WWHSync.document.write(ParamHTML);
  365.   }
  366. }
  367.  
  368. function  Outline_FindClosedParents(ParamEntryID)
  369. {
  370.   var  SomeEntry;
  371.   var  ClosedParents = new Array();
  372.  
  373.  
  374.   SomeEntry = this.mEntries[ParamEntryID];
  375.   if (SomeEntry != null)
  376.   {
  377.     var  SomeParent;
  378.  
  379.  
  380.     SomeParent = SomeEntry.mParent;
  381.     while (SomeParent != null)
  382.     {
  383.       if ( ! SomeParent.mbExpanded)
  384.       {
  385.         ClosedParents.length += 1;
  386.         ClosedParents[ClosedParents.length - 1] = SomeParent;
  387.       }
  388.  
  389.       SomeParent = SomeParent.mParent;
  390.     }
  391.   }
  392.  
  393.   return ClosedParents;
  394. }
  395.  
  396. function  Outline_Sync(ParamBookID,
  397.                        ParamFileHREF,
  398.                        bParamVisible)
  399. {
  400.   var  EntryID = -1;
  401.   var  BookStartIndex;
  402.   var  MaxIndex;
  403.   var  Index;
  404.   var  BookEndIndex;
  405.   var  TrimmedEntryHREF;
  406.  
  407.  
  408.   // Find start of book entries
  409.   //
  410.   BookStartIndex = -1;
  411.   MaxIndex = this.mEntries.length;
  412.   Index = 0;
  413.   while ((BookStartIndex == -1) &&
  414.          (Index < MaxIndex))
  415.   {
  416.     if ((this.mEntries[Index].mBookID != null) &&
  417.         (this.mEntries[Index].mBookID == ParamBookID))
  418.     {
  419.       BookStartIndex = Index;
  420.     }
  421.  
  422.     Index++;
  423.   }
  424.  
  425.   // Search book entries for match
  426.   //
  427.   BookEndIndex = this.mEntries.length;
  428.   Index = BookStartIndex;
  429.   while ((EntryID == -1) &&
  430.          (Index < BookEndIndex))
  431.   {
  432.     // Check for FileHREF match
  433.     //
  434.     if (this.mEntries[Index].mHREF == ParamFileHREF)
  435.     {
  436.       EntryID = this.mEntries[Index].mID;
  437.     }
  438.  
  439.     // Check to see if we can improve our guess
  440.     // for the BookEndIndex
  441.     //
  442.     if ((this.mEntries[Index].mBookID != null) &&
  443.         (this.mEntries[Index].mBookID != ParamBookID))
  444.     {
  445.       BookEndIndex = Index;
  446.     }
  447.  
  448.     Index++;
  449.   }
  450.  
  451.   // If we haven't matched yet, try trimming off "#" entries
  452.   // and check for a match again
  453.   //
  454.   TrimmedFileHREF = this.mWWHelp.fTrimHREF(ParamFileHREF)
  455.   Index = BookStartIndex;
  456.   while ((EntryID == -1) &&
  457.          (Index < BookEndIndex))
  458.   {
  459.     // Trim the entry's HREF and check for match
  460.     //
  461.     TrimmedEntryHREF = this.mWWHelp.fTrimHREF(this.mEntries[Index].mHREF);
  462.     if (TrimmedEntryHREF == TrimmedFileHREF)
  463.     {
  464.       EntryID = this.mEntries[Index].mID;
  465.     }
  466.  
  467.     Index++;
  468.   }
  469.  
  470.   // If valid, reveal the entry
  471.   //
  472.   if (EntryID != -1)
  473.   {
  474.     this.fRevealEntry(EntryID, bParamVisible);
  475.   }
  476. }
  477.  
  478. function  Outline_DisplayEntrySafe(ParamEntry)
  479. {
  480.   if (ParamEntry.mChildren == null)
  481.   {
  482.     WWHelpTopFrame.WWHNavigation.WWHSync.document.write("<p class=l" + ParamEntry.mLevel + ">");
  483.     WWHelpTopFrame.WWHNavigation.WWHSync.document.write("<nobr>");
  484.     WWHelpTopFrame.WWHNavigation.WWHSync.document.write(ParamEntry.fLinkEntry("<img width=17 height=17 border=0 src=\"" + this.mImgSrcDir + "images/doc.gif\"> "));
  485.     WWHelpTopFrame.WWHNavigation.WWHSync.document.write("</nobr>");
  486.     WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("</p>");
  487.   }
  488.   else
  489.   {
  490.     if (ParamEntry.mbExpanded)
  491.     {
  492.       var  MaxChildIndex;
  493.       var  ChildIndex;
  494.  
  495.  
  496.       WWHelpTopFrame.WWHNavigation.WWHSync.document.write("<p class=l" + ParamEntry.mLevel + ">");
  497.       WWHelpTopFrame.WWHNavigation.WWHSync.document.write("<nobr>");
  498.       WWHelpTopFrame.WWHNavigation.WWHSync.document.write("<a name=\"toc" + ParamEntry.mID + "\" href=\"javascript:WWHelpTopFrame.WWHelp.mContents.fCollapse(" + ParamEntry.mID + ");\" " + ParamEntry.fPopupActionString() + "><img width=17 height=17 border=0 src=\"" + this.mImgSrcDir + "images/fo.gif\"></a>");
  499.       WWHelpTopFrame.WWHNavigation.WWHSync.document.write(" " + ParamEntry.fLinkEntry());
  500.       WWHelpTopFrame.WWHNavigation.WWHSync.document.write("</nobr>");
  501.       WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("</p>");
  502.  
  503.       MaxChildIndex = ParamEntry.mChildren.length;
  504.       for (ChildIndex = 0 ; ChildIndex < MaxChildIndex ; ChildIndex++)
  505.       {
  506.         this.fDisplayEntry(ParamEntry.mChildren[ChildIndex]);
  507.       }
  508.     }
  509.     else
  510.     {
  511.       WWHelpTopFrame.WWHNavigation.WWHSync.document.write("<p class=l" + ParamEntry.mLevel + ">");
  512.       WWHelpTopFrame.WWHNavigation.WWHSync.document.write("<nobr>");
  513.       WWHelpTopFrame.WWHNavigation.WWHSync.document.write("<a name=\"toc" + ParamEntry.mID + "\" href=\"javascript:WWHelpTopFrame.WWHelp.mContents.fExpand(" + ParamEntry.mID + ");\" " + ParamEntry.fPopupActionString() + "><img width=17 height=17 border=0 src=\"" + this.mImgSrcDir + "images/fc.gif\"></a>");
  514.       WWHelpTopFrame.WWHNavigation.WWHSync.document.write(" " + ParamEntry.fLinkEntry());
  515.       WWHelpTopFrame.WWHNavigation.WWHSync.document.write("</nobr>");
  516.       WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("</p>");
  517.     }
  518.   }
  519. }
  520.  
  521. function  Outline_DisplayOutlineSafe()
  522. {
  523.   var  MaxChildIndex;
  524.   var  ChildIndex;
  525.  
  526.  
  527.   MaxChildIndex = this.mTop.mChildren.length;
  528.   for (ChildIndex = 0 ; ChildIndex < MaxChildIndex ; ChildIndex++)
  529.   {
  530.     this.fDisplayEntry(this.mTop.mChildren[ChildIndex]);
  531.   }
  532. }
  533.  
  534. function  Outline_GenerateStylesSafe()
  535. {
  536.   var  ChildLevel;
  537.  
  538.  
  539.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("<style type=\"text/css\">");
  540.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln(" <!--");
  541.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("  a { text-decoration: none ;");
  542.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("      color: " + this.mWWHelp.mMessages["Anchor Color"] + " }");
  543.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("  p { margin-top: 1pt ;");
  544.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("      margin-bottom: 1pt ;");
  545.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("      font-family: " + this.mWWHelp.mMessages["Font Family"] + " ;");
  546.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("      font-size: " + this.mWWHelp.mMessages["Font Size"] + " }");
  547.   for (ChildLevel = 0 ; ChildLevel < this.mMaxLevel ; ChildLevel++)
  548.   {
  549.     WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("  p.l" + (ChildLevel + 1) + " { margin-left: " + (this.mWWHelp.mMessages["TOC Indent"] * ChildLevel) + "pt }");
  550.   }
  551.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln(" -->");
  552.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("</style>");
  553. }
  554.  
  555. function  Outline_UpdateOutlineSafe(ParamJumpToID)
  556. {
  557.   // Can't find the position of the target element in Netscape,
  558.   // so we'll use a named anchor to jump there.
  559.   //
  560. // HACK BEN
  561. //  WWHelpTopFrame.WWHNavigation.WWHSync.location.href = this.mWWHelp.mBaseURL + "wwhelp/js/html/sync.htm";
  562. //  WWHelpTopFrame.WWHNavigation.WWHSync.location.href = "#toc" + ParamJumpToID;
  563.   this.mWWHelp.mTabs.fUpdateXYPosition();
  564.  
  565.   // Close down any popups we had going to prevent JavaScript errors
  566.   //
  567.   this.mPopup.fHide();
  568.  
  569.   WWHelpTopFrame.WWHNavigation.WWHSync.location.href = this.mWWHelp.mBaseURL + "wwhelp/js/html/sync.htm";
  570. }
  571.  
  572. function  Outline_RevealEntrySafe(ParamEntryID,
  573.                                   bParamVisible)
  574. {
  575.   var  ExpandList;
  576.   var  SomeParent;
  577.  
  578.  
  579.   // Expand out enclosing entries
  580.   //
  581.   ExpandList = this.fFindClosedParents(ParamEntryID);
  582.   while (ExpandList.length > 0)
  583.   {
  584.     SomeParent = ExpandList[ExpandList.length - 1];
  585.  
  586.     SomeParent.mbExpanded = true;
  587.  
  588.     ExpandList.length -= 1;
  589.   }
  590.  
  591.   // Scroll to the entry not possible in Netscape, so just preserve current layout
  592.   //
  593.   if (bParamVisible)
  594.   {
  595.     this.fUpdateOutline(ParamEntryID);
  596.   }
  597. }
  598.  
  599. function  Outline_DisplayEntryFast(ParamEntry)
  600. {
  601.   if (ParamEntry.mChildren == null)
  602.   {
  603.     this.fDumpHTML("<nobr>");
  604.     this.fDumpHTML(ParamEntry.fLinkEntry("<img width=17 height=17 border=0 src=\"" + this.mImgSrcDir + "images/doc.gif\"> ") + "\n");
  605.     this.fDumpHTML("</nobr>");
  606.   }
  607.   else
  608.   {
  609.     if (ParamEntry.mbExpanded)
  610.     {
  611.       var  MaxChildIndex;
  612.       var  ChildIndex;
  613.  
  614.  
  615.       this.fDumpHTML("<nobr>");
  616.       this.fDumpHTML("<a href=\"javascript:WWHelpTopFrame.WWHelp.mContents.fCollapse(" + ParamEntry.mID + ");\" " + ParamEntry.fPopupActionString() + "><img width=17 height=17 border=0 src=\"" + this.mImgSrcDir + "images/fo.gif\"></a>");
  617.       this.fDumpHTML(" " + ParamEntry.fLinkEntry() + "\n");
  618.       this.fDumpHTML("</nobr>");
  619.  
  620.       this.fDumpHTML("<ul>\n");
  621.       MaxChildIndex = ParamEntry.mChildren.length;
  622.       for (ChildIndex = 0 ; ChildIndex < MaxChildIndex ; ChildIndex++)
  623.       {
  624.         this.fDumpHTML("<li id=toc" + ParamEntry.mChildren[ChildIndex].mID + ">");
  625.         this.fDisplayEntry(ParamEntry.mChildren[ChildIndex]);
  626.         this.fDumpHTML("</li>\n");
  627.       }
  628.       this.fDumpHTML("</ul>\n");
  629.     }
  630.     else
  631.     {
  632.       this.fDumpHTML("<nobr>");
  633.       this.fDumpHTML("<a href=\"javascript:WWHelpTopFrame.WWHelp.mContents.fExpand(" + ParamEntry.mID + ");\" " + ParamEntry.fPopupActionString() + "><img width=17 height=17 border=0 src=\"" + this.mImgSrcDir + "images/fc.gif\"></a>");
  634.       this.fDumpHTML(" " + ParamEntry.fLinkEntry() + "\n");
  635.       this.fDumpHTML("</nobr>");
  636.     }
  637.   }
  638. }
  639.  
  640. function  Outline_DisplayOutlineFast()
  641. {
  642.   var  MaxChildIndex;
  643.   var  ChildIndex;
  644.  
  645.  
  646.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("<ul>");
  647.  
  648.   this.mbStoreHTML = false;
  649.  
  650.   MaxChildIndex = this.mTop.mChildren.length;
  651.   for (ChildIndex = 0 ; ChildIndex < MaxChildIndex ; ChildIndex++)
  652.   {
  653.     this.fDumpHTML("<li class=book id=toc" + this.mTop.mChildren[ChildIndex].mID + ">");
  654.     this.fDisplayEntry(this.mTop.mChildren[ChildIndex]);
  655.     this.fDumpHTML("</li>\n");
  656.   }
  657.  
  658.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("</ul>");
  659. }
  660.  
  661. function  Outline_GenerateStylesFast()
  662. {
  663.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("<style type=\"text/css\">");
  664.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln(" <!--");
  665.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("  a  { text-decoration: none ;");
  666.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("       color: " + this.mWWHelp.mMessages["Anchor Color"] + " }");
  667.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("  ul { list-style-type: none ;");
  668.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("       margin-top: 1pt ;");
  669.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("       margin-bottom: 1pt ;");
  670.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("       margin-left: 0pt }");
  671.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("  li { margin-top: 1pt ;");
  672.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("       margin-bottom: 1pt ;");
  673.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("       font-family: " + this.mWWHelp.mMessages["Font Family"] + " ;");
  674.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("       font-size: " + this.mWWHelp.mMessages["Font Size"] + " ;");
  675.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("       margin-left: " + this.mWWHelp.mMessages["TOC Indent"] + "pt }");
  676.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("  li.book { margin-left: 0pt }");
  677.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln(" -->");
  678.   WWHelpTopFrame.WWHNavigation.WWHSync.document.writeln("</style>");
  679. }
  680.  
  681. function  Outline_UpdateOutlineFast(ParamJumpToID)
  682. {
  683.   var  ElementID;
  684.  
  685.  
  686.   this.mStoredHTML = "";
  687.   this.mbStoreHTML = true;
  688.  
  689.   this.fDisplayEntry(this.mEntries[ParamJumpToID]);
  690.   ElementID = "toc" + ParamJumpToID;
  691.   WWHelpTopFrame.WWHNavigation.WWHSync.document.all[ElementID].innerHTML = this.mStoredHTML;
  692.  
  693.   this.mStoredHTML = "";
  694.   this.mbStoreHTML = false;
  695. }
  696.  
  697. function  Outline_RevealEntryFast(ParamEntryID,
  698.                                   bParamVisible)
  699. {
  700.   var  ExpandList;
  701.   var  SomeParent;
  702.  
  703.  
  704.   // Expand out enclosing entries
  705.   //
  706.   ExpandList = this.fFindClosedParents(ParamEntryID);
  707.   while (ExpandList.length > 0)
  708.   {
  709.     SomeParent = ExpandList[ExpandList.length - 1];
  710.  
  711.     SomeParent.mbExpanded = true;
  712.     if (bParamVisible)
  713.     {
  714.       this.fUpdateOutline(SomeParent.mID);
  715.     }
  716.  
  717.     ExpandList.length -= 1;
  718.   }
  719.  
  720.   // Scroll to the entry
  721.   //
  722.   if (bParamVisible)
  723.   {
  724.     if (WWHelpTopFrame.WWHNavigation.WWHSync.document.all["toc" + ParamEntryID].offsetTop)  // Test for offsetTop support, i.e. IE
  725.     {
  726.       this.mWWHelp.mTabs.mXYPosition[0][1] = WWHelpTopFrame.WWHNavigation.WWHSync.document.all["toc" + ParamEntryID].offsetTop;
  727.  
  728.       setTimeout("WWHelpTopFrame.WWHNavigation.WWHSync.window.scroll(" + this.mWWHelp.mTabs.mXYPosition[0][0]
  729.                                                                        + ", "
  730.                                                                        + this.mWWHelp.mTabs.mXYPosition[0][1]
  731.                                                                        + ");", 100);
  732.     }
  733.   }
  734. }
  735.