Are you talking about the web page at http://www.myphysicslab.com/collision.html ?
It already explain in detail how to handle the collision.
May I know what kind of help you need or what you really want to do!