home *** CD-ROM | disk | FTP | other *** search
/ Netwerk 14 / Netwerk_Vol14.iso / ie55 / TS95.CAB / mstask.chm / shared.js < prev    next >
Text File  |  2000-05-31  |  43KB  |  1,090 lines

  1. // Filename: shared.js in Shared.chm
  2. // Version post beta 3 (7)
  3. // version 07.01.99
  4.  
  5. //************************************************ EVENT HANDLING ********************************************
  6. //*******************************************************************************************************************
  7. //  re-directs to the proper event-driven functions.
  8.  
  9. window.onload= loadPage;
  10. document.onclick= onclickTriage;
  11. document.onmouseover= gettingHot;
  12. document.onmouseout= gettingCold;
  13. window.onunload=saveChecklistState;
  14. window.onresize= resizeDiv;
  15.  
  16. //window.onbeforeprint= set_to_print;
  17. //window.onafterprint= reset_form;
  18. //********************************************  USER-DEFINED GLOBAL VARIABLES  ****************************************
  19. //********************************************************************************************************************
  20. //  The images listed below can all be changed by the user.
  21.  
  22. var sPreviousTip= "Vorig onderwerp";
  23. var sNextTip= "Volgend onderwerp";
  24. var sExpandTip= "Uitvouwen/samenvouwen";
  25. var sPopupTip= "Definitie weergeven";
  26. var sShortcutTip= "";
  27.  
  28. var moniker= "ms-its:";                                         // moniker= ""; for flat files
  29. var sSharedCHM= moniker+"shared.chm::/";
  30.  
  31. //************************************************  RESTORE ADDITION BEGIN  ******************************************* 
  32.  
  33. sCurrentDirectory = ".\\";
  34. //var shortcutCold= sSharedCHM + "shortcutCold.gif";
  35. //var shortcutHot= sSharedCHM + "shortcutHot.gif";
  36. var shortcutCold= sCurrentDirectory + "shortcutCold.gif";
  37. var shortcutHot= sCurrentDirectory + "shortcutHot.gif";    
  38.  
  39. //***********************************************  END RESTORE MODIFICATION  *****************************************
  40.  
  41. var closed = sSharedCHM + "plusCold.gif";                //image used for collapsed item in callExpand()
  42. var closedHot = sSharedCHM + "plusHot.gif";            //hot image used for collapsed item in callExpand()
  43. var expand = sSharedCHM + "minusCold.gif";            //image used for expanded item in callExpand()
  44. var expandHot = sSharedCHM + "minusHot.gif";            //hot image used for expanded item in callExpand()
  45.  
  46. var previousCold= sSharedCHM + "previousCold.gif";
  47. var previousHot= sSharedCHM + "previousHot.gif"; 
  48. var nextCold= sSharedCHM + "nextCold.gif";
  49. var nextHot= sSharedCHM + "nextHot.gif"; 
  50.  
  51. var shortcutCold= sSharedCHM + "shortcutCold.gif";
  52. var shortcutHot= sSharedCHM + "shortcutHot.gif";
  53.  
  54. var popupCold= sSharedCHM + "popupCold.gif";
  55. var popupHot= sSharedCHM + "popupHot.gif";
  56.  
  57. var emptyImg= sSharedCHM + "empty.gif";        //image used for empty expand
  58. var noteImg= sSharedCHM + "note.gif";            //image used for notes
  59. var tipImg= sSharedCHM + "tip.gif";            //image used for tips
  60. var warningImg= sSharedCHM + "warning.gif";        //image used for warnings
  61. var cautionImg= sSharedCHM + "caution.gif";        //image used for cautions
  62. var importantImg= sSharedCHM + "important.gif";        //image used for important notice
  63. var relTopicsImg= sSharedCHM + "rel_top.gif";        //image used for important notice
  64.  
  65. var diagramImg= sSharedCHM + "diagram.gif";        //image used for diagram links
  66.  
  67. var branchImg= sSharedCHM + "elle.gif";
  68. var branchImg_RTL= sSharedCHM + "elle_rtl.gif";
  69.  
  70.  
  71. //********************************************  GLOBAL VARIABLES  ******************************************
  72. //********************************************************************************************************
  73.  
  74. var printing = "FALSE";
  75. var single = "FALSE";
  76. var scroller = "FALSE";
  77. var isRTL= (document.dir=="rtl");
  78. var imgStyleRTL= ""; 
  79.       if (isRTL) imgStyleRTL=" style='filter:flipH' ";
  80.  
  81. var sActX_TDC= "CLASSID='CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83'";        //Tabular Data Control  for  reusable text data
  82. var sSharedReusableTextFile= sSharedCHM + "shared.txt";                                        // common reusable text file
  83. var sSharedReusableTextFileRecord= "para";                                                        //reusable text record
  84.  
  85. var numbers= /\d/g;                //javascript regular expression
  86. var spaces= /\s/g;                //javascript regular expression
  87. var semicolon= /;/g;            //javascript regular expression
  88.  
  89. var isIE5= (navigator.appVersion.indexOf("MSIE 5")>0) || (navigator.appVersion.indexOf("MSIE")>0 && parseInt(navigator.appVersion)> 4);
  90. var isPersistent= false;
  91.  
  92.  
  93. //********************************************  INITIALIZATION  *************************************************
  94. //******************************************************************************************************************
  95.  
  96. //*** loadPage **********************************************************************************************
  97. //  Adds the default image tags and re-usable text to the HTML page.
  98.  
  99. function loadPage(){
  100. isPersistent= (document.all.item("checklist")!=null) && (isIE5);
  101.  
  102.   setPreviousNext();
  103.   resizeDiv();
  104.   if (isPersistent) getChecklistState();
  105.   addReusableText();
  106.   insertImages();
  107. }
  108.  
  109. //****** setPreviousNext  ************************************************************************ ********************************************************************************************* 
  110. // insert previous/next navbar
  111. // called by: <div id="nav">@@HTMLsequenceFile.txt or .lst@@</div>
  112.  
  113. function setPreviousNext(){
  114.  
  115.  
  116.   var oNav = document.all.item("nav");
  117.         if (oNav == null ) return;
  118.   
  119.   var sPreviousALT= sPreviousTip;
  120.   var sNextALT= sNextTip;
  121.   var sHTMLfile= oNav.innerHTML;
  122.  
  123.   var imgPrev= "<IMG SRC='"+previousCold+"' BORDER=0 ALT='"+ sPreviousALT +"' ALIGN='top' "+ imgStyleRTL +">";
  124.   var imgNext= "<IMG SRC='"+nextCold+"' BORDER=0 ALT='"+ sNextALT  + "' ALIGN='top' "+ imgStyleRTL +">";
  125.   
  126.   var previousNextObject= "<OBJECT ID='HTMlist' WIDTH=100 HEIGHT=51 " + sActX_TDC +"><param name='DataURL' value='"
  127.         +sHTMLfile +"'><param name='UseHeader' value=True></OBJECT>";
  128.       
  129.         oNav.innerHTML= "<TABLE WIDTH='100%' STYLE='margin-top:0;' cellspacing=0>"
  130.         + "<TR><TD style='text-align=left; background-color:transparent'><A ID='previousLink' HREF='#' REL='previous' CLASS='navbar'>"
  131.         +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'>"
  132.         +imgNext+ "</A></TD></TR></TABLE>";
  133.                     
  134.       document.body.innerHTML= document.body.innerHTML +  previousNextObject;
  135.       findPageSeq();
  136.       if (printing == "TRUE") return;
  137.       var  thisLoc= document.location.href +"#";
  138.  
  139.       if (previousLink.href== thisLoc) previousLink.style.display="none";
  140.       else  previousLink.style.display="block";
  141.  
  142.       if (nextLink.href== thisLoc) nextLink.style.display="none";
  143.       else  nextLink.style.display="block";
  144.       
  145. }
  146.  
  147. //****** findPageSeq *********************************************************************************************
  148. // finds this page in the "html sequence list" file (filename.lst) and determines the previous & next pages from the list
  149. // the list is created from a tool named "chumper"
  150.  
  151. function findPageSeq() {
  152.  
  153. var rs= HTMlist.recordset;
  154. var thisLoc= document.location.href;
  155. var iLoc= thisLoc.lastIndexOf("/");
  156.  
  157.     if (iLoc > 0) thisLoc= thisLoc.substring(iLoc+1, thisLoc.length);
  158.     
  159.     
  160.     if (nav.style == "[object]") {
  161.                 nav.style.visibility="hidden";
  162.                 printing = "FALSE";
  163.                 }
  164.         else
  165.             {
  166.                 printing = "TRUE";
  167.                 return;
  168.             }
  169.     
  170.        
  171.     rs.moveFirst();
  172.        
  173.     while (!rs.EOF) {
  174.           if (thisLoc == rs.fields("HTMfiles").value){
  175.               nav.style.visibility="visible"; 
  176.                 rs.MoveNext();
  177.               break;
  178.           }
  179.           previousLink.href=rs.fields("HTMfiles").value;      
  180.           rs.moveNext();
  181.      }
  182.                 
  183.       if (!rs.EOF) nextLink.href=rs.fields("HTMfiles").value;
  184. }
  185.  
  186.  
  187. //******Re-usable text ********************************************************************************************* 
  188. // Inserts the Tabular Data Control (TDC) object at the end of the page 
  189. // Inserts "re-usable text" from the txt file at: <span id="@@CHM_name@@@@index#@@" class="reuse"></span>
  190. // e.g.<span id="printing4" class="reuse"></span> for record#4 in the printing.txt in printing.chm.
  191.  
  192. function addReusableText(){
  193.  
  194. var sharedAdded= false;                    // make sure the object is only added once
  195. var CHMspecificAdded= false;                // make sure the object is only added once
  196. var coll = document.all.tags("SPAN");
  197. var sIndex,sRecord,sFile,sFileID,dataBindingObject;
  198.  
  199. // TDC object for shared.chm
  200. var coreObject= "WIDTH=100 HEIGHT=51 "+sActX_TDC+"><param name='UseHeader' value=True><param name='FieldDelim' value='~'><param name='sort' value='INDEX'>";
  201. var shareTextObject = "<OBJECT ID='NTsharedText' " + coreObject + "<param name='DataURL' value='"+sSharedReusableTextFile+"'></OBJECT>";
  202.  
  203.     for (var i=0; i< coll.length; i++)                                   
  204.          if (coll[i].className.toLowerCase()=="reuse"){
  205.              if (isRTL) coll[i].dir= "rtl";
  206.              
  207.              if (coll[i].id == null) return;
  208.              
  209.                 sFile= coll[i].id.toLowerCase();
  210.              sFile= sFile.replace(spaces,"");
  211.              sFileID= sFile;
  212.              sFile= sFile.replace(numbers,""); 
  213.  
  214.              if (sFile == sSharedReusableTextFileRecord) coll[i].dataSrc= "#NTsharedText";
  215.              else coll[i].dataSrc= "#CHMspecificText";
  216.     
  217.              coll[i].dataField= "INDEX";
  218.       
  219.              if (!sharedAdded && sFile==sSharedReusableTextFileRecord){
  220.                  document.body.innerHTML= document.body.innerHTML + shareTextObject;
  221.                  sharedAdded= true;
  222.              }
  223.  
  224.              else if (!CHMspecificAdded && sFile !=sSharedReusableTextFileRecord){
  225.                       dataBindingObject= "<OBJECT ID='CHMspecificText'" + coreObject
  226.                       + "<param name='DataURL' value='"+sSharedCHM+sFile+".txt'></OBJECT>";
  227.                       document.body.innerHTML= document.body.innerHTML + dataBindingObject; 
  228.                       CHMspecificAdded= true;
  229.              }
  230.                     
  231.              if (sFile == sSharedReusableTextFileRecord)
  232.                  sRecord= NTsharedText.recordset;
  233.              else sRecord= CHMspecificText.recordset; 
  234.                                                     
  235.              sRecord.moveFirst(); 
  236.     
  237.               do { sIndex= sRecord.fields("INDEX").value;
  238.                      sText= sRecord.fields("TEXT").value;
  239.                      
  240.                      if (sIndex < sFileID) sRecord.moveNext();
  241.                      else break;
  242.               } while (!sRecord.EOF);
  243.                   
  244.                if (sIndex == sFileID) coll[i].innerHTML= sText;
  245.     }           
  246. }
  247.  
  248.  //****** insertImages ********************************************************************************************* 
  249.  //  Inserts shared images in User-Defined Variables section and thumbnails.
  250.  
  251. function insertImages(){
  252.  
  253. // insert alert icons
  254.   var collP = document.all.tags("P");
  255.   var collA = document.all.tags("A");
  256.   for (var i=0; i<collP.length; i++) {
  257.        if (collP[i].className.toLowerCase()=="note")            collP[i].innerHTML ="<img class='alert' src='"+noteImg+"' "+ imgStyleRTL +"> " +     collP[i].innerHTML;
  258.        else if (collP[i].className.toLowerCase()=="warning")    collP[i].innerHTML ="<img class='alert' src='"+warningImg+"'> " +  collP[i].innerHTML;
  259.        else if (collP[i].className.toLowerCase()=="caution")    collP[i].innerHTML ="<img class='alert' src='"+cautionImg+"'> " +  collP[i].innerHTML;
  260.        else if (collP[i].className.toLowerCase()=="tip")        collP[i].innerHTML ="<img class='alert' src='"+tipImg+"'> " +      collP[i].innerHTML;
  261.        else if (collP[i].className.toLowerCase()=="important")  collP[i].innerHTML ="<img class='alert' src='"+importantImg+"'> " + collP[i].innerHTML;
  262.        else if (collP[i].className.toLowerCase()=="empty")      collP[i].innerHTML ="<img class='alert' src='"+emptyImg+"'> " +    collP[i].innerHTML;
  263.        else if (collP[i].className.toLowerCase()=="reltopics")  collP[i].innerHTML ="<img class='alert' src='"+relTopicsImg+"'> " + collP[i].innerHTML;
  264.   }
  265. // insert diagram link icons
  266.    for (var i=0; i<collA.length; i++) {
  267.     if (collA[i].className.toLowerCase()=="diagram")  collA[i].outerHTML = collA[i].outerHTML+" " + "<img class=\"alert\" src=\"" +diagramImg+ "\" border=\"0\">";
  268.   }
  269.  
  270.  
  271.  
  272. //indents for Navigation Tree 
  273. var collUL = document.all.tags("UL");
  274.  
  275. for (var i=0; i<collUL.length; i++) {
  276.        var indent= 0;
  277.        if (collUL[i].className.toLowerCase()=="navtree"){
  278.            if (isRTL) collUL[i].style.listStyleImage= "url('" + branchImg_RTL + "')";
  279.            else collUL[i].style.listStyleImage= "url('" + branchImg + "')";
  280.              for (var j = 0; j < collUL[i].children.length; j++)
  281.                 if (collUL[i].children[j].className.toLowerCase()=="branch"){
  282.                     if (isRTL) collUL[i].children[j].style.marginRight= (indent +'em');
  283.                     else   collUL[i].children[j].style.marginLeft= (indent +'em');
  284.                     indent= indent + 0.75;
  285.                 }
  286.       }
  287. }
  288.    
  289.   for (var i=0; i < document.anchors.length; i++){
  290.          var imgInsert="";  
  291.          var imgStyle= "";
  292.          var imgSpace= "<span class='space'></span>";      
  293.          var oBefore=document.anchors[i].parentElement.tagName;
  294.          var oAnchor= document.anchors[i].id.toLowerCase();
  295.          
  296. // insert RELTOPICS icons
  297. //       if (oAnchor=="reltopics")          
  298. //            if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "reltopics")
  299. //                    imgInsert= "";    // not to re-insert when persistent
  300. //            else  imgInsert= "<img class='alert' src='"+relTopicsImg+"'>" + imgSpace;
  301.             
  302. // insert SHORTCUT icons
  303.        if (oAnchor=="shortcut") {    
  304.             document.anchors[i].title= sShortcutTip;     
  305.             if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "shortcut")
  306.                     imgInsert= "";    // not to re-insert when persistent
  307.             else  imgInsert= "<img class='shortcut' src='"+shortcutCold+"' "+ imgStyleRTL+ ">" + imgSpace;
  308.         }    
  309.                       
  310. // insert POPUP icons
  311.        else if (oAnchor=="wpopup" || oAnchor=="wpopupweb") document.anchors[i].title= sPopupTip;
  312.        else if (document.anchors[i].className.toLowerCase()=="popupicon")
  313.             if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "popup")
  314.                    imgInsert= "";    // not to re-insert when persistent
  315.             else imgInsert= "<img class='popup' src='"+popupCold+"'>" + imgSpace;
  316.  
  317. // insert EXPAND icons 
  318.        else if (oAnchor=="expand") {
  319.               document.anchors[i].title= sExpandTip;
  320.               if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "expand")
  321.                   imgInsert= "";     // not to re-insert when persistent      
  322.               else{ 
  323.                   if (document.anchors[i].parentElement.offsetLeft == document.anchors[i].offsetLeft) {
  324.                       imgSpace= "<span class='space' style='width:0'></span>";     
  325.                       if (isRTL){ document.anchors[i].parentElement.style.marginRight= "1.5em";  imgStyle=" style=margin-right:'-1.5em'";}
  326.                       else { document.anchors[i].parentElement.style.marginLeft= "1.5em";  imgStyle=" style=margin-left:'-1.5em'";}
  327.                   }      
  328.                   imgInsert= "<img class='expand' src='"+ closed +"' "+imgStyle+">" +imgSpace;
  329.               }
  330.        }
  331.  
  332. // insert thumbnail images       
  333.        else if (oAnchor=="thumbnail"  || oAnchor=="thumbnailweb"){ 
  334.             var sAltText = document.anchors[i].innerHTML;
  335.  
  336.             var sThumbnailText = document.anchors[i].title; 
  337.             var oImg = document.anchors[i].href.toLowerCase();
  338.                   if (oAnchor=="thumbnail") 
  339.                          var sThumbnailImg= moniker + getURL(oImg);
  340.                   else var sThumbnailImg = document.anchors[i].href.toLowerCase();
  341.                 document.anchors[i].outerHTML = "<DIV id='thumbDiv' class='thumbnail'>"+document.anchors[i].outerHTML+"</div>";
  342.                 document.anchors[i].innerHTML = "<img class='thumbnail' src='" + sThumbnailImg + "' alt= ' " + sAltText + "'><p>" +sThumbnailText+"</p>";
  343.                 
  344.                   if (isRTL) thumbDiv.style.styleFloat= "right";
  345.            }
  346.         
  347.         document.anchors[i].innerHTML = imgInsert + document.anchors[i].innerHTML;
  348.        if (isRTL) document.anchors[i].dir="rtl";
  349.    }
  350. }
  351.  
  352.  
  353. //***** onclickTriage ****************************************************************************************
  354. // redirects to the appropriate function based on the ID of the clicked <A> tag.
  355.  
  356. function onclickTriage(){
  357. var e= window.event.srcElement;
  358.  
  359. //  if the innerHTML in the <a> tag is encapsulated by a style tag or hightlighted in the word seach,
  360. //  the parentElement is called.
  361.  
  362.     for (var i=0; i < 5; i++)
  363.            if (e.tagName!="A" && e.parentElement!=null) e= e.parentElement;
  364.     eID= e.id.toLowerCase();
  365.                 
  366.     if (popupOpen) closePopup();
  367.     
  368.  // expand image in a new window
  369.     if (eID=="thumbnail" || eID=="pophtm") popNewWindow(e);
  370.     else if (eID=="thumbnailweb") callThumbnailWeb(e);
  371.     else if (eID=="wpopup")    callPopup(e);
  372.     else if (eID=="wpopupweb") callPopupWeb(e);
  373.     else if (eID=="shortcut")  callShortcut(e);
  374.     else if (eID=="reltopics") callRelatedTopics(e);
  375.     else if (eID=="altloc")    callAltLocation(e);
  376.     else if (eID=="expand")    callExpand(e);
  377.     return;
  378. }
  379.  
  380.  
  381. //*** gettingHot ****************************************************************************************
  382. // Makes all the required changes for mouseover.
  383.  
  384. function gettingHot() {
  385. var e = window.event.srcElement;
  386.   
  387.   if (e.id.toLowerCase()=="cold")  e.id ="hot";
  388.   else if (e.src== previousCold)  e.src = previousHot;
  389.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== previousCold)  e.children.tags("IMG")(0).src= previousHot;
  390.   else if (e.src== nextCold)  e.src = nextHot;
  391.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== nextCold)  e.children.tags("IMG")(0).src= nextHot;
  392.   
  393.   else if (e.className.toLowerCase()=="shortcut" && e.tagName=="IMG")  e.src = shortcutHot;            //<img> tags have a class
  394.   else if (e.id.toLowerCase()=="shortcut")  e.children.tags("IMG")(0).src = shortcutHot;            //<a> tags have an ID
  395.   
  396.   else if (e.className.toLowerCase()=="popup" && e.tagName=="IMG")  e.src = popupHot;            //<img> tags have a class
  397.   else if (e.className.toLowerCase()=="popupicon")  e.children.tags("IMG")(0).src = popupHot;            //<a> tags have an ID
  398.   
  399.   else if ((e.className.toLowerCase()=="expand" && e.tagName=="IMG") ||( e.id.toLowerCase()=="expand")) expandGoesHot(e);
  400.  
  401. }
  402.  
  403. //*** gettingCold **************************************************************************************
  404. // Initial state for mouseout.
  405.  
  406. function gettingCold() {
  407. var e = window.event.srcElement;
  408.  
  409.   if (e.id.toLowerCase()=="hot")  e.id ="cold";
  410.   else if (e.src== previousHot)  e.src = previousCold;
  411.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== previousHot)  e.children.tags("IMG")(0).src= previousCold;
  412.   else if (e.src== nextHot)  e.src = nextCold;
  413.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== nextHot)  e.children.tags("IMG")(0).src= nextCold;
  414.   
  415.   else if (e.className.toLowerCase()=="shortcut" && e.tagName=="IMG")   e.src = shortcutCold;        //<img> tags have a class
  416.   else if (e.id.toLowerCase()=="shortcut")  e.children.tags("IMG")(0).src= shortcutCold;             //<a> tags have an ID
  417.   
  418.   else if (e.className.toLowerCase()=="popup" && e.tagName=="IMG")   e.src = popupCold;        //<img> tags have a class
  419.   else if (e.className.toLowerCase()=="popupicon")  e.children.tags("IMG")(0).src= popupCold;             //<a> tags have an ID
  420.   
  421.   else if ((e.className.toLowerCase()=="expand" && e.tagName=="IMG") ||( e.id.toLowerCase()=="expand")) expandGoesCold(e);
  422. }
  423.  
  424. //****************************************** OBJECT CONSTRUCTION **************************************
  425. //*****************************************************************************************************
  426. //  Uses an A tag to pass parameters between an HTML page and this script.
  427. //  Creates an ActiveX Object from these parameters, appends the Object to the end of the page,
  428. //  and clicks it. These objects relate to HTMLHelp environment and information about them can be found on the http://HTMLHelp site.
  429.  
  430. //  Object construction variables *********************************************************************
  431.  
  432. var sParamCHM,sParamFILE, sParamEXEC, sParamMETA,iEND;
  433. var sActX_HH= " type='application/x-oleobject' classid='clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11' ";
  434.  
  435.  
  436. //*** callPopup ***************************************************************************************
  437. // creates an object from an <A> tag HREF, the object inserts a winhelp popup
  438. // called by: <A ID="wPopup" HREF="HELP=@@file_name.hlp@@ TOPIC=@@topic#@@">@@Popup text@@</A>
  439.  
  440. function callPopup(eventSrc) {
  441. var e= eventSrc;
  442. var eH= unescape(e.href);
  443. var eH_= eH.toLowerCase();
  444.        event.returnValue = false;
  445.                                                                
  446.   var iTOPIC      = eH_.lastIndexOf("topic=");
  447.         if (iTOPIC==-1) return;
  448.         sParamTOPIC = eH.substring((iTOPIC+6),eH.length);          // extracts the topic for item2
  449.         
  450.   var iHELP       = eH_.lastIndexOf("help=");
  451.         if (iHELP==-1) return;
  452.         sParamHELP = eH.substring(iHELP+5,iTOPIC);            // extracts the help file for item1
  453.         
  454.         if (document.hhPopup) document.hhPopup.outerHTML = "";    // if hhPopup object exists, clears it
  455.  
  456.  
  457.  var  h= "<object id='hhPopup'"+ sActX_HH + "STYLE='display:none'><param name='Command' value='WinHelp, Popup'>";
  458.       h= h + "<param name='Item1' value='" + sParamHELP + "'><param name='Item2' value='" + sParamTOPIC + "'></object>";
  459.         
  460.         document.body.insertAdjacentHTML("beforeEnd", h);     
  461.         document.hhPopup.hhclick();
  462. }
  463.  
  464.  
  465. //*** callAltLocation******************************************************************************
  466. // creates an object from an <A> tag HREF, the object will navigate to the alternate location if the first location is not found.
  467. // 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>
  468.    
  469.  
  470. function callAltLocation(eventSrc) {
  471. var e= eventSrc;
  472. var eH= unescape(e.href);
  473. var eH_= eH.toLowerCase();
  474. var sFILEarray,sCHMarray;
  475.      event.returnValue = false;
  476.      
  477.   var sParamTXT= e.innerHTML;
  478.       sParamTXT= sParamTXT.replace(semicolon,"");
  479.                                        
  480.   var iFILE = eH_.lastIndexOf("file=");
  481.         if (iFILE==-1) return;
  482.         sParamFILE= eH.substring((iFILE+5),eH.length);                  // extracts the 2 HTM files
  483.         sParamFILE= sParamFILE.replace(spaces,"");
  484.         iSPLIT= sParamFILE.match(semicolon);
  485.         if (iSPLIT)
  486.               sFILEarray = sParamFILE.split(";");                                        // separates the 2 HTM files
  487.         else return;
  488.           
  489.   var iCHM  = eH_.lastIndexOf("chm=");
  490.         if(iCHM==-1) return;
  491.         else         sParamCHM = eH.substring(iCHM+4,iFILE);            // extracts the 2 CHM's
  492.         sParamCHM= sParamCHM.replace(spaces,"");
  493.         iSPLIT= sParamCHM.match(semicolon);
  494.         if (iSPLIT)
  495.             sCHMarray= sParamCHM.split(";");                                    // separates the 2 CHM's
  496.         else return;
  497.         
  498.         sParamFILE= moniker + sCHMarray[0]+ "::/" + sFILEarray[0] + ";" + moniker + sCHMarray[1]+ "::/" + sFILEarray[1];
  499.                 
  500.         if (document.hhAlt) document.hhAlt.outerHTML = "";                // if hhAlt object exists, clears it
  501.  
  502.  
  503.   var h= "<object id='hhAlt'"+ sActX_HH + "STYLE='display:none'><PARAM NAME='Command' VALUE='Related Topics'>";
  504.       h= h + "<param name='Item1' value='" + sParamTXT +";" + sParamFILE + "'></object>";
  505.     
  506.         document.body.insertAdjacentHTML("beforeEnd", h); 
  507.         document.hhAlt.hhclick();
  508. }
  509.  
  510.  
  511. //*** callRelatedTopics******************************************************************************
  512. // creates an object from an <A> tag HREF, the object inserts a popup of the related topics to select
  513. // called from: <A ID="relTopics" HREF="CHM=@@chm_name1.chm;chm_name2.chm@@ META=@@a_filename1;a_filename2@@">Related Topics</A>
  514.    
  515.  
  516. function callRelatedTopics(eventSrc) {
  517. var e= eventSrc;
  518. var eH= unescape(e.href);
  519. var eH_= eH.toLowerCase();
  520.      event.returnValue = false;
  521.                                        
  522.   var iMETA = eH_.lastIndexOf("meta=");
  523.         if (iMETA==-1) return;
  524.         sParamMETA = eH.substring((iMETA+5),eH.length);              // extracts the META keywords for item2
  525.         
  526.   var iCHM  = eH_.lastIndexOf("chm=");
  527.         if(iCHM==-1) sParamCHM = "";
  528.         else         sParamCHM = eH.substring(iCHM+4,iMETA);            // extracts the CHM files for item1
  529.     
  530.         if (document.hhRel) document.hhRel.outerHTML = "";            // if hhRel object exists, clears it
  531.  
  532.  
  533.   var h= "<object id='hhRel'"+ sActX_HH + "STYLE='display:none'><param name='Command' value='ALink,MENU'>";
  534.       h= h + "<param name='Item1' value='" + sParamCHM + "'><param name='Item2' value='" + sParamMETA + "'></object>";
  535.     
  536.         document.body.insertAdjacentHTML("beforeEnd", h);     
  537.         document.hhRel.hhclick();
  538. }
  539.  
  540. //*** popNewWindow***************************************************************************************
  541. // creates an object from an <A> tag HREF, the object then opens a new window from the image URL found in the HREF
  542. // called from: <a id="thumbnail" title="Enlarge figure" href="CHM=NTArt.chm FILE=@@image_name.gif@@">@@alt text here@@</A>
  543. // the thumbnail image is loaded by loadPage();
  544.  
  545.  
  546. function popNewWindow(eventSrc) {
  547. var eH= eventSrc.href;
  548.       event.returnValue = false;
  549.       
  550.  // extracts the thumbnail image URL from the <a> tag HREF
  551.     sParamFILE =  getURL(eH);
  552.     if (sParamFILE=="") return;
  553.        
  554.  // if the hhWindow object exists, clears it
  555.     if (document.hhWindow) document.hhWindow.outerHTML = "";        
  556.         
  557. var  h =  "<object id='hhWindow'"+ sActX_HH +" STYLE='display:none'><param name='Command' value='Related Topics'>";
  558.      h = h + "<param name='Window' value='$global_largeart'><param name='Item1' value='$global_largeart;" + moniker + sParamFILE+ "'> </object>";
  559.     
  560.      document.body.insertAdjacentHTML("beforeEnd", h);
  561.      document.hhWindow.hhclick();
  562. }
  563.  
  564. //*** callShortcut ***************************************************************************************
  565. // creates an object from an <A> tag, the object then calls the executable code
  566. // called from: <A ID="shortcut" HREF="EXEC=@@executable_name.exe@@ CHM=shared.chm FILE=@@error_file_name.htm@@">@@Shortcut text@@</A>
  567. // the shortcut image is loaded by loadInitialImg();
  568.  
  569. function callShortcut(eventSrc) {
  570. var e= eventSrc;
  571. var eH= unescape(e.href);
  572. var eH_= eH.toLowerCase();
  573.  
  574.  
  575.     event.returnValue = false;
  576.               
  577.  // extracts the error file URL from the <a> tag HREF
  578.     iEND= eH.length;
  579.     sParamFILE =  getURL(eH);
  580.     
  581.     
  582.     
  583. var con_mmc;
  584. var doc_mmc;
  585.  
  586.     doc_mmc = sParamFILE.length;
  587.     con_mmc = sParamFILE.indexOf(".chm");
  588.     sParamFILE = "shared" + sParamFILE.substring(con_mmc,doc_mmc);    
  589.     
  590.  
  591. //code added to redirect if shortcut is nonexisting
  592.  
  593. var con_mmc;
  594. var doc_mmc;
  595.  
  596.     doc_mmc = sParamFILE.toLowerCase();
  597.     con_mmc = doc_mmc.indexOf("mmc.chm");
  598.     if (con_mmc != -1){
  599.         doc_mmc = " " + document.location;
  600.         con_mmc = doc_mmc.indexOf("mmc.chm");
  601.         if (con_mmc == -1){
  602.             sParamFILE = "shared.chm::/alt_url_deux.htm"
  603.             }
  604.         }
  605. // *************************************************
  606.         
  607.      
  608.      
  609. var iEXEC = eH_.lastIndexOf("exec="); 
  610.         if (iEXEC==-1) return;
  611.         else sParamEXEC = eH.substring(iEXEC+5,iEND);                // extracts the executable for item1
  612.         
  613.         if (document.hhShortcut) document.hhShortcut.outerHTML = "";            // if the hhShortcut object exists, clears it
  614.     
  615. var  h =  "<object id='hhShortcut'"+ sActX_HH +" STYLE='display:none'> <param name='Command' value='ShortCut'>";
  616.      if(sParamFILE != "") h = h + "<param name='Window' value='" + moniker + sParamFILE+ "'>";
  617.      h = h + "<param name='Item1' value='" + sParamEXEC + "'><param name='Item2' value='msg,1,1'></object>";
  618.  
  619.         document.body.insertAdjacentHTML("beforeEnd", h);
  620.         document.hhShortcut.hhclick();
  621. }
  622.  
  623. //****************************************  EXPAND FUNCTIONS *********************************************************
  624. //********************************************************************************************************************
  625.  
  626. //**  callExpand **************************************************************************************************
  627. //  This expands & collapses (based on current state) "expandable" nodes as they are clicked.
  628. //  Called by: <A ID="expand" href="#">@@Hot text@@</A>
  629. //  Followed by:  <div class="expand">
  630.  
  631. function callExpand(eventSrc) {
  632.  
  633. var e= eventSrc;
  634.     event.returnValue = false;                    // prevents navigating for <A> tag
  635.     
  636. var oExpandable = getExpandable(e); 
  637. var oImg = getImage(e);
  638.  
  639.      if (oExpandable.style.display == "block")
  640.           doCollapse(oExpandable, oImg);
  641.      else doExpand(oExpandable, oImg);
  642. }
  643.  
  644. //** expandGoesHot *********************************************************************************************
  645. // Returns expand image to hot. 
  646.  
  647. function expandGoesHot(eventSrc){
  648. var e= eventSrc;
  649.     
  650. var oExpandable = getExpandable(e);  
  651. var oImg = getImage(e);
  652.  
  653.     if (oExpandable.style.display == "block") oImg.src = expandHot;
  654.     else oImg.src = closedHot;
  655. }
  656.  
  657.  
  658. //** expandGoesCold *********************************************************************************************
  659. // Returns expand image to cold.
  660.  
  661. function expandGoesCold(eventSrc){
  662. var e= eventSrc;
  663.  
  664. var oExpandable = getExpandable(e);   
  665. var oImg = getImage(e);
  666.  
  667.     if (oExpandable.style.display == "block") oImg.src = expand;
  668.     else oImg.src = closed;
  669. }
  670.  
  671.  
  672. //** getExpandable *****************************[used by callExpand, expandGoesHot, expandGoesCold]*******
  673. //  Determine if the element is an expandable node or a child of one.  
  674.  
  675. function getExpandable(eventSrc){
  676. var  e = eventSrc;
  677. var iNextTag, oExpandable;
  678.  
  679.        for (var i=1;i<4; i++){
  680.                iNextTag=    e.sourceIndex+e.children.length+i;
  681.               oExpandable= document.all(iNextTag);
  682.               if (oExpandable.className.toLowerCase()=="expand" || iNextTag == document.all.length)
  683.                    break;
  684.        }
  685.        return oExpandable;
  686. }
  687.  
  688. //**  getImage ***********************************[used by callExpand, expandGoesHot, expandGoesCold]*******
  689. //  Find the first image in the children of the current srcElement.   
  690. // (allows the  image to be placed anywhere inside the <A HREF> tag)
  691.  
  692. function getImage(header) {
  693. var oImg = header;
  694.  
  695.        if(oImg.tagName != "IMG") oImg=oImg.children.tags("IMG")(0);
  696.        return oImg;
  697. }
  698.  
  699.  
  700. //****  expandAll *******************************************************************************************************
  701. //  Will expand or collapse all "expandable" nodes when clicked. [calls closeAll()]
  702. //  called by: <A HREF="#" onclick="expandAll();">expand all</A>
  703.  
  704. var stateExpand = false;    //applies to the page 
  705.  
  706. //**** ****************************************************************************************************************
  707.  
  708. function expandAll() {
  709. var oExpandToggle, oImg;
  710. var expandAllMsg = "expand all";                    //message returned when CloseAll() is invoked
  711. var closeAllMsg = "close all";                        //message returned when ExpandAll() is invoked
  712. var e= window.event.srcElement;
  713.        event.returnValue = false;
  714.  
  715.        for (var i=0; i< document.anchors.length; i++){
  716.                oExpandToggle = document.anchors[i];
  717.          
  718.                 if (oExpandToggle.id.toLowerCase() == "expand"){ 
  719.                      oExpandable = getExpandable(oExpandToggle);  
  720.                      oImg = getImage(oExpandToggle);
  721.              
  722.                      if (stateExpand == true) doCollapse(oExpandable, oImg);
  723.                      else                     doExpand(oExpandable, oImg);
  724.                 }
  725.        }
  726.        if (stateExpand == true) {
  727.             stateExpand = false;
  728.             e.innerText= expandAllMsg;
  729.        }
  730.        else {
  731.             stateExpand = true;
  732.             e.innerText= closeAllMsg;
  733.        }
  734. }
  735.  
  736.  
  737. //****  doExpand *******************************************************************************************************
  738. //  Expands expandable block & changes image
  739.     
  740. var redo = false;    
  741. function doExpand(oToExpand, oToChange) {
  742. var oExpandable= oToExpand;
  743. var oImg= oToChange;
  744.     
  745.     oImg.src = expand;
  746.     oExpandable.style.display = "block";
  747.     
  748.     if (!redo && !isIE5) {
  749.         redo = true;
  750.         focus(oToExpand);
  751.         doExpand(oToExpand, oToChange);
  752.         }
  753.     
  754. }
  755.  
  756.  
  757. //****  doCollapse *****************************************************************************************************
  758. //  Collapses expandable block & changes image
  759.     
  760. function doCollapse(oToCollapse, oToChange) {
  761. if (printing == "TRUE") return;
  762. var oExpandable= oToCollapse;
  763. var oImg= oToChange;
  764.  
  765.     oExpandable.style.display = "none";
  766.     oImg.src = closed;
  767. }
  768.  
  769. //*******************************************************************************************************
  770. //******* WEB  FUNCTIONS **************************************************************************
  771. //*******************************************************************************************************
  772.  
  773. //**** callThumbnailWeb **************************************************************************************
  774.  
  775. function callThumbnailWeb(eventSrc) {
  776. var e= eventSrc;
  777.        event.returnValue = false;
  778.                     
  779. var thumbnailWin= window.open (e.href, "$global_largeart",  "height=450, width=600, left=10, top=10, dependent=yes, resizable=yes, status=no, directories=no, titlebar=no, toolbar=yes, menubar=no, location=no","true");
  780.  
  781. thumbnailWin.document.write ("<html><head><title>Windows 2000</title></head><body><img src='"+e.href+"'></body></html>");
  782.  
  783. return;
  784. }
  785.  
  786. //*********************************************************************************************************
  787. //*********************************************************************************************************
  788.                                 
  789.                                 
  790. var popupOpen= false;                //state of popups
  791. var posX, posY;                        //coordinates of popups
  792. var oPopup;                            //object to be used as popup content
  793.  
  794. //**** callPopupWeb **************************************************************************************
  795. // the web popups have been converted from the object winHelp popup for the web.
  796. // called by: <A ID="wPopupWeb" HREF="#">@@Popup text@@</A>
  797. // followed by: <div class="popup">Popup content</div>
  798.  
  799.  
  800. function callPopupWeb(eventSrc) {
  801. var e= eventSrc;
  802.   
  803.   // find the popup <div> that follows <a id="wPopupWeb"></a>
  804.   findPopup(e);
  805.   positionPopup(e)
  806.  
  807.   oPopup.style.visibility = "visible";
  808.   popupOpen = true;
  809.  
  810.   return;
  811. }
  812.  
  813. //**** findPopup ****************************************************************************************
  814.  
  815. function findPopup(oX){
  816. var e= oX;
  817. var iNextTag;
  818.     
  819.     for (var i=1;i<4; i++){
  820.          iNextTag=    e.sourceIndex + i;
  821.          oPopup= document.all(iNextTag);
  822.          if (oPopup.className.toLowerCase()=="popup" || iNextTag == document.all.length)
  823.              break;
  824.     }
  825.     if (iNextTag != document.all.length) {
  826.         posX = window.event.clientX; 
  827.         posY = window.event.clientY + document.body.scrollTop+10;
  828.     }
  829.     else closePopup();
  830. }
  831.  
  832. //****  positionPopup ************************************************************************************
  833. // Set size and position of popup.
  834. // If it is off the page, move up, but not past the very top of the page.
  835.  
  836. function positionPopup(oX){
  837. var e= oX;    
  838. var popupOffsetWidth = oPopup.offsetWidth;
  839.  
  840. //determine if popup will be offscreen to right
  841. var rightlimit = posX + popupOffsetWidth;
  842.  
  843.   if (rightlimit >= document.body.clientWidth) 
  844.       posX -= (rightlimit - document.body.clientWidth);
  845.   if (posX < 0) posX = 0;
  846.     
  847. //position popup
  848.   oPopup.style.top = posY;
  849.   oPopup.style.left = posX;
  850.  
  851. var pageBottom = document.body.scrollTop + document.body.clientHeight;
  852. var popupHeight = oPopup.offsetHeight;
  853.   
  854.   if (popupHeight + posY >= pageBottom) {
  855.       if (popupHeight <= document.body.clientHeight)
  856.           oPopup.style.top = pageBottom - popupHeight;
  857.       else
  858.            oPopup.style.top = document.body.scrollTop;
  859.   }
  860. }
  861.  
  862. //**** closePopup ****************************************************************************************
  863. // Close Popup
  864. function closePopup() {
  865.  
  866.   oPopup.style.visibility = "hidden";
  867.   popupOpen = false;
  868.   return;
  869. }
  870.  
  871. //*********************************************  GENERAL FUNCTIONS ************************************************
  872. //**************************************************************************************************************************
  873.  
  874. //***ajustImg *************************************************************************************************************
  875. // expands an image to the with of the window or shrinks it to 90px
  876.  
  877. function ajustImg(eventSrc) {
  878. var e= eventSrc;
  879. var fullWidth= document.body.offsetWidth;
  880.  
  881.     fullWidth = fullWidth - 50;
  882.     if (e.style.pixelWidth==90)
  883.          e.style.pixelWidth=fullWidth;
  884.     else e.style.pixelWidth=90;
  885. }
  886.  
  887.  
  888. //**  getURL **************************************[used in callShortcut, popNewWindow& loadPage]********
  889. // extracts the file location (CHM::/HTM) URL 
  890.  
  891. function getURL(sHREF) {
  892. var spaces= /\s/g
  893. var eH = unescape(sHREF);
  894.     eH = eH.replace(spaces,""); 
  895.  
  896. var eH_= eH.toLowerCase();
  897. var sParamFILE= "";
  898. var sParamCHM= "";
  899.  
  900. var iFILE= eH_.lastIndexOf("file=");
  901.     if (iFILE!=-1){
  902.         iEND= iFILE +1;
  903.         sParamFILE = eH.substring(iFILE+5,eH.length);
  904.     }  
  905.  
  906. var iCHM  = eH_.lastIndexOf("chm=");
  907.     if (iCHM!=-1){
  908.         iEND  = iCHM +1;                             // iEND used by callShortcut
  909.  
  910.         sParamCHM = eH.substring(iCHM+4, iFILE);
  911.         sParamFILE= sParamCHM+"::/"+sParamFILE;
  912.     }    
  913.     return sParamFILE;
  914. }
  915.  
  916. //****************************************************************************************************************************
  917. //********************************************  IE5 PERSISTENCE  *************************************************************
  918. //****************************************************************************************************************************
  919.  
  920. var oTD,iTD;         // persistence
  921.  
  922. //****** Persistence for userData ********************************************************************************************* 
  923.  
  924. function getChecklistState(){ 
  925.  
  926.  var pageID= addID();
  927.  
  928.     if (checklist.all== "[object]") {
  929.     oTD=checklist.all.tags("INPUT");
  930.     iTD= oTD.length;
  931.         }
  932.     else
  933.         {
  934.         printing = "TRUE";
  935.         isPersistent = false;
  936.         return;
  937.         }
  938.  
  939.     if (iTD == 0){
  940.         printing = "TRUE";
  941.         isPersistent = false;
  942.         return;
  943.         }
  944.     
  945. // routine added to fix a bug in the ocx 06/14/99    
  946.      lct = document.location + ".";
  947.      xax = 10;
  948.      xax = lct.indexOf("mk:@MSITStore");
  949.      if (xax != -1) {
  950.          lct = "ms-its:" + lct.substring(14,lct.length-1);
  951.         // alert("before reload : " + document.location);
  952.         // alert("replace with : " + lct);
  953.         isPersistent = false;
  954.         document.location.replace(lct);
  955.         isPersistent = true;
  956.         // alert("after reload : " + document.location);
  957.         }     
  958.      else
  959.          {      
  960.          checklist.load("oXMLStore");
  961.         }
  962. // routine added to fix a bug in the ocx 06/14/99
  963.     if (checklist.getAttribute("sPersist"+pageID+"0"))    
  964.     for (i=0; i<iTD; i++){
  965.  
  966.          if (oTD[i].type =="checkbox" || oTD[i].type =="radio"){
  967.          checkboxValue= checklist.getAttribute("sPersist"+pageID+i);
  968.         
  969.          if (checkboxValue=="yes") oTD[i].checked=true;
  970.          else oTD[i].checked=false;
  971.          }// if
  972.          if (oTD[i].type =="text")              
  973.               oTD[i].value= checklist.getAttribute("sPersist"+pageID+i);
  974.      }// for
  975. } // end persistence
  976.  
  977. //**  saveChecklistState *************************************************************************************************************
  978. function saveChecklistState(){
  979. var pageID= addID(); 
  980.  
  981.         if (!isPersistent) return; 
  982.          //  you will need this           window.location
  983.         for (i=0; i<iTD; i++){
  984.  
  985.                 if (oTD[i].type =="checkbox" || oTD[i].type =="radio"){
  986.                  if (oTD[i].checked) checkboxValue="yes";
  987.                  else checkboxValue="no";
  988.                  
  989.                  checklist.setAttribute("sPersist"+pageID+i, checkboxValue);
  990.              }// if
  991.             
  992.               if (oTD[i].type =="text") 
  993.                  checklist.setAttribute("sPersist"+pageID+i, oTD[i].value);
  994.          }    // for
  995.  
  996.  // routine added to fix a bug in the ocx 06/14/99    
  997.      lct = window.location + ".";
  998.      xax = 10;
  999.      xax = lct.indexOf("mk:@MSITStore");
  1000.      if (xax != -1) {
  1001.          lct = "ms-its:" + lct.substring(14,lct.length-1);
  1002.         // alert("before reload : " + window.location);
  1003.         // alert("replace with : " + lct);
  1004.         isPersistent = false;
  1005.         window.location.replace(lct);
  1006.         isPersistent = true;
  1007.         // alert("after reload : " + window.location);
  1008.         }     
  1009.      else
  1010.          {      
  1011.          checklist.save("oXMLStore");
  1012.         }
  1013. // routine added to fix a bug in the ocx 06/14/99
  1014.      
  1015. }//end function
  1016.  
  1017. //**  resizeDiv *******************************[used with callPopupWeb, setPreviousNext}****************************************************
  1018. //  resize the page when the <div class=nav></div> && <div class=text></div> are found
  1019. function resizeDiv(){
  1020. if (printing == "TRUE") return;
  1021. var oNav = document.all.item("nav");
  1022. var oText= document.all.item("text");
  1023.  
  1024.     if (popupOpen) closePopup();
  1025.     if (oText == null) return;
  1026.     if (oNav != null){
  1027.         document.all.nav.style.width= document.body.offsetWidth;
  1028.         document.all.text.style.width= document.body.offsetWidth-4;
  1029.         document.all.text.style.top= document.all.nav.offsetHeight;
  1030.         if (document.body.offsetHeight > document.all.nav.offsetHeight)
  1031.             document.all.text.style.height= document.body.offsetHeight - document.all.nav.offsetHeight;
  1032.          else document.all.text.style.height=0; 
  1033.   }
  1034. }
  1035.  
  1036. //**  addID *************************************************************************************************************
  1037. function addID(){
  1038.  
  1039. var locID = window.location.href; 
  1040. var iHTM = locID.lastIndexOf(".htm");
  1041. var iName=locID.lastIndexOf("/");
  1042.       locID = locID.substring(iName+1,iHTM);
  1043.     
  1044.     return locID;
  1045. }//End function
  1046.  
  1047. //** set_to_print ***************
  1048. function set_to_print(){
  1049.     var i;
  1050.     printing = "TRUE";
  1051.     
  1052.     if (window.text) {
  1053.         if (!window.text.style){
  1054.             scroller = "FALSE";
  1055.             }
  1056.         else
  1057.             {
  1058.             document.all.text.style.height = "auto";
  1059.             scroller = "TRUE";
  1060.             }
  1061.         }
  1062.         
  1063.     for (i=0; i < document.all.length; i++){
  1064.         if (document.all[i].id == "expand") {
  1065.             callExpand(document.all[i]);
  1066.             single = "TRUE";
  1067.             }
  1068.         if (document.all[i].tagName == "BODY") {
  1069.             document.all[i].scroll = "auto";
  1070.             }
  1071.         if (document.all[i].tagName == "A" && scroller != "TRUE") {
  1072.             document.all[i].outerHTML = "<A HREF=''>" + document.all[i].innerHTML + "</a>";
  1073.             }
  1074.         }
  1075.  
  1076. }
  1077. //** used to reset a page if needed ********************
  1078. function reset_form(){
  1079.  
  1080.     if (single == "TRUE") document.location.reload();
  1081.     if (scroller = "TRUE") document.location.reload();
  1082.     
  1083. }
  1084.  
  1085.     
  1086. //** on error routine *********************************
  1087. function errorHandler() {
  1088.   // alert("Error Handled");
  1089.   return true;
  1090. }