Copied YUI prototype from client-side experiment.
snapshot