﻿
//$(window).resize(function () { resizeSideBar(); });
$(window).load(function () { resizeSideBar(); });
var width = 1;

function resizeSideBar() {

    var sideBar = $('#sideContent');

    // Is side bar is on this page?
    if (sideBar.length) {

        // Grab the height of the parent element
        var height = $('#mainContent').height();
        var minHeight = 500;

        if (height > minHeight) {
            // Set the height of the sideBar to be the 
            sideBar.height(height);
        }
        else {
            // Enforce the min height
            sideBar.height(minHeight);
        }

       width = width * -1;
       sideBar.css("margin-left", (parseInt(sideBar.css("margin-left").replace("px","")) - width) + 'px');
       sideBar.width(sideBar.width() + width);
       

    }
}

