/**
 * @file
 * Equalize the heights of the views blocks on the front page
 */
function pascEqualizeHeights() {
  var height = 0;
  jQuery('.pasc-foursquare').each( function(index) {
    if (index%2 == 0) {
      height = 0;
    }
    if (height > 0) {
      if (height > jQuery(this).height()) {
        diff = height - jQuery(this).height();
        jQuery(this).height(height).children('.more-link').css('padding-top', diff);
      }
      else {
        diff = jQuery(this).height() - height;
        jQuery('.pasc-foursquare').eq(index-1).height(jQuery(this).height()).children('.more-link').css('padding-top', diff);
      }
    }
    height = jQuery(this).height();
  });
}

jQuery(document).ready( function() {
  pascEqualizeHeights();
});
;
/**
 * @file
 * Provides js driven drop-down javascript functionality to a menu in the menu-bar
 */
jQuery(document).ready( function() {
  var lastDropDown = null;

  jQuery('#menu-bar .expanded .menu').not('#menu-bar .expanded .menu .menu').hide();
  jQuery('#menu-bar .expanded .menu').not('#menu-bar .expanded .menu .menu').css('position', 'absolute').css('z-index', '99');
  jQuery('#menu-bar .expanded').not('#menu-bar .expanded .menu li').removeClass('active-trail');

  jQuery('#menu-bar .expanded a').not('#menu-bar .expanded .menu a').click( function(event) {
    event.preventDefault();
    jQuery(lastDropDown).slideToggle();
    jQuery(lastDropDown).closest('li').removeClass('active-trail');
    jQuery(lastDropDown).closest('li').children('a:first').removeClass('drop-up');
    dropDown = jQuery(this).closest('li').children('ul:first');
    if (jQuery(dropDown).hasClass('dropdown-down')) {
      lastDropDown = null;
      jQuery(dropDown).removeClass('dropdown-down');
    }
    else {
      jQuery(dropDown).addClass('dropdown-down').slideToggle();
      jQuery(dropDown).closest('li').addClass('active-trail');
      jQuery(lastDropDown).removeClass('dropdown-down');
      jQuery(this).addClass('drop-up');
      lastDropDown = dropDown;
    }
  });
});
;

