/**
 *
 * jQuery plugin 'EqualHeights'
 * author					Wil Linssen
 * copyright			Copyright (c) 2009 Wil Linssen
 * license				http://creativecommons.org/licenses/by-sa/3.0/
 * link		  			http://www.wil-linssen.com/jquery/equalheights/
 * 
 * This work is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported.
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/
 * or send a letter to Creative Commons, 171 Second Street, Suite 300,
 * San Francisco, California, 94105, USA.
 * 
 * Example usage: $(".equalheights").equalHeights();
 *
 */

$.fn.equalHeights=function(){
	var maxHeight=0;
	$('.equalheight').each(function(){
		var thisHeight = $(this).height()+parseInt($(this).css('padding-top'))+parseInt($(this).css('padding-bottom'))+parseInt($(this).css('border-top-width'))+parseInt($(this).css('border-bottom-width'));
		if ( thisHeight > maxHeight ) { maxHeight = thisHeight; $(this).removeClass('equalheight'); }
	});
	$('.equalheight').each(function(){
$(this).height(maxHeight-parseInt($(this).css('padding-top'))-parseInt($(this).css('padding-bottom'))-parseInt($(this).css('border-top-width'))-parseInt($(this).css('border-bottom-width')));
	})
}
