﻿$(function() {
    var html = {
        top_blocks: $('.block-row > div:lt(4)'),
        bottom_blocks: $('.block-row > div:gt(3)')
    };
    var tallest_block = 0;
    html.bottom_blocks.each(function(i) {
        getTallestBlock($(this));
        if (i == 2) { return tallest_block = 0; }
    });
    html.bottom_blocks.each(function() {
        $(this).css('height', tallest_block);
    });
    html.top_blocks.each(function(i) {
        getTallestBlock($(this));
        if (i == 3) { return tallest_block = 0; }
    });
    html.top_blocks.each(function() {
        $(this).css('height', tallest_block);
    });
    function getTallestBlock(curr_block) {
        var block = curr_block;
        var block_height = curr_block.height();
        var test_height = curr_block.innerHeight();
        if (block_height > tallest_block) {
            return tallest_block = block_height;
        };
    };
});