/*

Sticky Footer jQuery Plugin - It is a bit crude but it works
By Chris Satchell
www.chrissatchell.com

=========================================
PARAMETERS

stickyWrapper (string/REQUIRED): CSS selector of the content you want to protect from the footer (the content you do not want the footer to overlap!)
topBorderSize (number/OPTIONAL): the pixel size of the footers top-border.
footerTopSpacing (number/OPTIONAL): the pixel size of the space you would like to appear between your content and footer.

=========================================
*/

(function($){
	$.fn.stickyFooter = function(object) {  
		var self = this;
		self.getHeight = this.height();
		self.topBorder = (object.topBorderSize != null) ? object.topBorderSize : 0;
		self.topSpacing = (object.footerTopSpacing != null) ? object.footerTopSpacing : 0;
		self.stickyWrapper = object.stickyWrapper;

		$(self.stickyWrapper)
			.wrap("<div class='sticky-wrap'></div>")
			.css({'padding-bottom': (self.getHeight + self.topSpacing) + 'px' });
        
	    return this.each(function() {
	
			$(this).css({
				'margin-top': -(self.getHeight + self.topBorder) + 'px',
				'position': 'relative',
				'clear': 'both'
			});
			
	    });
  	};
})(jQuery);
