var t;
var len;
var len2;
var lenCont0;
var lenCont1;
var strSearchCont0;
var strSearchCont1;
var wildcard;
var wildcardType;
var lenSrch;
var lenSrch2;
var strSrch;
var strSrch2;
var strSearch;
var strSearch2;
var strSndSurname="";
var xmlhttp=null;
var xmlhttpH=null;
var results=false;
var w=window;
var h=history;
var d=document;
var gm=google.maps;
var strLat=[];
var strLng=[];
var ltlg=[];
var strMrkrTtl=[];
var strMkrTtl=[];
var imgWin='';
function dtaLoad(){
var e;
var strErrMsg='Your internet browser is unable to search this database. Suitable browsers include recent versions of Internet Explorer, Firefox and Safari.'
  if(w.ActiveXObject){
    try{
      xmlhttp=new ActiveXObject('Msxml2.XMLHTTP');
      xmlhttpH=new ActiveXObject('Msxml2.XMLHTTP');
    }
    catch(e){
      try{
        xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
        xmlhttpH=new ActiveXObject('Microsoft.XMLHTTP');
      }
      catch(e){
        xmlhttp=false;
        xmlhttpH=false;
        alert(strErrMsg);
        if(w.h.length)w.h.back();
        return;
      }
    }
  }
  else if(w.XMLHttpRequest){
    try{
      xmlhttp=new XMLHttpRequest();
      xmlhttp.overrideMimeType('text/xml');
      xmlhttpH=new XMLHttpRequest();
      xmlhttpH.overrideMimeType('text/xml');
    }
    catch(e){
      xmlhttp=false;
      xmlhttpH=false;
      alert(strErrMsg);
      if(w.h.length)w.h.back();
      return;
    }
  }
  else{
    alert(strErrMsg);
    if(w.h.length)w.h.back();
    return;
  }
  if(xmlhttp && xmlhttpH){
    xmlhttp.open('GET','tblc.xml',true);
    xmlhttp.send(null);
    xmlhttpH.open('GET','tblh.xml',true);
    xmlhttpH.send(null);
    d.getElementById('dbType')[0].selected=true;
    d.getElementById('strQry').value="";
    d.getElementById('strQry2').value="";
    d.getElementById('btnGo').disabled=false;
    d.getElementById('strQry').focus();
  }
  else{
    alert(strErrMsg);
    if(w.h.length)w.h.back();
    return;
  }
}
function changeSelection(){
  if(d.getElementById('dbType').value=="c"){
    d.getElementById('strMain').innerHTML="<b>suburb,&nbsp;town,&nbsp;locality&nbsp;or&nbsp;cemetery&#160;name</b>";
    d.getElementById('strGiven').innerHTML="";
    d.getElementById('strQry').value="";
    d.getElementById('strQry').style.width="25em";
    d.getElementById('strQry2').value="";
    d.getElementById('strQry2').disabled="disabled";
    d.getElementById('strQry2').style.visibility='hidden';
    d.getElementById('blnSortAlpha').checked="checked";
    d.getElementById('blnSortDate').disabled="disabled";
    d.getElementById('blnSDL').disabled="disabled";
    d.getElementById('blnWildcards').checked="checked";
    d.getElementById('blnExact').disabled="disabled";
    d.getElementById('blnE').disabled="disabled";
    d.getElementById('blnSound').disabled="disabled";
    d.getElementById('blnS').disabled="disabled";
  }
  else{
    d.getElementById('strMain').innerHTML="<b>surname</b>&nbsp;<sup>(required)</sup>";
    d.getElementById('strGiven').innerHTML="<b>given&nbsp;name</b>&nbsp;<sup>(optional)</sup>";
    d.getElementById('strQry').value="";
    d.getElementById('strQry').style.width="12em";
    d.getElementById('strQry2').disabled=false;
    d.getElementById('strQry2').value="";
    d.getElementById('strQry2').style.visibility='visible';
    d.getElementById('blnE').disabled=false;
    d.getElementById('blnExact').disabled=false;
    d.getElementById('blnSDL').disabled=false;
    d.getElementById('blnS').disabled=false;
    d.getElementById('blnSound').disabled=false;
    d.getElementById('blnSortDate').disabled=false;
  }
  d.getElementById('strQry').focus();
}
function findQuery(){
  var i;
  d.getElementById('btnGo').disabled='disabled';
  lenSrch=d.getElementById('strQry').value.length;
  if(lenSrch>28)lenSrch=28;
  lenSrch2=d.getElementById('strQry2').value.length;
  if(lenSrch2>24)lenSrch2=24;
  strSrch=d.getElementById('strQry').value.toUpperCase();
  strSrch2=d.getElementById('strQry2').value.toLowerCase();
  len=0;
  lenCont0=0;
  lenCont1=0;
  len2=0;
  strSearch="";
  strSearchCont0="";
  strSearchCont1="";
  strSearch2="";
  wildcard=0;
  wildcardType="";
  for(i=0;i<lenSrch;i++){
    if((strSrch.charAt(i)>='A' && strSrch.charAt(i)<='Z') /*|| (strSrch.charAt(i)>='0' && strSrch.charAt(i)<='9')*/ || strSrch.charAt(i)=="'" || strSrch.charAt(i)=="-" || strSrch.charAt(i)==" " || strSrch.charAt(i)=="*" || strSrch.charAt(i)=="?" /*|| strSrch.charAt(i)=="."*/){
      strSearch +=strSrch.charAt(i);
      len++;
    }
  }
  for(i=0;i<len;i++){
    switch (wildcard){
      case 0:
        if(strSearch.charAt(i)=="*" || strSearch.charAt(i)=="?")break;
        strSearchCont0 +=strSearch.charAt(i);
        lenCont0++;
        break;
      case 1:
        if(strSearch.charAt(i)=="*" || strSearch.charAt(i)=="?")break;
        strSearchCont1 +=strSearch.charAt(i);
        lenCont1++;
        break;
      default:
        if(strSearch.charAt(i)=="*" || strSearch.charAt(i)=="?")break;
        strSearchCont1 +=strSearch.charAt(i);
        lenCont1++;
        break;
    }
    if(strSearch.charAt(i)=="*"){
      wildcard++;
      wildcardType="*";
    }
    else if(strSearch.charAt(i)=="?"){
      wildcard++;
      wildcardType="?";
    }
  }
  len=lenCont0+lenCont1;
  for(i=0;i<lenSrch2;i++){
    if((strSrch2.charAt(i)>='a' && strSrch2.charAt(i)<='z') || strSrch2.charAt(i)==" " || strSrch2.charAt(i)=="-" || strSrch2.charAt(i)=="'"){
      strSearch2 +=strSrch2.charAt(i);
      len2++;
    }
  }
  if(len<2 && d.getElementById('dbType').value=="h"){
    d.getElementById('strResult').innerHTML="<table border='0' cellspacing='0'><tr><th class='error'>Data Entry Error</th></tr><tr><td class='error'>Fill in the <b>surname</b> box with at least 2 characters of the name to be found.<br />";
    d.getElementById('btnGo').disabled=false;
    d.getElementById('strQry').focus();
    return;
  }
  else if(len<4 && d.getElementById('dbType').value=="c"){
    d.getElementById('strResult').innerHTML="<table border='0' cellspacing='0'><tr><th class='error'>Data Entry Error</th></tr><tr><td class='error'>Fill in the <b>location</b> box with at least 4 characters of the place to be found.<br />";
    d.getElementById('btnGo').disabled=false;
    d.getElementById('strQry').focus();
    return;
  }
  else if(strSearchCont0=="A22Z" && d.getElementById('dbType').value=="c"){
    xmlhttp.onreadystatechange=checkReadyState;
    xmlhttpH.onreadystatechange=checkReadyState;
    if(xmlhttp.readyState==4 && xmlhttpH.readyState==4 && xmlhttp.status=='200' && xmlhttpH.status=='200')runSearch();
  }
  else{
    d.getElementById('htmlProgress').innerHTML='Downloading the indexes ...';
    if(d.getElementById('blnSound').checked)strSearch=calculateSound(strSearch);
    xmlhttp.onreadystatechange=checkReadyState;
    xmlhttpH.onreadystatechange=checkReadyState;
    if(xmlhttp.readyState==4 && xmlhttpH.readyState==4 && xmlhttp.status=='200' && xmlhttpH.status=='200'){
      d.getElementById('htmlProgress').innerHTML='Searching ...';
      if(t)w.clearTimeout(t);
      t=w.setTimeout('runSearch()',200);
    }
  }
}
function checkReadyState(){
  if(xmlhttp.readyState==4 && xmlhttpH.readyState==4 && xmlhttp.status=='200' && xmlhttpH.status=='200'){
    d.getElementById('htmlProgress').innerHTML='Searching ...';
    if(t)w.clearTimeout(t);
    t=w.setTimeout('runSearch()',200);
  }
  else if(xmlhttp.readyState==4 && xmlhttpH.readyState==4 && (xmlhttp.status !='200' || xmlhttpH.status !='200')){
    alert('An error occurred while loading the index');
    if(w.h.length)w.h.back();
    return;
  }
}
function runSearch(){
var i;
var j;
var count=0;
var strName="";
var strName2="";
var strName3="";
var strName4="";
var strArray=[];
var strPrint="";
var cemDoc=xmlhttp.responseXML;
var rList=cemDoc.getElementsByTagName('r');
var nList=cemDoc.getElementsByTagName('n');
var lList=cemDoc.getElementsByTagName('l');
var lgList=cemDoc.getElementsByTagName('lg');
var mList=cemDoc.getElementsByTagName('m');
var pList=cemDoc.getElementsByTagName('p');
var hList=cemDoc.getElementsByTagName('h');
var tList=cemDoc.getElementsByTagName('t');
var hlDoc=xmlhttpH.responseXML;
var nHList=hlDoc.getElementsByTagName('n');
var gHList=hlDoc.getElementsByTagName('g');
var dHList=hlDoc.getElementsByTagName('d');
var yHList=hlDoc.getElementsByTagName('y');
var rHList=hlDoc.getElementsByTagName('r');
var cemLen=nList.length;
var hlLen=nHList.length;
var strL=[];
var strLG=[];
var strLoc;
var s=d.getElementById('blnSortAlpha').checked;
var k,l,m,n,o,p;
var intSrchType;
  rslt=0;
  if(d.getElementById('blnWildcards').checked)intSrchType=0;
  else if(d.getElementById('blnExact').checked)intSrchType=1;
  else if(d.getElementById('blnSound').checked)intSrchType=2;
  j=0;
  if(d.getElementById('dbType').value=='c'){
    while(j<cemLen){
      strL[j]=lList[j].firstChild.nodeValue;
      strLG[j]=lgList[j].firstChild.nodeValue;
      if(strL[j] !='-' && strLG[j] !='-'){
        if(strL[j].charAt(0) =='-' && strLG[j].charAt(strLG[j].length-1) !='?'){
          strLat[j]=strL[j];
          strLng[j]=strLG[j];
          strMkrTtl[j]=nList[j].firstChild.nodeValue;
        }
        else if(strL[j].charAt(0)=='~'){
          strLat[j]=strL[j].substr(1,strL[j].length-1);
          strLng[j]=strLG[j];
          strMkrTtl[j]=nList[j].firstChild.nodeValue+' (in this vicinity)';
        }
        else if(strL[j].charAt(0)!='-'){
          strLat[j]=strL[j].substr(1,strL[j].length-1);
          strLng[j]=strLG[j];
          strMkrTtl[j]=nList[j].firstChild.nodeValue+' (approximate location)';
        }
        else if(strLG[j].charAt(strLG[j].length-1)=='?'){
          strLat[j]=strL[j];
          strLng[j]=strLG[j].substr(0,strLG[j].length-1);
          strMkrTtl[j]=nList[j].firstChild.nodeValue+' (unconfirmed location)';
        }
      }
      else{strLat[j]='';strLng[j]='';}
      strName=nList[j].firstChild.nodeValue.toUpperCase();
      strName2=lList[j].firstChild.nodeValue+lgList[j].firstChild.nodeValue;
      strName3=pList[j].firstChild.nodeValue.toUpperCase();
      strName4=hList[j].firstChild.nodeValue.toUpperCase();
      if(strName2=='-')strName2="";
      if(strName3=='-' || strName3=='?')strName3="";
      if(strName4=='-')strName4="";
      l=0;
      m=strName.indexOf(strSearchCont0);
      n=strName2.indexOf(strSearchCont0);
      o=strName3.indexOf(strSearchCont0);
      p=strName4.indexOf(strSearchCont0);
      if((m>=0 && strName.indexOf(strSearchCont1,m+lenCont0-1)>=0)||(strName.substr(0,lenCont0)==strSearchCont0 && strName.substr(strName.length-lenCont1,lenCont1)==strSearchCont1)||(n>=0 && strName2.indexOf(strSearchCont1,n+lenCont0-1)>=0)||(o>=0 && strName3.indexOf(strSearchCont1,o+lenCont0-1)>=0)||(p>=0 && strName4.indexOf(strSearchCont1,p+lenCont0-1)>=0)||strSearchCont0=="A22Z"){
        strArray[count]="<p><i>Cemetery:</i> <b>"+nList[j].firstChild.nodeValue+"</b>";
        strLoc=pList[j].firstChild.nodeValue;
        strRef=rList[j].firstChild.nodeValue;
        strScale=mList[j].firstChild.nodeValue;
        strMrkrTtl[j]=nList[j].firstChild.nodeValue;
        if(strScale=='-')strScale='14,"400px"';
        else if(strScale.length==2)strScale+=',"400px"';
        if(strLat[j] && strL[j].charAt(0) !='~'){
          strArray[count]+="<br/><i>Latitude, longitude:</i> "+strL[j]+", "+strLG[j]+" (<a href='javascript:;' onclick='dispMap(&#39;"+strRef+"&#39;,"+strLat[j]+", "+strLng[j]+","+strScale+","+j+");'>road map</a>, <a href='javascript:;' onclick='dispMapPlus(&#39;"+strRef+"&#39;,"+strLat[j]+", "+strLng[j]+","+strScale+","+cemLen+");'>nearby cemeteries</a>, <a href='javascript:;' onclick='dispSat(&#39;"+strRef+"&#39;,"+strLat[j]+", "+strLng[j]+","+strScale+","+j+");'>satellite view</a>, <a href='javascript:;' onclick='clrMap(&#39;"+strRef+"&#39;);'>clear</a>)";
        }
        else if(strLat[j]){
          strArray[count]+="<br/><i>Latitude, longitude:</i> "+strL[j]+", "+strLG[j]+" (<a href='javascript:;' onclick='dispMap(&#39;"+strRef+"&#39;,"+strLat[j]+", "+strLng[j]+","+strScale+","+j+");'>road map - marker shows vicinity only</a>, <a href='javascript:;' onclick='dispMapPlus(&#39;"+strRef+"&#39;,"+strLat[j]+", "+strLng[j]+","+strScale+","+cemLen+");'>nearby cemeteries</a>, <a href='javascript:;' onclick='clrMap(&#39;"+strRef+"&#39;);'>clear</a>)";
        }
        if(strLoc !='?' && strLoc !='-')strArray[count]+="<br/><i>Location:</i> "+strLoc;
        if(hList[j].firstChild.nodeValue !='-')strArray[count]+="<br/><i>Notes:</i> "+hList[j].firstChild.nodeValue;
        l=tList[j].firstChild.nodeValue.length;
        if(tList[j].firstChild.nodeValue.charAt(0)!='-')strArray[count]+="<br/><i>Online data:</i> "+tList[j].firstChild.nodeValue;
        if(strLat[j])strArray[count]+="<div id="+strRef+" style='display:none;margin-bottom:0.5em;'></div>";
        strArray[count]+="</p>";
        count++;
      }
      j++;
    }
  }
  else{
    while(j<hlLen){
      strName=nHList[j].firstChild.nodeValue;
      if(intSrchType==2)strName=calculateSound(strName);
      strName2=gHList[j].firstChild.nodeValue.toLowerCase();
      k=strName.length;
      m=strName.indexOf(strSearchCont0);
      n=strName.indexOf(strSearchCont1, m+lenCont0-1);
      p=n-m;
      if(((!intSrchType && (!wildcard || wildcardType=='*') && m>=0 && n>=0) || (!intSrchType && wildcardType=='?' && (p==lenCont0+1 || lenCont0==0 || lenCont1==0) && m>=0 && n>=0) || (intSrchType==1 && (!wildcard || wildcardType=='*') && strName.substr(0,lenCont0)==strSearchCont0 && strName.substr(k-lenCont1,lenCont1)==strSearchCont1) || (intSrchType==1 && wildcardType=='?' && k==(lenCont0+1+lenCont1) && strName.substr(0,lenCont0)==strSearchCont0 && strName.substr(k-lenCont1, lenCont1)==strSearchCont1) || (intSrchType==2 && strName==strSearch)) && (len2==0 || (len2>1 && strName2.indexOf(strSearch2)>=0) || (len2==1 && strName2.charAt(0)==strSearch2.charAt(0)))){
        i=0;
        while(i<cemLen){
          if(rList[i].firstChild.nodeValue==rHList[j].firstChild.nodeValue){
            if(s){
              strArray[count]=nHList[j].firstChild.nodeValue+" "+gHList[j].firstChild.nodeValue+" died "+dHList[j].firstChild.nodeValue+" aged "+yHList[j].firstChild.nodeValue+" buried &amp;/or memorialised at "+nList[i].firstChild.nodeValue;
            }
            else{
              strArray[count]=dHList[j].firstChild.nodeValue+" death of "+nHList[j].firstChild.nodeValue+" "+gHList[j].firstChild.nodeValue+" aged "+yHList[j].firstChild.nodeValue+" buried &amp;/or memorialised at "+nList[i].firstChild.nodeValue;
            }
            if(nList[i].firstChild.nodeValue.toLowerCase().indexOf('lone grave')<0)strArray[count]+=" Cemetery";
            strArray[count]+="<br />";
            count++;
            break;
          }
          i++;
        }
      }
      j++;
    }
  }
  if(count){
    strArray.sort();
    strPrint='<h3 class="results">Search results <span style="font-size:93%;font-weight:normal;">(total of '+count+')</span></h3><p>';
    for(i=0;i<count;i++)strPrint +=strArray[i];
    strPrint +="</p>";
    d.getElementById('strResult').innerHTML=strPrint;
    d.getElementById('htmlProgress').innerHTML='View the results below...';
    results=true;
  }
  else{
    d.getElementById('strResult').innerHTML="<h3 class='results'>Search results <span style='font-size:93%;font-weight:normal;'>(total of 0)</span></h3><p>The data you entered, <b><i>"+d.getElementById('strQry').value+" "+d.getElementById('strQry2').value+"</i></b>, is not in this database. <a href='index.html'>Click here for a list of other sites with SA cemetery memorial inscriptions or burial registers.</a></p>";
    d.getElementById('htmlProgress').innerHTML='There are no results to view.';
    results=false;
  }
  if(!d.getElementById('strQry').disabled) d.getElementById('strQry').focus();
  d.getElementById('btnGo').disabled=false;
}
function calculateSound(strString){
var strModSound="";
var strSound="";
var i;
var intStrLen=strString.length;
  for(i=0; i<intStrLen; i++){
    var strChar=strString.charAt(i);
    if(strChar=='P' || strChar=='F' || strChar=='V')strSound +='1';
    else if(strChar=='B'){
      if(strString.substr(intStrLen-2,2)!='MB' && strString.substr(intStrLen-3,3)!='MBE' && strString.substr(intStrLen-4,4)!='MBES' && strString.substr(intStrLen-3,3)!='MBS') strSound +='1';
    }
    else if(strChar=='C' || strChar=='S' || strChar=='K' || (strChar=='G' && i != intStrLen-1 && (!(i==intStrLen-2 && strString.charAt(intStrLen-1)=='N'))) || strChar=='J' || strChar=='Q' || strChar=='X' || strChar=='Z') strSound +='2';
    else if(strChar=='D' || strChar=='T')strSound +='3';
    else if(strChar=='L') strSound +='4';
    else if(strChar=='M' || strChar=='N'){
      if(i==1 && strChar=='N' && (strString.charAt(0)=='G' || strString.charAt(0)=='K' || strString.charAt(0)=='P'))strSound='5';
      else strSound +='5';
      if(i==0 && strString.charAt(1)=='C' && strChar=='M')strSound += '0'; // add a ifMc
    }
    else if(strChar=='R')strSound +='6';
    else if(strChar=='H'){
      if(i>1 && strString.charAt(i-1)=='G' && (strString.charAt(i-2)=='A' || strString.charAt(i-2)=='I' || strString.charAt(i-2)=='O' || strString.charAt(i-2)=='U')){
        strSound=strSound.substring(0,strSound.length-1);
      }
    }
    else if(strChar=='W' || strChar=='Y'){
      if(i==0 && ((strChar=='W' && strString.charAt(1)!='R') || strChar=='Y')) strSound +='9';
      else if(strChar=='Y') strSound +='0';
    }
    else if(((strChar=='A' || strChar=='I' || strChar=='O') && (i>0 || (i==0 && strString.charAt(1)!="'"))) || (i != intStrLen-1 && strChar=='E') || strChar=='I' || strChar=='U') strSound +='0';
  }
  strModSound=strSound.charAt(0);
  strSoundLen=strSound.length;
  for(i=1;i<strSoundLen;i++){
    if(strSound.charAt(i)!=strSound.charAt(i-1))strModSound +=strSound.charAt(i);
  }
  return strModSound;
}
function clearForm(){
  d.getElementById('htmlProgress').innerHTML="";
  d.getElementById('strResult').innerHTML="";
}
function displayHelp(){
var htmlResults="";
  if(results) htmlResults="<br /><br />"+d.getElementById('strResult').innerHTML;
  else htmlResults="";
  d.getElementById('strResult').innerHTML="<h3 class='results'>Using the cemetery database</h3><p>From the drop-down list, select the type of search you require. <strong>Person</strong> allows you to search all of the burials in the cemeteries listed at the top of this page for a particular person. <strong>Location</strong> allows you to search for location details and, in some cases, brief historical notes about any South Australian cemetery. Links to burial data and headstone photographs are often included.<!-- You can enter a place name, or a geolocation in the format latitude<b>*</b>longitude, both in decimal degrees, eg -34.9<b>*</b>138.5 gives cemeteries in the Adelaide western suburbs, -32.<b>*</b>137. gives northern Spencer Gulf towns. It is recommended that you do not enter more than 2 decimal places.--></p><h4>Text entry</h4><p>At least 2 allowed characters must be entered into the surname box, or 4 characters in the location box, before a search can proceed.<br />A given name is optional. If only given name initials are known, enter the first initial only or leave the given name box blank.<br />The search is not case sensitive.<br />The only characters allowed are letters of the alphabet, hyphens, spaces, apostrophes and no more than one <b>*</b> or <b>?</b> wildcard. &nbsp;Any other entered characters are ignored. In particular, the logical operators (and, or, not, &, |, &lt;, >, +, -) cannot be used.</p><h4>Searching for a name using the <i>'containing'</i> method</h4><p>This is the default and generally most satisfactory method of searching for a name. Select [containing] by clicking it, if necessary. Then enter into the surname box, sufficient letters to define the name to be found. Optionally, enter a given name. Click the [&#160;<b>Go</b>&#160;] button or press the [Enter] key to begin the search. If the name you wish to find is not in the database, take into account possible spelling variations, as the people and the officials recording their information were often illiterate or semiliterate.<br />It is advisable to omit surname prefixes such as O' and Mac so that the usual variations of spelling these names are all found. <br />The search behaves as though you have entered a <b>*</b> wildcard at each end of your search text. That is, the search engine looks for the exact text you have entered anywhere within the name. This feature has the annoyance of giving some unwanted names but can be very useful as it allows you to take into account some likely mis-spellings or variations of the name of interest. If required, one <b>*</b> wildcard can be inserted within the surname to replace zero or more unknown or doubtful characters, or one <b>?</b> wildcard (not at either end) to replace exactly one unknown or doubtful character.<br />The [Clear] button clears both boxes and places the cursor in the left hand box, ready for your next search. It also clears any displayed results and this help text.</p><h4>Using the <i>'beginning'</i> method</h4><p>If you only wish to find surnames beginning with exactly the same spelling as you have entered, select [beginning] by clicking it, if necessary. Note, however, that the database contains spelling variants separated by slashes for some names. With this method, only the first variant is compared with your entered text. Also, no comparison is made with any maiden name. In these cases, the method may not be satisfactory. If required, one <b>*</b> wildcard can be added anywhere within the surname to replace zero or more unknown or doubtful characters, or one <b>?</b> wildcard to replace exactly one unknown or doubtful character. <i>Beginning</i> matching of given names is only available if the 1st initial only is entered. Otherwise, the given name will be matched by the containing method.</p><h4>Using the <i>'sounds like'</i> method</h4><p>If the above techniques fail, as a last resort you may wish to try this method of matching. It will allow you to find more variations of spelling and also take into account the pronunciation of the surname. For example, searching on the name <b>smith</b> will find any of the names smith, smyth, smythe and schmidt. The method used here is a heavily modified version of Soundex code matching. You must be prepared to scan the results and reject those that are poor matches. For some shorter names and ones with mainly vowels, all the results may be unsatisfactory.<br />To use this method, select [sounds like] before clicking [&#160;<b>Go</b>&#160;] or pressing [Enter]. You <b>must enter the full surname</b> required. <b>Wildcards are not permitted</b>. Sounds like matching of given names is not available. Any entered given name will be matched by the containing method unless the 1st given name initial only is entered.</p><h4>Notes on geolocations and using the maps</h4>Accuracy of the geolocations:<ul><li>If a geolocation is not prefixed or suffixed it is considered to be accurate.</li><li>If it is prefixed by <b>&#8776;</b> it is considered to be approximately correct.</li><li>If prefixed by <b>~</b> it is in the vicinity only. In closely settled areas this means probably within 500 m; in remote areas, 20 km.</li><li>If suffixed by <b>?</b> the location may be accurate but has not been confirmed.</li></ul><p style='margin-top:0.5em'>When displaying nearby burial places, you can zoom in to give more detail of the closest sites or zoom out to see those further afield.</p><p>You can put your mouse cursor over any marker to display the burial place name.</p><p>If you are using an older computer or have a dial-up internet connection, rendering of the nearby burial place maps may be quite slow.</p>"+htmlResults;
  if(!d.getElementById('strQry').disabled)d.getElementById('strQry').focus();
}
function clrMap(mapId){
  d.getElementById(mapId).style.display="none";
  d.getElementById(mapId).innerHTML="";
  d.getElementById(mapId).style.height="0";
  if(imgWin)imgWin.close();
}
function dispMap(mapId,lat,lng,mag,hgt,cnt){
  d.getElementById(mapId).style.height=hgt;
  d.getElementById(mapId).style.display="block";
  d.getElementById(mapId).innerHTML="<br />&#160;loading map...";
  type=gm.MapTypeId.ROADMAP;
  var latlng=new gm.LatLng(lat,lng);
  var options={zoom:mag, center:latlng, mapTypeId:type, navigationControl:true, mapTypeControl:false, scaleControl:true};
  var map=new gm.Map(document.getElementById(mapId),options);
  var marker=new gm.Marker({position:latlng, map:map, flat:true, title:strMrkrTtl[cnt]});
}
function dispSat(mapId,lat,lng,mag,hgt,cnt){
  d.getElementById(mapId).style.height=hgt;
  d.getElementById(mapId).style.display="block";
  d.getElementById(mapId).innerHTML="<br />&#160;loading map...";
  type=gm.MapTypeId.SATELLITE;
  var latlng=new gm.LatLng(lat,lng);
  var options={zoom:mag+2, center:latlng, mapTypeId:type, navigationControl:true, mapTypeControl:false, scaleControl:true, streetViewControl:true};
  var map=new gm.Map(document.getElementById(mapId),options);
  var marker=new gm.Marker({position:latlng, map:map, flat:true, title:strMkrTtl[cnt]});
}
function dispMapPlus(mapId,lat,lng,mag,hgt,cnt){
  var mkr=[];
  var i;
  d.getElementById(mapId).style.height=hgt;
  d.getElementById(mapId).style.display="block";
  d.getElementById(mapId).innerHTML="<br />&#160;loading map...";
  type=gm.MapTypeId.ROADMAP;
  var latlng=new gm.LatLng(lat,lng);
  for(var k=0;k<=cnt;k++)ltlg[k]=new gm.LatLng(strLat[k],strLng[k]);
  var options={zoom:mag-2, center:latlng, mapTypeId:type, navigationControl:true, mapTypeControl:false, scaleControl:true};
  var map=new gm.Map(document.getElementById(mapId),options);
  for(i=0;i<=cnt;i++)mkr[i]=new gm.Marker({position:ltlg[i], map:map, flat:true, title:strMkrTtl[i]});
}
function wo(path){
  imgWin=window.open(path,'imgWin','width=720,height=600');
  imgWin.focus();
}//Copyright(c)2003-2010 B Leadbeater, Australia