(function($){
var target = $('.about_body_index');
var fixed_point = 448;

if (target.size() === 1) {
    var init_top = target.css('top').replace('px', '') / 1;

    var get_side_width = (function (){
        var win = $(window);
        var side_width = 0;

        return function () {
            side_width = win.width() / 1 - 960;
            if (win.width() / 1 > 960) {
                side_width = side_width / 2;
            }
            if (win.scrollLeft() > 0) {
                side_width = side_width + win.scrollLeft();
            }
            return side_width;
        }
    })();

    window.setInterval(function(){
        var curr_distance = $(window).scrollTop();
        
        if ($.browser.msie && $.browser.version / 1 < 7) {
            var new_top = init_top;
            if (curr_distance > fixed_point) {
                var new_top = curr_distance - fixed_point + new_top;
            }
            target.css('top', new_top + 'px');
        } else {
            if (curr_distance > fixed_point) {
                target.css('position', 'fixed');
                target.css('right', get_side_width()+'px');
                target.css('top', '20px');
            } else {
                target.css('position', 'absolute');
                target.css('right', '0px');
                target.css('top', init_top+'px');
            }
        }
    }, 200);
}
})(jQuery);

