$(function() {
var box = $('#messagelist'); // float-fixed block
var top = box.offset().top - parseFloat(box.css('marginTop').replace(/auto/, 0));
$(window).scroll(function(){
var windowpos = $(window).scrollTop();
if(windowpos < top) {
box.css('position', 'static');
} else {
box.css('position', 'fixed');
box.css('top', 0);
}
});
});