/**
 * EqualHeight 1.0
 *
 * Makes all matched elements equal height. Does not work in
 * browsers that do not support min-height (no IE.. who cares)
 *
 * Usage: jQuery('#content, #sub-content').equoalHeight();
 *
 * @class equalHeight
 *
 * Copyright (c) 2008 Andreas Lagerkvist (andreaslagerkvist.com)
 * Released under a GNU General Public License v3 (http://creativecommons.org/licenses/by/3.0/)
 */
jQuery.fn.equalHeight = function () {
    var height        = 450;
    var maxHeight    = 0;

    // Store the tallest element's height
    this.each(function () {
        height        = jQuery(this).outerHeight();
        maxHeight    = (height > maxHeight) ? height : maxHeight;
    });

    // Set element's min-height to tallest element's height
    return this.each(function () {
        var t            = jQuery(this);
        var minHeight    = maxHeight - (t.outerHeight() - t.height());
        if((t.attr('id') == 'noticies' || t.attr('id') == 'activitats') && jQuery.browser.msie){
        	minHeight = 100 + minHeight;
        }
        var property    = jQuery.browser.msie && jQuery.browser.version < 7 ? 'height' : 'min-height';
        t.css(property, minHeight + 'px');
    });
};
