I don't think, that they just compare the mouse coordinates to every object boundaries in the DOM tree.
Unfortunately didn't find anything on Google, so I'll try here :)
Eine Methode ist z.b. das http://en.wikipedia.org/wiki/Bounding_volume_hierarchy
Struppi.