(function($)
{



	// Add padding to the bottom of the document so it can be scrolled past the footer
	function PadDocument() {
		var paddingRequired = $("." + classModifier).height();
		$("#" + classModifier + "padding").css({ paddingTop: paddingRequired+"px"});
	}
	
	$.fn.constantfooter = function (settings) {
	
		var config = {
			classmodifier: "constantfooter",
			feed: "",
			feedlink: "Read more &raquo;",
			opacity: 0.9,
			showclose: false,
			closebutton: "[x]"
		};
		
		if (settings) {
			$.extend(config, settings);
		}

		return this.each(function () {
			
			classModifier = config.classmodifier;
			
			// Make sure opacity is a number between 0.1 and 1
			var opacity = parseFloat(config.opacity);
			if (opacity > 1) {
				opacity = 1;
			} else if (opacity < 0.1) {
				opacity = 1;
			}


			
			// Hide it
			$(this).hide().addClass(classModifier).css({ position: "fixed", bottom: "0px", left: "0px", width: "100%" })
			
			// If there is a feed, we will replace the footer HTML with the feed
			if (config.feed.length > 0) {
				//$(this).html("xaxasxasx");
			}
			
			// Show a close button if required
			if (config.showclose) {
				$(this).prepend("<div style=\"float: right;\" class=\"" + classModifier + "close\">" + config.closebutton + "</div>");
				$("." + classModifier + "close").css({ cursor: "pointer" });
				$("." + classModifier + "close").click( function () {
					$(this).parent().fadeOut();
					window.clearTimeout(feedTimer);
				});
			}
			


			// Show it
			$(this).fadeTo(1000, opacity);
			
			// Pad the bottom of the document

			
			// Process any feeds

		});
	};
})(jQuery);
