Do you see the spinning gear at all? If so, try booting in Verbose mode, then you should see text and the last line usually tells you where the boot did hang.
Have you tried to boot from any installation discs? Put a disc in the drive and hold C. If you still have the original disks you could try Apple Hardware Test, boot from that disc.
Also check capacitors, if you have 2004 model it usually fails with capacitors going bad. Open up the case (http://www.macwiki.nl/wiki/Hoe_kan_ik:IMac_G5_schoonmaken) and take a look at capacitors. If you see something like this: http://www.instructables.com/image/F6WK6L2G3TDN8SZ/The-Imac.jpg
Then the caps are bad. Top of the caps should be perfectly flat, even if they bulge just a little they can be faulty, they may also show no external signs... but usually you can see if they have failed. Caps can be replaced and theya are pretty cheap (quality of course varies a lot). Rubycon has been praised as reliable brand for example.