I reckon all they've done is create an image map on every swap image. When the mouse rolls over one of the anchors in the image they then swap the image. That's pretty easy to do.
There's a more sophisticated method involving event-capturing and arrays. You put all your images into an array, and, depending on the direction of the mouse movement, the image is swapped for a corresponding one.
It's quite a nce effect, but is it really necessary?