// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

var contactInfoTabs = $A(['phones_and_emails_container', 'addresses_container', 'instant_messengers_container', 'websites_container']);

function showContactInfoTab(tab_to_show){ 

  contactInfoTabs.each(function(tab) {
    if (tab != tab_to_show) {
      $(tab).hide();
    } else {
      $(tab).show();
    }
  })
}

function receivedFocus(){
  $('search_field').value = '';
}

function lostFocus(){
  if ($('search_field').value == ''){
    $('search_field').value = 'Search on Prático';
  }
}


Ajax.Responders.register({
  onCreate: function() {
    if (Ajax.activeRequestCount > 0)
      Element.show('spinner');
  },

  onComplete: function() {
    if (Ajax.activeRequestCount == 0)
      Element.hide('spinner');
  }
});

