Detect Collision between 2 objects

Hello,

I have two moving cubes with attached box collider and rigidbody. I want to detect the collider when they touch each other and run a script to stop moving.

Any help would be highly appreciated.

http://unity3d.com/support/documentation/ScriptReference/Collider.OnCollisionEnter.html

function OnCollisionEnter (collision : Collision) {
    rigidbody.Sleep();
    collision.rigidbody.Sleep();
}

Make it more complex if necessary. I assume you need to check to see if the cubes are what collided, but you haven't specified.