	
	jQuery.fn.sortList = function(numCols) {
		return this.each(function() {
			
			$(this).addClass('sorted_list');
		
			var grandHeight = 0;
		
			var numItems = $('.multi_col_list').children('li').length;
			var colBreak = Math.ceil(numItems / numCols);
			var colNum = 0;
		
			var top = 0;
		
			$('.multi_col_list').children('li').each(function(intIndex) {
				if (intIndex > 1 && intIndex % colBreak == 0) {
					colNum++;
					top = 0;
				}
			
				var left = colNum * Number($(this).css('width').replace('px', ''));
			
				$(this).css('top', top+'px');
				$(this).css('left', left+'px');
			
				// Get the elements base height.
				var height = Number($(this).height());
			
				// Add the elements top margin into the height.
				var margin = Number($(this).css('margin-top').replace('px', ''));
				height += (!isNaN(margin) ? margin : 0);
				// Add the elements bottom margin into the height.
				var margin = Number($(this).css('margin-bottom').replace('px', ''));
				height += (!isNaN(margin) ? margin : 0);
			
				top += height;
			
				if (top > grandHeight) {
					grandHeight = top;
				}
			});
		
			$(this).css('height', grandHeight+'px');
		});
	};
