// JavaScript Document
$(function(){
    positionFooter(); 
    function positionFooter(){
        if($("#container").height() < $(window).height()){//Without the body height conditional the footer will always stick to the bottom of the window, regardless of the body height, $(document).height() - could be main container/wrapper like $("#main").height() it depend on your code
            $("#footer").css({margin: "0", padding:"0",position: "absolute",top:($(window).scrollTop()+$(window).height()-$("#footer").height())+"px"})
        }   
   }

    $(window).scroll(positionFooter);
    $(window).resize(positionFooter);
	$("#footer").addClass("footer");
});
