window.addEvent('domready' , function(){
    var ff = document.id('fixiefooter'),
        ftop,
        fheight
        check_scroll = function(){
            var scy = window.getScroll().y,
                siy = window.getSize().y;
            if ( siy + scy - fheight >= ftop ) ff.removeClass('fixed');
            else {
                if ( !ff.hasClass( 'fixed' ) ) ff.addClass('fixed');
            }
        };
    ff.addClass('fixed');
    window.addEvent( 'load' , function(){
        ftop = document.id('footer').getCoordinates().top;
        fheight = ff.getSize().y;
        window.addEvent( 'scroll' , check_scroll );
        check_scroll();
    } );
});

