﻿$(document).ready(function() {

    $(window).resize(function() { setFooterPosition(); });
    $('#show_more_models').click(function() { setFooterPosition(); });

    setFooterPosition();
});
$(window).bind('load', function() {
    setFooterPosition();

});

function setFooterPosition() {
    //console.log($(document).height() + ' / ' + $(window).height() + ' / ' + $('body').height());
    //console.log('moving footer');
    $('#container').css('padding-bottom', '50px');
    var h = Math.max($(window).height(), $('body').height());
    h = Math.max(h, ($('.left').height() + 270)); // +220 voor alles boven linker kolom

    var left = ($('.left').height() + 270);
    var right = ($('.right').height() + 270);
    h = Math.max(left, right);
    h -= 40;
    $('footer.navigation').css({
        position:'absolute',
        top: h + 'px',
        'margin-bottom':0,
        'margin-top':0,
        'width': $('body').width()
    });
}
