Implementing JS animation of the Sliding Windown Protocol