Save selection and scroll position

Seems to works, but really this is just "proof of concept".
And IE doesn't supported. :)
And I test only in Firefox 11.0.

So code should be improved and tested.