View the DQSD CVS repository here:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dqsd/

Update of /cvsroot/dqsd/dqsd/addons/genealogy
In directory usw-pr-cvs1:/tmp/cvs-serv28092/addons/genealogy

Modified Files:
        genealogy.nsi 
Added Files:
        fhlc.xml fhlc_func.js 
Log Message:
added fhlc search and supporting files

--- NEW FILE: fhlc.xml ---
<search function="fhlc">
  <name>Family History Library Catalog</name>
  <category>Genealogy</category>
  <contributor>Brent Beardsley</contributor>
  <link>http://www.familysearch.org/Eng/Library/FHLC/frameset_fhlc.asp</link>
  <email></email>
  <description>
    <div class="helpboxDescLabels">Switches:</div>
    <table class="helpboxDescTable">
      <tr><td>/author</td><td> - </td><td>Search for items by author</td></tr>
      <tr><td>/callno</td><td> - </td><td>Search for items by call number</td></tr>
      <tr><td>/film</td><td> - </td><td>Search for items by film or fiche 
number</td></tr>
      <tr><td>/place</td><td> - </td><td>Search for items by place</td></tr>
      <tr><td>/subject</td><td> - </td><td>Search for items by subject</td></tr>
      <tr><td>/surname</td><td> - </td><td>Search for items by surname</td></tr>
    </table>
    <div class="helpboxDescLabels">Examples:</div>
    <table class="helpboxDescTable">
      <tr><td>fhlc /a beardsley</td><td> - </td><td>Search for items with author named 
with last name of Beardsley</td></tr>
      <tr><td>fhlc /a beardsley, isaac</td><td> - </td><td>Search for items with 
author named Isaac Beardsley</td></tr>
      <tr><td>fhlc /c [call number]</td><td> - </td><td>Search for item with specified 
call number</td></tr>
      <tr><td>fhlc /f 1234987</td><td> - </td><td>Search for film or fiche with film 
number 1234987</td></tr>
      <tr><td>fhlc /p perth</td><td> - </td><td>Search for places containing the name 
Perth</td></tr>
      <tr><td>fhlc /p fulton, ny</td><td> - </td><td>Search for places containing 
Fulton as a part of New York</td></tr>
      <tr><td>fhlc /sub immigration</td><td> - </td><td>Search for items with a 
subject of immigration</td></tr>
      <tr><td>fhlc /sur Beardsley</td><td> - </td><td>Search for items containing 
references to the Beardsley surname</td></tr>
    </table>
  </description>
  <form name="fhlc_surnamef"
        method="get"
        
action="http://www.familysearch.org/Eng/Library/fhlcatalog/supermainframeset.asp";>
    <input type="hidden" name="display" value="titlehitlist" />
    <input type="hidden" name="columns" value="*,0,0" />
    <input type="hidden" name="surname" value="" />
    <input type="hidden" name="presurname" value="" />
  </form>
  <form name="fhlc_placef"
        method="get"
        
action="http://www.familysearch.org/Eng/Library/fhlcatalog/supermainframeset.asp";>
    <input type="hidden" name="display" value="localityhitlist" />
    <input type="hidden" name="columns" value="*,0,0" />
    <input type="hidden" name="PLACE" value="" />
    <input type="hidden" name="PARTOF" value="" />
    <input type="hidden" name="prePLACE" value="" />
    <input type="hidden" name="prePARTOF" value="" />
  </form>
  <form name="fhlc_authorf"
        method="get"
        
action="http://www.familysearch.org/Eng/Library/fhlcatalog/supermainframeset.asp";>
    <input type="hidden" name="display" value="authorhitlist" />
    <input type="hidden" name="columns" value="*,0,0" />
    <input type="hidden" name="surname" value="" />
    <input type="hidden" name="forename" value="" />
    <input type="hidden" name="presurname" value="" />
    <input type="hidden" name="preforename" value="" />
  </form>
  <form name="fhlc_subjectf"
        method="get"
        
action="http://www.familysearch.org/Eng/Library/fhlcatalog/supermainframeset.asp";>
    <input type="hidden" name="display" value="subjecthitlist" />
    <input type="hidden" name="columns" value="*,0,0" />
    <input type="hidden" name="subject" value="" />
    <input type="hidden" name="presubject" value="" />
  </form>
  <form name="fhlc_callnof"
        method="get"
        
