$(window).bind("load", function() { 

	   var footerHeight = 0,
		   footerTop = 0,
		   $footer = $("#footer");

	   positionFooter();
	   $("#footer").fadeIn(1200);

	   function positionFooter() {

				footerHeight = $footer.height();
				footerTop = ($(window).scrollTop()+$(window).height()-footerHeight)+"px";

			   if ( $(window).height() > ($(document.body).height()+footerHeight)) {
				   $footer.css({
						position: "absolute"
				   }).css({
						top: footerTop
				   })
			   } else {
				   $footer.css({
						position: "static"
				   })
			   }

	   }

	   $(window)
			   .scroll(positionFooter)
			   .resize(positionFooter)

});
