﻿/*
* Make height of all selected elements equal
* EG:
*   $("#this #that #other").equalheight();
* * * * * * */

$.fn.equalheight = function () {
	var oHeight = 0;
	$(this).each(function () {
		if ($(this).height() > oHeight) {
			/*Find the highest height of all elements*/
			oHeight = $(this).height();
		}
	});
	if (oHeight > 0) {
		/*in some cases firefox and ie will need to you height and min-height*/
		if ($.browser.msie || $.browser.mozilla  /*&& $.browser.version == 6.0*/) {
			$(this).css({ 'height': oHeight });
		}
		$(this).css({ 'min-height': oHeight });
	}
	return this;
};
