(function ($) {
  Drupal.behaviors.ec_frontpage = {
    attach: function(context) {  
      $('.views-view .centre-wrapper .button a').css("color","#ffffff").css("font-weight", "700").css("line-height", "1.5em");
      $('.views-view .centre-wrapper .centre .more').css("clear","right");
    }
  };
})(jQuery);;

(function ($) {
  Drupal.Panels = {};

  Drupal.Panels.autoAttach = function() {
    if ($.browser.msie) {
      // If IE, attach a hover event so we can see our admin links.
      $("div.panel-pane").hover(
        function() {
          $('div.panel-hide', this).addClass("panel-hide-hover"); return true;
        },
        function() {
          $('div.panel-hide', this).removeClass("panel-hide-hover"); return true;
        }
      );
      $("div.admin-links").hover(
        function() {
          $(this).addClass("admin-links-hover"); return true;
        },
        function(){
          $(this).removeClass("admin-links-hover"); return true;
        }
      );
    }
  };

  $(Drupal.Panels.autoAttach);
})(jQuery);
;
(function($) {

Drupal.behaviors.searchlight = {};
Drupal.behaviors.searchlight.attach = function(context, settings) {
  if (Drupal.settings && Drupal.settings.views && Drupal.settings.views.ajaxViews) {
    $('.searchlight-environment:not(.searchlightProcessed)').each(function() {
      // Retrieve current page view's settings and DOM element.
      var settings = {};
      var view = '';
      var identifier = $(this).attr('class').split('searchlight-view-')[1].split('-');
      for (var i in Drupal.settings.views.ajaxViews) {
        if (
          Drupal.settings.views.ajaxViews[i].view_name == identifier[0]
          // @TODO: Do a loose (view-name only) check for attaching AJAX
          // view handlers to allow environments to be used with multiple
          // displays in the same view.
          // && Drupal.settings.views.ajaxViews[i].view_display_id == identifier[1]
        ) {
          settings = Drupal.settings.views.ajaxViews[i];
          view = $('.view-dom-id-' + settings.view_dom_id);
          $('a', this).drupalSearchlight('ajaxViewLink', {view: view, settings: settings});
          break;
        }
      }
    }).addClass('searchlightProcessed');
  }
};

$.fn.drupalSearchlight = function(method, params) {
  switch (method) {
    case 'ajaxViewLink':
      var settings = params.settings;
      var view = params.view;

      // If there are multiple views this might've ended up showing up multiple times.
      var ajax_path = Drupal.settings.views.ajax_path;
      if (ajax_path.constructor.toString().indexOf("Array") != -1) {
        ajax_path = ajax_path[0];
      }

      $(this).each(function() {
        var viewData = {};
        var link = $(this);

        // Construct an object using the settings defaults and then overriding
        // with data specific to the link.
        $.extend(
          viewData,
          Drupal.Views.parseQueryString(link.attr('href')),
          // Extract argument data from the URL.
          Drupal.Views.parseViewArgs(link.attr('href'), settings.view_base_path),
          // Settings must be used last to avoid sending url aliases to the server.
          settings
        );

        var ajax = new Drupal.ajax(false, link, {
          url: ajax_path,
          submit: viewData,
          event: 'click',
          selector: view
        });

        // Override HTTP method type and beforeSerialize method.
        // See note above.
        ajax.options.type = 'GET';
        ajax.beforeSerialize = function(element_settings, options) { return; };
      });
      break;
  }
  return this;
};

$.fn.drupalSearchlight.replace = function(selector, data) {
  if (data.searchlightData) {
    for (var target in data.searchlightData) {
      if ($(target).size()) {
        $(target).replaceWith(data.searchlightData[target]);
        Drupal.attachBehaviors($(target));
      }
    }
  }
};

})(jQuery);

;

