/*
// Purpose:     Maximize width of footer to achieve nice visual effect
// Requires:    jQuery library
// Author:      Eelco Weijmans, 29 okt 2009
*/


// set default footer width
var default_footer_width = 840;

// add event handlers to ready() and resize() events
$(document).ready(function(){ maximize_footer_width(); });
$(window).resize(function(){ maximize_footer_width(); });


// function to maximize footer to fit in window
function maximize_footer_width() {

  // find left offset of footer
  var footer_left = $("#footer").offset().left;
  
  // find current width of window
  var window_width = $("body").width();
  
  // if the window is wider than the footer, resize the footer
  if((window_width - footer_left) > default_footer_width) {
    $("#footer").width(window_width - footer_left);
  }
}
