Like Phreadee said, there should be a jQuery plugin. If I could impress upon you, from a design aspect, make all of the images the same size. If you do something like what you're wanting, and aren't very careful to do it right, it'll look like a giant pile of ass.