
/** 
 * @projectDescription	Simple Equal Columns
 * @author 	Matt Hobbs
 * @version 	0.01 
 */
jQuery.fn.equalCols = function(){
	//Array Sorter
	var sortNumber = function(a,b){return b - a;};
	var heights = [];
	//Push each height into an array
	$(this).each(function(){
		heights.push($(this).height());
	});
	heights.sort(sortNumber);
	var maxHeight = heights[0];
	return this.each(function(){
		//Set each column to the max height
		$(this).css({'height': maxHeight});
	});
};

//Usage
jQuery(function($){
	//$('#left_column,#center_column').equalCols();
});



if($.browser.msie) { 
		$(document).ready(function(){
			//set the starting bigestHeight variable
			var biggestHeight = 0;
			//check each of them
			$('.equal_height').each(function(){
				//if the height of the current element is
				//bigger then the current biggestHeight value
				if($(this).height() > biggestHeight){
					//update the biggestHeight with the
					//height of the current elements
					biggestHeight = $(this).height();
				}
			});
			//when checking for biggestHeight is done set that
			//height to all the elements
			$('.equal_height').height(biggestHeight);
			
		});

}else{
	//Usage
	jQuery(function($){
		$('#pb-left-column,#pb-right-column').equalCols();
	});	 
 
}


