Adding collision to this gravity code

I have a move that has a bunch of boxes that drop into the screen and bounce with a little gravity at the bottom of the window.

for (i=0; i<4; i++) {
 var clip:MovieClip = attachMovie("circle", "circle"+i, getNextHighestDepth());
 clip._x =i*randRange(0, 600)
 clip._y = i*randRange(-200,-600)
 clip.xspeed = 30;
 clip.yspeed = 30;
 clip.bottomedge = 600;
 clip.leftedge = 0;
 clip.rightedge = 1000;
 clip.gravity = 6;
 clip.drag = .95;
 clip.bounce = .8;
 clip.onEnterFrame = function() {
  with (this) {
   _x += xspeed;
   _y += yspeed;
   if (_x+_width/2>rightedge) {
    _x = rightedge-_width/2;
    xspeed = -xspeed*bounce;
   }
   if (_x-_width/2<leftedge) {
    _x = leftedge+_width/2;
    xspeed = -xspeed*bounce;
   }
   if (_y+_height/2>bottomedge) {
    _y = bottomedge-_height/2;
    yspeed = -yspeed*bounce;
   }
   xspeed = xspeed*drag;
   yspeed = yspeed*drag+gravity;
  }
 };
}

I’m having some issues getting the collision built in and am not really looking forward to starting from scratch, anybody have any ingenious ideas?
[whisper]Canadian?:Dhisper]