   </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)">

  </cfif>
</cfif>

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

  </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)">
