Javascript tree animation