(function($){

$(function(){
	$.sameHeight();
});
//高さの違うカラムを同じ高さにする
$.sameHeight = function(settings){
	var c = $.extend({
		selector: '.sameHeight' //class='.sameHeight'
	}, settings);
	
	$(c.selector).each(function(){
		//変数をセット
		var eachHeight = 0;
		var eachPaddingTop = 0;
		var eachPaddingBottom = 0;
		
		$(this).children().each(function(){

			//高さの値を取得
			var heightValue = $(this).height();
			
			//IE6用 padding-topとpadding-bottomの値を取得
			var topValue = $(this).css("padding-top");
			var bottomValue = $(this).css("padding-bottom");
			
			//文字を数値に変換
			topValue = parseFloat(topValue);
			bottomValue = parseFloat(bottomValue);
			
			//一番大きいheightの値にする
			if (heightValue > eachHeight) { eachHeight = heightValue; };
			
			//一番大きいpadding-topの値にする
			if (topValue > eachPaddingTop) { eachPaddingTop = topValue; };
			
			//一番大きいpadding-bottomの値にする
			if (bottomValue > eachPaddingBottom) { eachPaddingBottom = bottomValue; };

		});
		
		//IE6用 height + paddint-top + padding-bottomの合計値
		var total =  eachHeight + eachPaddingTop + eachPaddingBottom;
		if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({'height': total}); };
		
		//IE6以外。paddingの値がそれぞれ違っても同じ高さになる。
		$(this).children().css({'min-height': eachHeight , 'padding-top':eachPaddingTop,'padding-bottom':eachPaddingBottom});
        
	});
};
})(jQuery);