 					<cfset dec_lat=#d.dec_lat#>
 					<cfset dec_long=#d.dec_long#>
 				</cfif>
-			</cfif>
+				
+				<!-- Orders the keywords -->
+				<cfset kw_list = "#scientific_name#, #locality#, #agent_name#, #description#">
+				<cfloop list="#kw_list#" index="word" delimiters=",">
+					<cfif len(word) gt 0>
+						<cfif len(kw) gt 0>
+							<cfset kw = kw & "; " & word>
+						<cfelse>
+							<cfset kw = word>						
+						</cfif>
+					</cfif>
+				</cfloop>
+			</cfif>
+			
+		
 			
 			<!-- Grid Display -->
 			<!-- <table>

							<cfset endPos = find(')', cat_item_sum)>
							<cfset scientific_name=mid(cat_item_sum,begPos+1, endPos-begPos-1)>
						</cfif>
						
						<cfif len(kw) gt 0>
							<cfset kw= kw &"; " & scientific_name>
						<cfelse>
							<cfset kw=""&scientific_name>
						</cfif>
					<cfelseif #rel_type# is "collecting_event">		
						<cfset coll_event_id=#related_primary_key#>			
						<cfset locality = replace(#summary#,"[:\(]",";")>
						<cfset locality = replace(#summary#, "\)", "")>
						
						<cfif len(kw) gt 0>
							<cfset kw= kw &"; " & locality>
						<cfelse>
							<cfset kw=""&locality>
						</cfif>

					</cfif>
				</cfloop>		

<table>
	<!-- Results Table Header -->
	<tr>
		<td><center><strong>Media Preview</strong></center></td>
		<td><center><strong>Mime Type</strong></center></td>
		<td><center><strong>Details</strong></center></td>
		<td><center><strong>Download</strong></center></td>
		<td><center><strong>Map</strong></center></td>
		<td><center><strong>Related Keywords</strong></center></td>		
	</tr>
<cfloop query="findIDs" startrow="#URL.offset#" endrow="#limit#">
	<cfquery name="labels_raw"  datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,cfid)#">