action="http://www.familysearch.org/Eng/Library/fhlcatalog/supermainframeset.asp";>
    <input type="hidden" name="display" value="titlehitlist" />
    <input type="hidden" name="columns" value="*,0,0" />
    <input type="hidden" name="callno" value="" />
  </form>
  <form name="fhlc_filmf"
        method="get"
        
action="http://www.familysearch.org/Eng/Library/fhlcatalog/supermainframeset.asp";>
    <input type="hidden" name="display" value="filmhitlist" />
    <input type="hidden" name="columns" value="*,0,0" />
    <input type="hidden" name="filmno" value="" />
  </form>

  <script src="addons/genealogy/genealogy_lib.js"></script>
  <script src="addons/genealogy/fhlc_func.js"></script>
  <script><![CDATA[
    function fhlc_film(q)
    {
      document.fhlc_filmf.filmno.value = q.replace(/[^0-9]/g, "");
      document.fhlc_filmf.filmno.value = fhlc_Clean(document.fhlc_filmf.filmno.value);
      submitForm(fhlc_filmf);
    }

    function fhlc_callno(q)
    {
      document.fhlc_callnof.callno.value = q;
      document.fhlc_callnof.callno.value = 
fhlc_repPCWithStar(document.fhlc_callnof.callno.value);
      document.fhlc_callnof.callno.value = 
fhlc_repSpWithU(document.fhlc_callnof.callno.value);
      submitForm(fhlc_callnof);
    }

    function fhlc_subject(q)
    {
      document.fhlc_subjectf.presubject.value = q;
      document.fhlc_subjectf.presubject.value = 
fhlc_repPCWithStar(document.fhlc_subjectf.presubject.value);
      document.fhlc_subjectf.presubject.value = 
fhlc_repSpWithU(document.fhlc_subjectf.presubject.value);
      document.fhlc_subjectf.subject.value = 
fhlc_Normalise(document.fhlc_subjectf.presubject.value);
      document.fhlc_subjectf.presubject.value = 
fhlc_ReplaceLigatures(document.fhlc_subjectf.presubject.value);
      submitForm(fhlc_subjectf);
    }

    function fhlc_author(q)
    {
      var surname = genealogy_parse_surname(q);
      var forename = genealogy_parse_givenname(q);

      document.fhlc_authorf.preforename.value = forename;
      document.fhlc_authorf.presurname.value = surname;
      document.fhlc_authorf.presurname.value = 
fhlc_repPCWithStar(document.fhlc_authorf.presurname.value);
      document.fhlc_authorf.preforename.value = 
fhlc_repPCWithStar(document.fhlc_authorf.preforename.value);
      document.fhlc_authorf.presurname.value = 
fhlc_repSpWithU(document.fhlc_authorf.presurname.value);
      document.fhlc_authorf.preforename.value = 
fhlc_repSpWithU(document.fhlc_authorf.preforename.value);
      document.fhlc_authorf.surname.value = 
fhlc_Normalise(document.fhlc_authorf.presurname.value);
      document.fhlc_authorf.forename.value = 
fhlc_Normalise(document.fhlc_authorf.preforename.value);
      document.fhlc_authorf.presurname.value = 
fhlc_ReplaceLigatures(document.fhlc_authorf.presurname.value);
      document.fhlc_authorf.preforename.value = 
fhlc_ReplaceLigatures(document.fhlc_authorf.preforename.value);
      submitForm(fhlc_authorf);
    }

    function fhlc_surname(q)
    {
      var surname = genealogy_parse_surname(q);
      document.fhlc_surnamef.surname.value = surname;
      document.fhlc_surnamef.presurname.value = surname;
      document.fhlc_surnamef.presurname.value = 
fhlc_repPCWithStar(document.fhlc_surnamef.presurname.value);
      document.fhlc_surnamef.presurname.value = 
fhlc_repSpWithU(document.fhlc_surnamef.presurname.value);
      document.fhlc_surnamef.surname.value = 
fhlc_Normalise(document.fhlc_surnamef.presurname.value);
      document.fhlc_surnamef.presurname.value = 
fhlc_ReplaceLigatures(document.fhlc_surnamef.presurname.value);
      submitForm(fhlc_surnamef);
    }

    function fhlc_place(q)
    {
      var state = genealogy_parse_place_state(q);
      var fullname_state = genealogy_lookup_place_name(state);
      if (fullname_state != "")
        state = fullname_state.toLowerCase();

      var county = genealogy_parse_place_county(q).toLowerCase();

      if (county == "")
      {
        document.fhlc_placef.PLACE.value = state;
        document.fhlc_placef.PARTOF.value = "";
        document.fhlc_placef.prePLACE.value = state;
        document.fhlc_placef.prePARTOF.value = "";
      } else {
        document.fhlc_placef.PLACE.value = county;
        document.fhlc_placef.PARTOF.value = state;
        document.fhlc_placef.prePLACE.value = county;
        document.fhlc_placef.prePARTOF.value = state;
      }

      document.fhlc_placef.prePLACE.value = 
fhlc_repPCWithStar(document.fhlc_placef.prePLACE.value);
      document.fhlc_placef.prePARTOF.value = 
fhlc_repPCWithStar(document.fhlc_placef.prePARTOF.value);
      document.fhlc_placef.prePLACE.value = 
fhlc_repSpWithU(document.fhlc_placef.prePLACE.value);
      document.fhlc_placef.prePARTOF.value = 
fhlc_repSpWithU(document.fhlc_placef.prePARTOF.value);
      document.fhlc_placef.PLACE.value = 
fhlc_Normalise(document.fhlc_placef.prePLACE.value);
      document.fhlc_placef.PARTOF.value = 
fhlc_Normalise(document.fhlc_placef.prePARTOF.value);
      document.fhlc_placef.prePLACE.value = 
fhlc_ReplaceLigatures(document.fhlc_placef.prePLACE.value);
      document.fhlc_placef.prePARTOF.value = 
fhlc_ReplaceLigatures(document.fhlc_placef.prePARTOF.value);
      submitForm(fhlc_placef);
    }

    function fhlc(q)
    {
      if( nullArgs("fhlc", q) )
        return;
      
      var args = parseArgs(q, "author, callno, film, place, subject, surname");
      if( args.switches.length != 1 ) {
        nullArgs("fhlc", "?");
        return;
      }
      switch(args.switches[0].name)
      {
      case "author":   fhlc_author(args.q);  break;
      case "callno":   fhlc_callno(args.q);  break;
      case "film":     fhlc_film(args.q);    break;
      case "place":    fhlc_place(args.q);   break;
      case "subject":  fhlc_subject(args.q); break;
      case "surname":  fhlc_surname(args.q); break;
      }
    }
  ]]></script>
