Before you panic -- the white iMac G5s were prone to a power supply failure problem and Apple had an extended warranty programme for some of them. If your particular Apple place can't tell you more about it, then take it to an independent Apple Authorized service place for an estimate and ask them.
This is the most sensible thing to follow up on. Our iMac G5 (first generation) had the power supply crap out twice. It's on the third one. Symptoms are any of the following:
1. You come back after a while and find the computer off when you know you left it on.
2. Shuts off by itself with no warning for no apparent reason while using it
3. #1 and 2 start happening at more frequent intervals
4. Shuts off and never turns back on
There may or may not be an acrid electronic smell or smoke coming from the computer vents. On both occasions we actually heard a cap burst in the iMac G5 about a day or two before the problems started happening. We had no smells or smoking, but apple fixed the first one at 13-14 months, and the second when it was around 3 years old. It was eligible for the extended PS repair program.