// JavaScript Document
$(window).bind("load", function() { 
       var footerHeight = 0,
           footerTop = 0,
           $footer = $(".footer");
		   $container = $(".contents");
		   contentHeight = $(window).height()-$(document.body).height()+$footer.height()+30;
       positionFooter();

       function positionFooter() {

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

               if ( ($(document.body).height()+footerHeight) < $(window).height()) {
                   $footer.css({
                        position: "absolute"
                   }).animate({
                        top: footerTop
                   })  
				   $container.css("height",contentHeight)
               }
       }
       $(window)
               .scroll(positionFooter)
               .resize(positionFooter)
});
