﻿$jq(window).load(function () {
    var containerHeight = $jq('#ContentContainerBody').offset().top + $jq('#ContentContainerBody').outerHeight(true);
    var windowHeight = $jq(window).height() - $jq('#FooterContentContainer').outerHeight(true);
    $jq('#FooterContentContainer').css('left', 0); //IE Fix
    //Place footer at bottom of page or below content
    if (containerHeight < windowHeight) {
        $jq('#FooterContentContainer').css('top', windowHeight);
    } else {
        $jq('#FooterContentContainer').css('top', containerHeight);
    }
    $jq('#FooterContentContainer').css('position', 'absolute');
    $jq('#FooterContentContainer').css('visibility', 'visible');
});

$jq(window).resize(function () {
    var containerHeight = $jq('#ContentContainerBody').offset().top + $jq('#ContentContainerBody').outerHeight(true);
    var windowHeight = $jq(window).height() - $jq('#FooterContentContainer').outerHeight(true);
    if (containerHeight < windowHeight) {
        $jq('#FooterContentContainer').css('top', windowHeight);
    } else {
        $jq('#FooterContentContainer').css('top', containerHeight);
    }
});
