$(document).ready(function(){
	
	$('.top').click(function(){
			$('html, body').animate({scrollTop:0}, 'slow');
		});
		
		positionFooter(); 
			function positionFooter(){
				if($(document.body).height() < $(window).height()){
					$("#footer").css({position: "absolute",top:($(window).scrollTop()+$(window).height()-$("#footer").height())+"px"})
				}	
			}

			$(window).resize(positionFooter);
		
});

