/**
 *
 * Copyright (c) 2007 Tom Deater (http://www.tomdeater.com)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */

(function($) {
	/**
	 * equalizes the heights of all elements in a jQuery collection
	 * thanks to John Resig for optimizing this!
	 * usage: $("#col1, #col2, #col3").equalizeCols();
	 */

	$.fn.equalizeCols = function(){
		var height = 0;
		var offset = 0;

		var tot = 0;
		reset = $.browser.msie && $.browser.version < 7 ? "1%" : "auto";

		 this
			.css("height", reset)
			.each(function() {
				height = Math.max(height + this.offsetHeight);
				offset = Math.max(offset,this.offsetHeight);

				tot = height + offset;


			});

			var arr_return = new Array (tot,height,offset);
			return arr_return;
	};

})(jQuery);
