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