function navFollow(id)
{
    var el = $("#" + id).get(0);
    el.cy = 0;
    el.floatIt = function()
        {
            var pY = $(window).scrollTop();
            var parentOffsetY = $(this.offsetParent).offset().top;
            if (pY >= parentOffsetY)
            {
                pY -= parentOffsetY;
            }
            else
            {
                pY = 0;
            }

            this.cy += (pY - this.cy) / 8;
            this.style.top = this.cy + "px";
            setTimeout(function(){el.floatIt()}, 30);
        }

    return el;
}
navFollow("floater").floatIt();