 			Explicitly exclude things we don't want --->
 		<cfloop list="#StructKeyList(form)#" index="key">
 			 <cfif len(form[key]) gt 0>
-				<cfif #key# is not "FIELDNAMES" 
-					AND #key# is not "SEARCHPARAMS" 
-					AND #key# is not "mapurl" 
-					AND #key# is not "cbifurl" 
+				<cfif #key# is not "FIELDNAMES"
+					AND #key# is not "SEARCHPARAMS"
+					AND #key# is not "mapurl"
+					AND #key# is not "cbifurl"
 					and #key# is not "newquery"
 					and #key# is not "ORDER_ORDER"
 					and #key# is not "ORDER_BY"

				<cfelse>
					<cfset basGroup = "GROUP BY #item#">
				</cfif>
				
			</cfif>
			
			<cfset basFrom = " FROM #session.flatTableName#">
			<cfset basJoin = "INNER JOIN cataloged_item ON (#session.flatTableName#.collection_object_id =cataloged_item.collection_object_id)">
			<cfset basWhere = " WHERE #session.flatTableName#.collection_object_id IS NOT NULL ">	
			
			<cfset basQual = "">
			<cfset mapurl="">
			<cfset basOrder = "ORDER BY count(#session.flatTableName#.cat_num) DESC">
			<cfinclude template="includes/SearchSql.cfm">
			<cfset SqlString = "#basSelect# #basFrom# #basJoin# #basWhere# #basQual# #basGroup# #basOrder#">	
			<cfquery name="getGraph" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
				#preservesinglequotes(SqlString)#
			</cfquery>
			
			 
			
			<cfchart format="#chartType#" 
				chartHeight = "#chartHeight#"
				chartWidth = "#chartWidth#"
				xaxistitle="#left(ucase(item),1)##right(lcase(item),len(item)-1)#" 
				yaxistitle="#y#"
				show3D="#show3D#"
				title = "Search Results by #left(ucase(item),1)##right(lcase(item),len(item)-1)# (#dateformat(now(),'dd mmm yyyy')#)"
				fontBold="yes"> 
				
				<cfchartseries type="#type#" 
					query="getGraph" 
					itemcolumn="x_data" 
					valuecolumn="y_data"
					seriesColor="##0066FF">
				</cfchartseries>
			</cfchart> 
	</cfloop>
</cfoutput>
</cfif>

				</cfif>
			 </cfif>
		</cfloop>

		<cfset searchParams = #replace(searchParams,"'","","all")#>
	<table>

<form name="browse" action="SpecimenGraph.cfm" method="post">
				<tr>
					<td><strong>Chart Settings</strong></td>
