﻿/* height() does not take padding-top and padding-bottom into account so that's why we add 74px for the mw8 padding.
issue marked as resolved in jQuery vNext but no release yet. */

function resizeMainWrapper() {
    var mw8_bottom = $('#mw8').offset().top + $('#mw8').height() + 74;
    var footer_top = $('#uza_footer').offset().top;
    var filler_hght = footer_top - mw8_bottom;

    // firefox doesn't handle negative or zero heights very well !
    if (filler_hght <= 0)
        filler_hghgt = 1;

    // /*DEBUG*/ $('form').append('<div style="background-color: blue; position: absolute; height: 2pt; width: 2pt; top: ' + mw8_bottom + 'px; left: 10px; z-index: 1000;">.</div>');
    // /*DEBUG*/ $('form').append('<div style="background-color: yellow; position: absolute; height: 2pt; width: 2pt; top: ' + footer_top + 'px; left: 10px; z-index: 1000;">.</div>');
    // /*DEBUG*/ $('#center_filler').css('border', '1pt solid red');

    $('#center_filler').height(filler_hght);
}

$(document).ready(function() {
    resizeMainWrapper();
});

$(window).resize(function() {
    resizeMainWrapper();
});

