 							cataloged_item.collection_object_id=#coll_obj_id#
 					</cfquery>
 					
-					<cfset locality = trim(d.data)>
+					<cfset coll_event_locality = trim(d.data)>
 					<cfset coll_event_id=#d.id#>
+					
+					<cfset coll_event_uri="/showLocality.cfm?action=srch&collecting_event_id=" & #d.id#>
 					
 
 				</cfif>

						<cfelse>
							<cfset cat_num = cat_item_sum>						
						</cfif>

					<cfelseif #rel_type# is "collecting_event">		
						<cfset coll_event_id=#related_primary_key#>			
						<cfset locality=trim(summary)>
						
					<cfelseif #rel_type# is "project">
						<cfset project_name=#summary#>
					</cfif>
				</cfloop>		
				
				<!-- Editing after extraction -->
				
				<cfif len(cat_num) gt 0>
					<cfset cat_num= '<a href="#cat_item_url#">' & cat_num & '</a>'>
				</cfif>
				
				<!-- If can't find a collecting event, try to find one through available cataloged item -->		
				<cfif len(locality) lte 0 and coll_obj_id gt 0>
					<cfquery name="d" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,cfid)#">
						select 
							higher_geog || ': ' || spec_locality || ' (' || verbatim_date || ')' data , collecting_event.collecting_event_id id

			
			<!-- variable holders -->
			<cfset kw="">
						
<!--		<cfset media_details_url = "http://arctos.database.museum/media/" & "" & #media_id#> -->
			<cfset media_details_url = "/media/" & "" & #media_id#>
			
			<cfset agent_name="">
			
			<cfset scientific_name="">
			
			<cfset description="#desc.label_value#">

			<!-- Cataloged item information -->
			<cfset cat_num="">
			<cfset cat_item_sum="">
			<cfset cat_item="">
			
			<cfset coll_obj_id=0>
			
			<!-- Collecting event info -->
			<cfset coll_event_id=0>			
			<cfset coll_event_locality="">
			<cfset coll_event_uri="">
			<cfset coll_event="">
			
			<!-- Lat/Long-->
			<cfset dec_lat=0>
			<cfset dec_long=0>
			
			<!-- Other relationships-->
			<cfset project="">			
			<cfset publication="">			
			<cfset shows_locality="">				
			<cfset descr_taxonomy="">
			
			<cfif mrel.recordcount gt 0>				
				<cfloop query="mrel">
					<cfif #rel_type# is "created by agent">
						<cfset agent_name=#summary#>
					<cfelseif #rel_type# is "cataloged_item">
						<cfset cat_item_sum=trim(summary)>
						<cfset coll_obj_id=#related_primary_key#>
						
