var t,len,len2,lenCont0,lenCont1,strSearchCont0,strSearchCont1,wildcard,wildcardType,lenSrch,lenSrch2,strSrch,strSrch2,strSearch,strSearch2,strSndSurname="",xmlhttp=null,xmlhttpH=null,results=false,w=window,h=history,d=document,imgWin="";
function dtaLoad(){if(w.ActiveXObject)try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");xmlhttpH=new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");xmlhttpH=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){xmlhttpH=xmlhttp=false;alert("Your internet browser is unable to search this database. Suitable browsers include recent versions of Microsoft Internet Explorer, Mozilla Firefox , Netscape and Safari.");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){xmlhttpH=xmlhttp=false;alert("Your internet browser is unable to search this database. Suitable browsers include recent versions of Microsoft Internet Explorer, Mozilla Firefox , Netscape and Safari.");w.h.length&&w.h.back();return}else{alert("Your internet browser is unable to search this database. Suitable browsers include recent versions of Microsoft Internet Explorer, Mozilla Firefox , Netscape and Safari.");
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("Your internet browser is unable to search this database. Suitable browsers include recent versions of Microsoft Internet Explorer, Mozilla Firefox , Netscape and Safari.");
w.h.length&&w.h.back()}}
function changeSelection(){if(d.getElementById("dbType").value=="c"){d.getElementById("strMain").innerHTML="<b>suburb,&nbsp;town&nbsp;or&nbsp;locality</b>";d.getElementById("strGiven").innerHTML="";d.getElementById("strQry").value="";d.getElementById("strQry").style.width="20em";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("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="14em";d.getElementById("strQry2").disabled=false;d.getElementById("strQry2").value=
"";d.getElementById("strQry2").style.visibility="visible";d.getElementById("blnSortDate").disabled=false;d.getElementById("blnSDL").disabled=false;d.getElementById("blnS").disabled=false;d.getElementById("blnSound").disabled=false}d.getElementById("strQry").focus()}
function findQuery(){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();len2=lenCont1=lenCont0=len=0;strSearch2=strSearchCont1=strSearchCont0=strSearch="";wildcard=0;wildcardType="";for(var a=0;a<lenSrch;a++)if(strSrch.charAt(a)>="A"&&strSrch.charAt(a)<=
"Z"||strSrch.charAt(a)>="0"&&strSrch.charAt(a)<="9"||strSrch.charAt(a)=="'"||strSrch.charAt(a)=="-"||strSrch.charAt(a)==" "||strSrch.charAt(a)=="*"||strSrch.charAt(a)=="?"||strSrch.charAt(a)=="."){strSearch+=strSrch.charAt(a);len++}for(a=0;a<len;a++){switch(wildcard){case 0:if(strSearch.charAt(a)=="*"||strSearch.charAt(a)=="?")break;strSearchCont0+=strSearch.charAt(a);lenCont0++;break;case 1:if(strSearch.charAt(a)=="*"||strSearch.charAt(a)=="?")break;strSearchCont1+=strSearch.charAt(a);lenCont1++;
break;default:if(strSearch.charAt(a)=="*"||strSearch.charAt(a)=="?")break;strSearchCont1+=strSearch.charAt(a);lenCont1++;break}if(strSearch.charAt(a)=="*"){wildcard++;wildcardType="*"}else if(strSearch.charAt(a)=="?"){wildcard++;wildcardType="?"}}len=lenCont0+lenCont1;for(a=0;a<lenSrch2;a++)if(strSrch2.charAt(a)>="a"&&strSrch2.charAt(a)<="z"||strSrch2.charAt(a)==" "||strSrch2.charAt(a)=="-"||strSrch2.charAt(a)=="'"){strSearch2+=strSrch2.charAt(a);len2++}if(len<2){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> (or place) box with at least 2 characters of the name or place to be found.<br />";d.getElementById("btnGo").disabled=false;d.getElementById("strQry").focus()}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 ...";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 ...";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");w.h.length&&w.h.back()}}
function runSearch(){var a=0,b="",e="",f="",c=[],i="",j=xmlhttp.responseXML;f=j.getElementsByTagName("r");i=j.getElementsByTagName("n");var q=j.getElementsByTagName("l"),p=j.getElementsByTagName("h"),m=j.getElementsByTagName("t");j=xmlhttpH.responseXML;var l=j.getElementsByTagName("n"),r=j.getElementsByTagName("g"),s=j.getElementsByTagName("d"),u=j.getElementsByTagName("y"),v=j.getElementsByTagName("r");j=i.length;var x=l.length,y=d.getElementById("blnSortAlpha").checked,k;if(d.getElementById("blnWildcards").checked)k=
0;else if(d.getElementById("blnExact").checked)k=1;else if(d.getElementById("blnSound").checked)k=2;var g=0;if(d.getElementById("dbType").value=="c")for(;g<j;){b=i[g].firstChild.nodeValue.toUpperCase();e=q[g].firstChild.nodeValue.toUpperCase();f=p[g].firstChild.nodeValue.toUpperCase();if(e=="?")e="";if(f=="-")f="";l=0;var n=b.indexOf(strSearchCont0),o=e.indexOf(strSearchCont0);l=f.indexOf(strSearchCont0);if(!k&&n>=0&&b.indexOf(strSearchCont1,n+lenCont0-1)>=0||k==1&&b.substr(0,lenCont0)==strSearchCont0&&
b.substr(b.length-lenCont1,lenCont1)==strSearchCont1||o>=0&&e.indexOf(strSearchCont1,o+lenCont0-1)>=0||l>=0&&f.indexOf(strSearchCont1,l+lenCont0-1)>=0){c[a]="<i>Cemetery:</i> <b>"+i[g].firstChild.nodeValue+"</b><br/>";b=q[g].firstChild.nodeValue;if(b!="?")c[a]+="<i>Location:</i> "+b+"<br/>";if(p[g].firstChild.nodeValue!="-")c[a]+="<i>Notes:</i> "+p[g].firstChild.nodeValue+"<br/>";l=m[g].firstChild.nodeValue.length;if(m[g].firstChild.nodeValue!="-")c[a]+=m[g].firstChild.nodeValue.charAt(0)=="-"?m[g].firstChild.nodeValue.substr(1,
l-1):"<i>Online data:</i> "+m[g].firstChild.nodeValue+"<br/>";c[a]+="<br/>";a++}g++}else for(;g<x;){b=l[g].firstChild.nodeValue;if(k==2)b=calculateSound(b);e=r[g].firstChild.nodeValue.toLowerCase();m=b.length;n=b.indexOf(strSearchCont0);o=b.indexOf(strSearchCont1,n+lenCont0-1);var z=o-n;q=" aged "+u[g].firstChild.nodeValue+" and was buried &amp;/or memorialised at ";p=" aged "+u[g].firstChild.nodeValue+" who was buried &amp;/or memorialised at ";if((!k&&(!wildcard||wildcardType=="*")&&n>=0&&o>=0||
!k&&wildcardType=="?"&&(z==lenCont0+1||lenCont0==0||lenCont1==0)&&n>=0&&o>=0||k==1&&(!wildcard||wildcardType=="*")&&b.substr(0,lenCont0)==strSearchCont0&&b.substr(m-lenCont1,lenCont1)==strSearchCont1||k==1&&wildcardType=="?"&&m==lenCont0+1+lenCont1&&b.substr(0,lenCont0)==strSearchCont0&&b.substr(m-lenCont1,lenCont1)==strSearchCont1||k==2&&b==strSearch)&&(len2==0||len2>1&&e.indexOf(strSearch2)>=0||len2==1&&e.charAt(0)==strSearch2.charAt(0)))for(b=0;b<j;){if(f[b].firstChild.nodeValue==v[g].firstChild.nodeValue){c[a]=
y?l[g].firstChild.nodeValue+" "+r[g].firstChild.nodeValue+" died "+s[g].firstChild.nodeValue+q+i[b].firstChild.nodeValue:s[g].firstChild.nodeValue+" death of "+l[g].firstChild.nodeValue+" "+r[g].firstChild.nodeValue+p+i[b].firstChild.nodeValue;if(i[b].firstChild.nodeValue.toLowerCase().indexOf("lone grave")<0)c[a]+=" Cemetery";c[a]+="<br />";a++;break}b++}g++}if(a){c.sort();i='<h3 class="results">Search results <span style="font-size:13px; font-weight:normal;">(total of '+a+")</span></h3><p>";for(b=
0;b<a;b++)i+=c[b];i+="</p>";d.getElementById("strResult").innerHTML=i;d.getElementById("htmlProgress").innerHTML="View the results below...";results=true}else{d.getElementById("strResult").innerHTML="<h3 class='results'>Search results <span style='font-size:13px; 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}d.getElementById("strQry").disabled||d.getElementById("strQry").focus();d.getElementById("btnGo").disabled=false}
function calculateSound(a){var b="",e="";b=a.length;for(var f=0;f<b;f++){var c=a.charAt(f);if(c=="P"||c=="F"||c=="V")e+="1";else if(c=="B"){if(a.substr(b-2,2)!="MB"&&a.substr(b-3,3)!="MBE"&&a.substr(b-4,4)!="MBES"&&a.substr(b-3,3)!="MBS")e+="1"}else if(c=="C"||c=="S"||c=="K"||c=="G"&&f!=b-1&&!(f==b-2&&a.charAt(b-1)=="N")||c=="J"||c=="Q"||c=="X"||c=="Z")e+="2";else if(c=="D"||c=="T")e+="3";else if(c=="L")e+="4";else if(c=="M"||c=="N"){if(f==1&&c=="N"&&(a.charAt(0)=="G"||a.charAt(0)=="K"||a.charAt(0)==
"P"))e="5";else e+="5";if(f==0&&a.charAt(1)=="C"&&c=="M")e+="0"}else if(c=="R")e+="6";else if(c=="H"){if(f>1&&a.charAt(f-1)=="G"&&(a.charAt(f-2)=="A"||a.charAt(f-2)=="I"||a.charAt(f-2)=="O"||a.charAt(f-2)=="U"))e=e.substring(0,e.length-1)}else if(c=="W"||c=="Y")if(f==0&&(c=="W"&&a.charAt(1)!="R"||c=="Y"))e+="9";else{if(c=="Y")e+="0"}else if((c=="A"||c=="I"||c=="O")&&(f>0||f==0&&a.charAt(1)!="'")||f!=b-1&&c=="E"||c=="I"||c=="U")e+="0"}b=e.charAt(0);strSoundLen=e.length;for(f=1;f<strSoundLen;f++)if(e.charAt(f)!=
e.charAt(f-1))b+=e.charAt(f);return b}function clearForm(){d.getElementById("htmlProgress").innerHTML="";d.getElementById("strResult").innerHTML=""}
function displayHelp(){var a="";a=results?"<br /><br />"+d.getElementById("strResult").innerHTML:"";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 only 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 sometimes included.</p><h4>Text entry</h4><p>At least 2 allowed characters must be entered into the surname 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 * or ? 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</h4><p>The default (and generally most satisfactory) method of searching for a name is the wildcards method. Select [Wildcards] 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 [ <b>Go</b> ] 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 * 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 * wildcard can be added within the surname to replace zero or more unknown or doubtful characters, or one ? 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 replaces them with this help text.</p><h4>Searching for names using exact matching</h4><p>If you only wish to find surnames with exactly the same spelling as you have entered, select [Exact] by clicking it, if necessary. Note, however, that the database contains spelling variants separated by slashes for some names. With exact matching, 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 * wildcard can be added anywhere within the surname to replace zero or more unknown or doubtful characters, or one ? wildcard to replace exactly one unknown or doubtful character. Exact matching of given names is not available. Any entered given name will be matched by the wildcards method. However, if only the 1st given name initial is entered, an exact match will be sought.</p><h4>Searching for names using sound matching</h4><p>If the above techniques fail, as a last resort you may wish to try the sound method of matching. This 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 which doesn't require the 1st letter of the name to be known and takes into account such pronunciation variations as dropped h's and g's. You must be prepared to scan the results and reject those which are poor matches. for some shorter names, ones with mainly vowels, and names containing spaces, all the results may be unsatisfactory.<br />To use sound matching, select [Sound] before clicking [ <b>Go</b> ] or pressing [Enter]. You <b>must enter the full surname</b> required. <b>Wildcards are not permitted</b>. Sound matching of given names is not available. Any entered given name will be matched by the wildcards method. However, if only the 1st given name initial is entered, an exact match will be sought.</p>"+a;
d.getElementById("strQry").disabled||d.getElementById("strQry").focus()}function cm(a){GUnload();d.getElementById(a).style.display="none";d.getElementById(a).innerHTML="";d.getElementById(a).style.height="0";imgWin&&imgWin.close()}
function dp(a,b,e,f,c,i,j){cm(a);myLoc=new GLatLng(b,e);myPOV={zoom:f,yaw:c,pitch:i};myOpts={latlng:myLoc,pov:myPOV};b=new GStreetviewPanorama(d.getElementById(a),myOpts);d.getElementById(a).style.height=j;d.getElementById(a).style.width="100%";d.getElementById(a).style.display="block"}function dm(a,b,e,f,c,i){cm(a);d.getElementById(a).style.height=c;d.getElementById(a).style.display="block";type=i==2?G_SATELLITE_MAP:i;gml(a,b,e,f,type)}
function gml(a,b,e,f,c){if(GBrowserIsCompatible()){a=new GMap2(d.getElementById(a));a.setCenter(new GLatLng(b,e),f,c);a.addControl(new GSmallMapControl);a.addMapType(G_PHYSICAL_MAP);a.addControl(new GMapTypeControl,new GControlPosition(G_ANCHOR_TOP_RIGHT));a.addOverlay(new GMarker(new GLatLng(b,e)));a.addControl(new GScaleControl,new GControlPosition(G_ANCHOR_BOTTOM_LEFT,new GSize(80,6)))}}function wo(a){imgWin=window.open(a,"imgWin","width=600,height=600");imgWin.focus()};