Minor corrections in Javascript

1. Stop running animation before starting a new one.
2. Fix ratio in animation
3. Fix div width

None of these change have any visible effect in the current use of
this script. (1) is just being safe, in (2) , the wrongly calculated
value was never used,and in (3), the div was a little too wide before.