doRectanglesOverlap function

Detect if two rectangles overlap.