/*
$(document).ready(function(){
    // need a <div style='clear:both' /> at the end of the wrapper
    $("#wrapper").append("<div style='clear:both' ></div>");
});
*/

// Window load event used just in case window height is dependant upon images
$(window).bind("load", function() {
    
    positionFooter(); 
    
    function positionFooter(){
        if( ($("#wrapper").height() +100 ) < ($(window).scrollTop() + $(window).height())){
            $("#footer").removeClass("footerstick").addClass("footerbottom");
        } else {
            $("#footer").removeClass("footerbottom").addClass("footerstick");
        }
    }
    
    $(window)
        .scroll(positionFooter)
        .resize(positionFooter)
    
});
