 				<!----
 				upper(trim(replace(replace(replace(replace(replace(replace(county,'Borough'), 'County'), 'Province'),'Parish'),'District'), 'Territory'))) = '#ucase(thisCounty)#'
 				---->
-				stripGeogRanks(county)=stripGeogRanks('#thisCounty#')
+				stripGeogRanks(county)=stripGeogRanks('#thisCounty#') and
 			<cfelse>
-				county is null
+				county is null and
+			</cfif>
+			<cfif len(thisDrainage) gt 0>
+				stripGeogRanks(drainage)=stripGeogRanks('#thisDrainage#')
+			<cfelse>
+				drainage is null
 			</cfif>
 		</cfquery>
 		<cfif debug is "yes">

							  	stripGeogRanks(island)=stripGeogRanks('#thisCounty#') or
							  	stripGeogRanks(island_group)=stripGeogRanks('#thisCounty#')
							  )
							<!----
						   and upper(trim(replace(replace(replace(replace(replace(replace(county,'Borough'), 'County'), 'Province'),'Parish'),'District'), 'Territory')))
						       like '%#ucase(thisCounty)#%'

						       					       and stripGeogRanks(county)=stripGeogRanks('#thisCounty#')



						       ---->
	                     </cfif>
	            </cfquery>


            <cfquery name="componentMatch" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
                select HIGHER_GEOG from geog_auth_rec where
                   upper(trim(Country)) = '#ucase(thisCountry)#' and
				stripGeogRanks(state_prov)=stripGeogRanks('#thisState#') and
				stripGeogRanks(county)=stripGeogRanks('#thisCounty#')
				<!--- just block this if we have drainage data; it's useful-ish in all other cases--->
				<cfif len(thisDrainage) gt 0>
					and 1=2
				</cfif>
            </cfquery>

			<cfif debug is "yes">
