(function ($) {
  Drupal.ajax.prototype.commands.boussoleUsersSearchRedirect = function(ajax, response, status) {
    $('#boussole .section form.search div.users-search-status').html("");
    $('#boussole .expand a').trigger('click', [true]);
    setTimeout(function() {
      window.location = response.uri;
    }, 1000);
    Drupal.attachBehaviors();
  };
  Drupal.ajax.prototype.commands.boussoleUsersSearchClear = function(ajax, response, status) {
    //$('#boussole .section form.search input[type="text"]').val("");
    $('#boussole .section form.search div.users-search-status').html(Drupal.t('Your search returned no results.'));
    $('#boussole .section form.search input').keypress(function (e) {
      $('#boussole .section form.search div.users-search-status').html("");
    });
    $('#boussole .section form.search input').mousedown(function () {
      $('#boussole .section form.search div.users-search-status').html("");
    });
    Drupal.attachBehaviors();
  };
  Drupal.ajax.prototype.commands.boussoleTermsSearchRedirect = function(ajax, response, status) {
    $('#boussole .section form.search div.terms-search-status').html("");
    $('#boussole .expand a').trigger('click', [true]);
    setTimeout(function() {
      window.location = response.uri;
    }, 1000);
    Drupal.attachBehaviors();
  };
  Drupal.ajax.prototype.commands.boussoleTermsSearchClear = function(ajax, response, status) {
    //$('#boussole .section form.search input[type="text"]').val("");
    $('#boussole .section form.search div.terms-search-status').html(Drupal.t('Your search returned no results.'));
    $('#boussole .section form.search input').keypress(function (e) {
      $('#boussole .section form.search div.terms-search-status').html("");
    });
    $('#boussole .section form.search input').mousedown(function () {
      $('#boussole .section form.search div.terms-search-status').html("");
    });
    Drupal.attachBehaviors();
  };
})(jQuery)
;

