﻿$(document).ready(function () {

    $(window).bind('resize', function () {

        var topNavWidth = parseInt($('#top-navigation').css('width'));

        // Calculate the "white-space" area surrounding the content area
        var outsideDesign = $(window).width() - topNavWidth;

        // Retrieve the current page's left bleed content section's width
        var contentWidth = parseInt($('#left-bleed-content').css('width'));

        // If there is no white space, or browser window is very small, force minimal padding
        if (outsideDesign <= 0) {
            $('#left-bleed').css('padding-right', contentWidth + 'px');
        }
        // If there is white space area, pad the bleed area to compensate
        if (outsideDesign > 0) {
            $('#left-bleed').css('padding-right', (outsideDesign / 2 + contentWidth) + 'px');
        }
        $('#banner-content').css('left', $('#left-bleed').outerWidth());

    });

    $(window).trigger('resize');

});

