Making cube a child of an object.

Okay, I have a JavaScript that creates 10x10 cube grid.
All I want is to make those cubes to be child of object that created it.

Also I want to know how to make cube stop being the child of object.

use the transform.parent attribute: http://unity3d.com/support/documentation/ScriptReference/Transform-parent.html