function move()
{
  if(!activeImg || !activeImg.parentNode) return;
  var maxX = activeImg.parentNode.offsetWidth - activeImg.offsetWidth;
  var maxY = activeImg.parentNode.offsetHeight - activeImg.offsetHeight;
  var x, y;
  x = isNaN(x = parseInt(activeImg.style.left))?0:x;
  y = isNaN(y = parseInt(activeImg.style.top))?0:y;
    
  x = x + stepX;
  y = y + stepY;

  if(x >= maxX){
    x = maxX;
    stepX = -stepX;
  }
  if(y >= maxY){
    y = maxY;
    stepY = -stepY;
  }
  if(x <= 0){
    x = 0;
    stepX = -stepX;
  }
  if(y <= 0){
    y = 0;
    stepY = -stepY;
  }
  activeImg.style.left = x + "px";
  activeImg.style.top = y + "px";
}
