var Search = { showSpinner: function() { $('#search-container input').attr('disabled', 'disabled').blur(); $('#search-container img').show(); Search.hideSuggestions(); }, hideSpinner: function() { $('#search-container input').removeAttr('disabled'); $('#search_field').focus(); $('#search-container img').hide(); }, showSuggestions: function(values) { for (var i = 0; i < values.length; i++) { $('.suggestions ul').append('\
  • \ '+ values[i] +'\
  • \ '); } $('.suggestions').show(); }, hideSuggestions: function() { $('.suggestions ul li').remove(); $('.suggestions').hide(); } } $(function(){ $('.search').live('click', function(){ Ajax.loadSearchPage(); return false; }); $('#search_form').live('submit', function(){ $('.autocomplete-container').remove(); Ajax.loadArtistData($('#search_field').val()); return false; }); $('.suggestions a').live('click', function(){ $('#search_field').val($(this).text()); return false; }); });