// Function to position the footer underneath both of the columns.
function positionFooter() {
  
    var maxColumnHeight = 0;
    var staticOffset = 288;
    var twitterHeight = 0;

    // Check if the twitter stream exists and get the height
    if (document.getElementById('twitter_div')) {
      twitterHeight = document.getElementById('twitter_div').offsetHeight
    }

    // Check for the longest column on regular web pages
    if (document.getElementById('the_posts') && 
        document.getElementById('global_navigation')) {
      if ((document.getElementById('the_posts').offsetHeight + twitterHeight) < 
          document.getElementById('global_navigation').offsetHeight) {
        maxColumnHeight = document.getElementById('global_navigation').offsetHeight;
      }
    }
    
    // Check for the longest column on favourite link web page
    if (document.getElementById('favourite_links') && 
        document.getElementById('global_navigation')) {
      if (document.getElementById('favourite_links').offsetHeight < 
          document.getElementById('global_navigation').offsetHeight) {
        maxColumnHeight = document.getElementById('global_navigation').offsetHeight;
      }
    }
                
    // Set the body height if the positioned main navigation column is longest
    if (document.getElementById('content_container') && maxColumnHeight > 0)
    {
      // IE or not IE?
      if (navigator.userAgent && navigator.userAgent.indexOf("MSIE") >= 0)
      {
        document.getElementById('content_container').style.setAttribute('height', 
        maxColumnHeight + 'px');
      }
      else
      {
        document.getElementById('content_container').style.setProperty('height', 
        maxColumnHeight + 'px', null);
      }
    }
    
}
