﻿/*-------------------------------------------------------------------- 
* JQuery Plugin:	"EqualHeights"
* Originally by:	Scott Jehl, Todd Parker, Maggie Costello Wachs (http://www.filamentgroup.com)
* Amended by:		Lee Kelleher (http://leekelleher.com)
*
* Copyright (c) 2008 Filament Group; Copyright (c) 2010 Vertino Ltd
* Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
*
* Description: Compares the heights or widths of the top-level children of a provided 
* element and sets their min-height to the tallest height.
* Usage Example: $(element).equalHeights();
* Version: 2.1, 17.06.2010
--------------------------------------------------------------------*/

$.fn.equalHeights = function() {
	$(this).each(function() {
		var currentTallest = 0;
		$(this).children().each(function(i) {
			if ($(this).height() > currentTallest) { currentTallest = $(this).height(); }
		});
		// for ie6, set height since min-height isn't supported
		if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({ 'height': currentTallest }); }
		$('.promo', this).css({ 'min-height': currentTallest - 130 });
	});
	return this;
};