</search>
--- NEW FILE: fhlc_func.js ---
/*
 * http://www.familysearch.org/Eng/Library/fhlcatalog/func.js
 * 11 Oct 2002 - prepended fhlc_ to filename and functions to avoid collisions
 */

function fhlc_ReplaceLigatures (InString)    
  {  
        if(InString == "")
       return "";
    
        var OutString = "";  
    var Count = 0;
    var TempChar = ' ';
        for (Count=0; Count < InString.length; Count++)    
        {  
                TempChar=InString.substring (Count, Count+1);  
                if (TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"s";  
                else if (TempChar=="�" || TempChar=="�" || TempChar=="�" || 
TempChar=="�")  
                        OutString=OutString+"y";  
                else if (TempChar=="�" || TempChar=="�" || TempChar=="�" || 
TempChar=="�" || TempChar=="�" || TempChar=="�"
              || TempChar=="�" || TempChar=="�" || TempChar=="�" || TempChar=="�" || 
TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"a"; 
                else if (TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"c";  
                else if (TempChar=="�" || TempChar=="�" || TempChar=="�" || 
TempChar=="�"
              || TempChar=="�" || TempChar=="�" || TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"e"; 
                else if (TempChar=="�" || TempChar=="�" || TempChar=="�" || 
TempChar=="�"
              || TempChar=="�" || TempChar=="�" || TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"i"; 
                else if (TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"d"; 
                else if (TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"n"; 
                else if (TempChar=="�" || TempChar=="�" || TempChar=="�" || 
TempChar=="�" || TempChar=="�" || TempChar=="�"
              || TempChar=="�" || TempChar=="�" || TempChar=="�" || TempChar=="�" || 
TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"o"; 
                else if (TempChar=="�" || TempChar=="�" || TempChar=="�" || 
TempChar=="�"
              || TempChar=="�" || TempChar=="�" || TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"u"; 
                else if (TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"oe"; 
                else if (TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"ae"; 
                else if (TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"th"; 
                else if (TempChar=="�")  
                        OutString=OutString+"ss"; 
                else  
                        OutString=OutString+TempChar;  
        }  
        return (OutString);  
  }  

  function fhlc_ReplaceSubstring(Old,New,InString,minLength)
  {
        if(InString == "")
       return "";
    
        var CurrString = "" + InString;

        var index = CurrString.indexOf(Old,0);

    while(index != -1)
        {
        var iPrevSpace = -1;
        var i = 0;
        
        for(i = 0; i < index; i++)
            if(CurrString.charAt(i) ==' ' || CurrString.charAt(i) =='_')
                iPrevSpace = i;

        var iCharsBeforeInWord = index - iPrevSpace - 1;

            var iNextSpace = -1;
        for(i = CurrString.length; i > index; i--)
            if(CurrString.charAt(i) ==' ' || CurrString.charAt(i) =='_')
                iNextSpace = i;

        if(iNextSpace == -1)
            iNextSpace = CurrString.length;

        var iCharsAfterInWord = iNextSpace - index - Old.length;

        var iLetters = iCharsBeforeInWord + Old.length + iCharsAfterInWord;

        if(iLetters >= minLength)
                    CurrString = CurrString.substring(0,index) + New + 
CurrString.substring(index+Old.length,CurrString.length); 

        if(index + 1 <= CurrString.length)
            index = CurrString.indexOf(Old,index+1);
        else
            index = -1;

        if(CurrString == "")
            index = -1;
        } 
              
        return (CurrString);  
  }

  function fhlc_ReplaceBeginning(Old,New,InString,minLength)
  {
        if(InString == "")
       return "";
    
        var strTemp = "" + InString;
        var OutString = "";

        var iIndex = strTemp.indexOf(Old,0);

    while(iIndex != -1)
        {
                // is the bit we want to replace right at the beginning of the string?
                if(iIndex == 0)
                {
                        // ensure the first word of the string is long enough
                        if(strTemp.length > minLength 
                                 && (strTemp.indexOf(' ',0) == -1 || strTemp.indexOf(' 
',0) > minLength)
                                         && (strTemp.indexOf('_',0) == -1 || 
strTemp.indexOf('_',0) > minLength))
                        OutString = New + strTemp.substring(Old.length,strTemp.length);
                    else
                        OutString = "" + strTemp;
                } 
                // is there a space or'_' before the bit we want to replace?
                else if(strTemp.charAt(iIndex-1) == " " || strTemp.charAt(iIndex-1) == 
"_")
                {
                    if(strTemp.length > (iIndex + minLength) 
                           && (strTemp.indexOf(' ',iIndex) == -1 || strTemp.indexOf(' 
',iIndex) > (iIndex + minLength))
                           && (strTemp.indexOf('_',iIndex) == -1 || 
strTemp.indexOf('_',iIndex) > (iIndex + minLength)))
                        OutString = strTemp.substring(0,iIndex) + New + 
strTemp.substring(iIndex+Old.length,strTemp.length); 
                    else
                        OutString = "" + strTemp;
                }
                else
                    OutString = "" + strTemp;

            strTemp = "" + OutString;
            OutString = "";

            if(strTemp != "")
            iIndex = strTemp.indexOf(Old,iIndex+1);
        else
            iIndex = -1;        
        } 
            
    OutString = "" + strTemp;
  
        return (OutString);  
  }

  function fhlc_ReverseString(InString)
  {
        if(InString == "")
       return "";
    
        var OutString = "";  
    var Count = 0;
    var TempChar = ' ';

        for (Count = InString.length - 1; Count >= 0; Count--)    
        {  
                TempChar=InString.charAt(Count);  
            OutString=OutString+TempChar;  
        }  
        
        return (OutString);  
  }

  function fhlc_ReplaceEnding(Old,New,InString,minLength)
  {
        if(InString == "")
       return "";
    
        // reverse the strings
        var revOld = fhlc_ReverseString(Old);
        var revNew = fhlc_ReverseString(New);
        var revInString = fhlc_ReverseString(InString);
        
        // effectively we now want to replace the beginning
        var revOutString = fhlc_ReplaceBeginning(revOld,revNew,revInString,minLength);
        
        // remember to reverse back the string we are after
        var OutString = fhlc_ReverseString(revOutString);
  
        return (OutString);  
  }

  function fhlc_LoseStopword(Stopword,InString) 
  {
        if(InString == "")
       return "";
    
    var locOutString = "";      
        var strTemp = InString;
        var lStop = Stopword.length;

        // is the stopword in the string?
        var iIndex = strTemp.indexOf(Stopword,0);

    while(iIndex != -1)
        {
                // if the stopword is the start of the string
                if(iIndex == 0)
                {
            if(strTemp.charAt(lStop) == ' ' || strTemp.charAt(lStop) == '_' || 
strTemp.length==lStop)
                        locOutString = strTemp.substring(lStop+1,strTemp.length);
                    else
                        locOutString = strTemp;
                } 
                // if the stopword is the end of the string
                else if(iIndex == (strTemp.length-lStop))
                {
            if(strTemp.charAt(iIndex-1) == ' ' || strTemp.charAt(iIndex-1) == '_')
                        locOutString = strTemp.substring(0,iIndex-1);
                    else
                        locOutString = strTemp;
                } 
                // if the stopword is in the middle of the string
                else if((strTemp.charAt(iIndex-1) == " " || strTemp.charAt(iIndex-1) 
== "_")
                      &&(strTemp.charAt(iIndex+lStop) == " " || 
strTemp.charAt(iIndex+lStop) == "_"))
        {
                        locOutString = strTemp.substring(0,iIndex) + 
strTemp.substring(iIndex+lStop,strTemp.length);
        }
                // if the stopword is not in the string
                else
                    locOutString = strTemp;

            strTemp = locOutString;
            locOutString = "";

            if(strTemp != "")
            iIndex = strTemp.indexOf(Stopword,iIndex+1);
        else
            iIndex = -1;        
        } 
            
    locOutString = "" + strTemp;

        return (locOutString);  
  }
     
  function fhlc_Normalise(InString)    
  {  
        if(InString == "")
       return "";
    
        // we'll return this when we're done
        OutString="";  

    // convert to lower case
        OutString="" + InString.toLowerCase();

        // get rid of stopwords
        OutString = fhlc_LoseStopword("a",OutString);
        OutString = fhlc_LoseStopword("an",OutString);
        OutString = fhlc_LoseStopword("and",OutString);
        OutString = fhlc_LoseStopword("at",OutString);
        OutString = fhlc_LoseStopword("da",OutString);
        OutString = fhlc_LoseStopword("das",OutString);
        OutString = fhlc_LoseStopword("de",OutString);
        OutString = fhlc_LoseStopword("del",OutString);
        OutString = fhlc_LoseStopword("dels",OutString);
        OutString = fhlc_LoseStopword("dem",OutString);
        OutString = fhlc_LoseStopword("den",OutString);
        OutString = fhlc_LoseStopword("der",OutString);
        OutString = fhlc_LoseStopword("des",OutString);
        OutString = fhlc_LoseStopword("det",OutString);
        OutString = fhlc_LoseStopword("di",OutString);
        OutString = fhlc_LoseStopword("die",OutString);
        OutString = fhlc_LoseStopword("du",OutString);
        OutString = fhlc_LoseStopword("e",OutString);
        OutString = fhlc_LoseStopword("een",OutString);
        OutString = fhlc_LoseStopword("ein",OutString);
        OutString = fhlc_LoseStopword("eine",OutString);
        OutString = fhlc_LoseStopword("eines",OutString);
        OutString = fhlc_LoseStopword("el",OutString);
        OutString = fhlc_LoseStopword("els",OutString);
        OutString = fhlc_LoseStopword("em",OutString);
        OutString = fhlc_LoseStopword("en",OutString);
        OutString = fhlc_LoseStopword("et",OutString);
        OutString = fhlc_LoseStopword("ett",OutString);
        OutString = fhlc_LoseStopword("for",OutString);
        OutString = fhlc_LoseStopword("from",OutString);
        OutString = fhlc_LoseStopword("gli",OutString);
        OutString = fhlc_LoseStopword("gl",OutString);
        OutString = fhlc_LoseStopword("het",OutString);
        OutString = fhlc_LoseStopword("il",OutString);
        OutString = fhlc_LoseStopword("im",OutString);
        OutString = fhlc_LoseStopword("in",OutString);
        OutString = fhlc_LoseStopword("is",OutString);
        OutString = fhlc_LoseStopword("la",OutString);
        OutString = fhlc_LoseStopword("las",OutString);
        OutString = fhlc_LoseStopword("le",OutString);
        OutString = fhlc_LoseStopword("les",OutString);
        OutString = fhlc_LoseStopword("los",OutString);
        OutString = fhlc_LoseStopword("not",OutString);
        OutString = fhlc_LoseStopword("o",OutString);
        OutString = fhlc_LoseStopword("of",OutString);
        OutString = fhlc_LoseStopword("on",OutString);
        OutString = fhlc_LoseStopword("or",OutString);
        OutString = fhlc_LoseStopword("os",OutString);
        OutString = fhlc_LoseStopword("te",OutString);
        OutString = fhlc_LoseStopword("the",OutString);
        OutString = fhlc_LoseStopword("to",OutString);
        OutString = fhlc_LoseStopword("um",OutString);
        OutString = fhlc_LoseStopword("uma",OutString);
        OutString = fhlc_LoseStopword("un",OutString);
        OutString = fhlc_LoseStopword("una",OutString);
        OutString = fhlc_LoseStopword("und",OutString);
        OutString = fhlc_LoseStopword("une",OutString);
        OutString = fhlc_LoseStopword("y",OutString);
        OutString = fhlc_LoseStopword("ye",OutString);
        OutString = fhlc_LoseStopword("yr",OutString);

        // convert disallowed characters
        strTemp = "" + OutString;
        OutString = "";
        
        for (Count=0; Count < strTemp.length; Count++)    
        {  
                TempChar=strTemp.charAt(Count);  
                
                if (TempChar=="@" || TempChar=="#" || TempChar=="$" || TempChar=="^" 
|| TempChar=="&" || TempChar=="("  
                    || TempChar==")" || TempChar=="-" || TempChar=="/" || 
TempChar=="<" || TempChar==">" || TempChar=="="
            || TempChar==":" || TempChar==";")  
                        OutString=OutString+"_";  
                else if (TempChar=="?" || TempChar=="," || TempChar=="'" || 
TempChar=='"' || TempChar=="+" || TempChar==".")  
                        OutString=OutString;  
                else if (TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"s";  
                else if (TempChar=="�" || TempChar=="�" || TempChar=="�" || 
TempChar=="�")  
                        OutString=OutString+"y";  
                else if (TempChar=="�" || TempChar=="�" || TempChar=="�" || 
TempChar=="�" || TempChar=="�" || TempChar=="�"
              || TempChar=="�" || TempChar=="�" || TempChar=="�" || TempChar=="�" || 
TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"a"; 
                else if (TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"c";  
                else if (TempChar=="�" || TempChar=="�" || TempChar=="�" || 
TempChar=="�"
              || TempChar=="�" || TempChar=="�" || TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"e"; 
                else if (TempChar=="�" || TempChar=="�" || TempChar=="�" || 
TempChar=="�"
              || TempChar=="�" || TempChar=="�" || TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"i"; 
                else if (TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"d"; 
                else if (TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"n"; 
                else if (TempChar=="�" || TempChar=="�" || TempChar=="�" || 
TempChar=="�" || TempChar=="�" || TempChar=="�"
              || TempChar=="�" || TempChar=="�" || TempChar=="�" || TempChar=="�" || 
TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"o"; 
                else if (TempChar=="�" || TempChar=="�" || TempChar=="�" || 
TempChar=="�"
              || TempChar=="�" || TempChar=="�" || TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"u"; 
                else if (TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"oe"; 
                else if (TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"ae"; 
                else if (TempChar=="�" || TempChar=="�")  
                        OutString=OutString+"th"; 
                else if (TempChar=="�")  
                        OutString=OutString+"ss"; 
                else  
                        OutString=OutString+TempChar;  
        }  

        // get rid of multiple spaces
        strTemp = "" + OutString;
        OutString = "";
        
        for (Count=0; Count < strTemp.length; Count++)    
        {  
                TempChar=strTemp.charAt(Count);  
                
                if (TempChar==" " || TempChar=="_")
                {
                    if (strTemp.charAt(Count+1)==" " || strTemp.charAt(Count+1)=="_")
                            OutString=OutString;
                        else
                            OutString=OutString+"_";  
                }  
                else  
                        OutString=OutString+TempChar;  
        }  

        // get rid of leading spaces
        while(OutString.charAt(0)==" " || OutString.charAt(0)=="_")
            OutString = OutString.substring(1,OutString.length);

        // get rid of trailing spaces
        len = OutString.length;
        while(OutString.charAt(len-1)==" " || OutString.charAt(len-1)=="_")
        {
            OutString = OutString.substring(0,len-1);
                len--;
        }


    // replace beginnings
    OutString = fhlc_ReplaceBeginning("mc","mac",OutString,3);
    OutString = fhlc_ReplaceBeginning("m'","mac",OutString,3);

    // replace endings
    OutString = fhlc_ReplaceEnding("sses","ss",OutString,7);
    OutString = fhlc_ReplaceEnding("ies","i",OutString,6);
    OutString = fhlc_ReplaceEnding("s","",OutString,5);
    OutString = fhlc_ReplaceEnding("gue","g",OutString,4);
    OutString = fhlc_ReplaceEnding("gu","g",OutString,4);
    OutString = fhlc_ReplaceEnding("amme","am",OutString,5);

    // replace substrings
    OutString = fhlc_ReplaceSubstring("iz","is",OutString,5);

        // return the normalised string
        return (OutString);  
  }  

  // extended to handle single character wildcard
  function fhlc_repPCWithStar (InString)    
  {  
        if(InString == "")
       return "";
    
        var OutString = "";  
    var Count = 0;
    var TempChar = ' ';
        for (Count=0; Count < InString.length; Count++)    
        {  
                TempChar=InString.substring (Count, Count+1);  
                if (TempChar=="%")  
                        OutString=OutString+"*";  
                else if (TempChar=="_")  
                        OutString=OutString+"!";  
                else  
                        OutString=OutString+TempChar;  
        }  
        return (OutString);  
  }  

  function fhlc_repSpWithU (InString)    
  {  
        if(InString == "")
       return "";
    
        var OutString="";  
        var Count = 0;
    var TempChar = ' ';
    for (Count=0; Count < InString.length; Count++)    
        {  
                TempChar=InString.substring (Count, Count+1);  
                if (TempChar!=" ")  
                        OutString=OutString+TempChar;  
                else  
                        OutString=OutString+"_";  
        }  
        return (OutString);  
  }  

  function fhlc_repUWithSp (InString)    
  {  
        if(InString == "")
       return "";
    
        var OutString="";  
        var Count = 0;
    var TempChar = ' ';
    for (Count=0; Count < InString.length; Count++)    
        {  
                TempChar=InString.substring (Count, Count+1);  
                if (TempChar!="_")  
                        OutString=OutString+TempChar;  
                else  
                        OutString=OutString+" ";  
        }  
        return (OutString);  
  }  

function fhlc_Clean(strIn)
{ 
  if(strIn == "") 
    return ""; 

  strOut = ""; 
  for (iCount=0; iCount < strIn.length; iCount++) 
  {  
    chTemp=strIn.charAt(iCount);        
    if (chTemp==" ")  
      strOut=strOut;  
    else if (chTemp=="0" && strOut=="")  
      strOut=strOut;  
    else  
      strOut=strOut+chTemp;  
  }  
  return (strOut);
}

Index: genealogy.nsi
===================================================================
RCS file: /cvsroot/dqsd/dqsd/addons/genealogy/genealogy.nsi,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** genealogy.nsi       22 Aug 2002 20:42:08 -0000      1.3
--- genealogy.nsi       12 Oct 2002 05:02:42 -0000      1.4
***************
*** 51,54 ****
--- 51,55 ----
    File "*.xml"
    File "genealogy_lib.js"
+   File "fhlc_func.js"
  
    ; Uninstallation keys




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
DQSD-CVS mailing list
https://lists.sourceforge.net/lists/listinfo/dqsd-cvs
DQSD CVS repository:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dqsd/

Reply via email to