(function ($) {
Drupal.behaviors.clear_search = {
  attach: function(context, settings) {
    $('#block-search-form .form-text', context).once(function(){  
      this.defaultValue = this.value;
      $(this).click(function(){
        if(this.value == this.defaultValue){
          $(this).val("");
        }
        return false;
      });
      $(this).blur(function(){
        if(this.value == ""){
          $(this).val(this.defaultValue);
        }
      });
    });
  }
}
})(jQuery);;
(function ($) {
//Thx misc/collapse.js

Drupal.toggleFooter = function ($footer, $button) {
  if ($footer.is('.collapsed')) {
    $footer.removeClass('collapsed');
    $footer.slideDown({
      duration: 'fast',
      complete: function () {
        $button.addClass('contract').html(Drupal.t('Contract Full Navigation'));
        Drupal.collapseScrollIntoView($footer.get(0));
        $footer.animating = false;
      },
      step: function () {
        // Scroll the fieldset into view using collapse.js function
        Drupal.collapseScrollIntoView($footer.get(0));
      }
    });
  }
  else {
    $footer.slideUp('fast', function () {
      $footer.addClass('collapsed').animating = false;
      $button.removeClass('contract').html(Drupal.t('Expand Full Navigation'));
    });

  }
}

Drupal.behaviors.collapse_nav = {
  attach: function(context, settings) {
    $('#collapse-control', context).once('collapse', function(){
      var $footer = $('#collapse-footer');
      var $control = $(this);
      var $button = $('#collapse-btn');
      $footer.addClass('collapsed');
      $control.click(function(){
        // Don't animate multiple times.
        if (!$footer.animating) {
          $footer.animating = true;
          Drupal.toggleFooter($footer, $button);
        }
        return false;
      });
    });
  }
}
})(jQuery);;

