home *** CD-ROM | disk | FTP | other *** search
/ ftp.ac-grenoble.fr / 2015.02.ftp.ac-grenoble.fr.tar / ftp.ac-grenoble.fr / assistance.logicielle / XP_ServicePack-3.iso / support / tools / deploy.cab / ref.chm / shared.js < prev    next >
Text File  |  2006-12-29  |  73KB  |  1,931 lines

  1. // Filename: shared.js
  2. // Version shared.js for windows.net
  3. // version for b3
  4.  
  5. //************************************************ Shared components path setting *****************************************
  6. //*******************************************************************************************************************
  7. //    Date   11/07/01
  8. //  
  9.  
  10. set_path = "" + document.URL
  11. ntshared = set_path.indexOf("::/")
  12.  
  13. if (ntshared == -1) {
  14.     var moniker= "ms-its:";                  
  15.     var sSharedCHM = moniker+"ref.chm::/";         
  16.     }                                                    
  17. else
  18.     {
  19.     path = set_path.substring(0,ntshared)
  20.     path = path.toLowerCase()
  21.     ntshared = path.lastIndexOf("\\")
  22.     var moniker = path.substring(0,ntshared)+ "\\";
  23.     //var ntshared = moniker.lastIndexOf("\\")
  24.     //var moniker = moniker.substring(0,ntshared) + "\\";
  25.     var sSharedCHM= moniker+"ref.chm::/";
  26.     }
  27.  
  28.  
  29.  
  30.  
  31. //************************************************ EVENT HANDLING ********************************************
  32. //*******************************************************************************************************************
  33. //  re-directs to the proper event-driven functions.
  34.  
  35. // window.onload = load_object;
  36. window.onload = loadPage;
  37. document.onclick= onclickTriage;
  38. document.onmouseover= gettingHot;
  39. document.onmouseout= gettingCold;
  40. window.onunload=saveChecklistState;
  41. window.onresize= resizeDiv;
  42.  
  43. window.onbeforeprint = set_to_print;
  44. window.onafterprint = reset_form;
  45.         
  46. //********************************************  USER-DEFINED GLOBAL VARIABLES  ************************************
  47. //********************************************************************************************************************
  48. //  The images listed below can all be changed by the user.
  49. var isIE5 = (navigator.appVersion.indexOf("MSIE 5")>0) || (navigator.appVersion.indexOf("MSIE")>0 && parseInt(navigator.appVersion)> 4);
  50. var isIE55 = (navigator.appVersion.indexOf("MSIE 5.5")>0);
  51. if (isIE5 && isIE55) isIE5 = false;
  52. var isIE6 = (navigator.appVersion.indexOf("MSIE 6")>0);
  53. var isIE4 = (navigator.appVersion.indexOf("MSIE 4")>0);
  54.  
  55. if (isIE4){
  56.     var moniker= "ms-its:";                                         // moniker= ""; for flat files
  57.     var sSharedCHM= moniker+"ref.chm::/";
  58. }
  59.  
  60.  
  61. if (!isIE5 && !isIE55 && !isIE4 && !isIE6) {
  62.     isIE6 = true;
  63.     }
  64.  
  65.  
  66. var sShortcutTip= "";
  67.  
  68. var gifwithin = false;
  69.  
  70.  
  71.  
  72. if(!isIE4){
  73.     xmldoc = new ActiveXObject("microsoft.XMLDOM");
  74.     xmldoc.async = false;
  75.     xmldoc.load(sSharedCHM + "alttext.xml");
  76.  
  77.     var Alt_sPreviousTip= xmldoc.getElementsByTagName("sPreviousTip")
  78.     var Alt_sNextTip= xmldoc.getElementsByTagName("sNextTip")
  79.     var Alt_sExpandTip= xmldoc.getElementsByTagName("sExpandTip")
  80.     var Alt_sPopupTip= xmldoc.getElementsByTagName("sPopupTip")
  81.     var hld_path2reuse= xmldoc.getElementsByTagName("path2reuse")
  82.     var hld_path2glossary= xmldoc.getElementsByTagName("path2glossary")
  83.     var hld_rel_gif = xmldoc.getElementsByTagName("reltopgif")
  84.     var hld_chmName = xmldoc.getElementsByTagName("chmName")
  85.     var hld_emailer = xmldoc.getElementsByTagName("emailer")
  86.     var hld_sendtext = xmldoc.getElementsByTagName("sendtext")
  87.     var hld_sendto = xmldoc.getElementsByTagName("sendto")
  88.     
  89.     //<SMARTHELP>
  90.  
  91.    var defaultStartMode;
  92.    var defaultCPanelMode;
  93.    var smartErrorTextNode;
  94.    var smartErrorText;
  95.    var xmldocSKUSettings;
  96.  
  97.    // Grab the ALTTEXT.XML enteries for smart span classes.
  98.    // Get SKU specific defaults.
  99.    var defaultSKUSettingsURL = xmldoc.documentElement.selectSingleNode("smartreusabletext");
  100.    if (defaultSKUSettingsURL != null) {
  101.       if (defaultSKUSettingsURL.text == sSharedCHM + "alttext.xml") {
  102.           xmldocSKUSettings = xmldoc;
  103.       } else {
  104.          xmldocSKUSettings = new ActiveXObject("microsoft.XMLDOM");
  105.          xmldocSKUSettings.async = false;
  106.          xmldocSKUSettings.load(moniker + defaultSKUSettingsURL.text);
  107.       }
  108.       if (xmldocSKUSettings.documentElement != null) {
  109.          defaultStartMode = xmldocSKUSettings.documentElement.selectSingleNode("smartstartdefault");
  110.          defaultCPanelMode = xmldocSKUSettings.documentElement.selectSingleNode("smartcpaneldefault");
  111.          smartErrorTextNode = xmldocSKUSettings.documentElement.selectSingleNode("smarterrortext");
  112.          smartErrorText = smartErrorTextNode ? smartErrorTextNode.text : "XOXOX";
  113.       }
  114.    } // (defaultSKUSettingsURL != NULL)
  115.  
  116. //</SMARTHELP>
  117.  
  118.     
  119.     var sPreviousTip="" + Alt_sPreviousTip.item(0).nodeTypedValue
  120.     var sNextTip="" + Alt_sNextTip.item(0).nodeTypedValue
  121.     var sExpandTip="" + Alt_sExpandTip.item(0).nodeTypedValue
  122.     var sPopupTip="" + Alt_sPopupTip.item(0).nodeTypedValue
  123.     var path2reuse="" + hld_path2reuse.item(0).nodeTypedValue
  124.     var path2glossary="" + hld_path2glossary.item(0).nodeTypedValue
  125.     var rel_gif="" + hld_rel_gif.item(0).nodeTypedValue
  126.     var chmName="" + hld_chmName.item(0).nodeTypedValue+"::/"
  127.     var emailer="" + hld_emailer.item(0).nodeTypedValue
  128.     var sendtext="" + hld_sendtext.item(0).nodeTypedValue
  129.     var sendto="" + hld_sendto.item(0).nodeTypedValue
  130.     
  131. var xmldom = new ActiveXObject("microsoft.XMLDOM");
  132.     xmldom.async = false;
  133.     
  134. //if (!xmlLoaded) {
  135.  
  136.             xmldoc = new ActiveXObject("microsoft.XMLDOM");
  137.  
  138.             // Init Properties
  139.             xmldoc.async = false;
  140.             xmldoc.validateOnParse = false; // improve perf
  141.             xmldoc.resolveExternals = false;
  142.             xmldoc.preserveWhiteSpace = false;
  143.  
  144.             // Load Document
  145.             xmldoc.load(moniker + path2reuse + "reusable.xml");
  146.             // if (xmldoc == null || xmldoc.documentElement == null) return;     // couldn't open reusable.xml
  147.             xmlLoaded = true;
  148. //         }
  149.  
  150. } // skip all this because ie4 doesn't support xml.
  151. else
  152. {
  153. var sPreviousTip="" 
  154.     var sNextTip=""
  155.     var sExpandTip=""
  156.     var sPopupTip=""
  157.     var rel_gif="no"
  158. }
  159.  
  160. var closed = sSharedCHM + "plusCold.gif";            //image used for collapsed item in callExpand()
  161. var closedHot = sSharedCHM + "plusHot.gif";            //hot image used for collapsed item in callExpand()
  162. var expand = sSharedCHM + "minusCold.gif";            //image used for expanded item in callExpand()
  163. var expandHot = sSharedCHM + "minusHot.gif";        //hot image used for expanded item in callExpand()
  164.  
  165. var previousCold= sSharedCHM + "previousCold.gif";
  166. var previousHot= sSharedCHM + "previousHot.gif"; 
  167. var nextCold= sSharedCHM + "nextCold.gif";
  168. var nextHot= sSharedCHM + "nextHot.gif"; 
  169.  
  170. var shortcutCold= sSharedCHM + "shortcutCold.gif";
  171. var shortcutHot= sSharedCHM + "shortcutHot.gif";
  172.  
  173. var popupCold= sSharedCHM + "popupCold.gif";
  174. var popupHot= sSharedCHM + "popupHot.gif";
  175.  
  176. var emptyImg= sSharedCHM + "empty.gif";        //image used for empty expand
  177. var noteImg= sSharedCHM + "note.gif";            //image used for notes
  178. var tipImg= sSharedCHM + "tip.gif";            //image used for tips
  179. var warningImg= sSharedCHM + "warning.gif";        //image used for warnings
  180. var cautionImg= sSharedCHM + "caution.gif";        //image used for cautions
  181. var importantImg= sSharedCHM + "important.gif";        //image used for important notice
  182. var relTopicsImg= sSharedCHM + "rel_top.gif";        //image used for important notice
  183.  
  184. var branchImg= sSharedCHM + "elle.gif";
  185. var branchImg_RTL= sSharedCHM + "elle_rtl.gif";
  186.  
  187.  
  188. //********************************************  GLOBAL VARIABLES  ******************************************
  189. //********************************************************************************************************
  190.  
  191. var joejoe = false;
  192. var printing = false;
  193. var single = "FALSE";
  194. var scroller = "FALSE";
  195. var valet = "FALSE";
  196. var isRTL= (document.dir=="rtl");
  197. var imgStyleRTL= ""; 
  198.       if (isRTL) imgStyleRTL=" style='filter:flipH' ";
  199.  
  200. var sActX_TDC= "CLASSID='CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83'";        //Tabular Data Control  for  reusable text data
  201. var sSharedReusableTextFile= sSharedCHM + "reusable.xml";                                        // common reusable text file
  202. var sSharedReusableTextFileRecord= "para";                                                        //reusable text record
  203.  
  204. var numbers= /\d/g;                //javascript regular expression
  205. var spaces= /\s/g;                //javascript regular expression
  206. var semicolon= /;/g;            //javascript regular expression
  207.  
  208. var isPersistent= false;
  209.  
  210.  
  211.  
  212.     
  213. //********************************************  INITIALIZATION  *************************************************
  214. //******************************************************************************************************************
  215. function list_them(){
  216.         
  217.     var envelope = sSharedCHM +'envelope.gif';
  218.     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 + " "; 
  219.     server += "<a href='mailto:" + sendto + "?subject=HELP: ";
  220.     server += document.title + "'";
  221.     server += ">" + sendto + "</a></SPAN></DIV>";
  222.     
  223.     var i;
  224.  
  225.     for (i=0; i < document.all.length; i++){
  226.         if ((document.all[i].tagName == "P") ||
  227.             (document.all[i].tagName == "H1")||
  228.             (document.all[i].tagName == "H6")){
  229.             document.all[i].outerHTML = server + document.all[i].outerHTML;
  230.             i = document.all.length;
  231.             }
  232.         }
  233. }
  234. //*** loadPage **********************************************************************************************
  235. //  Adds the default image tags and re-usable text to the HTML page.
  236.  
  237. function loadPage(){
  238. if (printing == true) return;
  239.  
  240. if (emailer == "yes" ) list_them();
  241.  
  242. isPersistent= (document.all.item("checklist")!=null) && ((isIE5) || (isIE55) ||(isIE6));
  243.  
  244.   setPreviousNext();
  245.   
  246.   resizeDiv();
  247.   if (isPersistent) getChecklistState();
  248.    
  249.      load_object();
  250.     addReusableText();
  251.     
  252.     insertImages();
  253. }
  254.  
  255. //****** setPreviousNext  ************************************************************************ ********************************************************************************************* 
  256. // insert previous/next navbar
  257. // called by: <div id="nav">@@HTMLsequenceFile.txt or .lst@@</div>
  258.  
  259. function setPreviousNext(){
  260.  
  261.   var oNav = document.all.item("nav");
  262.         if (oNav == null ) return;
  263.   
  264.   var sPreviousALT= sPreviousTip;
  265.   var sNextALT= sNextTip;
  266.   var sHTMLfile= oNav.innerHTML;
  267.  
  268.   var imgPrev= "<IMG SRC='"+previousCold+"' BORDER=0 ALT='"+ sPreviousALT +"' ALIGN='top' "+ imgStyleRTL +">";
  269.   var imgNext= "<IMG SRC='"+nextCold+"' BORDER=0 ALT='"+ sNextALT  + "' ALIGN='top' "+ imgStyleRTL +">";
  270.   
  271.   var previousNextObject= "<OBJECT ID='HTMlist' WIDTH=100 HEIGHT=51 " + sActX_TDC +"><param name='DataURL' value='"
  272.         +sHTMLfile +"'><param name='UseHeader' value=True></OBJECT>";
  273.       
  274.         oNav.innerHTML= "<TABLE WIDTH='100%' STYLE='margin-top:0;' cellspacing=0>"
  275.         + "<TR><TD style='text-align=left; background-color:transparent'><A ID='previousLink' HREF='#' REL='previous' CLASS='navbar'>"
  276.         +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'>"
  277.         +imgNext+ "</A></TD></TR></TABLE>";
  278.                     
  279.       document.body.innerHTML= document.body.innerHTML +  previousNextObject;
  280.       findPageSeq();
  281.       if (printing == true) return;
  282.       var  thisLoc= document.location.href +"#";
  283.  
  284.       if (previousLink.href== thisLoc) previousLink.style.display="none";
  285.       else  previousLink.style.display="block";
  286.  
  287.       if (nextLink.href== thisLoc) nextLink.style.display="none";
  288.       else  nextLink.style.display="block";
  289.       
  290. }
  291.  
  292. function findPageSeq() {
  293.  
  294. var rs= HTMlist.recordset;
  295. var thisLoc= document.location.href;
  296. var iLoc= thisLoc.lastIndexOf("/");
  297.  
  298.     if (iLoc > 0) thisLoc= thisLoc.substring(iLoc+1, thisLoc.length);
  299.     
  300.     
  301.     if (nav.style == "[object]") {
  302.                 nav.style.visibility="hidden";
  303.                 printing = false;
  304.                 }
  305.         else
  306.             {
  307.                 printing = true;
  308.                 return;
  309.             }
  310.     
  311.        
  312.     rs.moveFirst();
  313.        
  314.     while (!rs.EOF) {
  315.           if (thisLoc == rs.fields("HTMfiles").value){
  316.               nav.style.visibility="visible"; 
  317.                 rs.MoveNext();
  318.               break;
  319.           }
  320.           previousLink.href=rs.fields("HTMfiles").value;      
  321.           rs.moveNext();
  322.      }
  323.                 
  324.       if (!rs.EOF) nextLink.href=rs.fields("HTMfiles").value;
  325. }
  326.     
  327. //******Re-usable text ********************************************************************************************* 
  328. // Inserts the Tabular Data Control (TDC) object at the end of the page 
  329. // Inserts "re-usable text" from the txt file at: <span id="@@CHM_name@@@@index#@@" class="reuse"></span>
  330. // e.g.<span id="printing4" class="reuse"></span> for record#4 in the printing.txt in printing.chm.
  331.  
  332. // <SMARTREUSABLETEXT>
  333.  
  334. // addReusableText() - called during document load to find all references
  335. // render time bound <SPAN> contents.  Extracts content resources from reusable.xml.
  336. //
  337. // "class" names bound (reuse, smart)
  338. // "reuse" static lookup of commonly referred to text.
  339. // "smart" dynamic lookup of navigation text relevent 
  340. //         to the shell presentation of the start menu 
  341. //         and the control panel, (simple and classic), for the logged on user.
  342. //         Requires inserting custom <OBJECT> supported by Help and Support Services viewer.
  343. //         Currently not available from HTML Help control. 2000/01/12.
  344. //
  345. function smarthelperror(){
  346.     // alert("error - error")
  347.     addReusableText();
  348.     
  349.     insertImages();
  350.     return true;
  351.     // alert("error - error")
  352.     }
  353.  
  354. //var obj = window.document.createElement("OBJECT");
  355.     
  356. function load_object(){
  357.             if(!isIE6) return;
  358.             
  359.             //window.onerror = smarthelperror;
  360.         try{
  361.             var obj = window.document.createElement("OBJECT");
  362.             var sActX_PCHealth = "CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7";
  363.            objLoaded = true;    
  364.            obj.width = 1;
  365.            obj.height = 1;
  366.         
  367.            obj = document.body.insertAdjacentElement("beforeEnd", obj)
  368.            obj.id = "pchealth";
  369.            obj.classid = sActX_PCHealth;
  370.           // alert("success")
  371.           }
  372.         catch(e){}
  373.        }
  374.  
  375. function addReusableText(){
  376.     if (isIE4) return;    // no reusable text for IE4
  377.    var coll = document.all.tags("SPAN");
  378.    var xmlLoaded = false;
  379.    var control = null;
  380.    var thisID;
  381.    var strKey;
  382.    var text;
  383.  
  384.    // original error text
  385.    text = "OXO";
  386.  
  387.    //<SMARTREUSABLETEXT>
  388.    //queried state of shell presentation for start menu and control panel.
  389.    var menuSimple = false;
  390.    var controlSimple = false;
  391.  
  392.    // holds calculated lookup suffixes for smart class items.
  393.    var strSuffixStartMenuOnly = "";
  394.    var strSuffixStartMenuAndControlPanel = "";
  395.  
  396.    // smart class UserSettings Interface classid
  397.    var sActX_PCHealth = "CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7";
  398.  
  399.    // smart class lookup suffixes per shell presentation mode.
  400.    // TODO: Findout where these constants are best documented.
  401.    var strMenuClassic =   "_smclassic";
  402.    var strMenuSimple =    "_smsimple";
  403.    var strCPanelClassic = "_cpclassic";
  404.    var strCPanelSimple =  "_cpsimple";
  405.  
  406.    // only attempt to query once per rendering
  407.    var bPresentationModeQueried = false;
  408.    //</SMARTREUSABLETEXT>
  409.     span_count = coll.length;
  410.    // Check every span in the document.
  411.    for (var i=0; i< span_count; i++) {
  412.     
  413.       var thisSpan = coll[i];
  414.       var spanClass = thisSpan.className.toLowerCase();
  415.       if (spanClass == "reuse" || spanClass == "smart") {
  416.          if (isRTL) thisSpan.dir = "rtl";
  417.          if (thisSpan.id == null) break;
  418.  
  419.          // strKey is the key we'll use to look up the replaceable text in the XML file
  420.          strKey = thisSpan.id.toLowerCase();
  421.          
  422.         
  423.            
  424.          // skip smart tags when defaults are not present
  425.          if ((defaultSKUSettingsURL != null) && (xmldocSKUSettings.documentElement != null)) {
  426.             if (spanClass == "smart") {
  427.              
  428.                // Query Presentation Mode once per rendering.
  429.                if (!bPresentationModeQueried) {
  430.                 
  431.                   bPresentationModeQueried=true;
  432.  
  433.                   // Set To Defaults
  434.                   if (defaultStartMode != null) {
  435.                      menuSimple = (defaultStartMode.text == strMenuSimple);
  436.                   } else {
  437.                      menuSimple = true;
  438.                   }
  439.  
  440.                   if (defaultCPanelMode != null) {
  441.                      controlSimple = (defaultCPanelMode.text == strCPanelSimple);
  442.                   } else {
  443.                      controlSimple = true;
  444.                   }
  445.                        
  446.                   
  447.                     
  448.                  // alert("inside of reuse")
  449.  
  450.                   // Get the current user's presentation settings
  451.                   // Attempt to read smart help values from system
  452.                   var test = window.document.all("pchealth");
  453.                   
  454.                   if (test != null) {
  455.                       
  456.                      if (test.UserSettings != null) {                        
  457.                           
  458.                    
  459.                             menuSimple = test.UserSettings.IsStartPanelOn;
  460.                     
  461.                             controlSimple = test.UserSettings.IsWebViewBarricadeOn;
  462.                                                 
  463.                         
  464.                      }
  465.                      else
  466.                      {
  467.                          menuSimple = (defaultStartMode.text == strMenuSimple)
  468.                         controlSimple = (defaultCPanelMode.text == strCPanelSimple);
  469.                     }
  470.                              
  471.                          
  472.                     
  473.                         
  474.                  }// (test != null)
  475.  
  476.               }// (!bPresentationModeQueried)
  477.  
  478.               // get the error text to display
  479.               text = smartErrorText;
  480.  
  481.               // Build key suffixes. One for start menu only and one for start menu and control panel.
  482.               strSuffixStartMenuOnly = (menuSimple ? strMenuSimple : strMenuClassic);
  483.               strSuffixStartMenuAndControlPanel = strSuffixStartMenuOnly + (controlSimple ? strCPanelSimple : strCPanelClassic);
  484.  
  485.               // The actual key could have either strSuffixStartMenuOnly or strSuffixStartMenuAndControlPanel suffixes.
  486.               // strSuffixStartMenuAndControlPanel has precedence over strSuffixStartMenuOnly
  487.               strKey = strKey + strSuffixStartMenuAndControlPanel;
  488.                 //alert(strKey)
  489.             }//if (spanClass == "smart")
  490.  
  491.          }// ((defaultSKUSettingsURL != null) && (xmldocSKUSettings.documentElement != null))
  492.  
  493.          // Lookup XML node containing reference
  494.  
  495.          var strNodeSelector = "glossSection/entry[@entryID='" + strKey + "']/scopeDef/def";
  496.          var node = xmldoc.documentElement.selectSingleNode(strNodeSelector);
  497.  
  498.          // if we haven't found the node yet, try the other suffix if this is a smart span
  499.          if (node == null && spanClass == "smart" && (defaultSKUSettingsURL != null) && (xmldocSKUSettings.documentElement != null)) {
  500.             // one more try--use the other suffix
  501.             strKey = thisSpan.id.toLowerCase() + strSuffixStartMenuOnly;
  502.             strNodeSelector = "glossSection/entry[@entryID='" + strKey + "']/scopeDef/def";
  503.             node = xmldoc.documentElement.selectSingleNode(strNodeSelector);
  504.          }
  505.  
  506.         // okay, we found the node, get the text
  507.          // alert(coll.length)
  508.          if (node != null) {
  509.             // replace the span's contents with the reusable text
  510.             thisSpan.insertAdjacentHTML("BeforeBegin",node.text);
  511.             // var coll = document.all.tags("SPAN");
  512.             thisSpan.className = "anything"
  513.             thisSpan.innerHTML = "";
  514.             //alert(node.text)
  515.              //thisSpan.innerHTML = node.text;
  516.          } else {
  517.                  // error shown by this  OXO
  518.                thisSpan.innerHTML = text;
  519.          }
  520.         
  521.       } // if (spanClass == "reuse" || spanClass == "smart")
  522.    }// for
  523.  
  524. }// addReusableText()
  525. // <SMARTREUSABLETEXT>
  526.  
  527.  
  528. //****** insertImages ********************************************************************************************* 
  529. //  Inserts shared images in User-Defined Variables section and thumbnails.
  530. var booking = false;
  531. function insertImages(){
  532.  
  533. if (printing == false) booking = true;
  534. if (printing == true && booking == true ) {
  535.     booking = false;
  536.     return;
  537.     }
  538. // insert alert icons
  539.   var collP = document.all.tags("P");
  540.   
  541.   for (var i=0; i<collP.length; i++) {
  542.        if (collP[i].className.toLowerCase()=="note")            collP[i].innerHTML ="<img class='alert' src='"+noteImg+"' "+ imgStyleRTL +"> " +     collP[i].innerHTML;
  543.        else if (collP[i].className.toLowerCase()=="warning")    collP[i].innerHTML ="<img class='alert' src='"+warningImg+"'> " +  collP[i].innerHTML;
  544.        else if (collP[i].className.toLowerCase()=="caution")    collP[i].innerHTML ="<img class='alert' src='"+cautionImg+"'> " +  collP[i].innerHTML;
  545.        else if (collP[i].className.toLowerCase()=="tip")        collP[i].innerHTML ="<img class='alert' src='"+tipImg+"'> " +      collP[i].innerHTML;
  546.        else if (collP[i].className.toLowerCase()=="important")  collP[i].innerHTML ="<img class='alert' src='"+importantImg+"'> " + collP[i].innerHTML;
  547.        else if (collP[i].className.toLowerCase()=="empty")      collP[i].innerHTML ="<img class='alert' src='"+emptyImg+"'> " +    collP[i].innerHTML;
  548.        if (collP[i].className.toLowerCase()=="reltopics" && rel_gif == "yes")  {
  549.             collP[i].outerHTML ="<img class='relTopics' src='"+relTopicsImg+"'> " + collP[i].outerHTML;
  550.             }   
  551.           }
  552.   
  553. //alert(printing)
  554. //alert(isIE55)
  555. //indents for Navigation Tree 
  556. var collUL = document.all.tags("UL");
  557. if (!printing) {
  558. for (var i=0; i<collUL.length; i++) {
  559.        var indent= 0;
  560.        if (collUL[i].className.toLowerCase()=="navtree"){
  561.            if (isRTL) collUL[i].style.listStyleImage= "url('" + branchImg_RTL + "')";
  562.            else collUL[i].style.listStyleImage= "url('" + branchImg + "')";
  563.              for (var j = 0; j < collUL[i].children.length; j++)
  564.                 if (collUL[i].children[j].className.toLowerCase()=="branch"){
  565.                     if (isRTL) collUL[i].children[j].style.marginRight= (indent +'em');
  566.                     else   collUL[i].children[j].style.marginLeft= (indent +'em');
  567.                     indent= indent + 0.75;
  568.                 }
  569.       }
  570. }
  571. }
  572.    
  573.   for (var i=0; i < document.anchors.length; i++){
  574.          var imgInsert="";  
  575.          var imgStyle= "";
  576.          var imgSpace= "<span class='space'></span>";      
  577.          var oBefore=document.anchors[i].parentElement.tagName;
  578.          var oAnchor= document.anchors[i].id.toLowerCase();
  579.          
  580. // insert RELTOPICS icons
  581.     if (rel_gif == "yes"){
  582.        if (oAnchor=="reltopics")
  583.                if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "reltopics")
  584.                     imgInsert= "";    // not to re-insert when persistent
  585.             else  imgInsert= "<img class='relTopics' src='"+relTopicsImg+"'>" + imgSpace;
  586.         }
  587.         
  588. // insert SHORTCUT icons
  589.        if (oAnchor=="shortcut") {    
  590.             document.anchors[i].title= sShortcutTip;     
  591.             if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "shortcut")
  592.                     imgInsert= "";    // not to re-insert when persistent
  593.             else  imgInsert= "<img class='shortcut' src='"+shortcutCold+"' "+ imgStyleRTL+ ">" + imgSpace;
  594.         }    
  595.                       
  596. // insert POPUP icons
  597.        else if (oAnchor=="wpopup" || oAnchor=="wpopupweb") document.anchors[i].title= sPopupTip;
  598.        else if (document.anchors[i].className.toLowerCase()=="popupicon")
  599.             if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "popup")
  600.                    imgInsert= "";    // not to re-insert when persistent
  601.             else imgInsert= "<img class='popup' src='"+popupCold+"'>" + imgSpace;
  602.  
  603. // insert EXPAND icons 
  604.        else if (oAnchor=="expand") {
  605.               document.anchors[i].title= sExpandTip;
  606.               if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "expand")
  607.                   imgInsert= "";     // not to re-insert when persistent      
  608.               else{ 
  609.                   if (document.anchors[i].parentElement.offsetLeft == document.anchors[i].offsetLeft) {
  610.                       imgSpace= "<span class='space' style='width:0'></span>";     
  611.                       if (isRTL){ document.anchors[i].parentElement.style.marginRight= "1.5em";  imgStyle=" style=margin-right:'-1.5em'";}
  612.                       else { document.anchors[i].parentElement.style.marginLeft= "1.5em";  imgStyle=" style=margin-left:'-1.5em'";}
  613.                   }      
  614.                   imgInsert= "<img class='expand' src='"+ closed +"' "+imgStyle+">" +imgSpace;
  615.               }
  616.        }
  617.  
  618.  
  619.  
  620. // insert thumbnail images       
  621.        else if (oAnchor=="thumbnail"  || oAnchor=="thumbnailweb"){ 
  622.             var sAltText = document.anchors[i].innerHTML;
  623.             gifwithin = true;
  624.             var sThumbnailText = document.anchors[i].title; 
  625.             var oImg = document.anchors[i].href.toLowerCase();
  626.                   if (oAnchor=="thumbnail") 
  627.                          var sThumbnailImg= moniker + getURL(oImg);
  628.                   else var sThumbnailImg = document.anchors[i].href.toLowerCase();
  629.                   
  630.                  found = sAltText.indexOf("BACKGROUND-COLOR:")
  631.             if (found != -1) {
  632.                 stop_p = sAltText.indexOf(">");
  633.                 sAltText = sAltText.substring(stop_p + 1, sAltText.length);
  634.                 stop_p = sAltText.indexOf("</FONT>");
  635.                 Highlighted = sAltText.substring(0,stop_p)
  636.                 sAltText = Highlighted + sAltText.substring(stop_p + 7, sAltText.length);
  637.                 }
  638.  
  639.                   
  640.                 document.anchors[i].outerHTML = "<DIV id='thumbDiv' class='thumbnail'>"+document.anchors[i].outerHTML+"</div>";
  641.                 document.anchors[i].innerHTML = "<img class='thumbnail' src='" + sThumbnailImg + "' alt= ' " + sAltText + "'><p>" +sThumbnailText+"</p>";
  642.                 
  643.                   if (isRTL) thumbDiv.style.styleFloat= "right";
  644.            }
  645.            
  646.         
  647.         
  648.         document.anchors[i].innerHTML = imgInsert + document.anchors[i].innerHTML;
  649.        if (isRTL) document.anchors[i].dir="rtl";
  650.    }
  651. }
  652.  
  653.  
  654.  
  655. //***** onclickTriage ****************************************************************************************
  656. // redirects to the appropriate function based on the ID of the clicked <A> tag.
  657.  
  658. function onclickTriage(){
  659. var e= window.event.srcElement;
  660.  
  661. //  if the innerHTML in the <a> tag is encapsulated by a style tag or hightlighted in the word seach,
  662. //  the parentElement is called.
  663.  
  664.     if ((isIE55 || isIE6) && printing == true) {
  665.         printing = false;
  666.         reset_form();
  667.         }
  668.         
  669.     for (var i=0; i < 5; i++)
  670.            if (e.tagName!="A" && e.parentElement!=null) e= e.parentElement;
  671.     eID= e.id.toLowerCase();
  672.                 
  673.     if (popupOpen) closePopup();
  674.     
  675. // expand image in a new window
  676.     if (eID=="thumbnail" || eID=="pophtm") popNewWindow(e);
  677.     else if (eID=="thumbnailweb") callThumbnailWeb(e);
  678.     else if (eID=="wpopup")    callPopup(e);
  679.     else if (eID=="wpopupweb") callPopupWeb(e);
  680.     else if (eID=="shortcut")  callShortcut(e);
  681.     else if (eID=="reltopics") callRelatedTopics(e);
  682.     else if (eID=="altloc")    callAltLocation(e);
  683.     else if (eID=="expand")    callExpand(e);
  684. // added to support Randy's Quad method code
  685.     else QuadDocumentClick()
  686. // ******************************
  687. }
  688.  
  689.  
  690. //*** gettingHot ****************************************************************************************
  691. // Makes all the required changes for mouseover.
  692.  
  693. function gettingHot() {
  694. var e = window.event.srcElement;
  695.     
  696.  
  697.  
  698.   if (e.id.toLowerCase()=="cold")  e.id ="hot";
  699.   else if (e.src== previousCold)  e.src = previousHot;
  700.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== previousCold)  e.children.tags("IMG")(0).src= previousHot;
  701.   else if (e.src== nextCold)  e.src = nextHot;
  702.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== nextCold)  e.children.tags("IMG")(0).src= nextHot;
  703.   
  704.   else if (e.className.toLowerCase()=="shortcut" && e.tagName=="IMG")  e.src = shortcutHot;            //<img> tags have a class
  705.   else if (e.id.toLowerCase()=="shortcut")  e.children.tags("IMG")(0).src = shortcutHot;            //<a> tags have an ID
  706.   
  707.   else if (e.className.toLowerCase()=="popup" && e.tagName=="IMG")  e.src = popupHot;            //<img> tags have a class
  708.   else if (e.className.toLowerCase()=="popupicon")  e.children.tags("IMG")(0).src = popupHot;            //<a> tags have an ID
  709.   
  710.   else if ((e.className.toLowerCase()=="expand" && e.tagName=="IMG") ||( e.id.toLowerCase()=="expand")) expandGoesHot(e);
  711.  
  712.  // Added to support Quad Method   **************************
  713.     if (e != null && e.firstChild != null && 
  714.         e.firstChild.tagName != null &&
  715.         e.firstChild.tagName.toLowerCase() == "input" && 
  716.         e.firstChild.type.toLowerCase() == "radio" && 
  717.         e.parentElement.className != "indentGray"){
  718.             QuadDocumentMouseOver()
  719.             }
  720.  
  721. // *****************************
  722. }
  723.  
  724. //*** gettingCold **************************************************************************************
  725. // Initial state for mouseout.
  726.  
  727. function gettingCold() {
  728. var e = window.event.srcElement;
  729.  
  730.  
  731.  
  732.   if (e.id.toLowerCase()=="hot")  e.id ="cold";
  733.   else if (e.src== previousHot)  e.src = previousCold;
  734.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== previousHot)  e.children.tags("IMG")(0).src= previousCold;
  735.   else if (e.src== nextHot)  e.src = nextCold;
  736.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== nextHot)  e.children.tags("IMG")(0).src= nextCold;
  737.   
  738.   else if (e.className.toLowerCase()=="shortcut" && e.tagName=="IMG")   e.src = shortcutCold;        //<img> tags have a class
  739.   else if (e.id.toLowerCase()=="shortcut")  e.children.tags("IMG")(0).src= shortcutCold;             //<a> tags have an ID
  740.   
  741.   else if (e.className.toLowerCase()=="popup" && e.tagName=="IMG")   e.src = popupCold;        //<img> tags have a class
  742.   else if (e.className.toLowerCase()=="popupicon")  e.children.tags("IMG")(0).src= popupCold;             //<a> tags have an ID
  743.   
  744.   else if ((e.className.toLowerCase()=="expand" && e.tagName=="IMG") ||( e.id.toLowerCase()=="expand")) expandGoesCold(e);
  745.   
  746.   // Added to support Quad Method   **************************
  747.     if (e != null && e.firstChild != null && 
  748.         e.firstChild.tagName != null &&
  749.         e.firstChild.tagName.toLowerCase() == "input" && 
  750.         e.firstChild.type.toLowerCase() == "radio" && 
  751.         e.parentElement.className != "indentGray"){
  752.             QuadDocumentMouseOver()
  753.             }
  754.  
  755. // *****************************
  756. }
  757.  
  758. //****************************************** OBJECT CONSTRUCTION **************************************
  759. //*****************************************************************************************************
  760. //  Uses an A tag to pass parameters between an HTML page and this script.
  761. //  Creates an ActiveX Object from these parameters, appends the Object to the end of the page,
  762. //  and clicks it. These objects relate to HTMLHelp environment and information about them can be found on the http://HTMLHelp site.
  763.  
  764. //  Object construction variables *********************************************************************
  765.  
  766. var sParamCHM,sParamFILE, sParamEXEC, sParamMETA,iEND;
  767. var sActX_HH= " type='application/x-oleobject' classid='clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11' ";
  768.  
  769.  
  770. //*** callPopup ***************************************************************************************
  771. // creates an object from an <A> tag HREF, the object inserts a winhelp popup
  772. // called by: <A ID="wPopup" HREF="HELP=@@file_name.hlp@@ TOPIC=@@topic#@@">@@Popup text@@</A>
  773.  
  774. var joker = false;
  775. var blague = true;
  776.  
  777. function callPopup(eventSrc) {
  778. if (popupOpen) closePopup();
  779. var ntsharedAdded= false;                    // make sure the object is only added once
  780. var CHMspecificAdded= false;                // make sure the object is only added once
  781. var coll = document.all.tags("SPAN");
  782. var sIndex,sText=" ",sFile,sFileID,dataBindingObject;
  783.  
  784.      var e= eventSrc;
  785.      var eH= unescape(e);
  786.      eH = eH.toLowerCase();
  787.      var eH_= eH.toLowerCase();
  788.      
  789.      if(event){
  790.          event.returnValue = false;
  791.         }
  792.      found = false;
  793.                                                        
  794.        var iTOPIC = eH.lastIndexOf("topic=");
  795.      if (iTOPIC==-1) return;
  796.      sParamTOPIC = eH.substring((iTOPIC+6),eH.length);
  797.      if (!isIE4){
  798.      if (!joejoe){
  799.         xmldom.load(moniker + path2glossary + "glossary.xml");
  800.         joejoe = true;
  801.         }
  802.          
  803.         var o=0;
  804.         var node = "";    
  805.         node = xmldom.selectSingleNode("glossary/glossSection/entry[@entryID='" + sParamTOPIC + "']");
  806.                     
  807.         if(node!=null)
  808.             {
  809.             
  810.             found = true;
  811.             var ralf = "";
  812.             ralf = node.getElementsByTagName("term")
  813.             sText = "<DIV CLASS='PopTerm'>" + ralf.item(0).nodeTypedValue + "</DIV>";
  814.             ralf = node.getElementsByTagName("para")
  815.             
  816.             if (ralf.length != 0){
  817.                 sText = sText + "<DIV CLASS='PopDef'>" + ralf.item(0).nodeTypedValue;
  818.                 sText = sText + "</DIV>";
  819.                 }
  820.             seealsos = node.getElementsByTagName("seeAlso");
  821.             var o=0;
  822.             
  823.             look_at = xmldom.getElementsByTagName("glossary/locSection/locItem[@locItemID = 'SeeAlso']");
  824.                         
  825.             while (o < seealsos.length){
  826.                 sIndex = seealsos.item(o).getAttribute("seeAlsoTermID");
  827.                 node = xmldom.selectSingleNode("glossary/glossSection/entry[@entryID='" + sIndex + "']");
  828.                 ralf = node.getElementsByTagName("term");
  829.                 sTerm = ralf.item(0).nodeTypedValue;
  830.                 if (o == 0) {
  831.                     sText = sText + "<DIV CLASS='PopSeeAlso'>" + look_at.item(0).nodeTypedValue + " "
  832.                     // sIndex = "<Input type=submit tabindex=1 value=hhhh onclick='jscript:alert(oPopup.sIndex.innerHTML)'>"
  833.                     sIndex = "<A ID='wPopup' HREF='HELP=glossary.hlp TOPIC=" + sIndex + "' bite_me='1'>" + sTerm + "</a>"
  834.                     }
  835.                 else
  836.                     {
  837.                     sIndex = ", <A ID='wPopup' HREF='HELP=glossary.hlp TOPIC=" + sIndex + "' bite_me='1'>" + sTerm + "</a>"
  838.                     }
  839.                 o++;
  840.                 sText = sText + sIndex 
  841.                 }
  842.                     
  843.             definition = xmldom.getElementsByTagName("glossary/locSection/locItem[@locItemID = 'See']");        
  844.             
  845.             seeentrys = node.getElementsByTagName("seeEntry");
  846.                             
  847.             while (o < seeentrys.length){
  848.                 sIndex = seeentrys.item(o).getAttribute("seeTermID");
  849.                 node = xmldom.selectSingleNode("glossary/glossSection/entry[@entryID='" + sIndex + "']");
  850.                 ralf = node.getElementsByTagName("term");
  851.                 sTerm = ralf.item(0).nodeTypedValue;
  852.                 if (o == 0) {
  853.                     sText = sText + "<DIV CLASS='PopSeeAlso'>" + definition.item(0).nodeTypedValue + " "
  854.                     // sIndex = "<Input type=submit tabindex=1 value=hhhh onclick='jscript:alert(oPopup.sIndex.innerHTML)'>"
  855.                     sIndex = "<A ID='wPopup' HREF='HELP=glossary.hlp TOPIC=" + sIndex + "' bite_me='1'>" + sTerm + "</a>"
  856.                     }
  857.                 else
  858.                     {
  859.                     sIndex = ", <A ID='wPopup' HREF='HELP=glossary.hlp TOPIC=" + sIndex + "' bite_me='1'>" + sTerm + "</a>"
  860.                     }
  861.                 o++;
  862.                 sText = sText + sIndex 
  863.                 }
  864.             }
  865.             
  866.             if (o != 0) sText = sText + "</DIV>" 
  867.              
  868.             if ((isIE55 || isIE6) && found){
  869.                 var oPopup = false
  870.                 var oPopup = window.createPopup();
  871.                  var strScript = "<script language='JScript'> function clickPopup(){if (event.srcElement.tagName.toLowerCase() == 'a') parent.callPopup(event.srcElement.href); window.PopObject.hide(); return false;}</script>";
  872.                   var strDoc = oPopup.document.body.outerHTML.toLowerCase()
  873.                 
  874.                   oPopup.document.write(strDoc.replace("></body>", " onclick=\"clickPopup()\">" + strScript + "</body>"));
  875.                 //oPopup.document.write(strDoc.replace("></body>", " onclick=\"clickPopup()\, onkeypress=\"process_closePopup()\">" + strScript + "</body>"));
  876.                     oPopup.document.createStyleSheet(sSharedCHM + "coUA.css");    // Apply the stylesheet.
  877.                 var oPopBody = oPopup.document.body;
  878.                 
  879.                 //oPopBody.style.backgroundColor = '#FFFFCC';
  880.                 
  881.                   // oPopBody.style.border = "solid black 1px";
  882.                   oPopBody.style.margin = "0 0 0 0";
  883.                 if (isRTL) oPopBody.innerHTML = "<SPAN DIR='RTL' class='XMLPopup'>" + sText + "</SPAN>"           // need to add the style class here.
  884.                 else oPopBody.innerHTML = "<SPAN class='XMLPopup'>" + sText + "</SPAN>"
  885.                     // alert(oPopBody.innerHTML)                
  886.                 if (window.event){
  887.                     joker = window.event.srcElement;
  888.                     }
  889.                 oPopup.show(0, 0, 400, 8, joker);    // Show the popup at an arbitrary size.
  890.                 var textSize = oPopBody.createTextRange();
  891.                 var wPop = textSize.boundingWidth + oPopBody.offsetWidth - oPopBody.clientWidth;    // Get the size of the text.
  892.                 var hPop = oPopBody.scrollHeight;
  893.                 oPopup.hide();
  894.                 oPopup.document.parentWindow.PopParent = window;
  895.                   oPopup.document.parentWindow.PopObject = oPopup;
  896.                 
  897.                   oPopup.show(0, 1, wPop , hPop, joker);
  898.                 //oPopup.document.focus(oPopup.document.body.JOKER);    
  899.                 return;
  900.                 }
  901.             
  902.             if (found){
  903.                 if (blague){
  904.                 document.body.insertAdjacentHTML("beforeEnd", "<DIV id='wPopupWeb' CLASS='popup'>" + sText + "</DIV>");
  905.                 blague = false;
  906.                 }
  907.                 window.wPopupWeb.innerHTML = sText;
  908.                 callPopupWeb(e);
  909.                 return;
  910.                 }
  911.             } // for support of IE4 disable xml popups
  912.                   
  913.    var iTOPIC = eH_.lastIndexOf("topic=");
  914.         if (iTOPIC==-1) return;
  915.         sParamTOPIC = eH.substring((iTOPIC+6),eH.length);          // extracts the topic for item2
  916.         
  917.   var iHELP = eH_.lastIndexOf("help=");
  918.         if (iHELP==-1) return;
  919.         sParamHELP = eH.substring(iHELP+5,iTOPIC);            // extracts the help file for item1
  920.         
  921.         if (document.hhPopup) document.hhPopup.outerHTML = "";    // if hhPopup object exists, clears it
  922.  
  923.  
  924.  var  h= "<object id='hhPopup'"+ sActX_HH + "STYLE='display:none'><param name='Command' value='WinHelp, Popup'>";
  925.       h= h + "<param name='Item1' value='" + sParamHELP + "'><param name='Item2' value='" + sParamTOPIC + "'></object>";
  926.         
  927.         document.body.insertAdjacentHTML("beforeEnd", h);     
  928.         document.hhPopup.hhclick();
  929. }
  930.  
  931.  
  932. //*** callAltLocation******************************************************************************
  933. // creates an object from an <A> tag HREF, the object will navigate to the alternate location if the first location is not found.
  934. // 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>
  935.    
  936.  
  937. function callAltLocation(eventSrc) {
  938. var e= eventSrc;
  939. var eH= unescape(e.href);
  940. var eH_= eH.toLowerCase();
  941. var sFILEarray,sCHMarray;
  942.      event.returnValue = false;
  943.      
  944. // var sParamTXT= e.innerHTML;
  945. //      sParamTXT= sParamTXT.replace(semicolon,"");
  946.       
  947.    var sParamTXT= "";
  948.                                        
  949.   var iFILE = eH_.lastIndexOf("file=");
  950.         if (iFILE==-1) return;
  951.         sParamFILE= eH.substring((iFILE+5),eH.length);                  // extracts the 2 HTM files
  952.         sParamFILE= sParamFILE.replace(spaces,"");
  953.         iSPLIT= sParamFILE.match(semicolon);
  954.         if (iSPLIT)
  955.               sFILEarray = sParamFILE.split(";");                                        // separates the 2 HTM files
  956.         else return;
  957.           
  958.   var iCHM  = eH_.lastIndexOf("chm=");
  959.         if(iCHM==-1) return;
  960.         else         sParamCHM = eH.substring(iCHM+4,iFILE);            // extracts the 2 CHM's
  961.         sParamCHM= sParamCHM.replace(spaces,"");
  962.         iSPLIT= sParamCHM.match(semicolon);
  963.         if (iSPLIT)
  964.             sCHMarray= sParamCHM.split(";");                                    // separates the 2 CHM's
  965.         else return;
  966.         
  967.         sParamFILE= moniker + sCHMarray[0]+ "::/" + sFILEarray[0] + ";" + moniker + sCHMarray[1]+ "::/" + sFILEarray[1];
  968.                 
  969.         if (document.hhAlt) document.hhAlt.outerHTML = "";                // if hhAlt object exists, clears it
  970.  
  971.  
  972.   var h= "<object id='hhAlt'"+ sActX_HH + "STYLE='display:none'><PARAM NAME='Command' VALUE='Related Topics'>";
  973.       h= h + "<param name='Item1' value='" + sParamTXT +";" + sParamFILE + "'></object>";
  974.     
  975.         document.body.insertAdjacentHTML("beforeEnd", h); 
  976.         document.hhAlt.hhclick();
  977. }
  978.  
  979.  
  980. //*** callRelatedTopics******************************************************************************
  981. // creates an object from an <A> tag HREF, the object inserts a popup of the related topics to select
  982. // called from: <A ID="relTopics" HREF="CHM=@@chm_name1.chm;chm_name2.chm@@ META=@@a_filename1;a_filename2@@">Related Topics</A>
  983.    
  984.  
  985. function callRelatedTopics(eventSrc) {
  986. var e= eventSrc;
  987. var eH= unescape(e.href);
  988. var eH_= eH.toLowerCase();
  989.      event.returnValue = false;
  990.                                        
  991.   var iMETA = eH_.lastIndexOf("meta=");
  992.         if (iMETA==-1) return;
  993.         sParamMETA = eH.substring((iMETA+5),eH.length);              // extracts the META keywords for item2
  994.         
  995.   var iCHM  = eH_.lastIndexOf("chm=");
  996.         if(iCHM==-1) sParamCHM = "";
  997.         else         sParamCHM = eH.substring(iCHM+4,iMETA);            // extracts the CHM files for item1
  998.     
  999.         if (document.hhRel) document.hhRel.outerHTML = "";            // if hhRel object exists, clears it
  1000.  
  1001.  
  1002.   var h= "<object id='hhRel'"+ sActX_HH + "STYLE='display:none'><param name='Command' value='ALink,MENU'>";
  1003.       h= h + "<param name='Item1' value='" + sParamCHM + "'><param name='Item2' value='" + sParamMETA + "'></object>";
  1004.     
  1005.         document.body.insertAdjacentHTML("beforeEnd", h);     
  1006.         document.hhRel.hhclick();
  1007. }
  1008.  
  1009. //*** popNewWindow***************************************************************************************
  1010. // creates an object from an <A> tag HREF, the object then opens a new window from the image URL found in the HREF
  1011. // called from: <a id="thumbnail" title="Enlarge figure" href="CHM=NTArt.chm FILE=@@image_name.gif@@">@@alt text here@@</A>
  1012. // the thumbnail image is loaded by loadPage();
  1013.  
  1014.  
  1015. function popNewWindow(eventSrc) {
  1016. var eH= eventSrc.href;
  1017.       event.returnValue = false;
  1018.       
  1019.  // extracts the thumbnail image URL from the <a> tag HREF
  1020.     sParamFILE =  getURL(eH);
  1021.     if (sParamFILE=="") return;
  1022.     
  1023.     // sParamFILE = moniker + sParamFILE; 
  1024.     // sParamFILE = moniker + sParamFILE; 
  1025.     //alert(sParamFILE)
  1026.     // callThumbnailWeb(sParamFFILE)
  1027.     
  1028.        
  1029.  // if the hhWindow object exists, clears it
  1030.     if (document.hhWindow) document.hhWindow.outerHTML = "";        
  1031.         
  1032. var  h =  "<object id='hhWindow'"+ sActX_HH +" STYLE='display:none'><param name='Command' value='Related Topics'>";
  1033.      h = h + "<param name='Window' value='$global_largeart'><param name='Item1' value='$global_largeart;" + moniker + sParamFILE+ "'> </object>";
  1034.     
  1035.      document.body.insertAdjacentHTML("beforeEnd", h);
  1036.      document.hhWindow.hhclick();
  1037. }
  1038.  
  1039. //*** callShortcut ***************************************************************************************
  1040. // creates an object from an <A> tag, the object then calls the executable code
  1041. // called from: <A ID="shortcut" HREF="EXEC=@@executable_name.exe@@ CHM=ntshared.chm FILE=@@error_file_name.htm@@">@@Shortcut text@@</A>
  1042. // the shortcut image is loaded by loadInitialImg();
  1043.  
  1044. function callShortcut(eventSrc) {
  1045. var e= eventSrc;
  1046. var eH= unescape(e.href);
  1047. var eH_= eH.toLowerCase();
  1048.  
  1049.     
  1050.  
  1051.     event.returnValue = false;
  1052.               
  1053.  // extracts the error file URL from the <a> tag HREF
  1054.     iEND= eH.length;
  1055.     sParamFILE =  getURL(eH);
  1056.     
  1057. var iEXEC = eH_.lastIndexOf("exec="); 
  1058.         if (iEXEC==-1) return;
  1059.         else sParamEXEC = eH.substring(iEXEC+5,iEND);                // extracts the executable for item1
  1060.         
  1061.         if (document.hhShortcut) document.hhShortcut.outerHTML = "";            // if the hhShortcut object exists, clears it
  1062.     
  1063. var  h =  "<object id='hhShortcut'"+ sActX_HH +" STYLE='display:none'> <param name='Command' value='ShortCut'>";
  1064.      if(sParamFILE != "") h = h + "<param name='Window' value='" + moniker + sParamFILE+ "'>";
  1065.      h = h + "<param name='Item1' value='" + sParamEXEC + "'><param name='Item2' value='msg,1,1'></object>";
  1066.  
  1067.         document.body.insertAdjacentHTML("beforeEnd", h);
  1068.         document.hhShortcut.hhclick();
  1069. }
  1070.  
  1071. //****************************************  EXPAND FUNCTIONS *********************************************************
  1072. //********************************************************************************************************************
  1073.  
  1074. //**  callExpand **************************************************************************************************
  1075. //  This expands & collapses (based on current state) "expandable" nodes as they are clicked.
  1076. //  Called by: <A ID="expand" href="#">@@Hot text@@</A>
  1077. //  Followed by:  <div class="expand">
  1078.  
  1079. function callExpand(eventSrc) {
  1080.  
  1081. var e= eventSrc;
  1082.     event.returnValue = false;                    // prevents navigating for <A> tag
  1083.     
  1084. var oExpandable = getExpandable(e); 
  1085. var oImg = getImage(e);
  1086.  
  1087.      if (oExpandable.style.display == "block")
  1088.           doCollapse(oExpandable, oImg);
  1089.      else doExpand(oExpandable, oImg);
  1090. }
  1091.  
  1092. //** expandGoesHot *********************************************************************************************
  1093. // Returns expand image to hot. 
  1094.  
  1095. function expandGoesHot(eventSrc){
  1096. var e= eventSrc;
  1097. //alert(e.outerHTML);
  1098. var oExpandable = getExpandable(e);
  1099.   
  1100. var oImg = getImage(e);
  1101. //alert (oImg.src)
  1102. if (oExpandable == false){
  1103.     plus_or_minus = oImg.src.indexOf("minus")
  1104.     if (plus_or_minus == -1){
  1105.         //alert(plus_or_minus)
  1106.         oImg.src = closedHot
  1107.         }
  1108.     else
  1109.         {
  1110.         oImg.src = expandHot;
  1111.         //alert(plus_or_minus)
  1112.         }
  1113.      return;
  1114.     }
  1115.  
  1116. if (!isIE4){
  1117.    if (oExpandable.style.display == "block"){
  1118.             oImg.src = expandHot;
  1119.          //alert(oImg.src)
  1120.          }
  1121.    else oImg.src = closedHot;
  1122. }
  1123. }
  1124.  
  1125.  
  1126. //** expandGoesCold *********************************************************************************************
  1127. // Returns expand image to cold.
  1128.  
  1129. function expandGoesCold(eventSrc){
  1130. var e= eventSrc;
  1131.  
  1132. var oExpandable = getExpandable(e);
  1133. var oImg = getImage(e);
  1134. // alert (oImg.src)
  1135.  
  1136. if (oExpandable == false){
  1137.     plus_or_minus = oImg.src.indexOf("minus")
  1138.     
  1139.     if (plus_or_minus == -1){
  1140.         //alert(plus_or_minus)
  1141.         oImg.src = closed
  1142.         }
  1143.     else
  1144.         {
  1145.         oImg.src = expand;
  1146.         //alert(plus_or_minus)
  1147.         }
  1148.      return;
  1149.     }
  1150.  
  1151.  
  1152. if (!isIE4){
  1153.  if (oExpandable.style.display == "block") oImg.src = expand;
  1154.   else oImg.src = closed;
  1155. }  
  1156. }
  1157.  
  1158.  
  1159. //** getExpandable *****************************[used by callExpand, expandGoesHot, expandGoesCold]*******
  1160. //  Determine if the element is an expandable node or a child of one.  
  1161.  
  1162. function getExpandable(eventSrc){
  1163. var  e = eventSrc;
  1164. var iNextTag, oExpandable;
  1165.     
  1166.        for (var i=1;i<4; i++){
  1167.                iNextTag=    e.sourceIndex+e.children.length+i;
  1168.               oExpandable= document.all(iNextTag);
  1169.               if (oExpandable.className.toLowerCase()=="expand" || iNextTag == document.all.length)
  1170.                   return oExpandable
  1171.                    break;
  1172.        }
  1173.        return false;
  1174.        
  1175. }
  1176.  
  1177. //**  getImage ***********************************[used by callExpand, expandGoesHot, expandGoesCold]*******
  1178. //  Find the first image in the children of the current srcElement.   
  1179. // (allows the  image to be placed anywhere inside the <A HREF> tag)
  1180.  
  1181. function getImage(header) {
  1182. var oImg = header;
  1183.  
  1184.        if(oImg.tagName != "IMG") oImg=oImg.children.tags("IMG")(0);
  1185.        return oImg;
  1186. }
  1187.  
  1188.  
  1189. //****  expandAll *******************************************************************************************************
  1190. //  Will expand or collapse all "expandable" nodes when clicked. [calls closeAll()]
  1191. //  called by: <A HREF="#" onclick="expandAll();">expand all</A>
  1192.  
  1193. var stateExpand = false;    //applies to the page 
  1194.  
  1195. //**** ****************************************************************************************************************
  1196.  
  1197. function expandAll() {
  1198. var oExpandToggle, oImg;
  1199. var expandAllMsg = "expand all";                    //message returned when CloseAll() is invoked
  1200. var closeAllMsg = "close all";                        //message returned when ExpandAll() is invoked
  1201. var e= window.event.srcElement;
  1202.        event.returnValue = false;
  1203.  
  1204.        for (var i=0; i< document.anchors.length; i++){
  1205.                oExpandToggle = document.anchors[i];
  1206.          
  1207.                 if (oExpandToggle.id.toLowerCase() == "expand"){ 
  1208.                      oExpandable = getExpandable(oExpandToggle);  
  1209.                      oImg = getImage(oExpandToggle);
  1210.              
  1211.                      if (stateExpand == true) doCollapse(oExpandable, oImg);
  1212.                      else                     doExpand(oExpandable, oImg);
  1213.                 }
  1214.        }
  1215.        if (stateExpand == true) {
  1216.             stateExpand = false;
  1217.             e.innerText= expandAllMsg;
  1218.        }
  1219.        else {
  1220.             stateExpand = true;
  1221.             e.innerText= closeAllMsg;
  1222.        }
  1223. }
  1224.  
  1225.  
  1226. //****  doExpand *******************************************************************************************************
  1227. //  Expands expandable block & changes image
  1228.     
  1229. var redo = false;    
  1230. function doExpand(oToExpand, oToChange) {
  1231. var oExpandable= oToExpand;
  1232. var oImg= oToChange;
  1233.  
  1234. //    if (printing == "TRUE") return;
  1235.  
  1236.     oImg.src = expand;
  1237.     oExpandable.style.display = "block";
  1238.     
  1239.     if (!redo && isIE4) {
  1240.         // alert("what")
  1241.         redo = true;
  1242.         // focus(oToExpand);
  1243.         doExpand(oToExpand, oToChange);
  1244.         }
  1245.     }
  1246.  
  1247.  
  1248. //****  doCollapse *****************************************************************************************************
  1249. //  Collapses expandable block & changes image
  1250.     
  1251. function doCollapse(oToCollapse, oToChange) {
  1252. // if (printing == "TRUE") return;
  1253. var oExpandable= oToCollapse;
  1254. var oImg= oToChange;
  1255.  
  1256.     oExpandable.style.display = "none";
  1257.     oImg.src = closed;
  1258. }
  1259.  
  1260. //*******************************************************************************************************
  1261. //******* WEB  FUNCTIONS **************************************************************************
  1262. //*******************************************************************************************************
  1263.  
  1264. //**** callThumbnailWeb **************************************************************************************
  1265.  
  1266. function callThumbnailWeb(eventSrc) {
  1267. var e= eventSrc;
  1268.        event.returnValue = false;
  1269.                     
  1270. var thumbnailWin= window.open (e.href, "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");
  1271.  
  1272. thumbnailWin.document.write ("<html><head><title>Windows 2000</title></head><body><img src='"+e.href+"'></body></html>");
  1273.  
  1274. return;
  1275. }
  1276.  
  1277. //*********************************************************************************************************
  1278. //*********************************************************************************************************
  1279.                                 
  1280. var popupOpen= false;                //state of popups
  1281. var posX, posY;                        //coordinates of popups
  1282. var oPopup;                            //object to be used as popup content
  1283.  
  1284. //**** callPopupWeb **************************************************************************************
  1285. // the web popups have been converted from the object winHelp popup for the web.
  1286. // called by: <A ID="wPopupWeb" HREF="#">@@Popup text@@</A>
  1287. // followed by: <div class="popup">Popup content</div>
  1288.  
  1289.  
  1290. function callPopupWeb(eventSrc) {
  1291. var e= eventSrc;
  1292.   
  1293.   // find the popup <div> that follows <a id="wPopupWeb"></a>
  1294.   findPopup(e);
  1295.   if (!e.bite_me) positionPopup(e)
  1296.  
  1297.   oPopup.style.visibility = "visible";
  1298.   // document.focus(e)
  1299.   popupOpen = true;
  1300.  
  1301.   return;
  1302. }
  1303.  
  1304. //**** findPopup ****************************************************************************************
  1305.  
  1306. function findPopup(oX){
  1307. var e= oX;
  1308. var iNextTag;
  1309.     
  1310.     for (var i=1;i<document.all.length; i++){
  1311.          iNextTag=    e.sourceIndex + i;
  1312.          oPopup= document.all(iNextTag);
  1313.          if (oPopup.className.toLowerCase()=="popup" || iNextTag == document.all.length)
  1314.              break;
  1315.     }
  1316.     
  1317.     if (iNextTag != document.all.length) {
  1318.         posX = window.event.clientX; 
  1319.         posY = window.event.clientY + document.body.scrollTop+10;
  1320.     }
  1321.     if (popupOpen) closePopup();
  1322. }
  1323.  
  1324.  
  1325. //****  positionPopup ************************************************************************************
  1326. // Set size and position of popup.
  1327. // If it is off the page, move up, but not past the very top of the page.
  1328.  
  1329. function positionPopup(oX){
  1330. var e= oX;    
  1331. var popupOffsetWidth = oPopup.offsetWidth;
  1332.  
  1333. //determine if popup will be offscreen to right
  1334. var rightlimit = posX + popupOffsetWidth;
  1335.  
  1336.   if (rightlimit >= document.body.clientWidth) 
  1337.       posX -= (rightlimit - document.body.clientWidth);
  1338.   if (posX < 0) posX = 0;
  1339.     
  1340. //position popup
  1341.   oPopup.style.top = posY;
  1342.   oPopup.style.left = posX;
  1343.  
  1344. var pageBottom = document.body.scrollTop + document.body.clientHeight;
  1345. var popupHeight = oPopup.offsetHeight;
  1346.   
  1347.   if (popupHeight + posY >= pageBottom) {
  1348.       if (popupHeight <= document.body.clientHeight)
  1349.           oPopup.style.top = pageBottom - popupHeight;
  1350.       else
  1351.            oPopup.style.top = document.body.scrollTop;
  1352.   }
  1353. }
  1354.  
  1355. //**** closePopup ****************************************************************************************
  1356. // Close Popup
  1357. function closePopup() {
  1358.  
  1359.   oPopup.style.visibility = "hidden";
  1360.   popupOpen = false;
  1361.   return;
  1362. }
  1363.  
  1364.  
  1365. //*********************************************  GENERAL FUNCTIONS ************************************************
  1366. //**************************************************************************************************************************
  1367.  
  1368. //***ajustImg *************************************************************************************************************
  1369. // expands an image to the with of the window or shrinks it to 90px
  1370.  
  1371. function ajustImg(eventSrc) {
  1372. var e= eventSrc;
  1373. var fullWidth= document.body.offsetWidth;
  1374.  
  1375.     fullWidth = fullWidth - 50;
  1376.     if (e.style.pixelWidth==90)
  1377.          e.style.pixelWidth=fullWidth;
  1378.     else e.style.pixelWidth=90;
  1379. }
  1380.  
  1381.  
  1382. //**  getURL **************************************[used in callShortcut, popNewWindow& loadPage]********
  1383. // extracts the file location (CHM::/HTM) URL 
  1384.  
  1385. function getURL(sHREF) {
  1386. var spaces= /\s/g
  1387. var eH = unescape(sHREF);
  1388.     eH = eH.replace(spaces,""); 
  1389.  
  1390. var eH_= eH.toLowerCase();
  1391. var sParamFILE= "";
  1392. var sParamCHM= "";
  1393.  
  1394. var iFILE= eH_.lastIndexOf("file=");
  1395.     if (iFILE!=-1){
  1396.         iEND= iFILE +1;
  1397.         sParamFILE = eH.substring(iFILE+5,eH.length);
  1398.     }
  1399.  
  1400. var iCHM  = eH_.lastIndexOf("chm=");
  1401.  
  1402. gifwithin = false; 
  1403. if (gifwithin){
  1404.     gifwithin = false;
  1405.     var con_mmc;
  1406.     var doc_mmc;
  1407.     doc_mmc = " " + document.location;
  1408.     doc_mmc = doc_mmc.toLowerCase();
  1409.     if (iCHM!=-1){
  1410.         iEND  = iCHM +1;                             // iEND used by callShortcut
  1411.         sParamCHM = eH.substring(iCHM+4, iFILE);
  1412.         con_mmc = doc_mmc.indexOf(sParamCHM);
  1413.             if (con_mmc != -1){
  1414.                 sParamCHM = "";
  1415.                 iCHM = -1;
  1416.             sParamFILE= sParamCHM+sParamFILE;    
  1417.             }
  1418.         }
  1419.     }
  1420.  
  1421.      if (iCHM!=-1){
  1422.         iEND  = iCHM +1;                             // iEND used by callShortcut
  1423.         sParamCHM = eH.substring(iCHM+4, iFILE);
  1424.         sParamFILE= sParamCHM+"::/"+sParamFILE;    
  1425.         }    
  1426.     return sParamFILE;
  1427. }
  1428. //****************************************************************************************************************************
  1429. //********************************************  IE5 PERSISTENCE  *************************************************************
  1430. //****************************************************************************************************************************
  1431.  
  1432. var oTD,iTD;         // persistence
  1433.  
  1434. //****** Persistence for userData ********************************************************************************************* 
  1435.  
  1436. function getChecklistState(){ 
  1437.  
  1438.  var pageID= addID();
  1439.  
  1440.     if (checklist.all== "[object]") {
  1441.     oTD=checklist.all.tags("INPUT");
  1442.     iTD= oTD.length;
  1443.         }
  1444.     else
  1445.         {
  1446.         printing = true;
  1447.         isPersistent = false;
  1448.         return;
  1449.         }
  1450.  
  1451.     if (iTD == 0){
  1452.         printing = true;
  1453.         isPersistent = false;
  1454.         return;
  1455.         }
  1456.     
  1457. // routine added to fix a bug in the ocx 06/14/99    
  1458.      lct = document.location + ".";
  1459.      xax = 10;
  1460.      xax = lct.indexOf("mk:@MSITStore");
  1461.      if (xax != -1) {
  1462.          lct = "ms-its:" + lct.substring(14,lct.length-1);
  1463.         // alert("before reload : " + document.location);
  1464.         // alert("replace with : " + lct);
  1465.         isPersistent = false;
  1466.         document.location.replace(lct);
  1467.         isPersistent = true;
  1468.         // alert("after reload : " + document.location);
  1469.         }     
  1470.      else
  1471.          {      
  1472.          checklist.load("oXMLStore");
  1473.         }
  1474. // routine added to fix a bug in the ocx 06/14/99
  1475.     if (checklist.getAttribute("sPersist"+pageID+"0"))    
  1476.     for (i=0; i<iTD; i++){
  1477.  
  1478.          if (oTD[i].type =="checkbox" || oTD[i].type =="radio"){
  1479.          checkboxValue= checklist.getAttribute("sPersist"+pageID+i);
  1480.         
  1481.          if (checkboxValue=="yes") oTD[i].checked=true;
  1482.          else oTD[i].checked=false;
  1483.          }// if
  1484.          if (oTD[i].type =="text")              
  1485.               oTD[i].value= checklist.getAttribute("sPersist"+pageID+i);
  1486.      }// for
  1487. } // end persistence
  1488.  
  1489. //**  saveChecklistState *************************************************************************************************************
  1490. function saveChecklistState(){
  1491. var pageID= addID(); 
  1492.  
  1493.         if (!isPersistent) return; 
  1494.          //  you will need this           document.location
  1495.         for (i=0; i<iTD; i++){
  1496.  
  1497.                 if (oTD[i].type =="checkbox" || oTD[i].type =="radio"){
  1498.                  if (oTD[i].checked) checkboxValue="yes";
  1499.                  else checkboxValue="no";
  1500.                  
  1501.                  checklist.setAttribute("sPersist"+pageID+i, checkboxValue);
  1502.              }// if
  1503.             
  1504.               if (oTD[i].type =="text") 
  1505.                  checklist.setAttribute("sPersist"+pageID+i, oTD[i].value);
  1506.          }    // for
  1507.  
  1508.  // routine added to fix a bug in the ocx 06/14/99    
  1509.      lct = document.location + ".";
  1510.      xax = 10;
  1511.      xax = lct.indexOf("mk:@MSITStore");
  1512.      if (xax != -1) {
  1513.          lct = "ms-its:" + lct.substring(14,lct.length-1);
  1514.         // alert("before reload : " + document.location);
  1515.         // alert("replace with : " + lct);
  1516.         isPersistent = false;
  1517.         document.location.replace(lct);
  1518.         isPersistent = true;
  1519.         // alert("after reload : " + document.location);
  1520.         }     
  1521.      else
  1522.          {      
  1523.          checklist.save("oXMLStore");
  1524.         }
  1525. // routine added to fix a bug in the ocx 06/14/99
  1526.      
  1527. }//end function
  1528.  
  1529. //**  resizeDiv *******************************[used with callPopupWeb, setPreviousNext}****************************************************
  1530. //  resize the page when the <div class=nav></div> && <div class=text></div> are found
  1531. function resizeDiv(){
  1532. if (printing == true) return;
  1533. var oNav = document.all.item("nav");
  1534. var oText= document.all.item("text");
  1535.  
  1536.     if (popupOpen) closePopup();
  1537.     if (oText == null) return;
  1538.     if (oNav != null){
  1539.         document.all.nav.style.width= document.body.offsetWidth;
  1540.         document.all.text.style.width= document.body.offsetWidth-4;
  1541.         document.all.text.style.top= document.all.nav.offsetHeight;
  1542.         if (document.body.offsetHeight > document.all.nav.offsetHeight)
  1543.             document.all.text.style.height= document.body.offsetHeight - document.all.nav.offsetHeight;
  1544.          else document.all.text.style.height=0; 
  1545.   }
  1546. }
  1547. //**  addID *************************************************************************************************************
  1548. function addID(){
  1549.  
  1550. var locID = document.location.href; 
  1551. var iHTM = locID.lastIndexOf(".htm");
  1552. var iName=locID.lastIndexOf("/");
  1553.       locID = locID.substring(iName+1,iHTM);
  1554.     
  1555.     return locID;
  1556. }    
  1557. //** set_to_print ***************
  1558. function set_to_print(){
  1559.     // alert(printing)
  1560.     if (printing == true) return
  1561.     var i;
  1562.     
  1563.  
  1564. var isIE5 = (navigator.appVersion.indexOf("MSIE 5")>0) || (navigator.appVersion.indexOf("MSIE")>0 && parseInt(navigator.appVersion)> 4);
  1565. var isIE55 = (navigator.appVersion.indexOf("MSIE 5.5")>0);
  1566. if (isIE5 && isIE55) isIE5 = false;
  1567. var isIE6 = (navigator.appVersion.indexOf("MSIE 6")>0);
  1568. var isIE4 = (navigator.appVersion.indexOf("MSIE 4")>0);
  1569.  
  1570. if (!isIE5 && !isIE55 && !isIE4 && !isIE6) {
  1571.     isIE6 = true;
  1572.     }
  1573.  
  1574.  
  1575. // trying    
  1576.  
  1577. printing = true;
  1578.  
  1579.  if (isIE55){
  1580.      addReusableText();
  1581.      insertImages_4_print();
  1582.      }
  1583. if (isIE6){
  1584.     addReusableText();
  1585.      insertImages_4_print();
  1586.     }
  1587.  
  1588. // to fix printing
  1589.  
  1590.  
  1591.  
  1592. isPersistent= (document.all.item("checklist")!=null) && ((isIE5) || (isIE6) || (isIE55));
  1593.  setPreviousNext();
  1594.  resizeDiv();
  1595. // if (isPersistent) getChecklistState();
  1596.  
  1597.  
  1598.     if (window.text) {
  1599.         if (!window.text.style){
  1600.             scroller = "FALSE";
  1601.             }
  1602.         else
  1603.             {
  1604.             document.all.text.style.height = "auto";
  1605.             scroller = "TRUE";
  1606.             }
  1607.         }
  1608.     
  1609. var thisLoc= document.location.href;
  1610.     thisLoc = thisLoc.indexOf("glossary.htm")
  1611.     if (thisLoc != -1){
  1612.         return;
  1613.         }
  1614.     // alert("in print")
  1615.     
  1616.     // alert(isIE6)
  1617.     for (i=0; i < document.all.length; i++){
  1618.         if (document.all[i].id == "expand") {
  1619.             // callExpand(document.all[i]);         // no longer needed since the coua_print.css does this now.
  1620.             single = "TRUE";
  1621.             }
  1622.         if (document.all[i].tagName == "BODY") {
  1623.             document.all[i].scroll = "auto";
  1624.             }
  1625.         if (document.all[i].tagName == "A" && scroller != "TRUE") {
  1626.             joe = " " + document.all[i].outerHTML
  1627.             joe = joe.toLowerCase();
  1628.             joe = joe.indexOf("href=")
  1629.             if(joe == -1){
  1630.                 document.all[i].outerHTML = "<A NAME=''>" + document.all[i].innerHTML + "</a>";
  1631.                 }
  1632.             else
  1633.                 {
  1634.                 document.all[i].outerHTML = "<A HREF=''>" + document.all[i].innerHTML + "</a>";
  1635.                 }
  1636.             }
  1637.         }
  1638.         
  1639. // reset_form();
  1640.     
  1641. }
  1642. //** used to reset a page if needed ********************
  1643. function reset_form(){
  1644.     printing = false;
  1645.     document.location.reload();
  1646. }
  1647.  
  1648.     
  1649. //** on error routine *********************************
  1650. function errorHandler() {
  1651.  //  alert("Error Handled");
  1652.   return true;
  1653. }
  1654.  
  1655. // ******************************* this function is to help ie55 and ie6 to print these images  ******
  1656. booking = false;
  1657. function insertImages_4_print(){
  1658.  
  1659. window.onerror = errorHandler
  1660. // if (isIE6) return
  1661. // if (isIE55) return
  1662. if (!printing) booking = true;
  1663. if (printing == true && booking == true ) {
  1664.     booking = false;
  1665.     return;
  1666.     }
  1667.  
  1668.  
  1669.  var collP = document.all.tags("P");
  1670.   
  1671.   for (var i=0; i<collP.length; i++) {
  1672.        if (collP[i].className.toLowerCase()=="note")            collP[i].innerHTML ="<img class='alert' src='"+noteImg+"' "+ imgStyleRTL +"> " +     collP[i].innerHTML;
  1673.        else if (collP[i].className.toLowerCase()=="warning")    collP[i].innerHTML ="<img class='alert' src='"+warningImg+"'> " +  collP[i].innerHTML;
  1674.        else if (collP[i].className.toLowerCase()=="caution")    collP[i].innerHTML ="<img class='alert' src='"+cautionImg+"'> " +  collP[i].innerHTML;
  1675.        else if (collP[i].className.toLowerCase()=="tip")        collP[i].innerHTML ="<img class='alert' src='"+tipImg+"'> " +      collP[i].innerHTML;
  1676.        else if (collP[i].className.toLowerCase()=="important")  collP[i].innerHTML ="<img class='alert' src='"+importantImg+"'> " + collP[i].innerHTML;
  1677.        else if (collP[i].className.toLowerCase()=="empty")      collP[i].innerHTML ="<img class='alert' src='"+emptyImg+"'> " +    collP[i].innerHTML;
  1678.        if (collP[i].className.toLowerCase()=="reltopics" && rel_gif == "yes")  {
  1679.             collP[i].outerHTML ="<img class='relTopics' src='"+relTopicsImg+"'> " + collP[i].outerHTML;
  1680.             }   
  1681.           }
  1682.   
  1683. //alert(printing)
  1684. //alert(isIE55)
  1685. //indents for Navigation Tree 
  1686. var collUL = document.all.tags("UL");
  1687. if (!printing) {
  1688. for (var i=0; i<collUL.length; i++) {
  1689.        var indent= 0;
  1690.        if (collUL[i].className.toLowerCase()=="navtree"){
  1691.            if (isRTL) collUL[i].style.listStyleImage= "url('" + branchImg_RTL + "')";
  1692.            else collUL[i].style.listStyleImage= "url('" + branchImg + "')";
  1693.              for (var j = 0; j < collUL[i].children.length; j++)
  1694.                 if (collUL[i].children[j].className.toLowerCase()=="branch"){
  1695.                     if (isRTL) collUL[i].children[j].style.marginRight= (indent +'em');
  1696.                     else   collUL[i].children[j].style.marginLeft= (indent +'em');
  1697.                     indent= indent + 0.75;
  1698.                 }
  1699.       }
  1700. }
  1701. }
  1702.    
  1703.   for (var i=0; i < document.anchors.length; i++){
  1704.          var imgInsert="";  
  1705.          var imgStyle= "";
  1706.          var imgSpace= "<span class='space'></span>";      
  1707.          var oBefore=document.anchors[i].parentElement.tagName;
  1708.          var oAnchor= document.anchors[i].id.toLowerCase();
  1709.          
  1710. // insert RELTOPICS icons
  1711.     if (rel_gif == "yes"){
  1712.        if (oAnchor=="reltopics")
  1713.                if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "reltopics")
  1714.                     imgInsert= "";    // not to re-insert when persistent
  1715.             else  imgInsert= "<img class='relTopics' src='"+relTopicsImg+"'>" + imgSpace;
  1716.         }
  1717.         
  1718. // insert SHORTCUT icons
  1719.        if (oAnchor=="shortcut") {    
  1720.             document.anchors[i].title= sShortcutTip;     
  1721.             if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "shortcut")
  1722.                     imgInsert= "";    // not to re-insert when persistent
  1723.             else  imgInsert= "<img class='shortcut' src='"+shortcutCold+"' "+ imgStyleRTL+ ">" + imgSpace;
  1724.         }    
  1725.                       
  1726. // insert POPUP icons
  1727.        else if (oAnchor=="wpopup" || oAnchor=="wpopupweb") document.anchors[i].title= sPopupTip;
  1728.        else if (document.anchors[i].className.toLowerCase()=="popupicon")
  1729.             if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "popup")
  1730.                    imgInsert= "";    // not to re-insert when persistent
  1731.             else imgInsert= "<img class='popup' src='"+popupCold+"'>" + imgSpace;
  1732.  
  1733. // insert EXPAND icons 
  1734.        else if (oAnchor=="expand") {
  1735.               document.anchors[i].title= sExpandTip;
  1736.               if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "expand")
  1737.                   imgInsert= "";     // not to re-insert when persistent      
  1738.               else{ 
  1739.                   if (document.anchors[i].parentElement.offsetLeft == document.anchors[i].offsetLeft) {
  1740.                       imgSpace= "<span class='space' style='width:0'></span>";     
  1741.                       if (isRTL){ document.anchors[i].parentElement.style.marginRight= "1.5em";  imgStyle=" style=margin-right:'-1.5em'";}
  1742.                       else { document.anchors[i].parentElement.style.marginLeft= "1.5em";  imgStyle=" style=margin-left:'-1.5em'";}
  1743.                   }      
  1744.                   imgInsert= "<img class='expand' src='"+ closed +"' "+imgStyle+">" +imgSpace;
  1745.               }
  1746.        }
  1747.  
  1748.  
  1749.  
  1750. // insert thumbnail images       
  1751.        else if (oAnchor=="thumbnail"  || oAnchor=="thumbnailweb"){ 
  1752.             var sAltText = document.anchors[i].innerHTML;
  1753.             gifwithin = true;
  1754.             var sThumbnailText = document.anchors[i].title; 
  1755.             var oImg = document.anchors[i].href.toLowerCase();
  1756.                   if (oAnchor=="thumbnail") 
  1757.                          var sThumbnailImg= moniker + getURL(oImg);
  1758.                   else var sThumbnailImg = document.anchors[i].href.toLowerCase();
  1759.                   
  1760.                  found = sAltText.indexOf("BACKGROUND-COLOR:")
  1761.             if (found != -1) {
  1762.                 stop_p = sAltText.indexOf(">");
  1763.                 sAltText = sAltText.substring(stop_p + 1, sAltText.length);
  1764.                 stop_p = sAltText.indexOf("</FONT>");
  1765.                 Highlighted = sAltText.substring(0,stop_p)
  1766.                 sAltText = Highlighted + sAltText.substring(stop_p + 7, sAltText.length);
  1767.                 }
  1768.  
  1769.                   
  1770.                 document.anchors[i].outerHTML = "<DIV id='thumbDiv' class='thumbnail'>"+document.anchors[i].outerHTML+"</div>";
  1771.                 document.anchors[i].innerHTML = "<img class='thumbnail' src='" + sThumbnailImg + "' alt= ' " + sAltText + "'><p>" +sThumbnailText+"</p>";
  1772.                 
  1773.                   if (isRTL) thumbDiv.style.styleFloat= "right";
  1774.            }
  1775.            
  1776.         
  1777.         
  1778.         document.anchors[i].innerHTML = imgInsert + document.anchors[i].innerHTML;
  1779.        if (isRTL) document.anchors[i].dir="rtl";
  1780.    }
  1781. }
  1782.  
  1783. //** quad method code --  Witten by Randy Feinger, morphed to work inside of shared.js
  1784. function QuadDocumentMouseOver()
  1785. {
  1786.     var elem = event.srcElement;
  1787.     
  1788.     // If the first childe of the source element is a radio button and 
  1789.     // the parent element isn't grayed, change the cursor to a hand
  1790.     // or back to the original as appropriate.
  1791.     if (elem != null && elem.firstChild != null && 
  1792.         elem.firstChild.tagName != null &&
  1793.         elem.firstChild.tagName.toLowerCase() == "input" && 
  1794.         elem.firstChild.type.toLowerCase() == "radio" && 
  1795.         elem.parentElement.className != "indentGray")
  1796.     {
  1797.         if (elem.style.cursor == "hand")
  1798.             elem.style.cursor = "auto";
  1799.         else
  1800.             elem.style.cursor = "hand";
  1801.     }
  1802. }
  1803.  
  1804. function QuadDocumentClick()
  1805. {
  1806.     // Don't process clicks on grayed text.
  1807.     if (event.srcElement.parentElement.className == "indentGray")
  1808.         return;
  1809.     
  1810.     // INPUT elements should be wrapped by another element such as a SPAN, DIV, or P.
  1811.     var elem = event.srcElement.firstChild;
  1812.     
  1813.     // If this is a radio button...
  1814.     if (elem != null && elem.tagName != null && elem.tagName.toLowerCase() == "input" && elem.type == "radio")
  1815.     {
  1816.         // check it.
  1817.         elem.checked = true;
  1818.     }
  1819.     else
  1820.     {    
  1821.         // Otherwise, set elem to the event's source element.
  1822.         elem = event.srcElement;
  1823.     }
  1824.     
  1825.     // Call OnElementClick() and pass in the source element, and the name token
  1826.     // used to mark a top-level clickable element such as a radio button.
  1827.     OnElementClick(elem, "row1");
  1828. }
  1829.  
  1830.  
  1831.  
  1832. function OnElementClick(srcElem, token)
  1833. {
  1834.     var elemTagName = srcElem.tagName;                        // Tag name of the source element.
  1835.     var collElements1 = document.all.item(srcElem.name);    // Collection of elements with the same name property as the source element.
  1836.     var n = srcElem.sourceIndex;                            // The source index of the source element.
  1837.     var elemGroup = srcElem.group;                            // The (dynamic) group property for the source element.
  1838.     var elemID = srcElem.id;                                // The source element's ID.
  1839.     var i, j, k;                                            // Loop variables.
  1840.     
  1841.     // If there are no elements with the same name as the source element, or
  1842.     // if the source element isn't part of a group, exit the function.
  1843.     if (collElements1 == null || elemGroup == null || collElements1.length == null)
  1844.         return;
  1845.     
  1846.     // Make sure the source element's name contains the designated token
  1847.     // so we know it's top-level element that should be processed.
  1848.     if (srcElem.name.toLowerCase().indexOf(token) != -1)
  1849.     {
  1850.         // Loop through the collection of 
  1851.         for (i = 0; i < collElements1.length; i++)
  1852.         {
  1853.             // Go up one level and then down a level in the element hierarchy to find
  1854.             // the container (parent) element for the clickable sub-elements (radio buttons).
  1855.             var oNextElement = collElements1(i).parentElement.nextSibling;
  1856.             
  1857.             // If there is no such element, get the next element in the collection.
  1858.             if (oNextElement == null || oNextElement.tagName == null)
  1859.                 continue;
  1860.             
  1861.             // Get the collection of all the elements within the container element that 
  1862.             // have the same tag name as the source element.
  1863.             var collElements2 = oNextElement.all.tags(elemTagName);
  1864.             
  1865.             // Make sure the collection is valid.
  1866.             if (collElements2 == null || collElements2.length == 0)
  1867.                 continue;
  1868.  
  1869.             // Loop through the collection of sub-elements within the container element.
  1870.             for (j = 0; j < collElements2.length; j++)
  1871.             {
  1872.                 // If the current element in the collection is not the
  1873.                 // source element, disable it and make the text gray.
  1874.                 if (collElements1(i).sourceIndex != n)
  1875.                 {
  1876.                     oNextElement.className = "indentGray"
  1877.                     collElements2(j).disabled = true;
  1878.                 }
  1879.                 else    // Otherwise, enable the element and make the text black.
  1880.                 {
  1881.                     oNextElement.className = "indentBlack"
  1882.                     collElements2(j).disabled = false;
  1883.                     
  1884.                     // Set the ID for the checked (selected) element for use below.
  1885.                     if (collElements2(j).tagName.toLowerCase() == "input" && 
  1886.                         collElements2(j).type.toLowerCase() == "radio" && 
  1887.                         collElements2(j).checked == true)
  1888.                     {
  1889.                         elemID = collElements2(j).id;
  1890.                     }
  1891.                 }
  1892.             }
  1893.         }
  1894.     }
  1895.     
  1896.     // Get the collection of all of the elements with the same tag name as that
  1897.     // of the source element.
  1898.     var collElements2 = document.all.tags(elemTagName);
  1899.         
  1900.     // Make sure the collection is valid.
  1901.     if (collElements2 == null || collElements2.length == 0)
  1902.         return;
  1903.         
  1904.     // Loop through the collection of elements.
  1905.     for (i = 0; i < collElements2.length; i++)
  1906.     {
  1907.         // Get the collection of all elements with the same ID as the
  1908.         // current item in the collection.
  1909.         var collAssocElems = document.all(collElements2(i).id);
  1910.                 
  1911.         // Make sure the collection is valid.
  1912.         if (collAssocElems == null || collAssocElems.length == 0)
  1913.             continue;
  1914.             
  1915.         // Loop through the collection of same-named elements.
  1916.         for (j = 0; j < collAssocElems.length; j++)
  1917.         {
  1918.             // If the tag name for the current element is different than that for the source element,
  1919.             // and the current element is part of the same group as the source element, 
  1920.             // hide or display the element as appropriate.
  1921.             if (collAssocElems(j).tagName != elemTagName && collAssocElems(j).group == elemGroup)
  1922.             {
  1923.                 // Hide the element unless the current element's ID matches the ID of the element
  1924.                 // that has been checked (selected).
  1925.                 collAssocElems(j).style.display = ((collAssocElems(j).id == elemID) ? "block" : "none")
  1926.             }
  1927.         }
  1928.     }
  1929. }
  1930.  
  1931.