home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 March / Chip_2011.03_CD.iso / I386 / ARTICLE.CH_ / article.chm / shared.js < prev    next >
Encoding:
JavaScript  |  2001-10-04  |  53.3 KB  |  1,523 lines

  1. // Filename: shared.js
  2. // Version shared.js for Whistler
  3. // version post b1
  4.  
  5. //******************** Shared components path setting **************
  6. //******************************************************************
  7. //  ALWAYS PUT THE NAME OF THE CHM THAT WILL CONTAIN shared.js 
  8. //  WHERE YOU SEE ntshared.chm IN LINE TWELVE. 
  9. //  ie:  var sSharedCHM= moniker+"ntshared.chm::/";
  10. //  
  11.  
  12.  var moniker= "";                           
  13.  var sSharedCHM= moniker+"";
  14.  
  15. //  var moniker= "";                  // moniker= ""; for flat files
  16. //  var sSharedCHM= moniker+"";
  17.  
  18. //******************** EVENT HANDLING *******************************
  19. //*******************************************************************
  20. //  re-directs to the proper event-driven functions.
  21.  
  22. window.onload= loadPage;
  23. document.onclick= onclickTriage;
  24. document.onmouseover= gettingHot;
  25. document.onmouseout= gettingCold;
  26. window.onunload=saveChecklistState;
  27. window.onresize= resizeDiv;
  28.  
  29. window.onbeforeprint = set_to_print;
  30. window.onafterprint = reset_form;
  31.         
  32. //************  USER-DEFINED GLOBAL VARIABLES  ***********************
  33. //********************************************************************
  34. //  The images listed below can all be changed by the user.
  35.  
  36. var sShortcutTip= "";
  37.  
  38. var gifwithin = false;
  39.  
  40.   
  41.     xmldoc = new ActiveXObject("microsoft.XMLDOM");
  42.       xmldoc.async = false;
  43.     xmldoc.load(sSharedCHM + "alttext.xml");
  44.  
  45.     var Alt_sPreviousTip= xmldoc.getElementsByTagName("sPreviousTip")
  46.     var Alt_sNextTip= xmldoc.getElementsByTagName("sNextTip")
  47.     var Alt_sExpandTip= xmldoc.getElementsByTagName("sExpandTip")
  48.     var Alt_sPopupTip= xmldoc.getElementsByTagName("sPopupTip")
  49.     var hld_path2reuse= xmldoc.getElementsByTagName("path2reuse")
  50.     var hld_path2glossary= xmldoc.getElementsByTagName("path2glossary")
  51.     var hld_rel_gif = xmldoc.getElementsByTagName("reltopgif")
  52.     var hld_chmName = xmldoc.getElementsByTagName("chmName")
  53.     var hld_emailer = xmldoc.getElementsByTagName("emailer")
  54.     var hld_sendtext = xmldoc.getElementsByTagName("sendtext")
  55.     var hld_sendto = xmldoc.getElementsByTagName("sendto")
  56.     
  57.     var sPreviousTip="" + Alt_sPreviousTip.item(0).nodeTypedValue
  58.     var sNextTip="" + Alt_sNextTip.item(0).nodeTypedValue
  59.     var sExpandTip="" + Alt_sExpandTip.item(0).nodeTypedValue
  60.     var sPopupTip="" + Alt_sPopupTip.item(0).nodeTypedValue
  61.     var path2reuse="" + hld_path2reuse.item(0).nodeTypedValue
  62.     var path2glossary="" + hld_path2glossary.item(0).nodeTypedValue
  63.     var rel_gif="" + hld_rel_gif.item(0).nodeTypedValue
  64.     var chmName="" + hld_chmName.item(0).nodeTypedValue+"::/"
  65.     var emailer="" + hld_emailer.item(0).nodeTypedValue
  66.     var sendtext="" + hld_sendtext.item(0).nodeTypedValue
  67.     var sendto="" + hld_sendto.item(0).nodeTypedValue
  68.     
  69. var xmldom = new ActiveXObject("microsoft.XMLDOM");
  70.     xmldom.async = false;
  71.         
  72. var closed = sSharedCHM + "plusCold.gif";            
  73.     //image used for collapsed item in callExpand()
  74. var closedHot = sSharedCHM + "plusHot.gif";        
  75.     //hot image used for collapsed item in callExpand()
  76. var expand = sSharedCHM + "minusCold.gif";        
  77.     //image used for expanded item in callExpand()
  78. var expandHot = sSharedCHM + "minusHot.gif";        
  79.     //hot image used for expanded item in callExpand()
  80.  
  81. var previousCold= sSharedCHM + "previousCold.gif";
  82. var previousHot= sSharedCHM + "previousHot.gif"; 
  83. var nextCold= sSharedCHM + "nextCold.gif";
  84. var nextHot= sSharedCHM + "nextHot.gif"; 
  85.  
  86. var shortcutCold= sSharedCHM + "shortcutCold.gif";
  87. var shortcutHot= sSharedCHM + "shortcutHot.gif";
  88.  
  89. var popupCold= sSharedCHM + "popupCold.gif";
  90. var popupHot= sSharedCHM + "popupHot.gif";
  91.  
  92. var emptyImg= sSharedCHM + "empty.gif";            //empty expand
  93. var noteImg= sSharedCHM + "note.gif";            //notes
  94. var tipImg= sSharedCHM + "tip.gif";                //tips
  95. var warningImg= sSharedCHM + "warning.gif";        //warnings
  96. var cautionImg= sSharedCHM + "caution.gif";        //cautions
  97. var importantImg= sSharedCHM + "important.gif";        //important 
  98. var relTopicsImg= sSharedCHM + "rel_top.gif";        //important
  99.  
  100. var branchImg= sSharedCHM + "elle.gif";
  101. var branchImg_RTL= sSharedCHM + "elle_rtl.gif";
  102.  
  103.  
  104. //**************************  GLOBAL VARIABLES  **********************
  105. //********************************************************************
  106.  
  107. var joejoe = false;
  108. var printing = "FALSE";
  109. var single = "FALSE";
  110. var scroller = "FALSE";
  111. var valet = "FALSE";
  112. var isRTL= (document.dir=="rtl");
  113. var imgStyleRTL= ""; 
  114.       if (isRTL) imgStyleRTL=" style='filter:flipH' ";
  115.  
  116. var sActX_TDC= "CLASSID='CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83'";        
  117.             //Tabular Data Control  for  reusable text data
  118. var sSharedReusableTextFile= sSharedCHM + "reusable.xml";                
  119.                         // common reusable text file
  120. var sSharedReusableTextFileRecord= "para";        
  121.                         //reusable text record
  122.  
  123. var numbers= /\d/g;            //javascript regular expression
  124. var spaces= /\s/g;            //javascript regular expression
  125. var semicolon= /;/g;            //javascript regular expression
  126.  
  127. var isIE5 = (navigator.appVersion.indexOf("MSIE 5")>0) || (navigator.appVersion.indexOf("MSIE")>0 && parseInt(navigator.appVersion)> 4);
  128. var isIE55 = (navigator.appVersion.indexOf("MSIE 5.5")>0);
  129. var isIE6 = (navigator.appVersion.indexOf("MSIE 6")>0);
  130.  
  131. var isPersistent= false;
  132.  
  133. //************************  INITIALIZATION  **************************
  134. //********************************************************************
  135. function list_them(){
  136.         
  137.     var envelope = sSharedCHM +'envelope.gif';
  138.     var server = "<DIV Class='FeedbackBar'><SPAN Class='webOnly'><IMG  SRC=" + envelope + " ALT='' BORDER='0'></SPAN><SPAN Class='webOnly' Style='position:relative; top:-1; left:1; color:#333333;'> " + sendtext + " "; 
  139.     server += "<a href='mailto:" + sendto + "?subject=HELP: ";
  140.     server += document.title + "'";
  141.     server += ">" + sendto + "</a></SPAN></DIV>";
  142.     
  143.     var i;
  144.  
  145.     for (i=0; i < document.all.length; i++){
  146.         if ((document.all[i].tagName == "P") ||
  147.             (document.all[i].tagName == "H1")||
  148.             (document.all[i].tagName == "H6")){
  149.             document.all[i].outerHTML = server + document.all[i].outerHTML;
  150.             i = document.all.length;
  151.             }
  152.         }
  153. }
  154. //*** loadPage *******************************************************
  155. //  Adds the default image tags and re-usable text to the HTML page.
  156.  
  157. function loadPage(){
  158. if (printing == "TRUE") return;
  159.  
  160. if (emailer == "yes" ) list_them();
  161.  
  162. isPersistent= (document.all.item("checklist")!=null) && ((isIE5) || (isIE6));
  163.  
  164.   setPreviousNext();
  165.   
  166.   resizeDiv();
  167.   if (isPersistent) getChecklistState();
  168.   addReusableText();
  169.   insertImages();
  170. }
  171.  
  172. //****** setPreviousNext  ******************************************** 
  173. // insert previous/next navbar
  174. // called by: <div id="nav">@@HTMLsequenceFile.txt or .lst@@</div>
  175.  
  176. function setPreviousNext(){
  177.  
  178.  
  179.   var oNav = document.all.item("nav");
  180.         if (oNav == null ) return;
  181.   
  182.   var sPreviousALT= sPreviousTip;
  183.   var sNextALT= sNextTip;
  184.   var sHTMLfile= oNav.innerHTML;
  185.  
  186.   var imgPrev= "<IMG SRC='"+previousCold+"' BORDER=0 ALT='"+ sPreviousALT +"' ALIGN='top' "+ imgStyleRTL +">";
  187.   var imgNext= "<IMG SRC='"+nextCold+"' BORDER=0 ALT='"+ sNextALT  + "' ALIGN='top' "+ imgStyleRTL +">";
  188.   
  189.   var previousNextObject= "<OBJECT ID='HTMlist' WIDTH=100 HEIGHT=51 " + sActX_TDC +"><param name='DataURL' value='"
  190.         +sHTMLfile +"'><param name='UseHeader' value=True></OBJECT>";
  191.       
  192.         oNav.innerHTML= "<TABLE WIDTH='100%' STYLE='margin-top:0;' cellspacing=0>"
  193.         + "<TR><TD style='text-align=left; background-color:transparent'><A ID='previousLink' HREF='#' REL='previous' CLASS='navbar'>"
  194.         +imgPrev + "</A></TD><TD width='100%' align='center'></td><TD style='text-align=right; background-color:transparent'><A ID='nextLink' HREF='#' REL='next' CLASS='navbar'>"
  195.         +imgNext+ "</A></TD></TR></TABLE>";
  196.                     
  197.       document.body.innerHTML= document.body.innerHTML +  previousNextObject;
  198.       findPageSeq();
  199.       if (printing == "TRUE") return;
  200.       var  thisLoc= document.location.href +"#";
  201.  
  202.       if (previousLink.href== thisLoc) previousLink.style.display="none";
  203.       else  previousLink.style.display="block";
  204.  
  205.       if (nextLink.href== thisLoc) nextLink.style.display="none";
  206.       else  nextLink.style.display="block";
  207.       
  208. }
  209.  
  210. function findPageSeq() {
  211.  
  212. var rs= HTMlist.recordset;
  213. var thisLoc= document.location.href;
  214. var iLoc= thisLoc.lastIndexOf("/");
  215.  
  216.     if (iLoc > 0) thisLoc= thisLoc.substring(iLoc+1, thisLoc.length);
  217.     
  218.     
  219.     if (nav.style == "[object]") {
  220.                 nav.style.visibility="hidden";
  221.                 printing = "FALSE";
  222.                 }
  223.         else
  224.             {
  225.                 printing = "TRUE";
  226.                 return;
  227.             }
  228.     
  229.        
  230.     rs.moveFirst();
  231.        
  232.     while (!rs.EOF) {
  233.           if (thisLoc == rs.fields("HTMfiles").value){
  234.               nav.style.visibility="visible"; 
  235.                 rs.MoveNext();
  236.               break;
  237.           }
  238.           previousLink.href=rs.fields("HTMfiles").value;      
  239.           rs.moveNext();
  240.      }
  241.                 
  242.       if (!rs.EOF) nextLink.href=rs.fields("HTMfiles").value;
  243. }
  244.     
  245. //******Re-usable text ************************************************ 
  246. // Inserts the Tabular Data Control (TDC) object at the end of the page 
  247. // Inserts "re-usable text" from the txt file at: <span id="@@CHM_name@@@@index#@@" class="reuse"></span>
  248. // e.g.<span id="printing4" class="reuse"></span> for record#4 in the printing.txt in printing.chm.
  249.  
  250. //function addReusableText(){
  251. //var ntsharedAdded= false;        // make sure object is only added once
  252. //var CHMspecificAdded= false;    // make sure object is only added once
  253. //var coll = document.all.tags("SPAN");
  254. //var sIndex,sRecord,sFile,sFileID,dataBindingObject;
  255. //var loaded = false;
  256.     
  257. //    xsldoc = new ActiveXObject("microsoft.XMLDOM");
  258. //    xmldoc = new ActiveXObject("microsoft.XMLDOM");
  259. //    xmldoc.async = false;
  260.         
  261. //     for (var i=0; i< coll.length; i++)                                   
  262. //         if (coll[i].className.toLowerCase()=="reuse"){
  263.     //         if (isRTL) coll[i].dir= "rtl";
  264.     //         
  265.     //         if (coll[i].id == null) return;
  266.              
  267.        //         sFile= coll[i].id.toLowerCase();
  268.              
  269.         //     sFileID= sFile;
  270.         //     var sText = "X";
  271.         //     var o = 0;    
  272.         //    xmldoc.load(path2reuse + "reusable.xml");
  273.         //    xsldoc.load(path2reuse + "formatter.xsl");
  274.         //    node = xmldoc.selectSingleNode("glossary/glossSection/entry[@entryID='" + sFileID + "']");
  275.         //    if(node!=null){
  276.         //        alert("hhh")
  277.         //        sText = " " + node.transformNode(xsldoc);
  278.         //        }
  279.         //    coll[i].innerHTML= sText;
  280. //    }           
  281. //}
  282. function addReusableText(){
  283. var ntsharedAdded= false;        // make sure the object is only added once
  284. var CHMspecificAdded= false;        // make sure the object is only added once
  285. var coll = document.all.tags("SPAN");
  286. var sIndex,sRecord,sFile,sFileID,dataBindingObject;
  287. var loaded = false;
  288.  
  289.     xmldoc = new ActiveXObject("microsoft.XMLDOM");
  290.     xmldoc.async = false;
  291.         
  292.      for (var i=0; i< coll.length; i++)                                   
  293.           if (coll[i].className.toLowerCase()=="reuse"){
  294.              if (isRTL) coll[i].dir= "rtl";
  295.              
  296.              if (coll[i].id == null) return;
  297.              
  298.                 sFile= coll[i].id.toLowerCase();
  299.              
  300.              sFileID= sFile;
  301.              sFile= sFile.replace(numbers,"");
  302.              
  303.              if (loaded != sFile){
  304.                  xmldoc.load(path2reuse + "reusable.xml");
  305.                 objXMLDOMNodeKey = xmldoc.getElementsByTagName("term");
  306.                  objXMLDOMNodeInsert = xmldoc.getElementsByTagName("para");
  307.                 loaded = sFile;
  308.                 }
  309.              
  310.             var o=0;
  311.         
  312.          while (o < objXMLDOMNodeKey.length){
  313.             sIndex = '' + objXMLDOMNodeKey.item(o).nodeTypedValue;
  314.             sIndex = sIndex.toLowerCase()
  315.             sText = '' + objXMLDOMNodeInsert.item(o).nodeTypedValue;
  316.             if (sIndex < sFileID) o++;
  317.                      else {
  318.                      break;
  319.                      }
  320.               }
  321.                 if (sIndex == sFileID) coll[i].innerHTML= sText;
  322.     }           
  323. }
  324.  
  325.  //****** insertImages ***************************************************** 
  326.  //  Inserts shared images in User-Defined Variables section and thumbnails.
  327. var booking = false;
  328. function insertImages(){
  329. if (printing == "FALSE") booking = true;
  330. if (printing == "TRUE" && booking == true ) {
  331.     booking = false;
  332.     return;
  333.     }
  334.  
  335.  
  336. // insert alert icons
  337.   var collP = document.all.tags("P");
  338.   
  339.   for (var i=0; i<collP.length; i++) {
  340.        if (collP[i].className.toLowerCase()=="note")            collP[i].innerHTML ="<img class='alert' src='"+noteImg+"' "+ imgStyleRTL +"> " +     collP[i].innerHTML;
  341.        else if (collP[i].className.toLowerCase()=="warning")    collP[i].innerHTML ="<img class='alert' src='"+warningImg+"'> " +  collP[i].innerHTML;
  342.        else if (collP[i].className.toLowerCase()=="caution")    collP[i].innerHTML ="<img class='alert' src='"+cautionImg+"'> " +  collP[i].innerHTML;
  343.        else if (collP[i].className.toLowerCase()=="tip")        collP[i].innerHTML ="<img class='alert' src='"+tipImg+"'> " +      collP[i].innerHTML;
  344.        else if (collP[i].className.toLowerCase()=="important")  collP[i].innerHTML ="<img class='alert' src='"+importantImg+"'> " + collP[i].innerHTML;
  345.        else if (collP[i].className.toLowerCase()=="empty")      collP[i].innerHTML ="<img class='alert' src='"+emptyImg+"'> " +    collP[i].innerHTML;
  346.        if (collP[i].className.toLowerCase()=="reltopics" && rel_gif == "yes")  {
  347.             collP[i].outerHTML ="<img class='relTopics' src='"+relTopicsImg+"'> " + collP[i].outerHTML;
  348.             }   
  349.           }
  350.   
  351.  
  352.  
  353. //indents for Navigation Tree 
  354. var collUL = document.all.tags("UL");
  355. if (printing != "TRUE") {
  356. for (var i=0; i<collUL.length; i++) {
  357.        var indent= 0;
  358.        if (collUL[i].className.toLowerCase()=="navtree"){
  359.            if (isRTL) collUL[i].style.listStyleImage= "url('" + branchImg_RTL + "')";
  360.            else collUL[i].style.listStyleImage= "url('" + branchImg + "')";
  361.              for (var j = 0; j < collUL[i].children.length; j++)
  362.                 if (collUL[i].children[j].className.toLowerCase()=="branch"){
  363.                     if (isRTL) collUL[i].children[j].style.marginRight= (indent +'em');
  364.                     else   collUL[i].children[j].style.marginLeft= (indent +'em');
  365.                     indent= indent + 0.75;
  366.                 }
  367.       }
  368. }
  369. }
  370.    
  371.   for (var i=0; i < document.anchors.length; i++){
  372.          var imgInsert="";  
  373.          var imgStyle= "";
  374.          var imgSpace= "<span class='space'></span>";      
  375.          var oBefore=document.anchors[i].parentElement.tagName;
  376.          var oAnchor= document.anchors[i].id.toLowerCase();
  377.          
  378. // insert RELTOPICS icons
  379.     if (rel_gif == "yes"){
  380.        if (oAnchor=="reltopics")
  381.                if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "reltopics")
  382.                     imgInsert= "";    // not to re-insert when persistent
  383.             else  imgInsert= "<img class='relTopics' src='"+relTopicsImg+"'>" + imgSpace;
  384.         }
  385.         
  386. // insert SHORTCUT icons
  387.        if (oAnchor=="shortcut") {    
  388.             document.anchors[i].title= sShortcutTip;     
  389.             if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "shortcut")
  390.                     imgInsert= "";    // not to re-insert when persistent
  391.             else  imgInsert= "<img class='shortcut' src='"+shortcutCold+"' "+ imgStyleRTL+ ">" + imgSpace;
  392.         }    
  393.                       
  394. // insert POPUP icons
  395.        else if (oAnchor=="wpopup" || oAnchor=="wpopupweb") document.anchors[i].title= sPopupTip;
  396.        else if (document.anchors[i].className.toLowerCase()=="popupicon")
  397.             if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "popup")
  398.                    imgInsert= "";    // not to re-insert when persistent
  399.             else imgInsert= "<img class='popup' src='"+popupCold+"'>" + imgSpace;
  400.  
  401. // insert EXPAND icons 
  402.        else if (oAnchor=="expand") {
  403.               document.anchors[i].title= sExpandTip;
  404.               if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "expand")
  405.                   imgInsert= "";     // not to re-insert when persistent      
  406.               else{ 
  407.                   if (document.anchors[i].parentElement.offsetLeft == document.anchors[i].offsetLeft) {
  408.                       imgSpace= "<span class='space' style='width:0'></span>";     
  409.                       if (isRTL){ document.anchors[i].parentElement.style.marginRight= "1.5em";  imgStyle=" style=margin-right:'-1.5em'";}
  410.                       else { document.anchors[i].parentElement.style.marginLeft= "1.5em";  imgStyle=" style=margin-left:'-1.5em'";}
  411.                   }      
  412.                   imgInsert= "<img class='expand' src='"+ closed +"' "+imgStyle+">" +imgSpace;
  413.               }
  414.        }
  415.  
  416.  
  417.  
  418. // insert thumbnail images       
  419.        else if (oAnchor=="thumbnail"  || oAnchor=="thumbnailweb"){ 
  420.             var sAltText = document.anchors[i].innerHTML;
  421.             gifwithin = true;
  422.             var sThumbnailText = document.anchors[i].title; 
  423.             var oImg = document.anchors[i].href.toLowerCase();
  424.                   if (oAnchor=="thumbnail") 
  425.                          var sThumbnailImg= moniker + getURL(oImg);
  426.                   else var sThumbnailImg = document.anchors[i].href.toLowerCase();
  427.                   
  428.                  found = sAltText.indexOf("BACKGROUND-COLOR:")
  429.             if (found != -1) {
  430.                 stop_p = sAltText.indexOf(">");
  431.                 sAltText = sAltText.substring(stop_p + 1, sAltText.length);
  432.                 stop_p = sAltText.indexOf("</FONT>");
  433.                 Highlighted = sAltText.substring(0,stop_p)
  434.                 sAltText = Highlighted + sAltText.substring(stop_p + 7, sAltText.length);
  435.                 }
  436.  
  437.                   
  438.                 document.anchors[i].outerHTML = "<DIV id='thumbDiv' class='thumbnail'>"+document.anchors[i].outerHTML+"</div>";
  439.                 document.anchors[i].innerHTML = "<img class='thumbnail' src='" + sThumbnailImg + "' alt= ' " + sAltText + "'><p>" +sThumbnailText+"</p>";
  440.                 
  441.                   if (isRTL) thumbDiv.style.styleFloat= "right";
  442.            }
  443.            
  444.         
  445.         
  446.         document.anchors[i].innerHTML = imgInsert + document.anchors[i].innerHTML;
  447.        if (isRTL) document.anchors[i].dir="rtl";
  448.    }
  449. }
  450.  
  451.  
  452. //***** onclickTriage **********************************************************
  453. // redirects to the appropriate function based on the ID of the clicked <A> tag.
  454.  
  455. function onclickTriage(){
  456. var e= window.event.srcElement;
  457.  
  458. //  if the innerHTML in the <a> tag is encapsulated by a style tag or
  459. //   hightlighted in the word seach, the parentElement is called.
  460.  
  461.     if (printing == "TRUE") {
  462.         printing = "FALSE";
  463.          reset_form();
  464.         }
  465.         
  466.     for (var i=0; i < 5; i++)
  467.            if (e.tagName!="A" && e.parentElement!=null) e= e.parentElement;
  468.     eID= e.id.toLowerCase();
  469.                 
  470.     if (popupOpen) closePopup();
  471.     
  472. // expand image in a new window
  473.     if (eID=="thumbnail" || eID=="pophtm") popNewWindow(e);
  474.     else if (eID=="thumbnailweb") callThumbnailWeb(e);
  475.     else if (eID=="wpopup")    callPopup(e);
  476.     else if (eID=="wpopupweb") callPopupWeb(e);
  477.     else if (eID=="shortcut")  callShortcut(e);
  478.     else if (eID=="reltopics") callRelatedTopics(e);
  479.     else if (eID=="altloc")    callAltLocation(e);
  480.     else if (eID=="expand")    callExpand(e);
  481. // added to support Randy's Quad method code
  482.     else QuadDocumentClick()
  483. // ******************************
  484. }
  485.  
  486.  
  487. //*** gettingHot *****************************************************************
  488. // Makes all the required changes for mouseover.
  489.  
  490. function gettingHot() {
  491. var e = window.event.srcElement;
  492.     
  493. // Added to support Quad Method   **************************
  494.     if (e != null && e.firstChild != null && 
  495.         e.firstChild.tagName != null &&
  496.         e.firstChild.tagName.toLowerCase() == "input" && 
  497.         e.firstChild.type.toLowerCase() == "radio" && 
  498.         e.parentElement.className != "indentGray"){
  499.             QuadDocumentMouseOver()
  500.             }
  501.  
  502. // *****************************
  503.  
  504.   if (e.id.toLowerCase()=="cold")  e.id ="hot";
  505.   else if (e.src== previousCold)  e.src = previousHot;
  506.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== previousCold)  e.children.tags("IMG")(0).src= previousHot;
  507.   else if (e.src== nextCold)  e.src = nextHot;
  508.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== nextCold)  e.children.tags("IMG")(0).src= nextHot;
  509.   
  510.   else if (e.className.toLowerCase()=="shortcut" && e.tagName=="IMG")  e.src = shortcutHot;        
  511.             //<img> tags have a class
  512.   else if (e.id.toLowerCase()=="shortcut")  e.children.tags("IMG")(0).src = shortcutHot;            
  513.             //<a> tags have an ID
  514.   
  515.   else if (e.className.toLowerCase()=="popup" && e.tagName=="IMG")  e.src = popupHot;              
  516.             //<img> tags have a class
  517.   else if (e.className.toLowerCase()=="popupicon")  e.children.tags("IMG")(0).src = popupHot;        
  518.             //<a> tags have an ID
  519.   
  520.   else if ((e.className.toLowerCase()=="expand" && e.tagName=="IMG") ||( e.id.toLowerCase()=="expand")) expandGoesHot(e);
  521.  
  522. }
  523.  
  524. //*** gettingCold *************************************************************
  525. // Initial state for mouseout.
  526.  
  527. function gettingCold() {
  528. var e = window.event.srcElement;
  529.  
  530. // Added to support Quad Method   **************************
  531.     if (e != null && e.firstChild != null && 
  532.         e.firstChild.tagName != null &&
  533.         e.firstChild.tagName.toLowerCase() == "input" && 
  534.         e.firstChild.type.toLowerCase() == "radio" && 
  535.         e.parentElement.className != "indentGray"){
  536.             QuadDocumentMouseOver()
  537.             }
  538.  
  539. // *****************************
  540.  
  541.   if (e.id.toLowerCase()=="hot")  e.id ="cold";
  542.   else if (e.src== previousHot)  e.src = previousCold;
  543.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== previousHot)  e.children.tags("IMG")(0).src= previousCold;
  544.   else if (e.src== nextHot)  e.src = nextCold;
  545.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== nextHot)  e.children.tags("IMG")(0).src= nextCold;
  546.   
  547.   else if (e.className.toLowerCase()=="shortcut" && e.tagName=="IMG")   e.src = shortcutCold;        //<img> tags have a class
  548.   else if (e.id.toLowerCase()=="shortcut")  e.children.tags("IMG")(0).src= shortcutCold;             //<a> tags have an ID
  549.   
  550.   else if (e.className.toLowerCase()=="popup" && e.tagName=="IMG")   e.src = popupCold;            //<img> tags have a class
  551.   else if (e.className.toLowerCase()=="popupicon")  e.children.tags("IMG")(0).src= popupCold;        //<a> tags have an ID
  552.   
  553.   else if ((e.className.toLowerCase()=="expand" && e.tagName=="IMG") ||( e.id.toLowerCase()=="expand")) expandGoesCold(e);
  554. }
  555.  
  556. //****************************************** OBJECT CONSTRUCTION **************************************
  557. //*****************************************************************************************************
  558. //  Uses an A tag to pass parameters between an HTML page and this script.
  559. //  Creates an ActiveX Object from these parameters, appends the Object to the end of the page,
  560. //  and clicks it. These objects relate to HTMLHelp environment and information about them can be found on the http://HTMLHelp site.
  561.  
  562. //  Object construction variables *********************************************************************
  563.  
  564. var sParamCHM,sParamFILE, sParamEXEC, sParamMETA,iEND;
  565. var sActX_HH= " type='application/x-oleobject' classid='clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11' ";
  566.  
  567.  
  568. //*** callPopup ***************************************************************************************
  569. // creates an object from an <A> tag HREF, the object inserts a winhelp popup
  570. // called by: <A ID="wPopup" HREF="HELP=@@file_name.hlp@@ TOPIC=@@topic#@@">@@Popup text@@</A>
  571.  
  572. var joker = false;
  573. var blague = true;
  574.  
  575. function callPopup(eventSrc) {
  576. if (popupOpen) closePopup();
  577. var ntsharedAdded= false;                        // make sure the object is only added once
  578. var CHMspecificAdded= false;                        // make sure the object is only added once
  579. var coll = document.all.tags("SPAN");
  580. var sIndex,sText=" ",sFile,sFileID,dataBindingObject;
  581.  
  582.      var e= eventSrc;
  583.      var eH= unescape(e);
  584.      eH = eH.toLowerCase();
  585.      var eH_= eH.toLowerCase();
  586.      
  587.      if(event){
  588.          event.returnValue = false;
  589.         }
  590.      found = false;
  591.                                                        
  592.        var iTOPIC = eH.lastIndexOf("topic=");
  593.      if (iTOPIC==-1) return;
  594.      sParamTOPIC = eH.substring((iTOPIC+6),eH.length);
  595.      
  596.      if (!joejoe){
  597.         xmldom.load(path2glossary + "glossary.xml");
  598.         joejoe = true;
  599.         }
  600.          
  601.         var o=0;
  602.         var node = "";    
  603.         node = xmldom.selectSingleNode("glossary/glossSection/entry[@entryID='" + sParamTOPIC + "']");
  604.                     
  605.         if(node!=null)
  606.             {
  607.             
  608.             found = true;
  609.             var ralf = "";
  610.             ralf = node.getElementsByTagName("term")
  611.             sText = "<DIV CLASS='PopTerm'>" + ralf.item(0).nodeTypedValue + "</DIV>";
  612.             ralf = node.getElementsByTagName("para")
  613.             sText = sText + "<DIV CLASS='PopDef'>" + ralf.item(0).nodeTypedValue; + "</DIV>"
  614.             
  615.             seealsos = node.getElementsByTagName("seeAlso");
  616.             var o=0;
  617.                         
  618.             while (o < seealsos.length){
  619.                 sIndex = seealsos.item(o).getAttribute("seeAlsoTermID");
  620.                 node = xmldom.selectSingleNode("glossary/glossSection/entry[@entryID='" + sIndex + "']");
  621.                 ralf = node.getElementsByTagName("term");
  622.                 sTerm = ralf.item(0).nodeTypedValue;
  623.                 if (o == 0) {
  624.                     sText = sText + "<DIV CLASS='PopSeeAlso'>See Also: "
  625.                     // sIndex = "<Input type=submit tabindex=1 value=hhhh onclick='jscript:alert(oPopup.sIndex.innerHTML)'>"
  626.                     sIndex = "<A ID='wPopup' HREF='HELP=glossary.hlp TOPIC=" + sIndex + "' TABINDEX='1'>" + sTerm + "</a>"
  627.                     }
  628.                 else
  629.                     {
  630.                     sIndex = ", <A ID='wPopup' HREF='HELP=glossary.hlp TOPIC=" + sIndex + "' TABINDEX='1'>" + sTerm + "</a>"
  631.                     }
  632.                 o++;
  633.                 sText = sText + sIndex 
  634.                 }
  635.             }
  636.             
  637.             if ((isIE55 || isIE6) && found){
  638.                 var oPopup = false
  639.                 var oPopup = window.createPopup();
  640.                  var strScript = "<script language='JScript'> function clickPopup(){if (event.srcElement.tagName.toLowerCase() == 'a') parent.callPopup(event.srcElement.href); window.PopObject.hide(); return false;}</script>";
  641.                   var strDoc = oPopup.document.body.outerHTML.toLowerCase()
  642.                 
  643.                   oPopup.document.write(strDoc.replace("></body>", " onclick=\"clickPopup()\">" + strScript + "</body>"));
  644.                 //oPopup.document.write(strDoc.replace("></body>", " onclick=\"clickPopup()\, onkeypress=\"process_closePopup()\">" + strScript + "</body>"));
  645.                     oPopup.document.createStyleSheet(sSharedCHM + "article.css");    // Apply the stylesheet.
  646.                 var oPopBody = oPopup.document.body;
  647.                 
  648.                 //oPopBody.style.backgroundColor = '#FFFFCC';
  649.                 
  650.                   // oPopBody.style.border = "solid black 1px";
  651.                   oPopBody.style.margin = "0 0 0 0";
  652.                 if (isRTL) oPopBody.innerHTML = "<DIV DIR='RTL' class='XMLPopup'>" + sText + "</DIV>"           // need to add the style class here.
  653.                 else oPopBody.innerHTML = "<DIV class='XMLPopup'>" + sText + "</DIV>"
  654.                 if (window.event){
  655.                     joker = window.event.srcElement;
  656.                     }
  657.                 oPopup.show(0, 0, 400, 8, joker);    // Show the popup at an arbitrary size.
  658.                 var textSize = oPopBody.createTextRange();
  659.                 var wPop = textSize.boundingWidth + oPopBody.offsetWidth - oPopBody.clientWidth;    // Get the size of the text.
  660.                 var hPop = oPopBody.scrollHeight;
  661.                 oPopup.hide();
  662.                 oPopup.document.parentWindow.PopParent = window;
  663.                   oPopup.document.parentWindow.PopObject = oPopup;
  664.                 // oPopup.focus();
  665.                   oPopup.show(0, 1, wPop + 10, hPop, joker);
  666.                 //oPopup.document.focus(oPopup.document.body.JOKER);    
  667.                 return;
  668.                 }
  669.             
  670.             if (found){
  671.                 if (blague){
  672.                 document.body.insertAdjacentHTML("beforeEnd", "<DIV id='wPopupWeb' CLASS='popup'>" + sText + "</DIV>");
  673.                 blague = false;
  674.                 }
  675.                 window.wPopupWeb.innerHTML = sText;
  676.                 callPopupWeb(e);
  677.                 return;
  678.                 }
  679.                   
  680.    var iTOPIC = eH_.lastIndexOf("topic=");
  681.         if (iTOPIC==-1) return;
  682.         sParamTOPIC = eH.substring((iTOPIC+6),eH.length);          // extracts the topic for item2
  683.         
  684.   var iHELP = eH_.lastIndexOf("help=");
  685.         if (iHELP==-1) return;
  686.         sParamHELP = eH.substring(iHELP+5,iTOPIC);            // extracts the help file for item1
  687.         
  688.         if (document.hhPopup) document.hhPopup.outerHTML = "";    // if hhPopup object exists, clears it
  689.  
  690.  
  691.  var  h= "<object id='hhPopup'"+ sActX_HH + "STYLE='display:none'><param name='Command' value='WinHelp, Popup'>";
  692.       h= h + "<param name='Item1' value='" + sParamHELP + "'><param name='Item2' value='" + sParamTOPIC + "'></object>";
  693.         
  694.         document.body.insertAdjacentHTML("beforeEnd", h);     
  695.         document.hhPopup.hhclick();
  696. }
  697.  
  698.  
  699. //*** callAltLocation******************************************************************************
  700. // creates an object from an <A> tag HREF, the object will navigate to the alternate location if the first location is not found.
  701. // called from: <A ID="altLoc" HREF="CHM=@@1st_chm_name.chm;Alt_chm_name.chm@@  FILE=@@1st_file_name.htm;Alt_file_name.htm@@">@@Link text here@@</A>
  702.    
  703.  
  704. function callAltLocation(eventSrc) {
  705. var e= eventSrc;
  706. var eH= unescape(e.href);
  707. var eH_= eH.toLowerCase();
  708. var sFILEarray,sCHMarray;
  709.      event.returnValue = false;
  710.      
  711.   var sParamTXT= e.innerHTML;
  712.       sParamTXT= sParamTXT.replace(semicolon,"");
  713.                                        
  714.   var iFILE = eH_.lastIndexOf("file=");
  715.         if (iFILE==-1) return;
  716.         sParamFILE= eH.substring((iFILE+5),eH.length);                      // extracts the 2 HTM files
  717.         sParamFILE= sParamFILE.replace(spaces,"");
  718.         iSPLIT= sParamFILE.match(semicolon);
  719.         if (iSPLIT)
  720.               sFILEarray = sParamFILE.split(";");                    // separates the 2 HTM files
  721.         else return;
  722.           
  723.   var iCHM  = eH_.lastIndexOf("chm=");
  724.         if(iCHM==-1) return;
  725.         else         sParamCHM = eH.substring(iCHM+4,iFILE);            // extracts the 2 CHM's
  726.         sParamCHM= sParamCHM.replace(spaces,"");
  727.         iSPLIT= sParamCHM.match(semicolon);
  728.         if (iSPLIT)
  729.             sCHMarray= sParamCHM.split(";");                    // separates the 2 CHM's
  730.         else return;
  731.         
  732.         sParamFILE= moniker + sCHMarray[0]+ "::/" + sFILEarray[0] + ";" + moniker + sCHMarray[1]+ "::/" + sFILEarray[1];
  733.                 
  734.         if (document.hhAlt) document.hhAlt.outerHTML = "";                    // if hhAlt object exists, clears it
  735.  
  736.  
  737.   var h= "<object id='hhAlt'"+ sActX_HH + "STYLE='display:none'><PARAM NAME='Command' VALUE='Related Topics'>";
  738.       h= h + "<param name='Item1' value='" + sParamTXT +";" + sParamFILE + "'></object>";
  739.     
  740.         document.body.insertAdjacentHTML("beforeEnd", h); 
  741.         document.hhAlt.hhclick();
  742. }
  743.  
  744.  
  745. //*** callRelatedTopics******************************************************************************
  746. // creates an object from an <A> tag HREF, the object inserts a popup of the related topics to select
  747. // called from: <A ID="relTopics" HREF="CHM=@@chm_name1.chm;chm_name2.chm@@ META=@@a_filename1;a_filename2@@">Related Topics</A>
  748.    
  749.  
  750. function callRelatedTopics(eventSrc) {
  751. var e= eventSrc;
  752. var eH= unescape(e.href);
  753. var eH_= eH.toLowerCase();
  754.      event.returnValue = false;
  755.                                        
  756.   var iMETA = eH_.lastIndexOf("meta=");
  757.         if (iMETA==-1) return;
  758.         sParamMETA = eH.substring((iMETA+5),eH.length);              // extracts the META keywords for item2
  759.         
  760.   var iCHM  = eH_.lastIndexOf("chm=");
  761.         if(iCHM==-1) sParamCHM = "";
  762.         else         sParamCHM = eH.substring(iCHM+4,iMETA);        // extracts the CHM files for item1
  763.     
  764.         if (document.hhRel) document.hhRel.outerHTML = "";            // if hhRel object exists, clears it
  765.  
  766.  
  767.   var h= "<object id='hhRel'"+ sActX_HH + "STYLE='display:none'><param name='Command' value='ALink,MENU'>";
  768.       h= h + "<param name='Item1' value='" + sParamCHM + "'><param name='Item2' value='" + sParamMETA + "'></object>";
  769.     
  770.         document.body.insertAdjacentHTML("beforeEnd", h);     
  771.         document.hhRel.hhclick();
  772. }
  773.  
  774. //*** popNewWindow***************************************************************************************
  775. // creates an object from an <A> tag HREF, the object then opens a new window from the image URL found in the HREF
  776. // called from: <a id="thumbnail" title="Enlarge figure" href="CHM=NTArt.chm FILE=@@image_name.gif@@">@@alt text here@@</A>
  777. // the thumbnail image is loaded by loadPage();
  778.  
  779.  
  780. function popNewWindow(eventSrc) {
  781. var eH= eventSrc.href;
  782.       event.returnValue = false;
  783.       
  784.  // extracts the thumbnail image URL from the <a> tag HREF
  785.     sParamFILE =  getURL(eH);
  786.     if (sParamFILE=="") return;
  787.  
  788. //    alert(sParamFILE);
  789.        
  790.  // if the hhWindow object exists, clears it
  791.     if (document.hhWindow) document.hhWindow.outerHTML = "";        
  792.         
  793. var  h =  "<object id='hhWindow'"+ sActX_HH +" STYLE='display:none'><param name='Command' value='Related Topics'>";
  794.      h = h + "<param name='Window' value='$global_largeart'><param name='Item1' value='$global_largeart;" + moniker + sParamFILE+ "'> </object>";
  795.     
  796.      document.body.insertAdjacentHTML("beforeEnd", h);
  797.      document.hhWindow.hhclick();
  798. }
  799.  
  800. //*** callShortcut ***************************************************************************************
  801. // creates an object from an <A> tag, the object then calls the executable code
  802. // called from: <A ID="shortcut" HREF="EXEC=@@executable_name.exe@@ CHM=ntshared.chm FILE=@@error_file_name.htm@@">@@Shortcut text@@</A>
  803. // the shortcut image is loaded by loadInitialImg();
  804.  
  805. function callShortcut(eventSrc) {
  806. var e= eventSrc;
  807. var eH= unescape(e.href);
  808. var eH_= eH.toLowerCase();
  809.  
  810.     
  811.  
  812.     event.returnValue = false;
  813.               
  814.  // extracts the error file URL from the <a> tag HREF
  815.     iEND= eH.length;
  816.     sParamFILE =  getURL(eH);
  817.     
  818. var iEXEC = eH_.lastIndexOf("exec="); 
  819.         if (iEXEC==-1) return;
  820.         else sParamEXEC = eH.substring(iEXEC+5,iEND);        
  821.             // extracts the executable for item1
  822.         
  823.         if (document.hhShortcut) document.hhShortcut.outerHTML = "";        // if the hhShortcut object exists, clears it
  824.     
  825. var  h =  "<object id='hhShortcut'"+ sActX_HH +" STYLE='display:none'> <param name='Command' value='ShortCut'>";
  826.      if(sParamFILE != "") h = h + "<param name='Window' value='" + moniker + sParamFILE+ "'>";
  827.      h = h + "<param name='Item1' value='" + sParamEXEC + "'><param name='Item2' value='msg,1,1'></object>";
  828.  
  829.         document.body.insertAdjacentHTML("beforeEnd", h);
  830.         document.hhShortcut.hhclick();
  831. }
  832.  
  833. //*************  EXPAND FUNCTIONS **********************************
  834. //******************************************************************
  835.  
  836. //**  callExpand ***************************************************
  837. //  This expands & collapses (based on current state) "expandable" nodes as they are clicked.
  838. //  Called by: <A ID="expand" href="#">@@Hot text@@</A>
  839. //  Followed by:  <div class="expand">
  840.  
  841. function callExpand(eventSrc) {
  842.  
  843. var e= eventSrc;
  844.     event.returnValue = false;    // prevents navigating for <A> tag
  845.     
  846. var oExpandable = getExpandable(e); 
  847. var oImg = getImage(e);
  848.  
  849.      if (oExpandable.style.display == "block")
  850.           doCollapse(oExpandable, oImg);
  851.      else doExpand(oExpandable, oImg);
  852. }
  853.  
  854. //** expandGoesHot *****************************************
  855. // Returns expand image to hot. 
  856.  
  857. function expandGoesHot(eventSrc){
  858. var e= eventSrc;
  859.     
  860. var oExpandable = getExpandable(e);  
  861. var oImg = getImage(e);
  862.  
  863.    if (oExpandable.style.display == "block") oImg.src = expandHot;
  864.    else oImg.src = closedHot;
  865. }
  866.  
  867.  
  868. //** expandGoesCold ****************************************
  869. // Returns expand image to cold.
  870.  
  871. function expandGoesCold(eventSrc){
  872. var e= eventSrc;
  873.  
  874. var oExpandable = getExpandable(e);   
  875. var oImg = getImage(e);
  876.  
  877.  if (oExpandable.style.display == "block") oImg.src = expand;
  878.   else oImg.src = closed;
  879.     
  880. }
  881.  
  882.  
  883. //** getExpandable *****[used by callExpand, expandGoesHot, expandGoesCold]*****
  884. //  Determine if the element is an expandable node or a child of one.  
  885.  
  886. function getExpandable(eventSrc){
  887. var  e = eventSrc;
  888. var iNextTag, oExpandable;
  889.     
  890.        for (var i=1;i<4; i++){
  891.                iNextTag=    e.sourceIndex+e.children.length+i;
  892.               oExpandable= document.all(iNextTag);
  893.               if (oExpandable.className.toLowerCase()=="expand" || iNextTag == document.all.length)
  894.                    break;
  895.        }
  896.        return oExpandable;
  897.        
  898. }
  899.  
  900. //**  getImage *****[used by callExpand, expandGoesHot, expandGoesCold]*****
  901. //  Find the first image in the children of the current srcElement.   
  902. // (allows the  image to be placed anywhere inside the <A HREF> tag)
  903.  
  904. function getImage(header) {
  905. var oImg = header;
  906.  
  907.        if(oImg.tagName != "IMG") oImg=oImg.children.tags("IMG")(0);
  908.        return oImg;
  909. }
  910.  
  911.  
  912. //****  expandAll *****************************************************
  913. //  Will expand or collapse all "expandable" nodes when clicked. [calls
  914. //  closeAll()]called by: <A HREF="#" onclick="expandAll();">expand all</A>
  915.  
  916. var stateExpand = false;    //applies to the page 
  917.  
  918. //*********************************************************************
  919.  
  920. function expandAll() {
  921. var oExpandToggle, oImg;
  922. var expandAllMsg = "expand all";    //message returned when CloseAll() is invoked
  923. var closeAllMsg = "close all";    //message returned when ExpandAll() is invoked
  924. var e= window.event.srcElement;
  925.        event.returnValue = false;
  926.  
  927.        for (var i=0; i< document.anchors.length; i++){
  928.                oExpandToggle = document.anchors[i];
  929.          
  930.                 if (oExpandToggle.id.toLowerCase() == "expand"){ 
  931.                      oExpandable = getExpandable(oExpandToggle);  
  932.                      oImg = getImage(oExpandToggle);
  933.              
  934.                      if (stateExpand == true) doCollapse(oExpandable, oImg);
  935.                      else                     doExpand(oExpandable, oImg);
  936.                 }
  937.        }
  938.        if (stateExpand == true) {
  939.             stateExpand = false;
  940.             e.innerText= expandAllMsg;
  941.        }
  942.        else {
  943.             stateExpand = true;
  944.             e.innerText= closeAllMsg;
  945.        }
  946. }
  947.  
  948.  
  949. //****  doExpand ******************************************************
  950. //  Expands expandable block & changes image
  951.     
  952. var redo = false;    
  953. function doExpand(oToExpand, oToChange) {
  954. var oExpandable= oToExpand;
  955. var oImg= oToChange;
  956.  
  957. //    if (printing == "TRUE") return;
  958.  
  959.     oImg.src = expand;
  960.     oExpandable.style.display = "block";
  961.     
  962.     if (!redo && !isIE5) {
  963.         redo = true;
  964.         focus(oToExpand);
  965.         doExpand(oToExpand, oToChange);
  966.         }
  967.     }
  968.  
  969.  
  970. //****  doCollapse ****************************************************
  971. //  Collapses expandable block & changes image
  972.     
  973. function doCollapse(oToCollapse, oToChange) {
  974. // if (printing == "TRUE") return;
  975. var oExpandable= oToCollapse;
  976. var oImg= oToChange;
  977.  
  978.     oExpandable.style.display = "none";
  979.     oImg.src = closed;
  980. }
  981.  
  982. //*********************************************************************
  983. //******* WEB  FUNCTIONS **********************************************
  984. //*********************************************************************
  985.  
  986. //**** callThumbnailWeb ***********************************************
  987.  
  988. function callThumbnailWeb(eventSrc) {
  989. var e= eventSrc;
  990.        event.returnValue = false;
  991.                     
  992. var thumbnailWin= window.open (e.href, "$global_largeart",  "height=450, width=600, left=10, top=10, dependent=yes, resizable=yes, status=no, directories=no, titlebar=no, toolbar=yes, menubar=no, location=no","true");
  993.  
  994. thumbnailWin.document.write ("<html><head><title>Windows 2000</title></head><body><img src='"+e.href+"'></body></html>");
  995.  
  996. return;
  997. }
  998.  
  999. //*********************************************************************
  1000. //*********************************************************************
  1001.                             
  1002. var popupOpen= false;            //state of popups
  1003. var posX, posY;                //coordinates of popups
  1004. var oPopup;                    //object to be used as popup content
  1005.  
  1006. //**** callPopupWeb ***************************************************
  1007. // the web popups have been converted from the object winHelp popup for
  1008. // the web.  Called by: <A ID="wPopupWeb" HREF="#">@@Popup text@@</A>
  1009. // followed by: <div class="popup">Popup content</div>
  1010.  
  1011.  
  1012. function callPopupWeb(eventSrc) {
  1013. var e= eventSrc;
  1014.   
  1015.   // find the popup <div> that follows <a id="wPopupWeb"></a>
  1016.   findPopup(e);
  1017.   positionPopup(e)
  1018.  
  1019.   oPopup.style.visibility = "visible";
  1020.   // document.focus(e)
  1021.   popupOpen = true;
  1022.  
  1023.   return;
  1024. }
  1025.  
  1026. //**** findPopup *******************************************************
  1027.  
  1028. function findPopup(oX){
  1029. var e= oX;
  1030. var iNextTag;
  1031.     
  1032.     for (var i=1;i<document.all.length; i++){
  1033.          iNextTag=    e.sourceIndex + i;
  1034.          oPopup= document.all(iNextTag);
  1035.          if (oPopup.className.toLowerCase()=="popup" || iNextTag == document.all.length)
  1036.              break;
  1037.     }
  1038.     
  1039.     if (iNextTag != document.all.length) {
  1040.         posX = window.event.clientX; 
  1041.         posY = window.event.clientY + document.body.scrollTop+10;
  1042.     }
  1043.     if (popupOpen) closePopup();
  1044. }
  1045.  
  1046.  
  1047. //****  positionPopup ******************************************
  1048. // Set size and position of popup.
  1049. // If it is off the page, move up, but not past the very 
  1050. // top of the page.
  1051.  
  1052. function positionPopup(oX){
  1053. var e= oX;    
  1054. var popupOffsetWidth = oPopup.offsetWidth;
  1055.  
  1056. //determine if popup will be offscreen to right
  1057. var rightlimit = posX + popupOffsetWidth;
  1058.  
  1059.   if (rightlimit >= document.body.clientWidth) 
  1060.       posX -= (rightlimit - document.body.clientWidth);
  1061.   if (posX < 0) posX = 0;
  1062.     
  1063. //position popup
  1064.   oPopup.style.top = posY;
  1065.   oPopup.style.left = posX;
  1066.  
  1067. var pageBottom = document.body.scrollTop + document.body.clientHeight;
  1068. var popupHeight = oPopup.offsetHeight;
  1069.   
  1070.   if (popupHeight + posY >= pageBottom) {
  1071.       if (popupHeight <= document.body.clientHeight)
  1072.           oPopup.style.top = pageBottom - popupHeight;
  1073.       else
  1074.            oPopup.style.top = document.body.scrollTop;
  1075.   }
  1076. }
  1077.  
  1078. //**** closePopup *****************************************************
  1079. // Close Popup
  1080. function closePopup() {
  1081.  
  1082.   oPopup.style.visibility = "hidden";
  1083.   popupOpen = false;
  1084.   return;
  1085. }
  1086.  
  1087.  
  1088. //***************  GENERAL FUNCTIONS **********************************
  1089. //*********************************************************************
  1090.  
  1091. //***ajustImg *********************************************************
  1092. // expands an image to the with of the window or shrinks it to 90px
  1093.  
  1094. function ajustImg(eventSrc) {
  1095. var e= eventSrc;
  1096. var fullWidth= document.body.offsetWidth;
  1097.  
  1098.     fullWidth = fullWidth - 50;
  1099.     if (e.style.pixelWidth==90)
  1100.          e.style.pixelWidth=fullWidth;
  1101.     else e.style.pixelWidth=90;
  1102. }
  1103.  
  1104.  
  1105. //**  getURL *****[used in callShortcut, popNewWindow& loadPage]********
  1106. // extracts the file location (CHM::/HTM) URL 
  1107.  
  1108. function getURL(sHREF) {
  1109. var spaces= /\s/g
  1110. var eH = unescape(sHREF);
  1111.     eH = eH.replace(spaces,""); 
  1112.  
  1113. var eH_= eH.toLowerCase();
  1114. var sParamFILE= "";
  1115. var sParamCHM= "";
  1116.  
  1117. var iFILE= eH_.lastIndexOf("file=");
  1118.     if (iFILE!=-1){
  1119.         iEND= iFILE +1;
  1120.         sParamFILE = eH.substring(iFILE+5,eH.length);
  1121.     }
  1122.  
  1123. var iCHM  = eH_.lastIndexOf("chm=");
  1124.      
  1125. if (gifwithin){
  1126.     gifwithin = false;
  1127.     var con_mmc;
  1128.     var doc_mmc;
  1129.     doc_mmc = " " + document.location;
  1130.     doc_mmc = doc_mmc.toLowerCase();
  1131.     if (iCHM!=-1){
  1132.         iEND  = iCHM +1;             // iEND used by callShortcut
  1133.         sParamCHM = eH.substring(iCHM+4, iFILE);
  1134.         con_mmc = doc_mmc.indexOf(sParamCHM);
  1135.             if (con_mmc != -1){
  1136.                 sParamCHM = "";
  1137.                 iCHM = -1;
  1138.             sParamFILE= sParamCHM+sParamFILE;    
  1139.             }
  1140.         }
  1141.     }
  1142.  
  1143.      if (iCHM!=-1){
  1144.         iEND  = iCHM +1;             // iEND used by callShortcut
  1145.         sParamCHM = eH.substring(iCHM+4, iFILE);
  1146.         sParamFILE= sParamCHM+"::/"+sParamFILE;    
  1147.         }    
  1148.     return sParamFILE;
  1149. }
  1150. //********************************************************************
  1151. //************  IE5 PERSISTENCE  *************************************
  1152. //********************************************************************
  1153.  
  1154. var oTD,iTD;         // persistence
  1155.  
  1156. //****** Persistence for userData ************************************ 
  1157.  
  1158. function getChecklistState(){ 
  1159.  
  1160.  var pageID= addID();
  1161.  
  1162.     if (checklist.all== "[object]") {
  1163.     oTD=checklist.all.tags("INPUT");
  1164.     iTD= oTD.length;
  1165.         }
  1166.     else
  1167.         {
  1168.         printing = "TRUE";
  1169.         isPersistent = false;
  1170.         return;
  1171.         }
  1172.  
  1173.     if (iTD == 0){
  1174.         printing = "TRUE";
  1175.         isPersistent = false;
  1176.         return;
  1177.         }
  1178.     
  1179. // routine added to fix a bug in the ocx 06/14/99    
  1180.      lct = document.location + ".";
  1181.      xax = 10;
  1182.      xax = lct.indexOf("mk:@MSITStore");
  1183.      if (xax != -1) {
  1184.          lct = "ms-its:" + lct.substring(14,lct.length-1);
  1185.         // alert("before reload : " + document.location);
  1186.         // alert("replace with : " + lct);
  1187.         isPersistent = false;
  1188.         document.location.replace(lct);
  1189.         isPersistent = true;
  1190.         // alert("after reload : " + document.location);
  1191.         }     
  1192.      else
  1193.          {      
  1194.          checklist.load("oXMLStore");
  1195.         }
  1196. // routine added to fix a bug in the ocx 06/14/99
  1197.     if (checklist.getAttribute("sPersist"+pageID+"0"))    
  1198.     for (i=0; i<iTD; i++){
  1199.  
  1200.          if (oTD[i].type =="checkbox" || oTD[i].type =="radio"){
  1201.          checkboxValue= checklist.getAttribute("sPersist"+pageID+i);
  1202.         
  1203.          if (checkboxValue=="yes") oTD[i].checked=true;
  1204.          else oTD[i].checked=false;
  1205.          }// if
  1206.          if (oTD[i].type =="text")              
  1207.               oTD[i].value= checklist.getAttribute("sPersist"+pageID+i);
  1208.      }// for
  1209. } // end persistence
  1210.  
  1211. //**  saveChecklistState ***********************************************
  1212. function saveChecklistState(){
  1213. var pageID= addID(); 
  1214.  
  1215.         if (!isPersistent) return; 
  1216.          //  you will need this document.location
  1217.         for (i=0; i<iTD; i++){
  1218.  
  1219.                 if (oTD[i].type =="checkbox" || oTD[i].type =="radio"){
  1220.                  if (oTD[i].checked) checkboxValue="yes";
  1221.                  else checkboxValue="no";
  1222.                  
  1223.                  checklist.setAttribute("sPersist"+pageID+i, checkboxValue);
  1224.              }// if
  1225.             
  1226.               if (oTD[i].type =="text") 
  1227.                  checklist.setAttribute("sPersist"+pageID+i, oTD[i].value);
  1228.          }    // for
  1229.  
  1230.  // routine added to fix a bug in the ocx 06/14/99    
  1231.      lct = document.location + ".";
  1232.      xax = 10;
  1233.      xax = lct.indexOf("mk:@MSITStore");
  1234.      if (xax != -1) {
  1235.          lct = "ms-its:" + lct.substring(14,lct.length-1);
  1236.         // alert("before reload : " + document.location);
  1237.         // alert("replace with : " + lct);
  1238.         isPersistent = false;
  1239.         document.location.replace(lct);
  1240.         isPersistent = true;
  1241.         // alert("after reload : " + document.location);
  1242.         }     
  1243.      else
  1244.          {      
  1245.          checklist.save("oXMLStore");
  1246.         }
  1247. // routine added to fix a bug in the ocx 06/14/99
  1248.      
  1249. }//end function
  1250.  
  1251. //**  resizeDiv *****[used with callPopupWeb, setPreviousNext}*****
  1252. //  resize the page when the <div class=nav></div> && 
  1253. //  <div class=text></div> are found
  1254.  
  1255. function resizeDiv(){
  1256. if (printing == "TRUE") return;
  1257. var oNav = document.all.item("nav");
  1258. var oText= document.all.item("text");
  1259.  
  1260.     if (popupOpen) closePopup();
  1261.     if (oText == null) return;
  1262.     if (oNav != null){
  1263.         document.all.nav.style.width= document.body.offsetWidth;
  1264.         document.all.text.style.width= document.body.offsetWidth-4;
  1265.         document.all.text.style.top= document.all.nav.offsetHeight;
  1266.         if (document.body.offsetHeight > document.all.nav.offsetHeight)
  1267.             document.all.text.style.height= document.body.offsetHeight - document.all.nav.offsetHeight;
  1268.          else document.all.text.style.height=0; 
  1269.   }
  1270. }
  1271. //**  addID *********************************************************
  1272. function addID(){
  1273.  
  1274. var locID = document.location.href; 
  1275. var iHTM = locID.lastIndexOf(".htm");
  1276. var iName=locID.lastIndexOf("/");
  1277.       locID = locID.substring(iName+1,iHTM);
  1278.     
  1279.     return locID;
  1280. }    
  1281. //** set_to_print ***************
  1282. function set_to_print(){
  1283.     
  1284.     var i;
  1285.     printing = "TRUE";
  1286.  
  1287.  
  1288.  
  1289. // trying    
  1290.  isPersistent= (document.all.item("checklist")!=null) && ((isIE5) || (isIE6));
  1291.  setPreviousNext();
  1292.  resizeDiv();
  1293.  if (isPersistent) getChecklistState();
  1294.  addReusableText();
  1295.  if (isIE55){
  1296.       insertImages();
  1297.      }
  1298. if (isIE6){
  1299.       insertImages();
  1300.      }
  1301.  
  1302. // to fix printing
  1303.  
  1304.  
  1305.     if (window.text) {
  1306.         if (!window.text.style){
  1307.             scroller = "FALSE";
  1308.             }
  1309.         else
  1310.             {
  1311.             document.all.text.style.height = "auto";
  1312.             scroller = "TRUE";
  1313.             }
  1314.         }
  1315.     
  1316. var thisLoc= document.location.href;
  1317.     thisLoc = thisLoc.indexOf("glossary.htm")
  1318.     if (thisLoc == -1){
  1319.         return;
  1320.         }
  1321.     
  1322.     // if(!isIE55 || !isIE6){
  1323.     for (i=0; i < document.all.length; i++){
  1324.         if (document.all[i].id == "expand") {
  1325.             callExpand(document.all[i]);
  1326.             single = "TRUE";
  1327.             }
  1328.         if (document.all[i].tagName == "BODY") {
  1329.             document.all[i].scroll = "auto";
  1330.             }
  1331.         if (document.all[i].tagName == "A" && scroller != "TRUE") {
  1332.             joe = " " + document.all[i].outerHTML
  1333.             joe = joe.toLowerCase();
  1334.             joe = joe.indexOf("href=")
  1335.             if(joe == -1){
  1336.                 document.all[i].outerHTML = "<A NAME=''>" + document.all[i].innerHTML + "</a>";
  1337.                 }
  1338.             else
  1339.                 {
  1340.                 document.all[i].outerHTML = "<A HREF=''>" + document.all[i].innerHTML + "</a>";
  1341.                 }
  1342.             }
  1343.         }
  1344.         //}
  1345. // reset_form();
  1346.     
  1347. }
  1348. //** used to reset a page if needed ********************
  1349. function reset_form(){
  1350.     printing = "FALSE";
  1351.     document.location.reload();
  1352. }
  1353.  
  1354.     
  1355. //** on error routine *********************************
  1356. function errorHandler() {
  1357.   // alert("Error Handled");
  1358.   return true;
  1359. }
  1360.  
  1361. //** quad method code -- morphed to work inside of shared.js
  1362. function QuadDocumentMouseOver()
  1363. {
  1364.     var elem = event.srcElement;
  1365.     
  1366.     // If the first childe of the source element is a radio button and 
  1367.     // the parent element isn't grayed, change the cursor to a hand
  1368.     // or back to the original as appropriate.
  1369.     if (elem != null && elem.firstChild != null && 
  1370.         elem.firstChild.tagName != null &&
  1371.         elem.firstChild.tagName.toLowerCase() == "input" && 
  1372.         elem.firstChild.type.toLowerCase() == "radio" && 
  1373.         elem.parentElement.className != "indentGray")
  1374.     {
  1375.         if (elem.style.cursor == "hand")
  1376.             elem.style.cursor = "auto";
  1377.         else
  1378.             elem.style.cursor = "hand";
  1379.     }
  1380. }
  1381.  
  1382. function QuadDocumentClick()
  1383. {
  1384.     // Don't process clicks on grayed text.
  1385.     if (event.srcElement.parentElement.className == "indentGray")
  1386.         return;
  1387.     
  1388.     // INPUT elements should be wrapped by another element  
  1389.     // such as a SPAN, DIV, or P.
  1390.     var elem = event.srcElement.firstChild;
  1391.     
  1392.     // If this is a radio button...
  1393.     if (elem != null && elem.tagName != null && elem.tagName.toLowerCase() == "input" && elem.type == "radio")
  1394.     {
  1395.         // check it.
  1396.         elem.checked = true;
  1397.     }
  1398.     else
  1399.     {    
  1400.         // Otherwise, set elem to the event's source element.
  1401.         elem = event.srcElement;
  1402.     }
  1403.     
  1404.     // Call OnElementClick() and pass in the source element, 
  1405.     // and the name token used to mark a top-level clickable 
  1406.     // element such as a radio button.
  1407.     OnElementClick(elem, "row1");
  1408. }
  1409.  
  1410. function OnElementClick(srcElem, token)
  1411. {
  1412.     var elemTagName = srcElem.tagName;    // Tag name of the source element.
  1413.     var collElements1 = document.all.item(srcElem.name);            
  1414.                             // Collection of elements with the same name property as the source element.
  1415.     var n = srcElem.sourceIndex;        // The source index of the source element.
  1416.     var elemGroup = srcElem.group;    // The (dynamic) group property for the source element.
  1417.     var elemID = srcElem.id;        // The source element's ID.
  1418.     var i, j, k;                // Loop variables.
  1419.     
  1420.     // If there are no elements with the same name as the source 
  1421.     // element, or if the source element isn't part of a group, 
  1422.     // exit the function.
  1423.     if (collElements1 == null || elemGroup == null || collElements1.length == null)
  1424.         return;
  1425.     
  1426.     // Make sure the source element's name contains the designated     
  1427.     // token so we know it's top-level element that should be 
  1428.     // processed.
  1429.     if (srcElem.name.toLowerCase().indexOf(token) != -1)
  1430.     {
  1431.         // Loop through the collection of 
  1432.         for (i = 0; i < collElements1.length; i++)
  1433.         {
  1434.             // Go up one level and then down a level in             
  1435.             // the element hierarchy to find the container 
  1436.             // (parent) element for the clickable sub-elements 
  1437.             // (radio buttons).
  1438.             var oNextElement = collElements1(i).parentElement.nextSibling;
  1439.             
  1440.             // If there is no such element, get the next element 
  1441.             // in the collection.
  1442.             if (oNextElement == null || oNextElement.tagName == null)
  1443.                 continue;
  1444.             
  1445.             // Get the collection of all the elements within the 
  1446.             // container element that have the same tag name as 
  1447.             // the source element.
  1448.             var collElements2 = oNextElement.all.tags(elemTagName);
  1449.             
  1450.             // Make sure the collection is valid.
  1451.             if (collElements2 == null || collElements2.length == 0)
  1452.                 continue;
  1453.  
  1454.             // Loop through the collection of sub-elements 
  1455.             // within the container element.
  1456.             for (j = 0; j < collElements2.length; j++)
  1457.             {
  1458.                 // If the current element in the collection is 
  1459.                 // not the source element, disable it and make 
  1460.                 // the text gray.
  1461.                 if (collElements1(i).sourceIndex != n)
  1462.                 {
  1463.                     oNextElement.className = "indentGray"
  1464.                     collElements2(j).disabled = true;
  1465.                 }
  1466.                 else    // Otherwise, enable the element and 
  1467.                     // make the text black.
  1468.                 {
  1469.                     oNextElement.className = "indentBlack"
  1470.                     collElements2(j).disabled = false;
  1471.                     
  1472.                     // Set the ID for the checked (selected) 
  1473.                     // element for use below.
  1474.                     if (collElements2(j).tagName.toLowerCase() == "input" && 
  1475.                         collElements2(j).type.toLowerCase() == "radio" && 
  1476.                         collElements2(j).checked == true)
  1477.                     {
  1478.                         elemID = collElements2(j).id;
  1479.                     }
  1480.                 }
  1481.             }
  1482.         }
  1483.     }
  1484.     
  1485.     // Get the collection of all of the elements with
  1486.     // the same tag name as that of the source element.
  1487.     var collElements2 = document.all.tags(elemTagName);
  1488.         
  1489.     // Make sure the collection is valid.
  1490.     if (collElements2 == null || collElements2.length == 0)
  1491.         return;
  1492.         
  1493.     // Loop through the collection of elements.
  1494.     for (i = 0; i < collElements2.length; i++)
  1495.     {
  1496.         // Get the collection of all elements with the same ID
  1497.         //  as the current item in the collection.
  1498.         var collAssocElems = document.all(collElements2(i).id);
  1499.                 
  1500.         // Make sure the collection is valid.
  1501.         if (collAssocElems == null || collAssocElems.length == 0)
  1502.             continue;
  1503.             
  1504.         // Loop through the collection of same-named elements.
  1505.         for (j = 0; j < collAssocElems.length; j++)
  1506.         {
  1507.             // If the tag name for the current element is 
  1508.             // different than that for the source element,
  1509.             // and the current element is part of the same 
  1510.             // group as the source element, hide or 
  1511.             // display the element as appropriate.
  1512.             if (collAssocElems(j).tagName != elemTagName && collAssocElems(j).group == elemGroup)
  1513.             {
  1514.                 // Hide the element unless the current element's 
  1515.                 // ID matches the ID of the element that has 
  1516.                 // been checked (selected).
  1517.                 collAssocElems(j).style.display = ((collAssocElems(j).id == elemID) ? "block" : "none")
  1518.             }
  1519.         }
  1520.     }
  1521. }
  1522.  
  1523.