/*-------------------------------------------------------------------- 
 * javascript method: "equalHeights"
 * by:
   Jean-Luc Thiebaut
   Nick Dunn
   http://www.airlock.com/
 *
 * inspired by http://www.filamentgroup.com/lab/setting_equal_heights_with_jquery/
--------------------------------------------------------------------*/


$.fn.equalHeights = function() {
	var currentTallest = 0;
	var heightOfMoreLink = 0;
	
	$(this).each(function(){
		if ($(this).height() > currentTallest) {
			currentTallest = $(this).height();
		};
		if ($(this).hasClass("news-content") && $(this).parent(".inner").find("a.more").parent().length == 1) {
			var more = $(this).parent(".inner").find("a.more").parent();
			heightOfMoreLink = more.height() + (more.css("margin-bottom").replace(/px/,"")*1) + (more.css("margin-top").replace(/px/,"")*1);
		}
	});

	$(this).each(function(){
		var height = currentTallest;
		if ($(this).hasClass("news-content") && $(this).parent(".inner").find("a.more").length == 0) {
			height += heightOfMoreLink;
		}
		//console.log(heightOfMoreLink)
		// for ie6, set height since min-height isn't supported
		if ($.browser.msie && $.browser.version == 6.0) {
			$(this).css({'height': height});
		} else {
			$(this).css({'min-height': height});
		}		
	});
	
	return this;
};