﻿var contentHeightNew;
var contentHeight;
var minScreenHeight = 500;
var doContentResize = true;
var screenHeight;


function setContentArea() {

    $(".content").css({ height: "auto" });

    screenHeight = $(window).height();

    if (screenHeight < minScreenHeight) screenHeight = minScreenHeight;

    contentHeightNew = screenHeight - (contentStart = $(".content").offset().top + 120 - 0);
    contentHeight = $(".content").height();

    if (contentHeight < contentHeightNew) $(".content").css({ height: contentHeightNew + "px", overflow: "hidden" });
}


$(window).resize(function() {
    if (doContentResize) setContentArea();
});

$(document).ready(function() {
    if (doContentResize) setContentArea();
});