// Function to position the footer underneath menu.
function positionFooter() {
  
    var maxColumnHeight = 0;
    var colNames = ['col1', 'col2', 'col3', 'col4']
    var heights = [];

    // Set the column height variables
    if (document.getElementById('col1') && 
        document.getElementById('col2') &&
        document.getElementById('col3') &&
        document.getElementById('col4')) {
      for ( var i=0; i<colNames.length; i++ ) {
        heights[i] = document.getElementById(colNames[i]).offsetHeight;
      }
    }
    
    // Find the longest column
    for ( var i=0; i<heights.length; i++ ) {
      if ( heights[i] > maxColumnHeight ) {
        maxColumnHeight = heights[i];
      }
    }
    
    // Set the menu height if the positioned main navigation column is longest
    if ( maxColumnHeight > 0 ) {
      // IE or not IE?
      if (navigator.userAgent && navigator.userAgent.indexOf("MSIE") >= 0)
      {
        document.getElementById('secondary_nav').style.setAttribute('height', 
        maxColumnHeight + 'px');
      }
      else
      {
        document.getElementById('secondary_nav').style.setProperty('height', 
        maxColumnHeight + 'px', null);
      }
    }
    
}
