/*
 * FooterPlace - Simple jQuery plugin for floating footer background into place
 *
 * Copyright (c) 2010 Steven Wiggins
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 */
(function($) {
	$.fn.footerPlace = function() {
		// cache vars
		var $footerTop = $('#footernav'),
			$footerPos = $footerTop.offset().top,
			$footerBottom = $('#bottomRow'),
			$tiled = $('#tiledFooter'),
			pageHeight = $('body').height(),
			docHeight = $('#centeredBody').height();
		// position and size
		$tiled.css({
			top: $footerPos+'px'
		});
		// extend to bottom
		if(pageHeight > docHeight) {
			$footerBottom.css({
				height: +parseInt(pageHeight - docHeight)
			});
		}
	}
})(jQuery);
