﻿MatchHeights = function (selector) {
    var $sameHeightDivs = $(selector);
    var maxHeight = 0;
    $sameHeightDivs.each(function () {
        var extras = $(this).outerHeight() - $(this).height();
        maxHeight = Math.max(maxHeight, $(this).outerHeight() - ($(this).position().top - extras));
    });
    $sameHeightDivs.css({ height: maxHeight + 'px' });
};
