/*
 * nomduplugin version 1.0.0
 * 
 * Copyright (c) 2010 PSR
 * 
 */

jQuery.fn.heightCols = function (options) {
	var defaults = {
		height: 0 
	} ;
	if(options) jQuery.extend(defaults, options);
	var maxHeight = parseInt(defaults.height);	
	this.each(function() {
		$(this).height("auto");		
		if($(this).outerHeight() > maxHeight) {
			maxHeight = $(this).outerHeight();
		}
	});	
	return this.each (function()  {  
		var borderTopWidth = isNaN($(this).css("border-top-width")) ? 0 : $(this).css("border-top-width");
		var borderBottomWidth = isNaN($(this).css("border-bottom-width")) ? 0 : $(this).css("border-bottom-width");
 		$(this).height( 
			maxHeight 
			- parseInt( $(this).css("padding-top") ) 
			- parseInt( $(this).css("padding-bottom" ) ) 
			- parseInt( borderTopWidth ) 
			- parseInt( borderBottomWidth )
		);
	}) ;
}
