Adding method for computig new sizes

On button click update measures and put them into cookies and reselect
the last selected document