You might be looking at a money pit there. The 17" and I think some 20" iMac 1.8GHz and 2.0GHz G5's had a bad batch of capacitors. I picked up a 17" off of craigslist that had this issue.
If you open up the iMac and look at the capacitors. The bad ones usually look like a scored "X" on the top of them while good ones (from what I've seen) look like a scored "K". Both the logic board and power supply have these issues.
Might I suggest (if you're good with electronics) to change out the capacitors in the power supply and logic board. Even if you buy a new (used) logic board and PSU, they might still have the issue down the line. If you really want to hold onto that iMac, check out this site
http://www.thecapking.com/applg5.html
as well as this site
http://www.instructables.com/id/Imac-G5-DIY-capacitors-repair/