﻿/// <reference path="~/Resources/js/jquery-1.2.6-intellisense.js" />

$(function() {
    //SetSpacerHeight('.promotion-margin');
    SpacerHeight('.promotion-margin');
});


function SetSpacerHeight(element) {
    tot = 0;
    $blurbs = $(element).children('div');
    for (index = 0; index < $blurbs.length; index++) {
        thisHeight = $blurbs[index].offsetTop + $blurbs[index].clientHeight;
        if (thisHeight > tot)
            tot = thisHeight;
    }

    $(element).height(tot);
}

function SpacerHeight(element) {
    $(element).each(function() {
        var maxHeight = 0;

        $('div', $(this)).each(function() {
            var height = $(this).outerHeight();
            if (maxHeight < height)
                maxHeight = height;
        });

        $(this).height(maxHeight);
    });
}