// A piece of code from QuirksMode for finding the real position of an object
function findPos(obj)
{
    var curleft = curtop = 0;
    if (obj.offsetParent)
    {
        do
        {
            curleft += obj.offsetLeft;
            curtop += obj.offsetTop;
        }
        while (obj = obj.offsetParent);
    }
    return [curleft,curtop];
}

// Resizes the left column content div so that the CSS looks right
function resizeLeftColumn()
{
    // Step 1: Check that the left content area is present
    var leftColumnContent = $("leftColumnContent");
    if (leftColumnContent)
    {
        // Step 2: This should never happen, but let's check that the footer is there anyway
        var footer = $("footer");
        if (footer)
        {
            // Step 3: Get the top of the left content area and the footer
            var leftColumnContentTop = findPos(leftColumnContent)[1];
            var footerTop = findPos(footer)[1];

            // Step 4: Get the difference in positions between the footer and the left content area
            var neededHeight = footerTop - leftColumnContentTop;

            // Step 5: Resize the left content area to the correct height
            leftColumnContent.style.height = String(neededHeight) + 'px';
        }
    }
}

// Add the function to the window onload
window.onload = resizeLeftColumn;
