      var myStyle = 'progen3protoTransform.xsl';
      var myGED = 'progen3proto.xml';
      var objSrcTree, ObjXSLT, objCache, objXSLTProc;
      var myXML;
      var iIndex = new Object();  // individuals index
      var pIndex = new Object();  // pair index 

      var permitRefocus = false;
      var blockHistory = false;
      var mySelectS, mtSelectG, mySelectV;
      var myHistory; 
// line 24
      function init()
      {
         window.onresize = resizeOutputBox;

         myHistory = createHistoryQ();

         mySelectV = document.getElementById('selectV').firstChild;
         mySelectV.id = "viewSelect";
         mySelectV.selectedIndex = 0;
         objSrcTree = new ActiveXObject('MSXML2.DOMDocument');
         objSrcTree.async = false;
         if (!objSrcTree.load(myGED)) 
         { alert('failed to load ' + myGED); 
           xPE = objSrcTree.parseError;
           alert(xPE.reason + "  (line: " + xPE.line + " pos: " + xPE.linepos + ")");
         }
         objXSLT = new ActiveXObject('MSXML2.FreeThreadedDOMDocument');
         objXSLT.async = false;
 
        if (!objXSLT.load(myStyle)) 
         { alert('failed to load ' + myStyle); 
           var xPE = objSrcTree.parseError;
           alert(xPE.reason + "  (line: " + xPE.line + " pos: " + xPE.linepos + ")");
         }
      }
// 
      function setup()
      {
         myXML = objSrcTree;

         var root = myXML.documentElement;

         var iList = root.getElementsByTagName('indiv');
         for (var i = 0; i < iList.length; i++)
         {
           var thisI = iList(i);
           var thisIref = thisI.getAttribute('iID');
           iIndex[thisIref] = thisI;
         }
         var pList = root.getElementsByTagName('pair');
         for (var j = 0; j < pList.length; j++)
         {
           var thisP = pList(j);
           var thisPref = thisP.getAttribute('pID');
           pIndex[thisPref] = thisP;
         }
// line 69 
         for (var i = 0; i < iList.length; i++)  
         {   // ********** sweep all individuals **********
           var thisI = iList(i);
           if (thisI.getAttribute('parentPairRef') != null)
           {
             var thisP = pIndex[thisI.getAttribute('parentPairRef')];
             var newProgeny = myXML.createElement('progeny');
             newProgeny.setAttribute('childRef', thisI.getAttribute('iID'));
             thisP.appendChild(newProgeny);
           }
           //  ****** chooses first of the name elements for 'displayNames' attribute ******
           var primeName = thisI.getElementsByTagName('iName')(0);
           var thisDN = primeName.getAttribute('surname') + ", " 
                     + primeName.getAttribute('givens') + " (";
           if ((thisBDate = thisI.getAttribute('bDate')) && (thisBDate != "9999-99-99"))
              thisDN = thisDN + thisBDate.substr(0, 4);   
           else
              thisDN = thisDN + "    ";
           if ((thisDDate= thisI.getAttribute('dDate')) && (thisDDate != "9999-99-99"))
              thisDN = thisDN + " - " + thisDDate.substr(0, 4);   
           else
              thisDN = thisDN + " -    ";
           thisDN = thisDN + ")";
           thisI.setAttribute("displayName", thisDN); 
         }
 
         for (var j=0; j < pList.length; j++)  
         {       // ********** sweep all pairs **********
           thisP = pList(j);
           var minSortDate = '9999-99-99';  // ***** insert pairSortDate *****
           var theseMarriages = thisP.getElementsByTagName('marriage');
           if (theseMarriages.length > 0)
           {     // ***** look first in marriage record(s) for each pair  *****
              for (var k = 0; k < theseMarriages.length; k++)
              {
                 if ((thisSortDate = theseMarriages(k).getAttribute('mDate')) && (thisSortDate <  minSortDate))
                    minSortDate = thisSortDate; 
              }
           }  
           var theseProgeny = thisP.getElementsByTagName('progeny');
           if (theseProgeny.length > 0)
           {  // ***** look next in list of children *****
              for (var k = 0; k < theseProgeny.length; k++)
              {
                 var bSortDate = iIndex[theseProgeny(k).getAttribute('childRef')].getAttribute('bDate');
                 var dSortDate = iIndex[theseProgeny(k).getAttribute('childRef')].getAttribute('dDate');
                 if (bSortDate < minSortDate) minSortDate = bSortDate;
                 if (dSortDate < minSortDate) minSortDate = dSortDate;
              }
           }
           thisP.setAttribute('pairSortDate', minSortDate);
          // ***** create xref partner-elements *****
           if (thisP.getAttribute('maleRef') != null)
           {         
             var thatI = iIndex[thisP.getAttribute('maleRef')];
             var newPartner = myXML.createElement('partner');
             newPartner.setAttribute('partnerPairRef', thisP.getAttribute('pID'));
             if (thisP.getAttribute('femaleRef') != null)
               newPartner.setAttribute('partnerRef', thisP.getAttribute('femaleRef'));
             newPartner.setAttribute('partnerSortDate', thisP.getAttribute('pairSortDate'));
             thatI.appendChild(newPartner);
             
           }
           if (thisP.getAttribute('femaleRef') != null)
           {         
             thatI = iIndex[thisP.getAttribute('femaleRef')];
             newPartner = myXML.createElement('partner');
             newPartner.setAttribute('partnerPairRef', thisP.getAttribute('pID'));
             if (thisP.getAttribute('maleRef') != null)
               newPartner.setAttribute('partnerRef', thisP.getAttribute('maleRef'));
             newPartner.setAttribute('partnerSortDate', thisP.getAttribute('pairSortDate'));
             thatI.appendChild(newPartner);
           }



         }     
 // 

         objCache = new ActiveXObject("Msxml2.XSLTemplate");
         objCache.stylesheet = objXSLT;
         objXSLTProc = objCache.createProcessor();
         objXSLTProc.input = objSrcTree;
        
         resizeOutputBox();
         permitRefocus = false;
         populateSurnames();
         permitRefocus = true;
         mySelectV.selectedIndex = document.getElementById('familyOption').index;
         populateNames(mySelectS.value);
         refocusSelect();
//         redisplay();
      }  
