/*
 * @file
 * Only site-wide script goes here.
 */

Drupal.behaviors.girlySearchPlaceholder = {
  attach: function(context) {
    if (jQuery.fn.placeholderLabelShiv) {
      jQuery('form#search-api-page-search-form-1', context).find('input.form-text').placeholderLabelShiv();
    }
  }
};
;
/**
 * @file
 * Expands and collapses the cart block in the navigation region.
 */

Drupal.behaviors.girlShopCartBlock = {
  'attach': function(context) {

    // Find the Cart block.
    var $block = jQuery('#block-commerce-cart-cart', context);
    if ($block.length) {

      // Create a "Close" link.
      var $close = Drupal.theme('girlUiCloseLink').click(function() {

        // Slide the checkout block away.
        $content.slideUp('fast');
      });

      // Add the close link to the content part of it.
      var $content = $block.children('div.content')
      $content.children('div').prepend($close);

      // Find the link in the title.
      var $link = $block.find('h2.block-title a').click(function() {

        // Slide the content up or down when the title link is clicked.
        if ($content.css('display') == 'none') {
          $content.slideDown('fast');
        }
        else {
          $content.slideUp('fast');
        }

        // Prevent the browser from going to the href of the link.
        return false;
      });
    }
  }
};
;

