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

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

       positionFooter();

       function positionFooter() {

                footerHeight = $footer.height();
                //alert($(window).scrollTop() + ">>" + $(window).height());
                footerTop = ($(window).scrollTop()+$(window).height()-footerHeight)+"px";
                //alert($(document.body).height() + ">>" + $(window).height());
               if ( ($(document.body).height()+footerHeight) < $(window).height()) {
                   $footer.css({
                        position: "absolute"
                   }).animate({
                        top: footerTop
                   })
               } else {
                   $footer.css({
                        position: "static"
                   })
               }

       }

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

});
