$(function(){
	positionFooter(); 
	function positionFooter(){
		if($(document.body).height() < $(window).height()){
			$("#footer").css({position: "absolute",top:($(window).scrollTop()+$(window).height()-$("#footer").height())+"px"})
		}	
	}
 
	$(window)
		.scroll(positionFooter)
		.resize(positionFooter)
});