How to make an object a child of another object in the middle of an animation

I am making a ninja game and he has a sword on his back. I have an animation that rases his arm to grab the sword and the animation is set to ping pong so it goes back down. My question is how can i script (preferably in Javascript) that when the arm reaches the sword, the sword becomes a child of the arm so when the arm goes back down to his side, the sword comes back with it. If you could show me how to that, that would be great!

Look into Animation Events. Basically you'd write a small script that does that reparenting, and use the event to trigger it.