Sprite and Javascript