if (typeof Site === "undefined") { Site = {}; }

/**
* @fileoverview Extensions to jQuery
*/
jQuery.fn.minHeight = function(size) {
	// Explorer versions prior to IE7 needs to have height instead of min-height
	var type = Site.ltIE7 ? "height" : "min-height";
	if (size == undefined) {
		// Get min-height for the first element
		return this.length ? jQuery.css( this[0], type ) : null;
	} else {
		// Set the min-height on all elements (default to pixels if value is unitless)
		this.css(type, size.constructor == String ? size : size + "px");
	}
};

/**
* Justify columns
*/
jQuery.fn.justifyTeaserGroup = function() {
	jQuery(this).each(function(){
		var maxHeight = 0;
		// Get the height of the highest element
		jQuery(".m-c", this).each(function(){
			var height;
			jQuery(this).minHeight(0);
			height = jQuery(this).height() + jQuery(this).siblings(".m-h").height();
			if (height > maxHeight) {
				maxHeight = height;
			}
		});
		// Set min-height for all elements
		jQuery(".m-c", this).each(function(){
			jQuery(this).minHeight(maxHeight - jQuery(this).siblings(".m-h").height());
		});
	});
	return this;
};