   </cfif>
 </cfif>
 
+<cfif isdefined("value") and len(value) gt 0>
+  <cfset mapurl = "#mapurl#&value=#value#">
+  <cfset basJoin = " #basJoin# INNER JOIN v_attributes tbl_value ON (#session.flatTableName#.collection_object_id = tbl_value.collection_object_id)">
+  <cfset basQual = " #basQual# AND tbl_value.attribute_type = 'value'">
+  <cfif session.flatTableName is not "flat"><cfset basQual = " #basQual# AND tbl_value.is_encumbered = 0"></cfif>
+  <cfif value neq "_">
+    <cfset schunits="">
+    <cfset oper=left(value,1)>
+    <cfif listfind(numattrschops,oper)>
+      <cfset schTerm=ucase(right(value,len(value)-1))>
+    <cfelse>
+      <cfset oper="like"><cfset schTerm=ucase(value)>
+    </cfif>
+    <cfif oper is "!"><cfset oper="!="></cfif>
+    <cfset temp=trim(rereplace(schTerm,"[0-9]","","all"))>
+    <cfif len(temp) gt 0 and listfindnocase('XXXX',temp) and isnumeric(replace(schTerm,temp,""))>
+      <cfset schTerm=replace(schTerm,temp,"")><cfset schunits=temp>
+    <cfelseif left(temp,1) eq "-" and listfindnocase(attrTimeUnits,trim(replace(temp,"-","")))>
+      <cfset schunits=trim(replace(temp,"-",""))>
+      <cfset low=trim(listgetat(numeric_age,1,"-"))>
+      <cfset high=trim(replacenocase(replace(replace(numeric_age,low,"","first"),"-",""),schunits,""))>
+      <cfset schTerm=trim(replace(replace(replace(numeric_age,schunits,""),low,""),high,""))>
+      <cfif len(low) gt 0 and len(high) gt 0 and len(schunits) gt 0><cfset oper="between"></cfif>
+    </cfif>
+    <cfif len(schunits) gt 0>
+      <cfset basQual = " #basQual# AND tbl_value.attribute_value #oper# #schTerm# and tbl_value.attribute_units='#schunits#' ">
+    <cfelse>
+      <cfset basQual = " #basQual# AND tbl_value.attribute_value #oper# '#schTerm#'">
+    </cfif>
+  </cfif>
+</cfif>
+
 <cfif isdefined("verbatim_collector") and len(verbatim_collector) gt 0>
   <cfset mapurl = "#mapurl#&verbatim_collector=#verbatim_collector#">
   <cfset basJoin = " #basJoin# INNER JOIN v_attributes tbl_verbatim_collector ON (#session.flatTableName#.collection_object_id = tbl_verbatim_collector.collection_object_id)">

  </cfif>
</cfif>

<cfif isdefined("appraised_value") and len(appraised_value) gt 0>
  <cfset mapurl = "#mapurl#&appraised_value=#appraised_value#">
  <cfset basJoin = " #basJoin# INNER JOIN v_attributes tbl_appraised_value ON (#session.flatTableName#.collection_object_id = tbl_appraised_value.collection_object_id)">
  <cfset basQual = " #basQual# AND tbl_appraised_value.attribute_type = 'appraised value'">
  <cfif session.flatTableName is not "flat"><cfset basQual = " #basQual# AND tbl_appraised_value.is_encumbered = 0"></cfif>
  <cfif appraised_value neq "_">
    <cfset schunits="">
    <cfset oper=left(appraised_value,1)>
    <cfif listfind(numattrschops,oper)>
      <cfset schTerm=ucase(right(appraised_value,len(appraised_value)-1))>
    <cfelse>
      <cfset oper="like"><cfset schTerm=ucase(appraised_value)>
    </cfif>
    <cfif oper is "!"><cfset oper="!="></cfif>
    <cfset temp=trim(rereplace(schTerm,"[0-9]","","all"))>
    <cfif len(temp) gt 0 and listfindnocase('XXXX',temp) and isnumeric(replace(schTerm,temp,""))>
      <cfset schTerm=replace(schTerm,temp,"")><cfset schunits=temp>
    <cfelseif left(temp,1) eq "-" and listfindnocase(attrTimeUnits,trim(replace(temp,"-","")))>
      <cfset schunits=trim(replace(temp,"-",""))>
      <cfset low=trim(listgetat(numeric_age,1,"-"))>
      <cfset high=trim(replacenocase(replace(replace(numeric_age,low,"","first"),"-",""),schunits,""))>
      <cfset schTerm=trim(replace(replace(replace(numeric_age,schunits,""),low,""),high,""))>
      <cfif len(low) gt 0 and len(high) gt 0 and len(schunits) gt 0><cfset oper="between"></cfif>
    </cfif>
    <cfif len(schunits) gt 0>
      <cfset basQual = " #basQual# AND tbl_appraised_value.attribute_value #oper# #schTerm# and tbl_appraised_value.attribute_units='#schunits#' ">
    <cfelse>
      <cfset basQual = " #basQual# AND tbl_appraised_value.attribute_value #oper# '#schTerm#'">
    </cfif>
  </cfif>
</cfif>

<cfif isdefined("axillary_girth") and len(axillary_girth) gt 0>
  <cfset mapurl = "#mapurl#&axillary_girth=#axillary_girth#">
  <cfset basJoin = " #basJoin# INNER JOIN v_attributes tbl_axillary_girth ON (#session.flatTableName#.collection_object_id = tbl_axillary_girth.collection_object_id)">

  </cfif>
</cfif>

<cfif isdefined("framed") and len(framed) gt 0>
  <cfset mapurl = "#mapurl#&framed=#framed#">
  <cfset basJoin = " #basJoin# INNER JOIN v_attributes tbl_framed ON (#session.flatTableName#.collection_object_id = tbl_framed.collection_object_id)">
  <cfset basQual = " #basQual# AND tbl_framed.attribute_type = 'framed'">
  <cfif session.flatTableName is not "flat"><cfset basQual = " #basQual# AND tbl_framed.is_encumbered = 0"></cfif>
  <cfif framed neq "_">
    <cfset oper=left(framed,1)>
    <cfif listfind(charattrschops,oper)>
      <cfset schTerm=ucase(right(framed,len(framed)-1))>
    <cfelse>
      <cfset oper="like"><cfset schTerm=ucase(framed)>
    </cfif>
    <cfif oper is "!"><cfset oper="!="></cfif>
    <cfif oper is "like">
      <cfset basQual = " #basQual# AND upper(tbl_framed.attribute_value) #oper# '%#ucase(escapeQuotes(schTerm))#%'">
	<cfelse>
      <cfset basQual = " #basQual# AND upper(tbl_framed.attribute_value) #oper# '#ucase(escapeQuotes(schTerm))#'">
	</cfif>
  </cfif>
</cfif>

<cfif isdefined("gonad") and len(gonad) gt 0>
  <cfset mapurl = "#mapurl#&gonad=#gonad#">
  <cfset basJoin = " #basJoin# INNER JOIN v_attributes tbl_gonad ON (#session.flatTableName#.collection_object_id = tbl_gonad.collection_object_id)">
