$(document).ready(function() {

    var total_width = 0;

    var container_height = 0;

    var $sub_footer_links = $('#sub_footer_links');

    var $footer_links = $sub_footer_links.find('div.sub_footer_link');

    $footer_links.each(function() {
        total_width+= $(this).outerWidth();
    });

    var extra_width = Math.floor(($sub_footer_links.width() - total_width) / $footer_links.length);

    $footer_links.each(function() {
        $(this).width($(this).width() + extra_width);
    });

    $sub_footer_links.add('#sub_footer_left').each(function() {

        if ($(this).outerHeight(true) > container_height) {

            container_height = $(this).outerHeight(true);
        }
    });

    $('#sub_footer_top').height(container_height);
});
