var resizeTimer;

function resizeBanner() {
    // Get the actual width
    var width = $('#banner').width();

    // Calculate what is out of the visible area
    var outOfBorder = width - 1045;

    // Check if we have corrent number. if not, correct!
    if((outOfBorder % 2) != 0)
        outOfBorder++;
        
    // Now lets divide the margin and resize
    var margin = outOfBorder / 2;
    $('#banner-img').css('margin-left', margin+'px');
    
    // fin
}

function bindResizeBanner() {
    $(window).bind('resize', function() { 
        if(resizeTimer)
            clearTimeout(resizeTimer); 
        
        resizeTimer = setTimeout(resizeBanner, 100);
    });
}
