matthewfrey is correct - you cannot repartition free space if it is not a contiguous block. iDefrag is a good choice, Drive Genius is another option. Using Carbon Copy Cloner or SuperDuper to clone the drive out and back is actually the best choice - faster, more efficient, and free. (plus you have a bootable backup, just in case)
asle is also correct in that OS X does not require forced defragmentation of the primary drive under normal operation (unlike Windows). OS X maintains proper fragmentation levels on the boot volume all on its own. In fact, you can make your system run SLOWER by defragging the boot volume!
Repartitioning a drive for Boot Camp is NOT a normal operation, however.
Defragmentation is widely recommended for external volumes used for video data storage - you want large continuous block of free space in order to prevent dropped frames.