//************************************************************************************* 
// File     :   mf_footer_push.js
// Requires :   mf_domLibrary_0.1.js, prototype.js
// Author   :   Kyle Weems (ksw)
// Origin   :   mindfly.com
// Created  :   July 26, 2007
// Modified :   July 26, 2007
// Purpose  :   Ensures that content div is tall enough to make the footer appear at the bottom
//              of the broswer window if the page's content would otherwise be too short.
//*************************************************************************************

function adjustContentHeight()
{
    // Get the heights of the browswer window and footer (for backup purposes).
    var windowHeight = getViewportSize()[1];
    var siHeight = $('footer').offsetHeight;
    // Only make changes to content height if footer actually exists.
    if($('footer'))
    {
        // Expand content's height to fill the broswer window after accounting for the branding and footer's heights.
        var minContentHeight = windowHeight - ($('branding').offsetHeight + $('footer').offsetHeight);
        if($('content').offsetHeight < minContentHeight)
        {
            $('content').style.height = minContentHeight + 'px';
            // Restore footer's height from backup (in case it distorted).
            $('footer').style.height = siHeight + 'px';
        } 
    }
} // end of adjustContentHeight()

addLoadEvent(adjustContentHeight);
addOnresizeEvent(adjustContentHeight);
