+<script type="text/javascript">
+<!--
+ function startSearch() {
+ updateSidebar("Search Results", "<p class='search_results_entry'>Searching...</p>");
+
+ $("search_field").style.display = "none";
+ $("search_active").style.display = "inline";
+ }
+
+ function endSearch() {
+ $("search_field").style.display = "inline";
+ $("search_active").style.display = "none";
+ }
+
+ function describeLocation() {
+ var position = getPosition();
+
+ <%= remote_function(:loading => "startSearch()",
+ :complete => "endSearch()",
+ :url => { :controller => :geocoder, :action => :description },
+ :with => "'lat=' + position.lat + '&lon=' + position.lon") %>
+ }
+
+ <% if params[:query] %>
+ <%= remote_function(:loading => "startSearch()",
+ :complete => "endSearch()",
+ :url => { :controller => :geocoder, :action => :search, :query => h(params[:query]) }) %>
+ <% end %>
+// -->
+</script>
+