home *** CD-ROM | disk | FTP | other *** search
/ Enter 2006 July / Enter 07 2006.iso / Internet / WinAgents RouterTweak 1.0 / rtsetup.exe / rtweak.chm / basics / shared.js < prev    next >
Encoding:
JavaScript  |  2006-04-26  |  48.7 KB  |  1,594 lines

  1. // Final version 1.000: 07/07/00 (BF)
  2.  
  3. // ***************************
  4. // SECTION BEGIN: LOCALIZATION
  5. // Localization must make changes to the following section.
  6. // ***************************
  7.  
  8. // TEXT
  9. // ---ALT text---
  10. var L_ExpandCollapseAlt_ToolTip = 'Expand or collapse text';  // expand
  11. var L_GlossaryAlt_ToolTip = 'View definition';      // glossary
  12. var L_NoteImgAlt_AlternativeText = '';        // note
  13. var L_ImportantImgAlt_AlternativeText = '';     // important
  14. var L_CautionImgAlt_AlternativeText = '';     // caution
  15. var L_WarningImgAlt_AlternativeText = '';     // warning
  16. var L_RelTopAlt_AlternativeText = 'See Also';     // related topics
  17. var L_KeyboardAlt_AlternativeText = 'Keyboard shortcuts'; // keyboard shortcuts
  18. var L_FeedbackAlt_AlternativeText = 'Send feedback about this page';  // feedback
  19.  
  20. // ---Glossary-related text---
  21. var L_NoDefAlertTitle_Text = 'definition unavailable';
  22. var L_NoDefAlert_Text = 'The glossary term and definition do not exist in the glossary file at this time.';
  23. var L_BrowserAlert_Message = 'You must use IE4 or greater in order to view popup glossary definitions.';      // downlevel browsers message
  24. var L_See_Text = '<B>See: </B>';
  25. var L_SeeAlso_Text = '<B>See Also: </B>';
  26.  
  27. //---Boilerplate text---
  28. var L_CopyrightPrelim_Text = 'This information is preliminary. It may be incomplete and is subject to change.';
  29. var L_CopyrightFinal_Text = 'Copyright © 2005-2006 Tandem Systems, Ltd. All Rights Reserved.';
  30.  
  31. // ---Other text---
  32. var L_RelTopHeader_Text = '<P><B>See Also</B></P>'; // related topics header text
  33. var L_GraphicClickText_Text = 'Enlarge diagram';    // hot text under thumbnail graphics
  34. var L_Error_Text = 'There was an error loading the HTML file.'; // linked-file failure message
  35.  
  36. // SECTION END: LOCALIZATION
  37.  
  38. // *********************
  39. // SECTION BEGIN: STYLES
  40. // *********************
  41.  
  42. // ---Notes---
  43. var L_NotesAlign_Style = 'STYLE="MARGIN-LEFT:0EM;"';      // IMG element alignment
  44. var L_NotesLTR_Style = 'STYLE="margin-left :1.5em; margin-top:-1.1em;"';  // P element style
  45. var L_NotesRTL_Style = 'STYLE="margin-right:1.5em; margin-top:-1.1em;"';  // P element style
  46.  
  47. // ---Related topics popup and icon alignment and font size---
  48. var L_RelPopAlign1_Style    = 'STYLE="margin-top:-1.4em; margin-right:1.6em;"';
  49. var L_RelPopAlign1RTL_Style = 'STYLE="margin-top:-1.4em; margin-left:1.6em;"';
  50. var L_RelPopAlign1A_Style   = 'STYLE="margin-top:-1.4em;"';
  51. var L_RelPopFontSize_Style = '100%';
  52. var L_RelPopPClassRight_Style = 'STYLE="text-align:right;"';
  53. var L_RelPopPClassLeft_Style  = 'STYLE="text-align:left;"';
  54.  
  55. // ---FAQ Expand alignment---
  56. var L_ExCoImgAlign_Style  = 'margin-left:-10px';
  57. var L_ExCoImgAlignRTL_Style = 'margin-right:-10px;';
  58.  
  59. // ---Popup box style---
  60. var L_PopUpBoxStyle_Style = 'visibility:hidden; position:absolute; top:0px; left:0px; width:200px; z-index:2; padding:10px; background-color:#FFFFCC; border:solid 1 #333333;';
  61.  
  62. // SECTION END: STYLES
  63.  
  64. // **********************************
  65. // SECTION BEGIN: FUNCTIONAL SETTINGS
  66. // **********************************
  67.  
  68. var InlineImgOn = true; // if true, inline gifs appear left of glossary and expand/collapse links
  69. var xmlGloss = true;    // selects XML/TXT glossary
  70. var InsertBoilerplateText = true; // if true, script inserts boilerplate
  71.  
  72. // SECTION END: FUNCTIONAL SETTINGS
  73.  
  74. // *****************************
  75. // SECTION BEGIN: FILE LOCATIONS
  76. // *****************************
  77.  
  78. //#####These locations vary between projects.#####
  79.  
  80. var moniker = 'MS-ITS:';
  81. var NameOfCHM = 'cvsuite.chm';
  82. var GlossaryCHM = 'MS-ITS:glossary.chm::/';
  83. var xmlFile = GlossaryCHM + 'Basics/Gloss.xml';
  84. bpKeyboardShortcutLink = 'MS-ITS:uiref.chm::/uiref_4xpu.htm';
  85. bpCopyrightLink = 'http://www.winagents.com';
  86. bpPreliminary_Switch = 0; // 1 = preliminary copyright text, 0 = no such text
  87. bpKeyboard_Switch = 0;    // 1 = keyboard shortcuts icon, 0 = no icon
  88. bpFeedback_Switch = 1;    // 1 = feedback icon, 0 = no icon
  89.  
  90. //################################################
  91.  
  92. // ---Basic locations.---
  93.  
  94. var BeforeReference = "/";
  95. var CHMRef = '';          // thumbnail windows base .chm
  96. var GifLocation = '';
  97.  
  98. // ---.gifs for the possible expand states---
  99. var closed    = BeforeReference + 'Basics/coe.gif';
  100. var expand    = BeforeReference + 'Basics/coc.gif';
  101. var closedHot = BeforeReference + 'Basics/coeb.gif';
  102. var expandHot = BeforeReference + 'Basics/cocb.gif';
  103.  
  104. // ---.gifs for the possible related topics button states---
  105. var InnerNavCold  = BeforeReference + 'Basics/relglyph.gif';    // onmouseout
  106. var InnerNavHot   = BeforeReference + 'Basics/relglyph_.gif';   // onmouseover
  107. var InnerNavClick = BeforeReference + 'Basics/relglyph_c.gif';    // onclick
  108.  
  109. //---.gifs for the possible feedback and keyboard icon states---
  110. var IconKBCold  = BeforeReference + 'Basics/keybrd.gif';
  111. var IconKBHot  = BeforeReference + 'Basics/keybrd_.gif';
  112. var IconKBClick  = BeforeReference + 'Basics/keybrd_c.gif';
  113. var IconFBCold  = BeforeReference + 'Basics/mailto.gif';
  114. var IconFBHot  = BeforeReference + 'Basics/mailto_.gif';
  115. var IconFBClick  = BeforeReference + 'Basics/mailto_c.gif';
  116.  
  117. // ---CSS styles with file names (inserted later)---
  118. var CSSInsertion =
  119.   '<STYLE><!--\r\n'
  120.   +((InlineImgOn)?'':'DIV.EXPAND,DIV.EXPAND2,DIV.EXPAND3 {MARGIN-LEFT:1EM; MARGIN-RIGHT:1EM;}')
  121.   +'\r\n// --></STYLE>';
  122.  
  123.   // Insert these CSS styles.
  124.   document.write(CSSInsertion);
  125.  
  126.  
  127. // SECTION END: FILE LOCATIONS
  128.  
  129. // ***********************************
  130. // SECTION BEGIN: VARIABLE DEFINITIONS
  131. // ***********************************
  132.  
  133. // ---"GLOSSARY POPUP BROWSER CHECK VARIABLE"---
  134. var browser = navigator.appName + ' ' + parseInt(navigator.appVersion);
  135.  
  136. // ---Globals---
  137. var theTimeOut,
  138.   ReltopicS,
  139.   TermDef,
  140.   tiC,
  141.   WorkText,
  142.   AnotherTagIndex,
  143.   noPopups,
  144.   ieX,
  145.   ieY,
  146.   popOpen,
  147.   theImg,
  148.   theDiv,
  149.   PopUp_InAPopUp,
  150.   e,
  151.   AnotherCheck,
  152.   WindowOne,
  153.   WindowTwo,
  154.   theTagIndex,
  155.   theTagIndex2,
  156.   sParamFILE,
  157.   lastClickedPopUp,
  158.   IE4,
  159.   IE5,
  160.   checkIt2,
  161.   checkIt,
  162.   LiNker,
  163.   HoldBookTitLe,
  164.   HoldBookTitLe2,
  165.   WindowIsLoading,
  166.   linkedFileID,
  167.   LinkedFileNum,
  168.   intervalID;
  169.  
  170. // ---HTML Help OCX declaration for graphic and procedure windows---
  171. var ActX = 'TYPE="application/x-oleobject" CLASSID="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"';
  172.  
  173. // ---Browser check for popup support---
  174. if (
  175.     (browser == 'Microsoft Internet Explorer 4')
  176.     || (browser == 'Microsoft Internet Explorer 5') )
  177.   IE4 = true;
  178. else
  179.   noPopups = true;
  180. if (
  181.     (navigator.appVersion.indexOf('MSIE 5') > 0)
  182.     ||
  183.     (
  184.       (navigator.appVersion.indexOf('MSIE') > 0
  185.       && parseInt(navigator.appVersion) >= 5)
  186.     )
  187.   )
  188.   IE5 = true;
  189.  
  190. // ---Linked files---
  191. var inCr;
  192. function public_get_innerHTML(){return document.body.innerHTML;}  // used when accessing linked files
  193. var tiC = 0;                            // stores initial timeout for linked file
  194.  
  195. var defContent = '';  // "picks up and holds glossary definition from txt file"
  196.  
  197. // ---XML popup support---
  198. var xmlTermRoot;          // XML term root variable (move into function later)
  199. var xmlDOM;         // The XMLDOM ActiveX object model
  200. var xmlDOMLoaded = false; // Not loaded til 1st glossary popup. Persists for see alsos
  201.  
  202. // SECTION END: VARIABLE DEFINITIONS
  203.  
  204. // ************************************
  205. // SECTION BEGIN: HTML TEXT DEFINITIONS
  206. // ************************************
  207.  
  208. // ---Other definitions---
  209. var SpacerGiffy = BeforeReference + 'Basics/spacer.gif';  // universal spacer image (1x1 square)
  210. var LtrOrRtlFloat = 'float:none;' // thumbnail style used on onload()
  211.  
  212. var _Cold  = '#0033BB';     // mouseout text color
  213. var _Hot   = '#FF6600';     // mouseover text color
  214. var _Click = '#FF6600';     // glossary click text color
  215.  
  216. // ---Inline images' html (set .gif height and width)---
  217. if (InlineImgOn)
  218. {
  219. // ---Expand IMG----
  220.   var initialClosed =
  221.     '<IMG CLASS="ExPand" '
  222.     +((document.dir == 'rtl')?'STYLE="FILTER: flipH;" ':'')   //
  223.     +'SRC="'
  224.     +BeforeReference
  225.     +'Basics/coe.gif" HEIGHT="9" WIDTH="12" ALT="'
  226.     +L_ExpandCollapseAlt_ToolTip
  227.     +'" BORDER="0">';
  228.   var initialClosed_B =
  229.     '<IMG CLASS="ExPand" STYLE="'
  230.     +((document.dir == 'rtl')?L_ExCoImgAlignRTL_Style+' FILTER: flipH;':L_ExCoImgAlign_Style) //
  231.     +'" SRC="'
  232.     +BeforeReference
  233.     +'Basics/coe.gif" HEIGHT="9" WIDTH="12" ALT="'
  234.     +L_ExpandCollapseAlt_ToolTip
  235.     +'" BORDER="0">';
  236. // ---Glossary IMG---
  237.   var glossInitial = '';
  238. }
  239.  
  240. // ---Popups---
  241. var popupDIV =            // glossary popup inserted onload()
  242.   '<DIV ID="popUpWindow" STYLE="'
  243.   +L_PopUpBoxStyle_Style
  244.   +'"></DIV>';
  245. var RelPopupDiV =         // related topics popup inserted onload()
  246.   '<DIV ID="RelpopUpWindow" STYLE="'
  247.   +L_PopUpBoxStyle_Style
  248.   +'"></DIV>';
  249.  
  250. // ---Related topics---
  251. var InnerNavInitial =       // related topics IMG for pages with related topics
  252.   '<IMG CLASS="HIDEREL"'
  253.   +((document.dir == 'rtl')?' STYLE="FILTER: flipH;"':'') // identical per original code: correct???
  254.   +' SRC="'
  255.   +BeforeReference
  256.   +'Basics/relglyph.gif" HEIGHT="18" WIDTH="28" ALT="'
  257.   +L_RelTopAlt_AlternativeText
  258.   +'" BORDER="0">';
  259.  
  260.  
  261. var RelPopSpacerGif =       // placeholder IMG for pages without related topics
  262.   '<IMG CLASS="HIDEREL" SRC="'
  263.   +SpacerGiffy
  264.   +'" HEIGHT="18" WIDTH="2" ALT="" BORDER="0">';
  265. var RelTOpSpacerGif =       // spacer used in laying out related topics at bottom of the page
  266.   '<IMG STYLE="DISPLAY:NONE;" SRC="'
  267.   +SpacerGiffy
  268.   +'" HEIGHT="18" WIDTH="28" ALT="" BORDER="0">';
  269.  
  270. // ---Notes, etc.---
  271. var noteImg =         // note IMG
  272.   '<IMG '
  273.   +L_NotesAlign_Style
  274.   +' SRC="'
  275.   +BeforeReference
  276.   +'Basics/note.gif" HEIGHT="11" WIDTH="12" ALT="'
  277.   +L_NoteImgAlt_AlternativeText
  278.   +'" BORDER="0">';
  279. var importantImg =        // important IMG
  280.   '<IMG '
  281.   +L_NotesAlign_Style
  282.   +' SRC="'
  283.   +BeforeReference
  284.   +'Basics/important.gif" HEIGHT="11" WIDTH="12" ALT="'
  285.   +L_ImportantImgAlt_AlternativeText
  286.   +'" BORDER="0">';
  287. var cautionImg =        // caution IMG
  288.   '<IMG '
  289.   +L_NotesAlign_Style
  290.   +' SRC="'
  291.   +BeforeReference
  292.   +'Basics/caution.gif" HEIGHT="11" WIDTH="12" ALT="'
  293.   +L_CautionImgAlt_AlternativeText
  294.   +'" BORDER="0">';
  295. var warningImg =        // warning IMG
  296.   '<IMG '
  297.   +L_NotesAlign_Style
  298.   +' SRC="'
  299.   +BeforeReference
  300.   +'Basics/warning.gif" HEIGHT="11" WIDTH="12" ALT="'
  301.   +L_WarningImgAlt_AlternativeText
  302.   +'" BORDER="0">';
  303.  
  304. //---Boilerplate text---
  305.  
  306. var bpIconRelTopics =
  307.   '<P ID="TiTLE"></P>';
  308.  
  309.  
  310. var bpIconKeyb =
  311.   '<A HREF="'
  312.   + bpKeyboardShortcutLink
  313.   + '" ID="IconKB">'
  314.   + '<IMG name="keysho" style="CURSOR:hand;margin-top:1px;margin-right:2px;'
  315.   + 'margin-left:2px;left:0;"'
  316.   + ' alt="' + L_KeyboardAlt_AlternativeText + '"'
  317.   //+ ' src="MS-ITS:' + NameOfCHM + '::/Basics/keybrd.gif"></A>';
  318.   + ' src="Basics/keybrd.gif"></A>';
  319.  
  320. var bpIconFeedb =
  321.   '<A HREF="#Feedback" ID="IconFB"><IMG name="feedb" onclick=EMailStream(fb)'
  322.   +' style="CURSOR:hand;margin-top:1px;margin-left:0px;"'
  323.   +' alt="' + L_FeedbackAlt_AlternativeText + '"'
  324.   //+' src="MS-ITS:' + NameOfCHM + '::/Basics/mailto.gif"></A>';
  325.   +' src="Basics/mailto.gif"></A>';
  326.  
  327.  
  328. if ((bpKeyboard_Switch == 1) && (bpFeedback_Switch == 1))
  329. {
  330.   bpIcons = bpIconFeedb + bpIconKeyb + bpIconRelTopics;
  331.   bpRelTopicsPopupX = 62;
  332. }
  333. if ((bpKeyboard_Switch == 0) && (bpFeedback_Switch == 1))
  334. {
  335.   bpIcons = bpIconFeedb + bpIconRelTopics;
  336.   bpRelTopicsPopupX = 30;
  337. }
  338. if ((bpKeyboard_Switch == 1) && (bpFeedback_Switch == 0))
  339. {
  340.   bpIcons = bpIconKeyb + bpIconRelTopics;
  341.   bpRelTopicsPopupX = 34;
  342. }
  343. if ((bpKeyboard_Switch == 0) && (bpFeedback_Switch == 0))
  344. {
  345.   bpIcons = bpIconRelTopics;
  346.   bpRelTopicsPopupX = 2;
  347. }
  348.  
  349. bpKeyboard_Switch = 0;    // 1 = keyboard shortcuts icon, 0 = no icon
  350. bpFeedback_Switch = 0;
  351.  
  352. var bpTopOfFile1 =
  353.   '<div id="nsbanner" class="nsbanner"><div id="bannerrow2" class="bannerrow2">'
  354.   + '<TABLE CLASS="buttonbartable" CELLSPACING=0><TR ID="hdr" NOWRAP>'
  355.   + '<TD width=40 NOWRAP>'
  356.   + bpIcons
  357.   + '</TD><TD NOWRAP>';
  358.  
  359. var bpTopOfFile2 =
  360.   '</TD></TR></TABLE></div></div>';
  361.  
  362. var bpCopyrightPrelim =
  363.   '\r<BR><CENTER><P STYLE="width:100%;position:relative;float:left;clear:left;"><b>' + L_CopyrightPrelim_Text + '</b></P></CENTER>';
  364.  
  365. var bpCopyrightFinal =
  366.   '\r<CENTER><P STYLE="width:100%;position:relative;float:left;clear:left;"><A HREF="'
  367.   + bpCopyrightLink
  368.   +'" target=_blank>'
  369.   + L_CopyrightFinal_Text
  370.   + '</A></P></CENTER>'
  371.   + '<H4><A NAME="feedback"></A></H4><SPAN id="fb"></SPAN>';
  372.  
  373.  
  374. // END SECTION: HTML DEFINITIONS
  375.  
  376. // ***********************************
  377. // BEGIN SECTION: FUNCTION DEFINITIONS
  378. // ***********************************
  379.  
  380. //---Add linked file content.---
  381.  
  382.  
  383. function displayLinkedDocument2(){
  384.   var theLinkHREF;
  385.   //--Get content of all linked files.--
  386.   LinkedFileNum = 1;
  387.   theLinkHREF = document.all['linkedFile1'].all.tags('A')(0).href.toLowerCase();
  388.   LinkedObjectReload(theLinkHREF);
  389.   }
  390.  
  391. function LinkedObjectReload(theLinkHREF)
  392. {
  393.   if (document.all['Scriptlet'] != null)
  394.   {
  395.     document.all['Scriptlet'].outerHTML = '';
  396.   }
  397.   // ---Build and insert linked file object.---
  398.   var sObjectText = '<OBJECT ID="Scriptlet'
  399.     +'" STYLE="display:none;" TYPE="text/x-scriptlet" DATA="'
  400.     +theLinkHREF
  401.     +'"></OBJECT>';
  402.   document.body.insertAdjacentHTML('beforeEnd', sObjectText);
  403.   intervalID = window.setInterval(checkReadyState,10);
  404. }
  405.  
  406. function checkReadyState()
  407. {
  408.   if (document.all['Scriptlet'].object.readyState == 4)
  409.   {
  410.     window.clearInterval(intervalID);
  411.     Scriptlet_onreadystatechange();
  412.   }
  413. }
  414.  
  415. function Scriptlet_onreadystatechange()
  416. {
  417.   //---Check to see if the document has been loaded. If not, exit.--
  418.   if (document.all['Scriptlet'].readyState == 4)
  419.   {
  420.   //---Variables.---
  421.   var aaa = "";
  422.   var sss = "";
  423.   b = LinkedFileNum;
  424.   var ItsIt = 'linkedFile' + b;
  425.   var theSpot = 'Scriptlet';
  426.   var objnum = 'hhobj_' + b + '0';
  427.   var seeme;
  428.   href = document.all[ItsIt].all.tags('A')(0).href.toLowerCase();
  429.   seeme = document.all[theSpot].object.innerHTML;
  430.  
  431.   if (seeme == null)
  432.   {
  433.   seeme = '';
  434.   }
  435.  
  436.   //--Remove "ends" from linked file.---
  437.   var bbb = seeme.indexOf('<A name');
  438.   var ccc= (seeme.lastIndexOf('<!--END-->'));
  439.   if ((bbb != -1) && (ccc != -1))
  440.   {
  441.     var aaa = seeme.substring((bbb-4), ccc);
  442.   }
  443.  
  444.   //Fix any ALinks present in the linked file.
  445.   //---Get the ALink information.---
  446.   var ppp = seeme.indexOf('hhobj_');
  447.   if (ppp != -1)
  448.   {
  449.     var qqq = seeme.lastIndexOf('<DIV',ppp);
  450.     var rrr = seeme.indexOf('</DIV>',qqq);
  451.     var sss = seeme.substring(qqq,(rrr+6));
  452.  
  453.     //--Get AName of current document, and deactivate AName links.--
  454.     var temp1 = document.body.innerHTML;
  455.     var temp2 = temp1.toLowerCase().indexOf('<a name=') + 8;
  456.     var temp3 = temp1.toLowerCase().indexOf('</a>',temp2) - 1;
  457.     var theAName = temp1.substring(temp2,temp3);
  458.     var ttt = sss.indexOf(theAName);
  459.     if (ttt != -1)
  460.     {
  461.       var uuu = sss.lastIndexOf('hhobj_',ttt);
  462.       var vvv = sss.substring(uuu,(uuu + 8));
  463.       if (vvv.substring(7) == " ")
  464.       {
  465.         vvv = vvv.substring(0,7);
  466.       }
  467.       var www = aaa.indexOf(vvv);
  468.       var xxx = aaa.lastIndexOf('<A href',www);
  469.       var yyy = aaa.indexOf('>',xxx);
  470.       var zzz = aaa.indexOf('</A>',xxx);
  471.       aaa = aaa.substring(0,xxx)
  472.         + aaa.substring((yyy + 1),(zzz + 2))
  473.         + aaa.substring((zzz + 6),aaa.length);
  474.     }
  475.   }
  476.  
  477.   //---Add .chm name to .htm HREF links.---
  478.   var aaaa = aaa.indexOf(".htm");
  479.   if (aaaa != -1)
  480.   {
  481.     theCHM = document.all[theSpot].getAttribute('DATA');
  482.     theCHM = theCHM.substring(0,(theCHM.indexOf('/') + 1));
  483.     aaa = aaa.replace(/"([^M].{5,25}\.htm")/gi,'"MS-ITS:' + theCHM + "$1");
  484.     aaa = aaa.replace(/MS-ITS:MS-ITS:/gi,'MS-ITS:');
  485.   }
  486.  
  487.  
  488.   //---Insert HTML.---
  489.   seeme = sss + aaa;
  490.   seeme = seeme.replace(/hhobj_/gi,objnum);
  491.   var theDocument = document.all[ItsIt];
  492.   theDocument.innerHTML = seeme;
  493.   LiNker = false;
  494.  
  495.   //---Call next linked file.---
  496.   incrementLinkedFileNum();
  497.   }
  498. }
  499.  
  500. function incrementLinkedFileNum()
  501. {
  502.   LinkedFileNum++;
  503.   if (LinkedFileNum >= linkedFileID)
  504.   {
  505.     return;
  506.   }
  507.   else
  508.   {
  509.     b = LinkedFileNum;
  510.     var ItsIt = 'linkedFile' + b;
  511.     href = document.all[ItsIt].all.tags('A')(0).href.toLowerCase();
  512.     LinkedObjectReload(href);
  513.   }
  514. }
  515.  
  516. // =====window.onload=====
  517. function window_onload()
  518. {
  519.   WindowIsLoading = 1;
  520.   if (InsertBoilerplateText == true) {InsertBoilerplate();}
  521.   ProcessSPANTags();  // linked file objects created here
  522.   ProcessATags();
  523.   ProcessDIVTags();
  524.   ProcessPTags();
  525.   ProcessPopups();
  526.   if ((IE4) && (LiNker)) {displayLinkedDocument2();}
  527.   WindowIsLoading = 0;
  528. }
  529.  
  530.   function InsertBoilerplate()
  531.   {
  532.   if (document.all['StartOfFile'] != null)
  533.     {
  534.     theTitle = document.all['StartOfFile'].innerHTML;
  535.     document.all['StartOfFile'].outerHTML =
  536.       bpTopOfFile1 + theTitle + bpTopOfFile2;
  537.     }
  538.   if (document.all['EndOfFile'] != null)
  539.     {
  540.     if (bpPreliminary_Switch == 1)
  541.       {bpCopyrightAll = bpCopyrightPrelim + bpCopyrightFinal;}
  542.     else
  543.       {bpCopyrightAll = bpCopyrightFinal;}
  544.  
  545.     document.all['EndOfFile'].outerHTML = bpCopyrightAll;
  546.     }
  547.   }
  548.  
  549.   function ProcessSPANTags()
  550.   {
  551.     inCr = 0;
  552.     var colln = document.all.tags('SPAN');  // SPAN tags
  553.     var i,imax = colln.length;
  554.     var theIdIs;        // 'ScriptletX'
  555.     var href;       // target A tag
  556.     for (var i=0; i<imax; i++)
  557.     {
  558.       if (colln[i].id.indexOf('linkedFile') < 0)
  559.         continue; // skip to next element
  560.  
  561.       inCr++;
  562.  
  563.       // --Grab the proper href (xxx.htm).---
  564.       href = colln[i].all.tags('A')(0).href.toLowerCase();
  565.  
  566.       colln[i].outerHTML =
  567.         '<SPAN ID="linkedFile'
  568.         +inCr
  569.         +'" CLASS="linkedfile"></SPAN>';
  570.  
  571.       colln[i].innerHTML =
  572.         '<A HREF="' + href
  573.         +'" STYLE="display:none"></A>';
  574.  
  575.     }
  576.     LiNker = (inCr > 0);
  577.     linkedFileID = inCr + 1;
  578.   }
  579.  
  580.   function ProcessATags()
  581.   {
  582.     var colln = document.all.tags('A');
  583.     var tmp;
  584.     for (var i=0; i<colln.length; i++)
  585.     {
  586.       tmp = colln[i].id;
  587.       if      (tmp.indexOf('ThumbNail'    ) > -1) ProcessATags_Thumbnail    (colln[i]);
  588.       else if (tmp.indexOf('PopUp'      ) > -1) ProcessATags_Glossary   (colln[i]);
  589.       else if (tmp.indexOf('ExPand'     ) > -1) ProcessATags_Expand     (colln[i]);
  590.     }
  591.   }
  592.     function ProcessATags_Thumbnail(e,floatdir)
  593.     {
  594.       var sThumbnailImg = e.href.toLowerCase();
  595.       var sAltText = e.title;
  596.       sThumbnailImg = get_TheUrL(sThumbnailImg);
  597.       e.innerHTML =
  598.         '<IMG CLASS="thumbnail" SRC="'
  599.         +moniker
  600.         +sThumbnailImg
  601.         +'" VSPACE="4" ALT="'
  602.         +sAltText
  603.         +'"><BR>'
  604.         +L_GraphicClickText_Text
  605.         +'<BR>';
  606.       e.outerHTML =
  607.         '<DIV CLASS="thumbnail" STYLE="'
  608.         +floatdir
  609.         +'" >'
  610.         +e.outerHTML
  611.         +'</DIV>';
  612.     }
  613.     function ProcessATags_Glossary(e)
  614.     {
  615.       e.title = L_GlossaryAlt_ToolTip;
  616.       if (InlineImgOn)
  617.         e.innerHTML = glossInitial + e.innerHTML; // write glossary .gifs
  618.     }
  619.     function ProcessATags_Expand(e)
  620.     {
  621.       e.title = L_ExpandCollapseAlt_ToolTip;
  622.       if (InlineImgOn)
  623.         e.innerHTML = initialClosed + e.innerHTML;  // write expand gifs
  624.     }
  625.  
  626.   function ProcessDIVTags()
  627.   {
  628.     var colln = document.all.tags('DIV');
  629.     var tmp,cls,contents;
  630.     for (var i=0; i<colln.length; i++)
  631.     {
  632.       tmp = colln[i].id;
  633.  
  634.         // Display any text automatically highlighted by HTML Help Search:
  635.         cls = colln[i].className.toLowerCase();
  636.         if  (  (cls == 'expand' )
  637.           || (cls == 'expand1')
  638.           || (cls == 'expand2')
  639.           || (cls == 'expand3') )
  640.         {
  641.           contents = colln[i].innerHTML;
  642.           if (   (contents.indexOf('<FONT'            ) > -1)
  643.             && (contents.indexOf('BACKGROUND-COLOR:') > -1) )
  644.             colln[i].style.display = 'block';
  645.         }
  646.  
  647.     }
  648.   }
  649.  
  650.   function ProcessPTags()
  651.   {
  652.     var bIsRTL = document.dir.toLowerCase() == 'rtl';
  653.     var s1 = '<P '+( (bIsRTL)?L_NotesRTL_Style:L_NotesLTR_Style )+'>';
  654.     var s2 = '</P>';
  655.  
  656.     var colln = document.all.tags('P');
  657.     var e;
  658.     for (var i=0; i<colln.length; i++)
  659.     {
  660.       e = colln[i];
  661.       switch(e.id)
  662.       {
  663.         case 'Alert_Caution'  : e.outerHTML = cautionImg   + s1 + e.innerHTML + s2; break;
  664.         case 'Alert_Important'  : e.outerHTML = importantImg + s1 + e.innerHTML + s2; break;
  665.         case 'Alert_Note'   : e.outerHTML = noteImg      + s1 + e.innerHTML + s2; break;
  666.         case 'Alert_Warning'  : e.outerHTML = warningImg   + s1 + e.innerHTML + s2; break;
  667.       }
  668.     }
  669.   }
  670.  
  671.   function ProcessPopups()
  672.   {
  673.     var bIsPopup = ( (IE4) && (document.all.item('LinKs') != null) );
  674.     var sA;
  675.  
  676.     if (bIsPopup)
  677.     {
  678.       ReltopicS = LinKs.innerHTML;
  679.       sA = '<A HREF="#" ID="InnerNav" TITLE="' + L_RelTopAlt_AlternativeText+'">' + InnerNavInitial + '</A>';
  680.     }
  681.     else
  682.     {
  683.       sA = RelPopSpacerGif;
  684.     }
  685.  
  686.     if (document.all['TiTLE'] != null)
  687.     {
  688.     TiTLE.outerHTML = sA +TiTLE.innerHTML;
  689.     }
  690.  
  691.     if (IE4)      // Insert popup boxes into the document
  692.     {
  693.       document.body.insertAdjacentHTML('beforeEnd', popupDIV);
  694.       document.body.insertAdjacentHTML('beforeEnd', RelPopupDiV);
  695.     }
  696.   }
  697.  
  698. // ----------------------------
  699. // ---Start of dynamic code.---
  700. // ----------------------------
  701.  
  702. //---window.onmouseover---
  703. // ONMOUSE-OVER ////////////////////////////////////////////////////
  704. function document_onmouseover()
  705. {
  706.   if (WindowIsLoading == 1) {return;}
  707.   e = window.event.srcElement;
  708.   // +++
  709.   for (var a = 0; a < 5; a++) // +++
  710.   {
  711.     if ((e.tagName != 'A') && (e.parentElement != null))
  712.       e = e.parentElement;
  713.     var eID = e.id;
  714.  
  715.     if (eID.indexOf('ExPand') != -1)              // Expand/Collapse
  716.     {
  717.       if (InlineImgOn)
  718.       {
  719.         e.style.color = _Hot;
  720.         var theDiv = GrabtheExpandDiv(e); // locate the div
  721.         theImg = getImage(e);
  722.         if (theImg != null){theImg.src = (theDiv.style.display == 'block')?expandHot:closedHot;}
  723.       }
  724.       else
  725.       {
  726.         e.style.color = _Hot;
  727.         e.style.textDecoration = 'underline';
  728.       }
  729.       break;
  730.     }
  731.  
  732.     else if ( (eID.indexOf('PopUp') != -1) && (theTagIndex != e.sourceIndex) )    // Glossary (no action if already clicked)
  733.     {
  734.       e.style.color = _Hot;
  735.       e.style.textDecoration = 'underline';
  736.       break;
  737.     }
  738.  
  739.     else if ( (eID.indexOf('InnerNav') != -1) && (theTagIndex2 != e.sourceIndex) )  // RelTopic (no action if already clicked)
  740.     {
  741.       theImg = getImage(e);
  742.       if (theImg != null){theImg.src = InnerNavHot;}
  743.       break;
  744.     }
  745.  
  746.     if (e.id.indexOf('IconFB') != -1)
  747.     {
  748.       document.all('feedb').src = IconFBHot;
  749.     }
  750.  
  751.     if (e.id.indexOf('IconKB') != -1)
  752.     {
  753.       document.all('keysho').src = IconKBHot;
  754.     }
  755.   }
  756. }
  757.  
  758. // ONMOUSE-OUT /////////////////////////////////////////////////////
  759. function document_onmouseout()
  760. {
  761.   if (WindowIsLoading == 1) {return;}
  762.   e = window.event.srcElement;
  763.  
  764.   // +++
  765.  
  766.   for (var a = 0; a < 5; a++)   // +++
  767.   {
  768.     if ((e.tagName != 'A') && (e.parentElement != null))
  769.       e = e.parentElement;
  770.     var eID = e.id;
  771.  
  772.  
  773.     // Expand/Collapse:
  774.     if (eID.indexOf('ExPand') != -1)
  775.     {
  776.       if (InlineImgOn)
  777.       {
  778.         e.style.color = _Cold;
  779.         var theDiv = GrabtheExpandDiv(e); // locate the div
  780.         theImg = getImage(e);
  781.         if (theImg != null){theImg.src = (theDiv.style.display == 'block')?expand:closed;}
  782.       }
  783.       else
  784.       {
  785.         e.style.color = _Cold;
  786.         e.style.textDecoration = 'none';
  787.       }
  788.       break;
  789.     }
  790.  
  791.     // Glossary: ("doesn't send if glossary term clicked and rolled over")
  792.     else if ( (eID.indexOf('PopUp')!= -1) && (theTagIndex != e.sourceIndex) )
  793.     {
  794.       e.style.color = _Cold;
  795.       e.style.textDecoration = 'none';
  796.       break;
  797.     }
  798.  
  799.     // Related Topic Link: ("doesn't send if reltopic icon clicked and rolled over")
  800.     else if ( (eID.indexOf('InnerNav') != -1) && (theTagIndex2 != e.sourceIndex) )
  801.     {
  802.       theImg = getImage(e);
  803.       if (theImg != null){theImg.src = InnerNavCold;}
  804.       break;
  805.     }
  806.     if (e.id.indexOf('IconFB') != -1)
  807.     {
  808.       document.all('feedb').src = IconFBCold;
  809.     }
  810.  
  811.     if (e.id.indexOf('IconKB') != -1)
  812.     {
  813.     document.all('keysho').src = IconKBCold;
  814.     }
  815.   }
  816. }
  817.  
  818. // ONCLICK /////////////////////////////////////////////////////////
  819. function document_onclick()
  820. {
  821.   if (WindowIsLoading == 1) {return;}
  822.   e = window.event.srcElement;
  823.   var relPopupVisible = 0;
  824.  
  825.   // Hide any open popups:
  826.   if (document.all.RelpopUpWindow.style.visibility == 'visible')
  827.   {
  828.     relPopupVisible = 1;
  829.   }
  830.   document.all.RelpopUpWindow.style.visibility = 'hidden';
  831.   document.all.popUpWindow.style.visibility = 'hidden';
  832.  
  833.   // Reset popup state variables (used in onresize)
  834.   WindowOne = false;    // popup
  835.   WindowTwo = false;    // innernav
  836.  
  837.   // Reset glossary popup state variables
  838.   popOpen   = false;  // is a Glossary popup visible
  839.   PopUp_InAPopUp  = false;  // user clicks a see-also term
  840.   AnotherCheck  = false;  // inline gifs are off and HTMLHelp added html
  841.  
  842.   // +++
  843.   for (var a = 0; a < 5; a++)   // +++
  844.   {
  845.     if ( (e.tagName != 'A') && (e.parentElement != null) )
  846.       e = e.parentElement;
  847.     eID = e.id;
  848.  
  849.     // ("XML code allows TDC to coexist because of this")
  850.     xmlTermRoot = '';
  851.     if (e.hash != null)
  852.       xmlTermRoot = e.hash;
  853.  
  854.     // Variables to control click color of glossary link text:
  855.     if (  checkIt2  &&  ( (eID.indexOf('PopUp') == -1) || (eID.indexOf('In_PopuP') == -1) )  )
  856.     {
  857.       var changeBack = document.all(theTagIndex);
  858.       changeBack.style.color = _Cold;
  859.       changeBack.style.textDecoration = 'none';
  860.       theTagIndex = false;
  861.       checkIt2 = false;
  862.     }
  863.  
  864.     // Variables to control click color of related topics icon:
  865.     if (  checkIt  &&  (theTagIndex2 != -1)  &&  (eID.indexOf('InnerNav') == -1)  )
  866.     {
  867.       theImg = getImage2(theTagIndex2);
  868.       if (theImg != null){theImg.src = InnerNavCold;}
  869.       theTagIndex2 = false;
  870.       checkIt = false;
  871.     }
  872.  
  873.     if (e.id.indexOf('IconFB') != -1)
  874.     {
  875.       document.all('feedb').src = IconFBClick;
  876.     }
  877.  
  878.     if (e.id.indexOf('IconKB') != -1)
  879.     {
  880.       document.all('keysho').src = IconKBClick;
  881.     }
  882.  
  883.     if      (eID.indexOf('ThumbNail') != -1)  { callThumbnail(e);     break;  }   // Thumbnail
  884.     else if (eID.indexOf('ExPand') != -1)   { callExpand(e,InlineImgOn);  break;  }   // Expand/Collapse
  885.  
  886.     if (eID.indexOf('InnerNav') != -1)          // reltopic
  887.     {
  888.       lastClickedPopUp = e; // used by onresize()
  889.       WindowTwo = true;
  890.       checkIt = true;
  891.       theTagIndex2 = e.sourceIndex;
  892.       theImg = getImage2(theTagIndex2);
  893.       if (theImg != null){theImg.src = InnerNavClick;}
  894.  
  895.       if (relPopupVisible == 1)
  896.       {
  897.         document.all.RelpopUpWindow.style.visibility = 'hidden';
  898.         if (theImg != null){theImg.src = InnerNavCold;}
  899.       }
  900.       else
  901.       {
  902.         callRelatedTopicS(e);
  903.       }
  904.       break;
  905.     }
  906.  
  907.     else if (eID.indexOf('PopUp') != -1)        // glossary
  908.     {
  909.       lastClickedPopUp = e;     // used by onresize()
  910.       WindowOne = true;
  911.  
  912.       // Set variables to control click color of glossary link text:
  913.       checkIt2 = true;
  914.       theTagIndex = true;
  915.       theTagIndex = e.sourceIndex;
  916.       AnotherTagIndex = parseInt(theTagIndex);
  917.       e.style.color = _Click;
  918.       //e.style.textDecoration = 'underline';
  919.  
  920.       WorkText = e.innerHTML;     // Capture the html containing the term
  921.  
  922.       var bAddedHTML = WorkText.indexOf('BACKGROUND-COLOR:') != -1; // has HTMLHelp added html
  923.       if (InlineImgOn)  // if glossary image is on
  924.       {
  925.         if (bAddedHTML)
  926.           GetTheRealTerm();
  927.         else
  928.           GetTheRealTerm2();
  929.       }
  930.       else        // if no image on
  931.       {
  932.         if (bAddedHTML)                       // has HTMLHelp added html
  933.         {
  934.           AnotherCheck = true;
  935.           GetTheRealTerm();
  936.         }
  937.         else
  938.           TermDef = e.innerHTML;
  939.       }
  940.  
  941.       // Now perform the term lookup:
  942.       callGlossary(e, TermDef);
  943.       break;
  944.     }
  945.  
  946.     else if (eID.indexOf('In_PopuP') != -1)         // Glossary SEE ALSO
  947.     {
  948.       // Set variables to control click color of glossary link text:
  949.       checkIt2 = true;
  950.       theTagIndex = parseInt(AnotherTagIndex);
  951.       var changeBack = document.all(theTagIndex);
  952.       changeBack.style.color = _Click;
  953.       //changeBack.style.textDecoration = 'underline';
  954.  
  955.       // Set a state variable and perform the term lookup:
  956.       PopUp_InAPopUp = true;
  957.       TermDef = e.innerHTML;
  958.       callGlossary(e, TermDef);
  959.       break;
  960.     }
  961.   }
  962. }
  963.  
  964. // ONKEYPRESS //////////////////////////////////////////////////////
  965. function document_onkeypress()
  966. {
  967.   if (WindowIsLoading == 1) {return;}
  968.   if (window.event.keyCode == 27)
  969.   {
  970.     document.all.popUpWindow.style.visibility = 'hidden';
  971.     popOpen = false;  // state variable
  972.   }
  973.   if (window.event.keyCode == 6)
  974.   {
  975.     window.focus();
  976.     window.location = "#Feedback";
  977.     EMailStream(fb);
  978.   }
  979.   if (window.event.keyCode == 11)
  980.   {
  981.     window.focus();
  982.     window.location = bpKeyboardShortcutLink;
  983.   }
  984.   if (window.event.keyCode == 19)
  985.   {
  986.     window.focus();
  987.     if (document.all.RelpopUpWindow.style.visibility == 'visible')
  988.     {
  989.     document.all.RelpopUpWindow.style.visibility = 'hidden';
  990.     document.all.tags('IMG')[2].src = InnerNavCold;
  991.     }
  992.     else
  993.     {
  994.       document.all.tags('IMG')[2].click();
  995.     }
  996.  
  997.   }
  998. }
  999.  
  1000. // ONRESIZE ////////////////////////////////////////////////////////
  1001. function window_onresize()
  1002. {
  1003.   if (WindowIsLoading == 1) {return;}
  1004.   // Pre-shortcut code...
  1005.   if(lastClickedPopUp)
  1006.   {
  1007.     var nClientWidth = document.body.clientWidth;
  1008.     var nPopupWidth  = popUpWindow.style.pixelWidth;
  1009.     var nLeft;    // popUpWindow.style.pixelLeft
  1010.     var nTop;   // popUpWindow.style.pixelTop
  1011.  
  1012.     if (WindowOne)              // glossary popups
  1013.     {
  1014.       if (lastClickedPopUp.offsetParent.tagName.toLowerCase() == 'body')
  1015.       {
  1016.         if((nPopupWidth + lastClickedPopUp.offsetLeft) <= nClientWidth)
  1017.           nLeft = lastClickedPopUp.offsetLeft;
  1018.         else
  1019.           nLeft = ((nClientWidth - 10) > nPopupWidth)?(nClientWidth - nPopupWidth):10;
  1020.         nTop = lastClickedPopUp.offsetTop + lastClickedPopUp.offsetHeight + 1;
  1021.       }
  1022.       else if (lastClickedPopUp.offsetParent.offsetParent.tagName.toLowerCase() == 'body')
  1023.       {
  1024.         if((nPopupWidth + lastClickedPopUp.offsetLeft + lastClickedPopUp.offsetParent.offsetLeft) <= nClientWidth)
  1025.           nLeft = lastClickedPopUp.offsetLeft + lastClickedPopUp.offsetParent.offsetLeft;
  1026.         else
  1027.           nLeft = ((nClientWidth - 10) > nPopupWidth)?(nClientWidth - nPopupWidth):10;
  1028.         nTop = lastClickedPopUp.offsetHeight + lastClickedPopUp.offsetTop + 1 + lastClickedPopUp.offsetParent.offsetTop;
  1029.       }
  1030.       else if (lastClickedPopUp.offsetParent.offsetParent.offsetParent.tagName.toLowerCase() == 'body')
  1031.       {
  1032.         if((nPopupWidth + lastClickedPopUp.offsetLeft + lastClickedPopUp.offsetParent.offsetLeft + lastClickedPopUp.offsetParent.offsetParent.offsetLeft) <= nClientWidth)
  1033.           nLeft = lastClickedPopUp.offsetLeft + lastClickedPopUp.offsetParent.offsetLeft + lastClickedPopUp.offsetParent.offsetParent.offsetLeft;
  1034.         else
  1035.           nLeft = ((nClientWidth - 10) > nPopupWidth)?(nClientWidth - nPopupWidth):10;
  1036.         nTop = lastClickedPopUp.offsetHeight + lastClickedPopUp.offsetTop + 1 + lastClickedPopUp.offsetParent.offsetTop + lastClickedPopUp.offsetParent.offsetParent.offsetTop;
  1037.       }
  1038.       else
  1039.       {
  1040.         if ((popUpWindow.style.pixelLeft + nPopupWidth) > document.body.clientWidth)
  1041.           nLeft = document.body.clientWidth - nPopupWidth;
  1042.         if ((popUpWindow.style.pixelTop + popUpWindow.style.pixelHeight) > document.body.clientHeight)
  1043.           nTop = document.body.clientHeight - popUpWindow.style.pixelHeight;
  1044.       }
  1045.       if (nLeft != null)
  1046.         popUpWindow.style.pixelLeft = nLeft;    // popUpWindow.style.pixelLeft
  1047.       if (nTop != null)
  1048.         popUpWindow.style.pixelTop  = nTop;     // popUpWindow.style.pixelTop
  1049.     }
  1050.  
  1051.     // Related Topics popups
  1052.     else if (WindowTwo)
  1053.     {
  1054.       RelpopUpWindow.style.pixelLeft = (document.dir=='rtl')
  1055.                         ?10
  1056.                         :nClientWidth - RelpopUpWindow.style.pixelWidth - 10;
  1057.       RelpopUpWindow.style.pixelTop = ((lastClickedPopUp.offsetTop) + (lastClickedPopUp.offsetHeight) + (1));
  1058.     }
  1059.   }
  1060. }
  1061.  
  1062. // parse the popup term (IF WorkText.indexOf('BACKGROUND-COLOR:') != -1)
  1063. function GetTheRealTerm()
  1064. {
  1065.   var c;
  1066.   var d = '</FONT>';
  1067.   var f = WorkText;
  1068.   if (!AnotherCheck)  // in this case we don't need to remove images (inline images are off)
  1069.   {         // AnotherCheck = false when inline gifs are off and HTMLHelp added html
  1070.     c = f.indexOf('width=12>');
  1071.     if (c == -1)
  1072.       return;
  1073.     f = f.substring((c+9),f.length);
  1074.   }
  1075.   f = f.replace(d,'');  // remove all but the term and the HTML from HTMLHelp
  1076.  
  1077.   // this removes HTML added by HTMLHelp, leaving the term
  1078.   var g = f.indexOf('<');
  1079.   var h = f.indexOf('>');
  1080.   if ( (g == -1) || (h == -1) )
  1081.     return;
  1082.   var i = f.substring(g,(h+1));
  1083.   f = f.replace(i,'');
  1084.   TermDef = f;
  1085.   return TermDef;
  1086. }
  1087.  
  1088. // parse the popup term when HTMLHelp has not added HTML (IF *NOT* WorkText.indexOf('BACKGROUND-COLOR:') != -1)
  1089. function GetTheRealTerm2()
  1090. {
  1091.   var c = WorkText.lastIndexOf('width=12>');
  1092.   if (c == -1)
  1093.     return;
  1094.   else
  1095.     TermDef = WorkText.substring((c+9),WorkText.length);
  1096.   return TermDef;
  1097. }
  1098.  
  1099. // FIND AREA TO EXPAND/COLLAPSE
  1100. function GrabtheExpandDiv(e)
  1101. {
  1102.   var theExpandDiv, sTagName, sClassName;
  1103.   for (var a = 0; a < 5; a++) // +++
  1104.   {
  1105.     var theTag = e.sourceIndex + e.children.length + a;
  1106.     theExpandDiv = document.all(theTag);
  1107.     sTagName   = theExpandDiv.tagName;
  1108.     sClassName = theExpandDiv.className.toLowerCase();
  1109.     if
  1110.     (
  1111.       ( (
  1112.              (sTagName == 'DIV')
  1113.           || (sTagName == 'SPAN')
  1114.         ) && (
  1115.              (sClassName == 'expand')
  1116.           || (sClassName == 'expand1')
  1117.           || (sClassName == 'expand2')
  1118.           || (sClassName == 'expand3')
  1119.       ) ) || theTag == document.all.length
  1120.     )
  1121.       break;
  1122.   }
  1123.   return theExpandDiv;
  1124. }
  1125.  
  1126. // rollovers and Expand getImage
  1127. function getImage(e)
  1128. {
  1129.   var ee = e;
  1130.   for (var a = 0; a < 5; a++)   // +++
  1131.   {
  1132.     if ((ee.tagName != 'A') && (ee.parentElement != null))
  1133.       ee = ee.parentElement;
  1134.     if(ee.tagName == 'A')
  1135.       return ee.all.tags('IMG')(0);
  1136.   }
  1137.   return ee;    // +++
  1138. }
  1139.  
  1140. // handles gray state of Related Topic and Glossary popups
  1141. function getImage2()  // +++
  1142. {
  1143.   // +++
  1144.   var TheSpot;
  1145.   if ((checkIt) && (theTagIndex2 != -1))      // if Related Topic
  1146.     TheSpot = document.all(theTagIndex2);
  1147.   else if ((checkIt2) && (theTagIndex != -1))   // if Glossary
  1148.     TheSpot = document.all(theTagIndex);
  1149.   else
  1150.     return;
  1151.  
  1152.   for (var a = 0; a < 5; a++)   // +++
  1153.   {
  1154.     if ((TheSpot.tagName != 'A') && (TheSpot.parentElement != null))
  1155.       TheSpot = TheSpot.parentElement;
  1156.     if(TheSpot.tagName == 'A')
  1157.       return TheSpot.all.tags('IMG')(0);
  1158.   }
  1159.   return TheSpot;   // +++
  1160. }
  1161.  
  1162. // call the Thumbnail window
  1163. function callThumbnail()
  1164. {
  1165.   event.returnValue = false;            // kill event
  1166.  
  1167.   var eH = e.href.toLowerCase();
  1168.   sParamFILE = get_TheUrL(eH);
  1169.   sParamFILE = CHMRef + sParamFILE;
  1170.  
  1171.   if (document.hhThumbnail)           // if exists, delete
  1172.     document.hhThumbnail.outerHTML = '';
  1173.  
  1174.   var h =
  1175.     '<OBJECT ID="hhThumbnail" '
  1176.     +ActX
  1177.     +' STYLE="display:none"><PARAM NAME="Command" VALUE="Related Topics">'
  1178.     +'VALUE="<PARAM NAME="Item1" VALUE="$global_largeart;'
  1179.     +moniker
  1180.     +sParamFILE
  1181.     +'"></OBJECT>';
  1182.  
  1183.   document.body.insertAdjacentHTML('beforeEnd', h); // create and activate
  1184.   document.hhThumbnail.hhclick();
  1185. }
  1186.  
  1187. // designed to get the URL out of 'funky'-style HREF fields
  1188. function get_TheUrL(sHREF)
  1189. {
  1190.   var spaces = /\s/g;
  1191.   var eH = unescape(sHREF);
  1192.   eH  = eH.replace(spaces,'');
  1193.   eH_ = eH.toLowerCase(); // added
  1194.  
  1195.   var sParamFILE = '';
  1196.   var sParamCHM  = '';
  1197.  
  1198.   var iFILE = eH_.lastIndexOf('file=');
  1199.   if (iFILE != -1)
  1200.     sParamFILE = eH.substring(iFILE+5, eH.length);
  1201.  
  1202.   var iCHM = eH_.lastIndexOf('chm=');
  1203.   if (iCHM != -1)
  1204.   {
  1205.     sParamCHM = eH.substring(iCHM+4, iFILE) + "::/";
  1206.     sParamFILE= sParamCHM + sParamFILE;
  1207.   }
  1208.   return sParamFILE;
  1209. }
  1210.  
  1211. // call Related Topics popup
  1212. function callRelatedTopicS()
  1213. {
  1214.   event.returnValue = false;                  // kill event
  1215.   document.all.RelpopUpWindow.innerHTML      = L_RelTopHeader_Text + ReltopicS;
  1216.   document.all.RelpopUpWindow.style.fontSize = L_RelPopFontSize_Style;
  1217.   document.all.RelpopUpWindow.style.left = (document.dir == 'rtl')
  1218.                         ?10
  1219.                         :(bpRelTopicsPopupX);
  1220.   document.all.RelpopUpWindow.style.top = document.all.InnerNav.offsetTop + document.all.InnerNav.offsetHeight + 4;
  1221.   document.all.RelpopUpWindow.style.visibility = 'visible';
  1222. //document.body.clientWidth - RelpopUpWindow.style.pixelWidth - 10
  1223.  
  1224. }
  1225.  
  1226. // call Glossary popup
  1227. function callGlossary()
  1228. {
  1229.   event.returnValue = false;              // kill event
  1230.  
  1231.   // set XY popup coordinates
  1232.   if (PopUp_InAPopUp)
  1233.   {
  1234.     ieX = document.all.popUpWindow.style.left;
  1235.     ieY = document.all.popUpWindow.style.top;
  1236.   }
  1237.   else
  1238.   {
  1239.     if (e.offsetParent.tagName.toLowerCase() == 'body')
  1240.     {
  1241.       ieX = e.offsetLeft;
  1242.       ieY = e.offsetTop + e.offsetHeight + 1;
  1243.     }
  1244.     else if (e.offsetParent.offsetParent.tagName.toLowerCase() == 'body')
  1245.     {
  1246.       ieX = e.offsetLeft + e.offsetParent.offsetLeft;
  1247.       ieY = e.offsetHeight + e.offsetTop + e.offsetParent.offsetTop + 1;
  1248.     }
  1249.     else if (e.offsetParent.offsetParent.offsetParent.tagName.toLowerCase() == 'body')
  1250.     {
  1251.       ieX = e.offsetLeft + e.offsetParent.offsetLeft + e.offsetParent.offsetParent.offsetLeft;
  1252.       ieY = e.offsetHeight + e.offsetTop + e.offsetParent.offsetTop + e.offsetParent.offsetParent.offsetTop + 1;
  1253.     }
  1254.     else
  1255.     {
  1256.       ieX = window.event.clientX;
  1257.       ieY = window.event.clientY + document.body.scrollTop;
  1258.     }
  1259.   }
  1260.  
  1261.   // if a popup window is open, pause then reissue function call
  1262.   if (popOpen)
  1263.     window.setTimeout('callGlossary()', 50);
  1264.  
  1265.   if (noPopups) // if not IE4+
  1266.   {
  1267.     alert (L_BrowserAlert_Message);
  1268.     noPopups = false;
  1269.     return;
  1270.   }
  1271.  
  1272.   // if no popup open, proceed to display popup...
  1273.   if (IE4 && !popOpen)
  1274.     iePopup();
  1275. }
  1276.  
  1277. // build the popup window
  1278. function iePopup()
  1279. {
  1280.   // adjust if the popup will be offscreen
  1281.   var rightlimit = ieX + document.all.popUpWindow.offsetWidth;
  1282.   if (rightlimit >= document.body.clientWidth)
  1283.     ieX -= (rightlimit - document.body.clientWidth);
  1284.  
  1285.   // set and position popup
  1286.   document.all.popUpWindow.innerHTML    = '';
  1287.   document.all.popUpWindow.style.height = 0;
  1288.  
  1289.   if (xmlGloss) // if glossary is in XML control
  1290.   {
  1291.     document.all.popUpWindow.innerHTML = getXMLPopupContent(xmlTermRoot); // load formatted popup content or not found
  1292.  
  1293.     // callback required to get popup height +++
  1294.     window.setTimeout ('iePopHeight()', 0);
  1295.  
  1296.     // set popup's XY coordinates
  1297.     document.all.popUpWindow.style.top  = ieY;
  1298.     document.all.popUpWindow.style.left = ieX;
  1299.     popOpen = true;   // state variable: popup is ready
  1300.     return (false);   // kill bubble
  1301.   }
  1302.   else      // else glossary is in TDC control
  1303.   {
  1304.     if (document.tdcGloss)            // if TDC exists, delete
  1305.       document.tdcGloss.outerHTML = '';
  1306.  
  1307.     var h =
  1308.       '<OBJECT ID="tdcGloss" CLASSID="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83" VIEWASTEXT>'
  1309.       +'<PARAM NAME="DataURL" VALUE="'
  1310.       +BeforeReference
  1311.       +'Basics/gloss.txt"><PARAM NAME="UseHeader" VALUE="True">'
  1312.       +'<PARAM NAME="FieldDelim" VALUE=","><PARAM NAME="EscapeChar" VALUE="#"></OBJECT>';
  1313.  
  1314.     document.body.insertAdjacentHTML('beforeEnd', h);   // create TDC
  1315.  
  1316.     var RS = tdcGloss.recordset;
  1317.     RS.moveFirst();
  1318.  
  1319.     // default text when no term is found
  1320.     document.all.popUpWindow.innerHTML =
  1321.       '<H6 CLASS="GLOSSARY_ITEM">'
  1322.       +L_NoDefAlertTitle_Text
  1323.       +'</H6><P>'
  1324.       +L_NoDefAlert_Text
  1325.       +'</P>';
  1326.  
  1327.     while (!RS.EOF)
  1328.     {
  1329.       if (TermDef.toLowerCase() == RS.fields('Term').value.toLowerCase())   // if found, get def
  1330.       {
  1331.         defContent = RS.fields('Definition').value;
  1332.  
  1333.         if (RS.fields('SeeAlso').value)       // handle any See Also's
  1334.           if (RS.fields('SeeAlso').value.indexOf('~') != -1)
  1335.             ParseOtherDefs();
  1336.           else
  1337.             document.all.popUpWindow.innerHTML =
  1338.               '<H6 CLASS="GLOSSARY_ITEM">'
  1339.               +TermDef
  1340.               +'</H6><P>'
  1341.               +defContent
  1342.               +'</P><P ID="OtherDefs"><B>See Also: </B><A ID="In_PopuP" HREF="#">'
  1343.               +RS.fields('SeeAlso').value
  1344.               +'</A></P>';
  1345.         else
  1346.           document.all.popUpWindow.innerHTML =
  1347.             '<H6 CLASS="GLOSSARY_ITEM">'
  1348.             +TermDef
  1349.             +'</H6><P>'
  1350.             +defContent
  1351.             +'</P>';
  1352.         break;
  1353.       }
  1354.       RS.moveNext();
  1355.     }
  1356.     // callback required to get popup height +++
  1357.     window.setTimeout ('iePopHeight()', 0);
  1358.  
  1359.     // set popup's XY coordinates
  1360.     document.all.popUpWindow.style.top = ieY;
  1361.     document.all.popUpWindow.style.left = ieX;
  1362.     popOpen = true;   // state variable: popup is ready
  1363.     return false;   // kill bubble
  1364.   }
  1365. }
  1366.  
  1367. // handle case of multiple See Also's in a TDC file (not used by XML glossary)
  1368. function ParseOtherDefs()
  1369. {
  1370.   var FstStop   =  0;
  1371.   var FstWrd    = '';
  1372.   var AimPnt    = tdcGloss.recordset.fields('SeeAlso').value;
  1373.   var DefsString  = '<B>See Also: </B>';
  1374.  
  1375.   while ( (FstStop = AimPnt.indexOf('~')) > -1)   // loop through each See Also, separated by tildes ('~')
  1376.   {
  1377.     FstWrd    = AimPnt.substring(0, FstStop);
  1378.     DefsString  =
  1379.       DefsString
  1380.       +'<A ID="In_PopuP" HREF="gloss_all.htm#def_'
  1381.       +FstWrd
  1382.       +'">'
  1383.       +FstWrd
  1384.       +'</a>, ';
  1385.     AimPnt = AimPnt.substring(FstStop + 1, AimPnt.length);
  1386.   }
  1387.   DefsString =
  1388.     DefsString
  1389.     +'<A ID="In_PopuP" HREF="gloss_all.htm#def_'
  1390.     +AimPnt
  1391.     +'">'
  1392.     +AimPnt
  1393.     +'</a>';
  1394.   document.all.popUpWindow.innerHTML =
  1395.     '<H6 CLASS="GLOSSARY_ITEM">'
  1396.     +TermDef
  1397.     +'</H6><P>'
  1398.     +defContent
  1399.     +'</P><P ID="OtherDefs">'
  1400.     +DefsString
  1401.     +'</P>';
  1402. }
  1403.  
  1404. // get popup height, nudge if necessary, and display popup
  1405. function iePopHeight()
  1406. {
  1407.   var pageBottom = document.body.scrollTop + document.body.clientHeight;
  1408.   var popHeight = document.all.popUpWindow.offsetHeight;
  1409.   document.all.popUpWindow.style.height = popHeight - 2 * (parseInt(document.all.popUpWindow.style.borderWidth));
  1410.  
  1411.   if (popHeight + ieY >= pageBottom)  // if popup longer than screen, move to top of screen
  1412.     document.all.popUpWindow.style.top = (popHeight <= pageBottom)?(pageBottom-popHeight):0;
  1413.  
  1414.   document.all.popUpWindow.style.visibility = 'visible';  // display popup
  1415. }
  1416.  
  1417. // show/hide Expand block
  1418. function callExpand(e,InlineImgOn)
  1419. {
  1420.   event.returnValue = false;      // kill bubble
  1421.   var theDiv = GrabtheExpandDiv(e);
  1422.  
  1423.   theDiv.style.display = (theDiv.style.display == 'block')?'none':'block';
  1424.   if (!InlineImgOn)
  1425.   {
  1426.     var theImg = getImage(e);
  1427.     if (theImg != null){theImg.src = (theDiv.style.display == 'block')?closed:expand;}
  1428.   }
  1429.   document.body.insertAdjacentHTML('beforeEnd',' ');
  1430. }
  1431.  
  1432. // XML POPUP CODE BEGINS
  1433. function getXMLPopupContent(theXMLTermRoot)
  1434. {
  1435.   var theXMLTerm, theXMLTermID;
  1436.   var theEntry;
  1437.   var theScopeDefs;
  1438.   var theScopes;
  1439.   var theDefinition;
  1440.   var theSeeAlsos, seeAlsoID, seeAlsoTerm;
  1441.   var theSeeEntry, seeID, seeTerm;
  1442.   var outText;
  1443.   var i, j, k, l, m;
  1444.   var scopeFound;
  1445.   var noDef =
  1446.     '<H6 CLASS="GLOSSARY_ITEM">'
  1447.     +L_NoDefAlertTitle_Text
  1448.     +'</H6><P>'
  1449.     +L_NoDefAlert_Text
  1450.     +'</P>';
  1451.  
  1452.   // CHECK THAT TERM ROOT EXISTS
  1453.   if (theXMLTermRoot.length > 1)
  1454.   {
  1455.     theXMLTermID = theXMLTermRoot.substring(1, theXMLTermRoot.length);
  1456.     i = theXMLTermID.indexOf(':');
  1457.     if (i > 0)
  1458.       theXMLTerm = theXMLTermID.substring(i+1, theXMLTermID.length);
  1459.     else
  1460.       return (noDef);
  1461.   }
  1462.   else
  1463.     return (noDef);
  1464.  
  1465.   if (!xmlDOMLoaded)  // load the XML object the first time through
  1466.   {
  1467.     xmlDOM = new ActiveXObject('Microsoft.XMLDOM');
  1468.     xmlDOM.async = false;
  1469.     xmlDOM.validateOnParse = false;
  1470.     xmlDOM.load(xmlFile);
  1471.     xmlDOMLoaded = true;    // state variable
  1472.   }
  1473.  
  1474.   outText = noDef;
  1475.   theEntry = xmlDOM.nodeFromID(theXMLTerm); // look up term
  1476.  
  1477.   if (theEntry == null)
  1478.     outText = noDef;
  1479.   else              // term found
  1480.   {
  1481.     theScopeDefs = theEntry.selectNodes('scopeDef');
  1482.     scopeFound = false;
  1483.  
  1484.     for (i = 0; i < theScopeDefs.length && !scopeFound; i++)
  1485.     {
  1486.       theScopes = theScopeDefs(i).selectNodes('scope');
  1487.       for (j = 0; j < theScopes.length; j++)    // this loop could be replaced with a single XSL pattern
  1488.       {
  1489.         if (theScopes(j).attributes.getNamedItem('scopeTermID').text == theXMLTermID) // checking for scopedef match
  1490.         {
  1491.           // FOUND SCOPE IN ENTERY - GET AND FORMAT THE TERM AND DEF DATA
  1492.           scopeFound = true;
  1493.           outText = formatXMLTerm(theEntry.selectSingleNode('term').text);
  1494.           if (theScopeDefs(i).selectSingleNode('def') != null)
  1495.           {
  1496.             theDefinition = formatXMLDef(theScopeDefs(i).selectSingleNode('def'));
  1497.             outText += theDefinition;       // get def
  1498.  
  1499.             theSeeAlsos = theScopeDefs(i).selectNodes('seeAlso');
  1500.             seeAlsoID = '';
  1501.             seeAlsoTerm = '';
  1502.             for (k = 0; k < theSeeAlsos.length; k++)  // search for See Alsos
  1503.             {
  1504.               seeAlsoID = theSeeAlsos(k).attributes.getNamedItem('seeAlsoID').text;
  1505.               l = seeAlsoID.indexOf(':');
  1506.               if (l > 0)
  1507.               {
  1508.                 seeAlsoScope = seeAlsoID.substring(0, l+1);
  1509.                 seeAlsoID    = seeAlsoID.substring(l+1, seeAlsoID.length);
  1510.               }
  1511.               else
  1512.                 seeAlsoScope = '';
  1513.               seeAlsoTerm = xmlDOM.nodeFromID(seeAlsoID).selectSingleNode('term').text;
  1514.  
  1515.               // if k == 0, format first See Also
  1516.               outText += formatXMLSeeAlso(seeAlsoScope + seeAlsoID, seeAlsoTerm, (k == 0));
  1517.             }
  1518.             if (k > 0)
  1519.               outText = outText + '</P>'; // if See Alsos, add trailing paragraph mark
  1520.           }
  1521.           else
  1522.           {
  1523.             theSeeEntry = theScopeDefs(i).selectSingleNode('seeEntry');
  1524.             seeID = theSeeEntry.attributes.getNamedItem('seeID').text;
  1525.             k = seeID.indexOf(':');
  1526.             if (k > 0)
  1527.             {
  1528.               seeScope = seeID.substring(0, k+1);
  1529.               seeID    = seeID.substring(k+1, seeID.length);
  1530.             }
  1531.             else
  1532.               seeScope = '';
  1533.             seeTerm = xmlDOM.nodeFromID(seeID).selectSingleNode('term').text;
  1534.             outText += formatXMLSee(seeScope + seeID, seeTerm);
  1535.           }
  1536.         }//end if-scope-found block
  1537.       }
  1538.     }
  1539.   }
  1540.   xmlTermRoot = ''; //  clean up global
  1541. //  for debugging:  return ("XML -" + xmlTermRoot + "/" + theXMLTerm + "termText:" + termText + "defText:" + defText  + outText);
  1542.   return outText;
  1543. }
  1544.  
  1545. // helper functions to format the glossary text
  1546. function formatXMLTerm(theTerm)   // term
  1547. {
  1548.   return ('<H6 CLASS="GLOSSARY_ITEM">'+theTerm+'</H6>');
  1549. }
  1550. function formatXMLDef(theDef)   // def
  1551. {
  1552.   var theParas = theDef.selectNodes('para');
  1553.   var theDefOut = '';
  1554.   for (var i = 0; i < theParas.length; i++)
  1555.     theDefOut += '<P>'+theParas(i).text+'</P>';
  1556.   return theDefOut;
  1557. }
  1558. function formatXMLSee(theSeeTermID, theSeeTerm) // see also
  1559. {
  1560.   var theSeeText;
  1561.   theSeeText = '<A ID="In_PopuP" HREF="#'+theSeeTermID+'">'+theSeeTerm+'</A>';
  1562.   return ('<P ID="SeeDef">'+L_See_Text+theSeeText);
  1563. }
  1564. function formatXMLSeeAlso(theSeeAlsoTermID, theSeeAlsoTerm, bFirstOne)  // see alsos
  1565. {
  1566.     var theSeeAlsoText =
  1567.     '<A ID="In_PopuP" HREF="#'
  1568.     +theSeeAlsoTermID
  1569.     +'">'
  1570.     +theSeeAlsoTerm
  1571.     +'</A>';
  1572.   return ( ((bFirstOne)?('<P ID="OtherDefs">'+L_SeeAlso_Text):(', '))  +  theSeeAlsoText );
  1573. }
  1574.  
  1575.  
  1576. // EVENT HANDLER HOOKS BEGIN
  1577.  
  1578. window.onload     = window_onload;
  1579. window.onresize     = window_onresize;
  1580. document.onkeypress   = document_onkeypress;
  1581. document.onclick    = document_onclick;
  1582. document.onmouseover    = document_onmouseover;
  1583. document.onmouseout   = document_onmouseout;
  1584.  
  1585. // legacy event handler names
  1586. function loadInitialThings()    { window_onload(); }
  1587. function fixPopUps()      { window_onresize(); }
  1588. function ieKey()      { document_onkeypress(); }
  1589. function clickAndDo()     { document_onclick(); }
  1590. function gettingHot()     { document_onmouseover(); }
  1591. function gettingCold()      { document_onmouseout(); }
  1592.  
  1593. // EVENT HANDLER HOOKS END
  1594.