jQuery.noConflict();

jQuery(document).ready(function() {
	if(jQuery('body').hasClass('home')) {
		jQuery('#col-11 div.col-content, #col-12 div.col-content, #col-2 div.col-content').equalHeights();
	}
	if(jQuery('#col-2 ul.similar').length > 0) {
		jQuery('#col-2 ul.similar li').each(function(){
			jQuery(this).children('span').height(jQuery(this).height());
		});
	}
	/* if(jQuery('body').hasClass('single')) {
		if(jQuery('#col-2 div.col-content').height() < jQuery('#col-1 div.col-content').height()) {
			jQuery('#col-2 div.col-content').css('height',((jQuery('#col-1 div.col-content').height()) + 'px'));
		}
	} */
	if(jQuery('#col-1 div.group').length > 0) {
		jQuery('#col-1 div.group').each(function(){
			jQuery(this).children('div.tile').children('h2').equalHeights();
			jQuery(this).children('div.tile').children('div.splash').equalHeights();
			jQuery(this).children('div.tile').children('p').equalHeights();
		});
	}
});


(function(jQuery) {
  jQuery.fn.equalHeights = function(minHeight, maxHeight) {
    tallest = (minHeight) ? minHeight : 0;
    this.each(function() {
      if (jQuery.browser.msie && jQuery.browser.version < 7) { jQuery(this).css("height", ""); }
      jQuery(this).css("min-height", "");
    });
    this.each(function() {
      if (jQuery(this).height() > tallest) {
        tallest = jQuery(this).height();
      }
    });
    if ((maxHeight) && tallest > maxHeight) tallest = maxHeight;
    return this.each(function() {
      if (jQuery.browser.msie && jQuery.browser.version < 7) { jQuery(this).css("height", tallest + "px"); }
      jQuery(this).css("min-height", tallest + "px");
    });
  }
})(jQuery);
