$(document).ready(function() {
    resize_footer();
});
    
$(window).resize(function(){
    alert(resize);
    resize_footer();
});    
    
function resize_footer() {
    
    if($('#body').height() >= 480) {
        $('#footer').css('position', 'fixed');
        $('#footer').css('bottom', '0');            
        $('#footer').css('margin-top', '0');            
        $('#body').css('margin-bottom', '100px');            
            
    } else {
        $('#footer').css('margin-top', '20px');            
        $('#footer').css('position', 'relative');
        $('#footer').css('bottom', 'auto');                        
        $('#body').css('margin-bottom', '0');            
    }
}  
