/**
 *
 * Copyright (c) 2007 Tom Deater (http://www.tomdeater.com)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * modified by zhen from CMS_Tuning 
 */
 
(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,
			reset = $.browser.msie ? "1%" : "auto";
			var $htype;
			$htype = ($.browser.msie && $.browser.version.substr(0,3)=="6.0") ? "height" : "min-height";
  
		return this
			.css("height", reset)
			.each(function() {
				height = Math.max(height, this.offsetHeight);
			})
			.css($htype, height)
		
			.each(function() {
				var h = this.offsetHeight;
				if (h > height) {
					
						$(this).css($htype, height - (h - height));
					
				
				};
			});
			
	};
	
})(jQuery);
