Fixed header based on scroll position

I am working on a project that will have a fixed header position based on how far you scroll the page vertically, something like this http://pinterest.com/

Please does anyone have an idea or a plugin for this.

Thanks
P

This smart sticky floating box seems to do the job well.

Thanks, that is exactly what i was looking for, so i guess that it just needs to be applied to the header markup?