/**
 *	JavaScript
 *	Columns
 *
 *	Ensure all items in of a certain class in a parent 
 *	are the same height
 *	
 *	@library: jQuery
 *  @author philthompson.co.uk
 *	@copyright 2009 philthompson.co.uk
 *	@written 03/03/2009
 *	@edited 04/03/2009
 *
 */
 
 
jQuery.fn.columns = function(options){
	
	var height = 0;
	
	if($(this).length > 1){
		
		/* Grab the largest height of the supplied elements*/
		this.each(function(){
			var thisHeight = $(this).height();
			if(thisHeight > height){
				height = thisHeight;
			}
		});
			
		
		/* If the largest height is bigger than an element then
		apply a min-height to the smallest element
		*/
		this.each(function(){
			var thisHeight = $(this).height();
			if(thisHeight < height){
				
				if ($.browser.msie && $.browser.version.substr(0, 1) < 7) {
					$(this).css('height', height + 'px'); /* IE6 - boo! */
				} else {
					$(this).css('min-height', height + 'px');
				}
			}
		});
	}
	
	return this;
}
