Well my 400MHz G3 imac had mirroring and the G4 ones could be hacked (ish) with a small app that removed the software restriction, BUT the G3s were hard wired to mirror (Boo!) it took me a lot of digging to find this because i wanted to replace the CRT in my OLD imac G3 with a flat Pannel, but it was not to be.
Current iMacs do screen spanning out of the box (currently writing this on an iMac with a secondary screen).
Most, if not all, G5 iMacs could be patched by an app called Screen Spanning Doctor to support spanning as well as mirroring. I'm not sure the patch has been updated to support Leopard, though, so you'll need to check it out. A quick google for 'screen spanning doctor' should turn up what you need.