	
	jQuery.stsm_sortNumber = function(a,b) { return a - b; };
	
	jQuery.setToSameDimensions = function(els, sizeEls) {
		if (!sizeEls) var sizeEls = els;
		
		// Get largest height.
		$.setToSameWidth(els, sizeEls);
		$.setToSameHeight(els, sizeEls);
	};
	
	jQuery.setToSameWidth = function(els, sizeEls) {
		if (!sizeEls) var sizeEls = els;
		
		// Get largest height.
		var arrWidths = [];
		sizeEls.each(function() {
			$(this).removeAttr("width");
			arrWidths.push($(this).width());
		});
		arrWidths.sort($.stsm_sortNumber);
		var width = arrWidths.pop();
		
		// Set all elements to the same height.
		els.each(function() {
			$(this).width(width);
		});
	};
	
	jQuery.setToSameHeight = function(els, sizeEls) {
		if (!sizeEls) var sizeEls = els;
		
		// Get largest height.
		var arrHeights = [];
		sizeEls.each(function() {
			$(this).removeAttr("height");
			arrHeights.push($(this).height());
		});
		arrHeights.sort($.stsm_sortNumber);
		var height = arrHeights.pop();
		
		// Set all elements to the same height.
		els.each(function() {
			$(this).height(height);
		});
	};
