$(window).load(function() {
   $(function(){
	positionFooter(); 
	function positionFooter(){
		if($(document.body).height() < $(window).height()){
			$("#footer").css({width:($(window).width()-16)+"px"})
			$("#footer").css({position: "absolute",top:($(window).scrollTop()+$(window).height()-$("#footer").height()-31)+"px",'z-index':'-100'})
			
		}	
	}
	$(window)
		.scroll(positionFooter)
		.resize(positionFooter)			
});
});

