home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 March / Chip_2002-03_cd1.bin / zkuste / vbasic / Data / ActiveX / mdac27.exe / sqlodbc.cab / sqlsodbc.chm / basics / shared.js < prev    next >
Encoding:
JavaScript  |  2001-03-08  |  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 = 'Rozbalit nebo sbalit text';    // expand
  11. var L_GlossaryAlt_ToolTip = 'Zobrazit definici';        // 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 = 'Viz takΘ';            // related topics
  17. var L_KeyboardAlt_AlternativeText = 'KlßvesovΘ zkratky';    // keyboard shortcuts
  18. var L_FeedbackAlt_AlternativeText = 'ZaÜlete nßm vßÜ nßzor na tuto strßnku.';     // feedback
  19.  
  20. // ---Glossary-related text---
  21. var L_NoDefAlertTitle_Text = 'Definice nenφ k dispozici.';
  22. var L_NoDefAlert_Text = 'V souΦasnosti neexistujφ v souboru glosß°e tyto glosß°ovΘ termφny a definice.';
  23. var L_BrowserAlert_Message = 'Chcete-li zobrazit kontextovΘ glosß°ovΘ definice, je nutnΘ pou₧φt aplikaci Internet Explorer 4 nebo vyÜÜφ verzi.';          // downlevel browsers message
  24. var L_See_Text = '<B>Viz: </B>';
  25. var L_SeeAlso_Text = '<B>Viz takΘ: </B>';
  26.  
  27. //---Boilerplate text---
  28. var L_CopyrightPrelim_Text = 'Tyto informace jsou p°edb∞₧nΘ. Mohou b²t ne·plnΘ a mohou podlΘhat zm∞nßm.';
  29. var L_CopyrightFinal_Text = '©1988-2000 Microsoft Corporation. VÜechna prßva vyhrazena.';
  30.  
  31. // ---Other text---
  32. var L_RelTopHeader_Text = '<P><B>Viz takΘ</B></P>';    // related topics header text
  33. var L_GraphicClickText_Text = 'Zv∞tÜit diagram';        // hot text under thumbnail graphics
  34. var L_Error_Text = 'P°i naΦφtßnφ souboru HTML doÜlo k chyb∞.'; // 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 = 'sqlsodbc.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 = 'MS-ITS:sqlsodbc.chm::/_sql_server_2000_copyright_and_disclaimer.htm';
  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="28" 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.  
  350. var bpTopOfFile1 = 
  351.     '<div id="nsbanner" class="nsbanner"><div id="bannerrow2" class="bannerrow2">'
  352.     + '<TABLE CLASS="buttonbartable" CELLSPACING=0><TR ID="hdr" NOWRAP>'
  353.     + '<TD width=95 NOWRAP>'
  354.     + bpIcons
  355.     + '</TD><TD NOWRAP>';
  356.  
  357. var bpTopOfFile2 = 
  358.     '</TD></TR></TABLE></div></div>';
  359.  
  360. var bpCopyrightPrelim = 
  361.     '\r<BR><CENTER><P STYLE="width:100%;position:relative;float:left;clear:left;"><b>' + L_CopyrightPrelim_Text + '</b></P></CENTER>';
  362.  
  363. var bpCopyrightFinal = 
  364.     '\r<CENTER><P STYLE="width:100%;position:relative;float:left;clear:left;"><A HREF="'
  365.     + bpCopyrightLink
  366.     +'">'
  367.     + L_CopyrightFinal_Text
  368.     + '</A></P></CENTER>'
  369.     + '<H4><A NAME="feedback"></A></H4><SPAN id="fb"></SPAN>';
  370.  
  371.  
  372. // END SECTION: HTML DEFINITIONS
  373.  
  374. // ***********************************
  375. // BEGIN SECTION: FUNCTION DEFINITIONS
  376. // ***********************************
  377.  
  378. //---Add linked file content.---
  379.  
  380.  
  381. function displayLinkedDocument2(){
  382.     var theLinkHREF;
  383.     //--Get content of all linked files.--
  384.     LinkedFileNum = 1;
  385.     theLinkHREF = document.all['linkedFile1'].all.tags('A')(0).href.toLowerCase();
  386.     LinkedObjectReload(theLinkHREF);
  387.     }
  388.  
  389. function LinkedObjectReload(theLinkHREF)
  390. {
  391.     if (document.all['Scriptlet'] != null) 
  392.     {
  393.         document.all['Scriptlet'].outerHTML = '';
  394.     }
  395.     // ---Build and insert linked file object.---
  396.     var sObjectText = '<OBJECT ID="Scriptlet'
  397.         +'" STYLE="display:none;" TYPE="text/x-scriptlet" DATA="'
  398.         +theLinkHREF
  399.         +'"></OBJECT>';
  400.     document.body.insertAdjacentHTML('beforeEnd', sObjectText);
  401.     intervalID = window.setInterval(checkReadyState,10);
  402. }
  403.  
  404. function checkReadyState() 
  405. {
  406.     if (document.all['Scriptlet'].object.readyState == 4) 
  407.     {
  408.         window.clearInterval(intervalID);
  409.         Scriptlet_onreadystatechange();
  410.     }
  411. }
  412.  
  413. function Scriptlet_onreadystatechange()
  414. {
  415.     //---Check to see if the document has been loaded. If not, exit.--
  416.     if (document.all['Scriptlet'].readyState == 4)
  417.     {
  418.     //---Variables.---
  419.     var aaa = "";
  420.     var sss = "";
  421.     b = LinkedFileNum;
  422.     var ItsIt = 'linkedFile' + b;
  423.     var theSpot = 'Scriptlet';
  424.     var objnum = 'hhobj_' + b + '0';
  425.     var seeme;
  426.     href = document.all[ItsIt].all.tags('A')(0).href.toLowerCase();
  427.     seeme = document.all[theSpot].object.innerHTML;
  428.     
  429.     if (seeme == null)
  430.     {
  431.     seeme = '';
  432.     }
  433.     
  434.     //--Remove "ends" from linked file.---
  435.     var bbb = seeme.indexOf('<A name');
  436.     var ccc= (seeme.lastIndexOf('<!--END-->'));
  437.     if ((bbb != -1) && (ccc != -1))
  438.     {
  439.         var aaa = seeme.substring((bbb-4), ccc);
  440.     }
  441.  
  442.     //Fix any ALinks present in the linked file.
  443.     //---Get the ALink information.---
  444.     var ppp = seeme.indexOf('hhobj_');
  445.     if (ppp != -1) 
  446.     {
  447.         var qqq = seeme.lastIndexOf('<DIV',ppp);
  448.         var rrr = seeme.indexOf('</DIV>',qqq);
  449.         var sss = seeme.substring(qqq,(rrr+6));
  450.  
  451.         //--Get AName of current document, and deactivate AName links.--
  452.         var temp1 = document.body.innerHTML;
  453.         var temp2 = temp1.toLowerCase().indexOf('<a name=') + 8;
  454.         var temp3 = temp1.toLowerCase().indexOf('</a>',temp2) - 1;
  455.         var theAName = temp1.substring(temp2,temp3);
  456.         var ttt = sss.indexOf(theAName);
  457.         if (ttt != -1)
  458.         {
  459.             var uuu = sss.lastIndexOf('hhobj_',ttt);
  460.             var vvv = sss.substring(uuu,(uuu + 8));
  461.             if (vvv.substring(7) == " ") 
  462.             {
  463.                 vvv = vvv.substring(0,7);
  464.             }
  465.             var www = aaa.indexOf(vvv);
  466.             var xxx = aaa.lastIndexOf('<A href',www);
  467.             var yyy = aaa.indexOf('>',xxx);
  468.             var zzz = aaa.indexOf('</A>',xxx);
  469.             aaa = aaa.substring(0,xxx)
  470.                 + aaa.substring((yyy + 1),(zzz + 2))
  471.                 + aaa.substring((zzz + 6),aaa.length);
  472.         }
  473.     }
  474.             
  475.     //---Add .chm name to .htm HREF links.---
  476.     var aaaa = aaa.indexOf(".htm");
  477.     if (aaaa != -1)
  478.     {
  479.         theCHM = document.all[theSpot].getAttribute('DATA');
  480.         theCHM = theCHM.substring(0,(theCHM.indexOf('/') + 1));
  481.         aaa = aaa.replace(/"([^M].{5,25}\.htm")/gi,'"MS-ITS:' + theCHM + "$1");
  482.         aaa = aaa.replace(/MS-ITS:MS-ITS:/gi,'MS-ITS:');
  483.     }
  484.     
  485.     
  486.     //---Insert HTML.---
  487.     seeme = sss + aaa;
  488.     seeme = seeme.replace(/hhobj_/gi,objnum);
  489.     var theDocument = document.all[ItsIt];
  490.     theDocument.innerHTML = seeme;
  491.     LiNker = false;
  492.     
  493.     //---Call next linked file.---
  494.     incrementLinkedFileNum();
  495.     }
  496. }
  497.  
  498. function incrementLinkedFileNum()
  499. {
  500.     LinkedFileNum++;
  501.     if (LinkedFileNum >= linkedFileID) 
  502.     {
  503.         return;
  504.     }
  505.     else 
  506.     {
  507.         b = LinkedFileNum;
  508.         var ItsIt = 'linkedFile' + b;
  509.         href = document.all[ItsIt].all.tags('A')(0).href.toLowerCase();
  510.         LinkedObjectReload(href);
  511.     }
  512. }
  513.  
  514. // =====window.onload=====
  515. function window_onload()
  516. {
  517.     WindowIsLoading = 1;
  518.     if (InsertBoilerplateText == true) {InsertBoilerplate();}
  519.     ProcessSPANTags();    // linked file objects created here
  520.     ProcessATags();
  521.     ProcessDIVTags();
  522.     ProcessPTags();
  523.     ProcessPopups();
  524.     if ((IE4) && (LiNker)) {displayLinkedDocument2();}
  525.     WindowIsLoading = 0;
  526. }
  527.  
  528.     function InsertBoilerplate()
  529.     {
  530.     if (document.all['StartOfFile'] != null)
  531.         {
  532.         theTitle = document.all['StartOfFile'].innerHTML;
  533.         document.all['StartOfFile'].outerHTML = 
  534.             bpTopOfFile1 + theTitle + bpTopOfFile2;
  535.         }
  536.     if (document.all['EndOfFile'] != null)
  537.         {
  538.         if (bpPreliminary_Switch == 1) 
  539.             {bpCopyrightAll = bpCopyrightPrelim + bpCopyrightFinal;}
  540.         else 
  541.             {bpCopyrightAll = bpCopyrightFinal;}
  542.  
  543.         document.all['EndOfFile'].outerHTML = bpCopyrightAll;
  544.         }
  545.     }
  546.  
  547.     function ProcessSPANTags()
  548.     {
  549.         inCr = 0;
  550.         var colln = document.all.tags('SPAN');    // SPAN tags
  551.         var i,imax = colln.length;
  552.         var theIdIs;                // 'ScriptletX'
  553.         var href;                // target A tag
  554.         for (var i=0; i<imax; i++)
  555.         {
  556.             if (colln[i].id.indexOf('linkedFile') < 0)
  557.                 continue;    // skip to next element
  558.             
  559.             inCr++;    
  560.         
  561.             // --Grab the proper href (xxx.htm).---
  562.             href = colln[i].all.tags('A')(0).href.toLowerCase();
  563.  
  564.             colln[i].outerHTML =
  565.                 '<SPAN ID="linkedFile'
  566.                 +inCr
  567.                 +'" CLASS="linkedfile"></SPAN>';
  568.  
  569.             colln[i].innerHTML =
  570.                 '<A HREF="' + href
  571.                 +'" STYLE="display:none"></A>';
  572.  
  573.         }
  574.         LiNker = (inCr > 0);
  575.         linkedFileID = inCr + 1;
  576.     }
  577.  
  578.     function ProcessATags()
  579.     {
  580.         var colln = document.all.tags('A');
  581.         var tmp;
  582.         for (var i=0; i<colln.length; i++)
  583.         {
  584.             tmp = colln[i].id;
  585.             if      (tmp.indexOf('ThumbNail'        ) > -1)    ProcessATags_Thumbnail        (colln[i]);
  586.             else if (tmp.indexOf('PopUp'            ) > -1)    ProcessATags_Glossary        (colln[i]);
  587.             else if (tmp.indexOf('ExPand'            ) > -1)    ProcessATags_Expand            (colln[i]);
  588.         }
  589.     }
  590.         function ProcessATags_Thumbnail(e,floatdir)
  591.         {
  592.             var sThumbnailImg = e.href.toLowerCase();
  593.             var sAltText = e.title;
  594.             sThumbnailImg = get_TheUrL(sThumbnailImg);
  595.             e.innerHTML =
  596.                 '<IMG CLASS="thumbnail" SRC="'
  597.                 +moniker
  598.                 +sThumbnailImg
  599.                 +'" VSPACE="4" ALT="'
  600.                 +sAltText
  601.                 +'"><BR>'
  602.                 +L_GraphicClickText_Text
  603.                 +'<BR>';
  604.             e.outerHTML =
  605.                 '<DIV CLASS="thumbnail" STYLE="'
  606.                 +floatdir
  607.                 +'" >'
  608.                 +e.outerHTML
  609.                 +'</DIV>';
  610.         }
  611.         function ProcessATags_Glossary(e)
  612.         {
  613.             e.title = L_GlossaryAlt_ToolTip;
  614.             if (InlineImgOn)
  615.                 e.innerHTML = glossInitial + e.innerHTML;    // write glossary .gifs
  616.         }
  617.         function ProcessATags_Expand(e)
  618.         {
  619.             e.title = L_ExpandCollapseAlt_ToolTip;
  620.             if (InlineImgOn)
  621.                 e.innerHTML = initialClosed + e.innerHTML;    // write expand gifs
  622.         }
  623.  
  624.     function ProcessDIVTags()
  625.     {    
  626.         var colln = document.all.tags('DIV');
  627.         var tmp,cls,contents;
  628.         for (var i=0; i<colln.length; i++)
  629.         {
  630.             tmp = colln[i].id;
  631.  
  632.                 // Display any text automatically highlighted by HTML Help Search:
  633.                 cls = colln[i].className.toLowerCase();
  634.                 if    (  (cls == 'expand' )
  635.                     || (cls == 'expand1')
  636.                     || (cls == 'expand2')
  637.                     || (cls == 'expand3') )
  638.                 {
  639.                     contents = colln[i].innerHTML;
  640.                     if (   (contents.indexOf('<FONT'            ) > -1)
  641.                         && (contents.indexOf('BACKGROUND-COLOR:') > -1) )
  642.                         colln[i].style.display = 'block';
  643.                 }
  644.                     
  645.         }
  646.     }
  647.  
  648.     function ProcessPTags()
  649.     {
  650.         var bIsRTL = document.dir.toLowerCase() == 'rtl';
  651.         var s1 = '<P '+( (bIsRTL)?L_NotesRTL_Style:L_NotesLTR_Style )+'>';
  652.         var s2 = '</P>';
  653.  
  654.         var colln = document.all.tags('P');
  655.         var e;
  656.         for (var i=0; i<colln.length; i++)
  657.         {
  658.             e = colln[i];
  659.             switch(e.id)
  660.             {
  661.                 case 'Alert_Caution'    : e.outerHTML = cautionImg   + s1 + e.innerHTML + s2; break;
  662.                 case 'Alert_Important'    : e.outerHTML = importantImg + s1 + e.innerHTML + s2; break;
  663.                 case 'Alert_Note'        : e.outerHTML = noteImg      + s1 + e.innerHTML + s2; break;
  664.                 case 'Alert_Warning'    : e.outerHTML = warningImg   + s1 + e.innerHTML + s2; break;
  665.             }
  666.         }
  667.     }
  668.  
  669.     function ProcessPopups()
  670.     {
  671.         var bIsPopup = ( (IE4) && (document.all.item('LinKs')    != null) );
  672.         var sA;
  673.  
  674.         if (bIsPopup)                                    
  675.         {
  676.             ReltopicS = LinKs.innerHTML;
  677.             sA = '<A HREF="#" ID="InnerNav" TITLE="' + L_RelTopAlt_AlternativeText+'">' + InnerNavInitial + '</A>';
  678.         }
  679.         else                                        
  680.         {
  681.             sA = RelPopSpacerGif;
  682.         }
  683.         
  684.         if (document.all['TiTLE'] != null)
  685.         {
  686.         TiTLE.outerHTML = sA +TiTLE.innerHTML;
  687.         }
  688.         
  689.         if (IE4)            // Insert popup boxes into the document
  690.         {
  691.             document.body.insertAdjacentHTML('beforeEnd', popupDIV);
  692.             document.body.insertAdjacentHTML('beforeEnd', RelPopupDiV);
  693.         }
  694.     }
  695.  
  696. // ----------------------------
  697. // ---Start of dynamic code.---
  698. // ----------------------------
  699.  
  700. //---window.onmouseover---
  701. // ONMOUSE-OVER ////////////////////////////////////////////////////
  702. function document_onmouseover()
  703. {
  704.     if (WindowIsLoading == 1) {return;}
  705.     e = window.event.srcElement;
  706.     // +++
  707.     for (var a = 0; a < 5; a++)    // +++
  708.     {
  709.         if ((e.tagName != 'A') && (e.parentElement != null))
  710.             e = e.parentElement;
  711.         var eID = e.id;
  712.         
  713.         if (eID.indexOf('ExPand') != -1)                            // Expand/Collapse
  714.         {
  715.             if (InlineImgOn)
  716.             {
  717.                 e.style.color = _Hot;
  718.                 var theDiv = GrabtheExpandDiv(e);    // locate the div
  719.                 theImg = getImage(e);
  720.                 if (theImg != null){theImg.src = (theDiv.style.display == 'block')?expandHot:closedHot;}
  721.             }
  722.             else
  723.             {
  724.                 e.style.color = _Hot;
  725.                 e.style.textDecoration = 'underline';
  726.             }
  727.             break;
  728.         }
  729.         
  730.         else if ( (eID.indexOf('PopUp') != -1) && (theTagIndex != e.sourceIndex) )        // Glossary (no action if already clicked)
  731.         {
  732.             e.style.color = _Hot;
  733.             e.style.textDecoration = 'underline';
  734.             break;
  735.         }
  736.         
  737.         else if ( (eID.indexOf('InnerNav') != -1) && (theTagIndex2 != e.sourceIndex) )    // RelTopic (no action if already clicked)
  738.         {
  739.             theImg = getImage(e);
  740.             if (theImg != null){theImg.src = InnerNavHot;}
  741.             break;
  742.         }
  743.  
  744.         if (e.id.indexOf('IconFB') != -1)
  745.         {
  746.             document.all('feedb').src = IconFBHot;
  747.         }
  748.  
  749.         if (e.id.indexOf('IconKB') != -1)
  750.         {
  751.             document.all('keysho').src = IconKBHot;
  752.         }    
  753.     }
  754. }
  755.  
  756. // ONMOUSE-OUT /////////////////////////////////////////////////////
  757. function document_onmouseout()
  758. {
  759.     if (WindowIsLoading == 1) {return;}
  760.     e = window.event.srcElement;
  761.  
  762.     // +++
  763.     
  764.     for (var a = 0; a < 5; a++)        // +++
  765.     {
  766.         if ((e.tagName != 'A') && (e.parentElement != null))
  767.             e = e.parentElement;
  768.         var eID = e.id;
  769.  
  770.         
  771.         // Expand/Collapse:
  772.         if (eID.indexOf('ExPand') != -1)
  773.         {
  774.             if (InlineImgOn)
  775.             {
  776.                 e.style.color = _Cold;
  777.                 var theDiv = GrabtheExpandDiv(e);    // locate the div
  778.                 theImg = getImage(e);
  779.                 if (theImg != null){theImg.src = (theDiv.style.display == 'block')?expand:closed;}
  780.             }
  781.             else
  782.             {
  783.                 e.style.color = _Cold;
  784.                 e.style.textDecoration = 'none';
  785.             }
  786.             break;
  787.         }
  788.         
  789.         // Glossary: ("doesn't send if glossary term clicked and rolled over")
  790.         else if ( (eID.indexOf('PopUp')!= -1) && (theTagIndex != e.sourceIndex) )
  791.         {
  792.             e.style.color = _Cold;
  793.             e.style.textDecoration = 'none';
  794.             break;
  795.         }
  796.         
  797.         // Related Topic Link: ("doesn't send if reltopic icon clicked and rolled over")
  798.         else if ( (eID.indexOf('InnerNav') != -1) && (theTagIndex2 != e.sourceIndex) )
  799.         {
  800.             theImg = getImage(e);
  801.             if (theImg != null){theImg.src = InnerNavCold;}
  802.             break;
  803.         }
  804.         if (e.id.indexOf('IconFB') != -1)
  805.         {
  806.             document.all('feedb').src = IconFBCold;
  807.         }
  808.  
  809.         if (e.id.indexOf('IconKB') != -1)
  810.         {
  811.         document.all('keysho').src = IconKBCold;
  812.         }    
  813.     }
  814. }
  815.  
  816. // ONCLICK /////////////////////////////////////////////////////////
  817. function document_onclick()
  818. {
  819.     if (WindowIsLoading == 1) {return;}
  820.     e = window.event.srcElement;
  821.     var relPopupVisible = 0;
  822.     
  823.     // Hide any open popups:
  824.     if (document.all.RelpopUpWindow.style.visibility == 'visible')
  825.     {
  826.         relPopupVisible = 1;
  827.     }
  828.     document.all.RelpopUpWindow.style.visibility = 'hidden';
  829.     document.all.popUpWindow.style.visibility = 'hidden';
  830.     
  831.     // Reset popup state variables (used in onresize)
  832.     WindowOne = false;        // popup
  833.     WindowTwo = false;        // innernav
  834.     
  835.     // Reset glossary popup state variables
  836.     popOpen        = false;    // is a Glossary popup visible
  837.     PopUp_InAPopUp    = false;    // user clicks a see-also term
  838.     AnotherCheck    = false;    // inline gifs are off and HTMLHelp added html
  839.  
  840.     // +++
  841.     for (var a = 0; a < 5; a++)        // +++
  842.     {
  843.         if ( (e.tagName != 'A') && (e.parentElement != null) )
  844.             e = e.parentElement;
  845.         eID = e.id;
  846.         
  847.         // ("XML code allows TDC to coexist because of this")
  848.         xmlTermRoot = '';
  849.         if (e.hash != null)
  850.             xmlTermRoot = e.hash;
  851.         
  852.         // Variables to control click color of glossary link text:
  853.         if (  checkIt2  &&  ( (eID.indexOf('PopUp') == -1) || (eID.indexOf('In_PopuP') == -1) )  )
  854.         {
  855.             var changeBack = document.all(theTagIndex);
  856.             changeBack.style.color = _Cold;
  857.             changeBack.style.textDecoration = 'none';
  858.             theTagIndex = false;
  859.             checkIt2 = false;
  860.         }
  861.  
  862.         // Variables to control click color of related topics icon:
  863.         if (  checkIt  &&  (theTagIndex2 != -1)  &&  (eID.indexOf('InnerNav') == -1)  )
  864.         {
  865.             theImg = getImage2(theTagIndex2);
  866.             if (theImg != null){theImg.src = InnerNavCold;}
  867.             theTagIndex2 = false;
  868.             checkIt = false;
  869.         }
  870.  
  871.         if (e.id.indexOf('IconFB') != -1)
  872.         {
  873.             document.all('feedb').src = IconFBClick;
  874.         }
  875.  
  876.         if (e.id.indexOf('IconKB') != -1)
  877.         {
  878.             document.all('keysho').src = IconKBClick;
  879.         }
  880.  
  881.         if      (eID.indexOf('ThumbNail') != -1)    {    callThumbnail(e);            break;    }        // Thumbnail
  882.         else if (eID.indexOf('ExPand') != -1)        {    callExpand(e,InlineImgOn);    break;    }        // Expand/Collapse
  883.  
  884.         if (eID.indexOf('InnerNav') != -1)                    // reltopic
  885.         {
  886.             lastClickedPopUp = e;    // used by onresize()
  887.             WindowTwo = true;
  888.             checkIt = true;
  889.             theTagIndex2 = e.sourceIndex;
  890.             theImg = getImage2(theTagIndex2);
  891.             if (theImg != null){theImg.src = InnerNavClick;}
  892.         
  893.             if (relPopupVisible == 1)
  894.             {
  895.                 document.all.RelpopUpWindow.style.visibility = 'hidden';
  896.                 if (theImg != null){theImg.src = InnerNavCold;}
  897.             }
  898.             else
  899.             {
  900.                 callRelatedTopicS(e);
  901.             }
  902.             break;
  903.         }
  904.  
  905.         else if (eID.indexOf('PopUp') != -1)                // glossary
  906.         {
  907.             lastClickedPopUp = e;            // used by onresize()
  908.             WindowOne = true;
  909.  
  910.             // Set variables to control click color of glossary link text:
  911.             checkIt2 = true;
  912.             theTagIndex = true;
  913.             theTagIndex = e.sourceIndex;
  914.             AnotherTagIndex = parseInt(theTagIndex);
  915.             e.style.color = _Click;
  916.             //e.style.textDecoration = 'underline';
  917.  
  918.             WorkText = e.innerHTML;            // Capture the html containing the term
  919.  
  920.             var bAddedHTML = WorkText.indexOf('BACKGROUND-COLOR:') != -1;    // has HTMLHelp added html
  921.             if (InlineImgOn)    // if glossary image is on
  922.             {
  923.                 if (bAddedHTML)
  924.                     GetTheRealTerm();
  925.                 else
  926.                     GetTheRealTerm2();
  927.             }
  928.             else                // if no image on
  929.             {
  930.                 if (bAddedHTML)                                                // has HTMLHelp added html
  931.                 {
  932.                     AnotherCheck = true;
  933.                     GetTheRealTerm();
  934.                 }
  935.                 else
  936.                     TermDef = e.innerHTML;
  937.             }
  938.  
  939.             // Now perform the term lookup:
  940.             callGlossary(e, TermDef);
  941.             break;
  942.         }
  943.  
  944.         else if (eID.indexOf('In_PopuP') != -1)                    // Glossary SEE ALSO
  945.         {
  946.             // Set variables to control click color of glossary link text:
  947.             checkIt2 = true;
  948.             theTagIndex = parseInt(AnotherTagIndex);
  949.             var changeBack = document.all(theTagIndex);
  950.             changeBack.style.color = _Click;
  951.             //changeBack.style.textDecoration = 'underline';
  952.  
  953.             // Set a state variable and perform the term lookup:
  954.             PopUp_InAPopUp = true;
  955.             TermDef = e.innerHTML;
  956.             callGlossary(e, TermDef);
  957.             break;
  958.         }
  959.     }
  960. }
  961.  
  962. // ONKEYPRESS //////////////////////////////////////////////////////
  963. function document_onkeypress()
  964. {
  965.     if (WindowIsLoading == 1) {return;}
  966.     if (window.event.keyCode == 27)
  967.     {
  968.         document.all.popUpWindow.style.visibility = 'hidden';
  969.         popOpen = false;    // state variable
  970.     }
  971.     if (window.event.keyCode == 6)
  972.     {
  973.         window.focus();
  974.         window.location = "#Feedback";
  975.         EMailStream(fb);
  976.     }    
  977.     if (window.event.keyCode == 11)
  978.     {
  979.         window.focus();
  980.         window.location = bpKeyboardShortcutLink;
  981.     }
  982.     if (window.event.keyCode == 19)
  983.     {
  984.         window.focus();
  985.         if (document.all.RelpopUpWindow.style.visibility == 'visible')
  986.         {
  987.         document.all.RelpopUpWindow.style.visibility = 'hidden';
  988.         document.all.tags('IMG')[2].src = InnerNavCold;
  989.         }
  990.         else
  991.         {    
  992.             document.all.tags('IMG')[2].click();
  993.         }
  994.  
  995.     }
  996. }
  997.  
  998. // ONRESIZE ////////////////////////////////////////////////////////
  999. function window_onresize()
  1000. {
  1001.     if (WindowIsLoading == 1) {return;}
  1002.      // Pre-shortcut code...
  1003.      if(lastClickedPopUp)
  1004.      {
  1005.          var nClientWidth = document.body.clientWidth;
  1006.          var nPopupWidth  = popUpWindow.style.pixelWidth;
  1007.          var nLeft;        // popUpWindow.style.pixelLeft
  1008.          var nTop;        // popUpWindow.style.pixelTop
  1009.         
  1010.         if (WindowOne)                            // glossary popups
  1011.         {
  1012.             if (lastClickedPopUp.offsetParent.tagName.toLowerCase() == 'body')
  1013.             {
  1014.                 if((nPopupWidth + lastClickedPopUp.offsetLeft) <= nClientWidth)
  1015.                     nLeft = lastClickedPopUp.offsetLeft;
  1016.                 else
  1017.                     nLeft = ((nClientWidth - 10) > nPopupWidth)?(nClientWidth - nPopupWidth):10;
  1018.                 nTop = lastClickedPopUp.offsetTop + lastClickedPopUp.offsetHeight + 1;
  1019.             }
  1020.             else if (lastClickedPopUp.offsetParent.offsetParent.tagName.toLowerCase() == 'body')
  1021.             {
  1022.                 if((nPopupWidth + lastClickedPopUp.offsetLeft + lastClickedPopUp.offsetParent.offsetLeft) <= nClientWidth)
  1023.                     nLeft = lastClickedPopUp.offsetLeft + lastClickedPopUp.offsetParent.offsetLeft;
  1024.                 else
  1025.                     nLeft = ((nClientWidth - 10) > nPopupWidth)?(nClientWidth - nPopupWidth):10;
  1026.                 nTop = lastClickedPopUp.offsetHeight + lastClickedPopUp.offsetTop + 1 + lastClickedPopUp.offsetParent.offsetTop;
  1027.             }
  1028.             else if (lastClickedPopUp.offsetParent.offsetParent.offsetParent.tagName.toLowerCase() == 'body')
  1029.             {
  1030.                 if((nPopupWidth + lastClickedPopUp.offsetLeft + lastClickedPopUp.offsetParent.offsetLeft + lastClickedPopUp.offsetParent.offsetParent.offsetLeft) <= nClientWidth)
  1031.                     nLeft = lastClickedPopUp.offsetLeft + lastClickedPopUp.offsetParent.offsetLeft + lastClickedPopUp.offsetParent.offsetParent.offsetLeft;
  1032.                 else
  1033.                     nLeft = ((nClientWidth - 10) > nPopupWidth)?(nClientWidth - nPopupWidth):10;
  1034.                 nTop = lastClickedPopUp.offsetHeight + lastClickedPopUp.offsetTop + 1 + lastClickedPopUp.offsetParent.offsetTop + lastClickedPopUp.offsetParent.offsetParent.offsetTop;
  1035.             }
  1036.             else
  1037.             {
  1038.                 if ((popUpWindow.style.pixelLeft + nPopupWidth) > document.body.clientWidth)
  1039.                     nLeft = document.body.clientWidth - nPopupWidth;
  1040.                 if ((popUpWindow.style.pixelTop + popUpWindow.style.pixelHeight) > document.body.clientHeight)
  1041.                     nTop = document.body.clientHeight - popUpWindow.style.pixelHeight;
  1042.             }
  1043.             if (nLeft != null)
  1044.                 popUpWindow.style.pixelLeft = nLeft;        // popUpWindow.style.pixelLeft
  1045.             if (nTop != null)
  1046.                 popUpWindow.style.pixelTop  = nTop;            // popUpWindow.style.pixelTop
  1047.         }
  1048.         
  1049.         // Related Topics popups
  1050.         else if (WindowTwo)
  1051.         {
  1052.             RelpopUpWindow.style.pixelLeft = (document.dir=='rtl')
  1053.                                                 ?10
  1054.                                                 :nClientWidth - RelpopUpWindow.style.pixelWidth - 10;
  1055.             RelpopUpWindow.style.pixelTop = ((lastClickedPopUp.offsetTop) + (lastClickedPopUp.offsetHeight) + (1));
  1056.         }
  1057.     }
  1058. }
  1059.  
  1060. // parse the popup term (IF WorkText.indexOf('BACKGROUND-COLOR:') != -1)
  1061. function GetTheRealTerm()
  1062. {
  1063.     var c;
  1064.     var d = '</FONT>';
  1065.     var f = WorkText;
  1066.     if (!AnotherCheck)    // in this case we don't need to remove images (inline images are off)
  1067.     {                    // AnotherCheck = false when inline gifs are off and HTMLHelp added html
  1068.         c = f.indexOf('width=12>');
  1069.         if (c == -1)
  1070.             return;
  1071.         f = f.substring((c+9),f.length);
  1072.     }
  1073.     f = f.replace(d,'');    // remove all but the term and the HTML from HTMLHelp
  1074.     
  1075.     // this removes HTML added by HTMLHelp, leaving the term
  1076.     var g = f.indexOf('<');
  1077.     var h = f.indexOf('>');
  1078.     if ( (g == -1) || (h == -1) )
  1079.         return;
  1080.     var i = f.substring(g,(h+1));
  1081.     f = f.replace(i,'');
  1082.     TermDef = f;
  1083.     return TermDef;
  1084. }
  1085.  
  1086. // parse the popup term when HTMLHelp has not added HTML (IF *NOT* WorkText.indexOf('BACKGROUND-COLOR:') != -1)
  1087. function GetTheRealTerm2()
  1088. {
  1089.     var c = WorkText.lastIndexOf('width=12>');
  1090.     if (c == -1)
  1091.         return;
  1092.     else
  1093.         TermDef = WorkText.substring((c+9),WorkText.length);
  1094.     return TermDef;
  1095. }
  1096.  
  1097. // FIND AREA TO EXPAND/COLLAPSE
  1098. function GrabtheExpandDiv(e)
  1099. {
  1100.     var theExpandDiv, sTagName, sClassName;
  1101.     for (var a = 0; a < 5; a++)    // +++
  1102.     {
  1103.         var theTag = e.sourceIndex + e.children.length + a;
  1104.         theExpandDiv = document.all(theTag);
  1105.         sTagName   = theExpandDiv.tagName;
  1106.         sClassName = theExpandDiv.className.toLowerCase();
  1107.         if 
  1108.         (
  1109.             ( (
  1110.                        (sTagName == 'DIV')
  1111.                     || (sTagName == 'SPAN')
  1112.                 ) && (
  1113.                        (sClassName == 'expand')
  1114.                     || (sClassName == 'expand1')
  1115.                     || (sClassName == 'expand2')
  1116.                     || (sClassName == 'expand3')
  1117.             ) ) || theTag == document.all.length
  1118.         )
  1119.             break;
  1120.     }
  1121.     return theExpandDiv;
  1122. }
  1123.  
  1124. // rollovers and Expand getImage
  1125. function getImage(e)
  1126. {
  1127.     var ee = e;
  1128.     for (var a = 0; a < 5; a++)        // +++
  1129.     {
  1130.         if ((ee.tagName != 'A') && (ee.parentElement != null))
  1131.             ee = ee.parentElement;
  1132.         if(ee.tagName == 'A')
  1133.             return ee.all.tags('IMG')(0);
  1134.     }
  1135.     return ee;        // +++
  1136. }
  1137.  
  1138. // handles gray state of Related Topic and Glossary popups
  1139. function getImage2()    // +++
  1140. {
  1141.     // +++
  1142.     var TheSpot;
  1143.     if ((checkIt) && (theTagIndex2 != -1))            // if Related Topic
  1144.         TheSpot = document.all(theTagIndex2);
  1145.     else if ((checkIt2) && (theTagIndex != -1))        // if Glossary
  1146.         TheSpot = document.all(theTagIndex);
  1147.     else
  1148.         return;
  1149.     
  1150.     for (var a = 0; a < 5; a++)        // +++
  1151.     {
  1152.         if ((TheSpot.tagName != 'A') && (TheSpot.parentElement != null))
  1153.             TheSpot = TheSpot.parentElement;
  1154.         if(TheSpot.tagName == 'A')
  1155.             return TheSpot.all.tags('IMG')(0);
  1156.     }
  1157.     return TheSpot;        // +++
  1158. }
  1159.  
  1160. // call the Thumbnail window
  1161. function callThumbnail()
  1162. {
  1163.     event.returnValue = false;                        // kill event
  1164.     
  1165.     var eH = e.href.toLowerCase();
  1166.     sParamFILE = get_TheUrL(eH);
  1167.     sParamFILE = CHMRef + sParamFILE;
  1168.     
  1169.     if (document.hhThumbnail)                        // if exists, delete
  1170.         document.hhThumbnail.outerHTML = '';
  1171.     
  1172.     var h =
  1173.         '<OBJECT ID="hhThumbnail" '
  1174.         +ActX
  1175.         +' STYLE="display:none"><PARAM NAME="Command" VALUE="Related Topics">'
  1176.         +'VALUE="<PARAM NAME="Item1" VALUE="$global_largeart;'
  1177.         +moniker
  1178.         +sParamFILE
  1179.         +'"></OBJECT>';
  1180.     
  1181.     document.body.insertAdjacentHTML('beforeEnd', h);    // create and activate
  1182.     document.hhThumbnail.hhclick();
  1183. }
  1184.  
  1185. // designed to get the URL out of 'funky'-style HREF fields
  1186. function get_TheUrL(sHREF)
  1187. {
  1188.     var spaces = /\s/g;
  1189.     var eH = unescape(sHREF);
  1190.     eH    = eH.replace(spaces,'');
  1191.     eH_    = eH.toLowerCase(); // added
  1192.     
  1193.     var sParamFILE = '';
  1194.     var sParamCHM  = '';
  1195.     
  1196.     var iFILE = eH_.lastIndexOf('file=');
  1197.     if (iFILE != -1)
  1198.         sParamFILE = eH.substring(iFILE+5, eH.length);
  1199.     
  1200.     var iCHM = eH_.lastIndexOf('chm=');
  1201.     if (iCHM != -1)
  1202.     {
  1203.         sParamCHM = eH.substring(iCHM+4, iFILE) + "::/";
  1204.         sParamFILE= sParamCHM + sParamFILE;
  1205.     }
  1206.     return sParamFILE;
  1207. }
  1208.  
  1209. // call Related Topics popup
  1210. function callRelatedTopicS()
  1211. {
  1212.     event.returnValue = false;                                    // kill event
  1213.     document.all.RelpopUpWindow.innerHTML      = L_RelTopHeader_Text + ReltopicS;
  1214.     document.all.RelpopUpWindow.style.fontSize = L_RelPopFontSize_Style;
  1215.     document.all.RelpopUpWindow.style.left = (document.dir == 'rtl')
  1216.                                                 ?10
  1217.                                                 :(bpRelTopicsPopupX);
  1218.     document.all.RelpopUpWindow.style.top = document.all.InnerNav.offsetTop + document.all.InnerNav.offsetHeight + 4;
  1219.     document.all.RelpopUpWindow.style.visibility = 'visible';
  1220. //document.body.clientWidth - RelpopUpWindow.style.pixelWidth - 10
  1221.  
  1222. }
  1223.  
  1224. // call Glossary popup
  1225. function callGlossary()
  1226. {
  1227.     event.returnValue = false;                            // kill event
  1228.     
  1229.     // set XY popup coordinates
  1230.     if (PopUp_InAPopUp)
  1231.     {
  1232.         ieX = document.all.popUpWindow.style.left;
  1233.         ieY = document.all.popUpWindow.style.top;
  1234.     }
  1235.     else
  1236.     {
  1237.         if (e.offsetParent.tagName.toLowerCase() == 'body')
  1238.         {
  1239.             ieX = e.offsetLeft;
  1240.             ieY = e.offsetTop + e.offsetHeight + 1;
  1241.         }
  1242.         else if (e.offsetParent.offsetParent.tagName.toLowerCase() == 'body')
  1243.         {
  1244.             ieX = e.offsetLeft + e.offsetParent.offsetLeft;
  1245.             ieY = e.offsetHeight + e.offsetTop + e.offsetParent.offsetTop + 1;
  1246.         }
  1247.         else if (e.offsetParent.offsetParent.offsetParent.tagName.toLowerCase() == 'body')
  1248.         {
  1249.             ieX = e.offsetLeft + e.offsetParent.offsetLeft + e.offsetParent.offsetParent.offsetLeft;
  1250.             ieY = e.offsetHeight + e.offsetTop + e.offsetParent.offsetTop + e.offsetParent.offsetParent.offsetTop + 1;
  1251.         }
  1252.         else
  1253.         {
  1254.             ieX = window.event.clientX;
  1255.             ieY = window.event.clientY + document.body.scrollTop;
  1256.         }
  1257.     }
  1258.     
  1259.     // if a popup window is open, pause then reissue function call
  1260.     if (popOpen)
  1261.         window.setTimeout('callGlossary()', 50);
  1262.     
  1263.     if (noPopups)    // if not IE4+
  1264.     {
  1265.         alert (L_BrowserAlert_Message);
  1266.         noPopups = false;
  1267.         return;
  1268.     }
  1269.     
  1270.     // if no popup open, proceed to display popup...
  1271.     if (IE4 && !popOpen)
  1272.         iePopup();
  1273. }
  1274.  
  1275. // build the popup window
  1276. function iePopup()
  1277. {
  1278.     // adjust if the popup will be offscreen
  1279.     var rightlimit = ieX + document.all.popUpWindow.offsetWidth;
  1280.     if (rightlimit >= document.body.clientWidth)
  1281.         ieX -= (rightlimit - document.body.clientWidth);
  1282.     
  1283.     // set and position popup
  1284.     document.all.popUpWindow.innerHTML    = '';
  1285.     document.all.popUpWindow.style.height = 0;
  1286.     
  1287.     if (xmlGloss)    // if glossary is in XML control
  1288.     {
  1289.         document.all.popUpWindow.innerHTML = getXMLPopupContent(xmlTermRoot); // load formatted popup content or not found
  1290.                 
  1291.         // callback required to get popup height +++
  1292.         window.setTimeout ('iePopHeight()', 0);
  1293.         
  1294.         // set popup's XY coordinates
  1295.         document.all.popUpWindow.style.top  = ieY;
  1296.         document.all.popUpWindow.style.left = ieX;
  1297.         popOpen = true;        // state variable: popup is ready
  1298.         return (false);        // kill bubble
  1299.     }
  1300.     else            // else glossary is in TDC control
  1301.     {
  1302.         if (document.tdcGloss)                        // if TDC exists, delete
  1303.             document.tdcGloss.outerHTML = '';
  1304.         
  1305.         var h =
  1306.             '<OBJECT ID="tdcGloss" CLASSID="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83" VIEWASTEXT>'
  1307.             +'<PARAM NAME="DataURL" VALUE="'
  1308.             +BeforeReference
  1309.             +'Basics/gloss.txt"><PARAM NAME="UseHeader" VALUE="True">'
  1310.             +'<PARAM NAME="FieldDelim" VALUE=","><PARAM NAME="EscapeChar" VALUE="#"></OBJECT>';
  1311.         
  1312.         document.body.insertAdjacentHTML('beforeEnd', h);        // create TDC
  1313.         
  1314.         var RS = tdcGloss.recordset;
  1315.         RS.moveFirst();
  1316.         
  1317.         // default text when no term is found
  1318.         document.all.popUpWindow.innerHTML =
  1319.             '<H6 CLASS="GLOSSARY_ITEM">'
  1320.             +L_NoDefAlertTitle_Text
  1321.             +'</H6><P>'
  1322.             +L_NoDefAlert_Text
  1323.             +'</P>';
  1324.         
  1325.         while (!RS.EOF)
  1326.         {
  1327.             if (TermDef.toLowerCase() == RS.fields('Term').value.toLowerCase())        // if found, get def
  1328.             {
  1329.                 defContent = RS.fields('Definition').value;
  1330.             
  1331.                 if (RS.fields('SeeAlso').value)                // handle any See Also's
  1332.                     if (RS.fields('SeeAlso').value.indexOf('~') != -1)
  1333.                         ParseOtherDefs();
  1334.                     else
  1335.                         document.all.popUpWindow.innerHTML =
  1336.                             '<H6 CLASS="GLOSSARY_ITEM">'
  1337.                             +TermDef
  1338.                             +'</H6><P>'
  1339.                             +defContent
  1340.                             +'</P><P ID="OtherDefs"><B>See Also: </B><A ID="In_PopuP" HREF="#">'
  1341.                             +RS.fields('SeeAlso').value
  1342.                             +'</A></P>';
  1343.                 else
  1344.                     document.all.popUpWindow.innerHTML =
  1345.                         '<H6 CLASS="GLOSSARY_ITEM">'
  1346.                         +TermDef
  1347.                         +'</H6><P>'
  1348.                         +defContent
  1349.                         +'</P>';
  1350.                 break;
  1351.             }
  1352.             RS.moveNext();
  1353.         }
  1354.         // callback required to get popup height +++
  1355.         window.setTimeout ('iePopHeight()', 0);
  1356.  
  1357.         // set popup's XY coordinates
  1358.         document.all.popUpWindow.style.top = ieY;
  1359.         document.all.popUpWindow.style.left = ieX;
  1360.         popOpen = true;        // state variable: popup is ready
  1361.         return false;        // kill bubble
  1362.     }
  1363. }
  1364.  
  1365. // handle case of multiple See Also's in a TDC file (not used by XML glossary)
  1366. function ParseOtherDefs()
  1367. {
  1368.     var FstStop        =  0;
  1369.     var FstWrd        = '';
  1370.     var AimPnt        = tdcGloss.recordset.fields('SeeAlso').value;
  1371.     var DefsString    = '<B>See Also: </B>';
  1372.     
  1373.     while ( (FstStop = AimPnt.indexOf('~')) > -1)        // loop through each See Also, separated by tildes ('~')
  1374.     {
  1375.         FstWrd        = AimPnt.substring(0, FstStop);
  1376.         DefsString    =
  1377.             DefsString
  1378.             +'<A ID="In_PopuP" HREF="gloss_all.htm#def_'
  1379.             +FstWrd
  1380.             +'">'
  1381.             +FstWrd
  1382.             +'</a>, ';
  1383.         AimPnt = AimPnt.substring(FstStop + 1, AimPnt.length);
  1384.     }
  1385.     DefsString =
  1386.         DefsString
  1387.         +'<A ID="In_PopuP" HREF="gloss_all.htm#def_'
  1388.         +AimPnt
  1389.         +'">'
  1390.         +AimPnt
  1391.         +'</a>';
  1392.     document.all.popUpWindow.innerHTML =
  1393.         '<H6 CLASS="GLOSSARY_ITEM">'
  1394.         +TermDef
  1395.         +'</H6><P>'
  1396.         +defContent
  1397.         +'</P><P ID="OtherDefs">'
  1398.         +DefsString
  1399.         +'</P>';
  1400. }
  1401.  
  1402. // get popup height, nudge if necessary, and display popup
  1403. function iePopHeight()
  1404. {
  1405.     var pageBottom = document.body.scrollTop + document.body.clientHeight;
  1406.     var popHeight = document.all.popUpWindow.offsetHeight;
  1407.     document.all.popUpWindow.style.height = popHeight - 2 * (parseInt(document.all.popUpWindow.style.borderWidth));
  1408.     
  1409.     if (popHeight + ieY >= pageBottom)    // if popup longer than screen, move to top of screen
  1410.         document.all.popUpWindow.style.top = (popHeight <= pageBottom)?(pageBottom-popHeight):0;
  1411.     
  1412.     document.all.popUpWindow.style.visibility = 'visible';    // display popup
  1413. }
  1414.  
  1415. // show/hide Expand block
  1416. function callExpand(e,InlineImgOn)
  1417. {
  1418.     event.returnValue = false;            // kill bubble
  1419.     var theDiv = GrabtheExpandDiv(e);
  1420.     
  1421.     theDiv.style.display = (theDiv.style.display == 'block')?'none':'block';
  1422.     if (!InlineImgOn)
  1423.     {
  1424.         var theImg = getImage(e);
  1425.         if (theImg != null){theImg.src = (theDiv.style.display == 'block')?closed:expand;}
  1426.     }
  1427.     document.body.insertAdjacentHTML('beforeEnd',' ');
  1428. }
  1429.  
  1430. // XML POPUP CODE BEGINS
  1431. function getXMLPopupContent(theXMLTermRoot)
  1432. {
  1433.     var theXMLTerm, theXMLTermID;
  1434.     var theEntry;
  1435.     var theScopeDefs;
  1436.     var theScopes;
  1437.     var theDefinition;
  1438.     var theSeeAlsos, seeAlsoID, seeAlsoTerm;
  1439.     var theSeeEntry, seeID, seeTerm;
  1440.     var outText;
  1441.     var i, j, k, l, m;
  1442.     var scopeFound;
  1443.     var noDef =
  1444.         '<H6 CLASS="GLOSSARY_ITEM">'
  1445.         +L_NoDefAlertTitle_Text
  1446.         +'</H6><P>'
  1447.         +L_NoDefAlert_Text
  1448.         +'</P>';
  1449.     
  1450.     // CHECK THAT TERM ROOT EXISTS
  1451.     if (theXMLTermRoot.length > 1)
  1452.     {
  1453.         theXMLTermID = theXMLTermRoot.substring(1, theXMLTermRoot.length);
  1454.         i = theXMLTermID.indexOf(':');
  1455.         if (i > 0)
  1456.             theXMLTerm = theXMLTermID.substring(i+1, theXMLTermID.length);
  1457.         else
  1458.             return (noDef);
  1459.     }
  1460.     else
  1461.         return (noDef);
  1462.     
  1463.     if (!xmlDOMLoaded)    // load the XML object the first time through
  1464.     {
  1465.         xmlDOM = new ActiveXObject('Microsoft.XMLDOM');
  1466.         xmlDOM.async = false;
  1467.         xmlDOM.validateOnParse = false;
  1468.         xmlDOM.load(xmlFile);
  1469.         xmlDOMLoaded = true;        // state variable
  1470.     }
  1471.  
  1472.     outText = noDef;
  1473.     theEntry = xmlDOM.nodeFromID(theXMLTerm);    // look up term
  1474.     
  1475.     if (theEntry == null)
  1476.         outText = noDef;
  1477.     else                            // term found
  1478.     {
  1479.         theScopeDefs = theEntry.selectNodes('scopeDef');
  1480.         scopeFound = false;
  1481.         
  1482.         for (i = 0; i < theScopeDefs.length && !scopeFound; i++)
  1483.         {
  1484.             theScopes = theScopeDefs(i).selectNodes('scope');
  1485.             for (j = 0; j < theScopes.length; j++)        // this loop could be replaced with a single XSL pattern
  1486.             {
  1487.                 if (theScopes(j).attributes.getNamedItem('scopeTermID').text == theXMLTermID)    // checking for scopedef match
  1488.                 {
  1489.                     // FOUND SCOPE IN ENTERY - GET AND FORMAT THE TERM AND DEF DATA
  1490.                     scopeFound = true;
  1491.                     outText = formatXMLTerm(theEntry.selectSingleNode('term').text);
  1492.                     if (theScopeDefs(i).selectSingleNode('def') != null)
  1493.                     {
  1494.                         theDefinition = formatXMLDef(theScopeDefs(i).selectSingleNode('def'));
  1495.                         outText += theDefinition;                // get def
  1496.                         
  1497.                         theSeeAlsos = theScopeDefs(i).selectNodes('seeAlso');
  1498.                         seeAlsoID = '';
  1499.                         seeAlsoTerm = '';
  1500.                         for (k = 0; k < theSeeAlsos.length; k++)    // search for See Alsos
  1501.                         {
  1502.                             seeAlsoID = theSeeAlsos(k).attributes.getNamedItem('seeAlsoID').text;
  1503.                             l = seeAlsoID.indexOf(':');
  1504.                             if (l > 0)
  1505.                             {
  1506.                                 seeAlsoScope = seeAlsoID.substring(0, l+1);
  1507.                                 seeAlsoID    = seeAlsoID.substring(l+1, seeAlsoID.length);
  1508.                             }
  1509.                             else
  1510.                                 seeAlsoScope = '';
  1511.                             seeAlsoTerm = xmlDOM.nodeFromID(seeAlsoID).selectSingleNode('term').text;
  1512.                             
  1513.                             // if k == 0, format first See Also
  1514.                             outText += formatXMLSeeAlso(seeAlsoScope + seeAlsoID, seeAlsoTerm, (k == 0));
  1515.                         }
  1516.                         if (k > 0)
  1517.                             outText = outText + '</P>';    // if See Alsos, add trailing paragraph mark
  1518.                     }
  1519.                     else
  1520.                     {
  1521.                         theSeeEntry = theScopeDefs(i).selectSingleNode('seeEntry');
  1522.                         seeID = theSeeEntry.attributes.getNamedItem('seeID').text;
  1523.                         k = seeID.indexOf(':');
  1524.                         if (k > 0)
  1525.                         {
  1526.                             seeScope = seeID.substring(0, k+1);
  1527.                             seeID    = seeID.substring(k+1, seeID.length);
  1528.                         }
  1529.                         else
  1530.                             seeScope = '';
  1531.                         seeTerm = xmlDOM.nodeFromID(seeID).selectSingleNode('term').text;
  1532.                         outText += formatXMLSee(seeScope + seeID, seeTerm);
  1533.                     }
  1534.                 }//end if-scope-found block
  1535.             }
  1536.         }
  1537.     }
  1538.     xmlTermRoot = '';    //  clean up global
  1539. //  for debugging:  return ("XML -" + xmlTermRoot + "/" + theXMLTerm + "termText:" + termText + "defText:" + defText  + outText);
  1540.     return outText;
  1541. }
  1542.  
  1543. // helper functions to format the glossary text
  1544. function formatXMLTerm(theTerm)        // term
  1545. {
  1546.     return ('<H6 CLASS="GLOSSARY_ITEM">'+theTerm+'</H6>');
  1547. }
  1548. function formatXMLDef(theDef)        // def
  1549. {
  1550.     var theParas = theDef.selectNodes('para');
  1551.     var theDefOut = '';
  1552.     for (var i = 0; i < theParas.length; i++)
  1553.         theDefOut += '<P>'+theParas(i).text+'</P>';
  1554.     return theDefOut;
  1555. }
  1556. function formatXMLSee(theSeeTermID, theSeeTerm)    // see also
  1557. {
  1558.     var theSeeText;
  1559.     theSeeText = '<A ID="In_PopuP" HREF="#'+theSeeTermID+'">'+theSeeTerm+'</A>';
  1560.     return ('<P ID="SeeDef">'+L_See_Text+theSeeText);
  1561. }
  1562. function formatXMLSeeAlso(theSeeAlsoTermID, theSeeAlsoTerm, bFirstOne)    // see alsos
  1563. {
  1564.     var theSeeAlsoText =
  1565.         '<A ID="In_PopuP" HREF="#'
  1566.         +theSeeAlsoTermID
  1567.         +'">'
  1568.         +theSeeAlsoTerm
  1569.         +'</A>';
  1570.     return ( ((bFirstOne)?('<P ID="OtherDefs">'+L_SeeAlso_Text):(', '))  +  theSeeAlsoText );
  1571. }
  1572.  
  1573.  
  1574. // EVENT HANDLER HOOKS BEGIN
  1575.  
  1576. window.onload            = window_onload;
  1577. window.onresize            = window_onresize;
  1578. document.onkeypress        = document_onkeypress;
  1579. document.onclick        = document_onclick;
  1580. document.onmouseover        = document_onmouseover;
  1581. document.onmouseout        = document_onmouseout;
  1582.  
  1583. // legacy event handler names
  1584. function loadInitialThings()        { window_onload(); }
  1585. function fixPopUps()            { window_onresize(); }
  1586. function ieKey()            { document_onkeypress(); }
  1587. function clickAndDo()            { document_onclick(); }
  1588. function gettingHot()            { document_onmouseover(); }
  1589. function gettingCold()            { document_onmouseout(); }
  1590.  
  1591. // EVENT HANDLER HOOKS END
  1592.  
  1593.