If you take the back off the iMac, you can see if it has a small 'watch type' battery. Perhaps this battery is going bad.
I have a similar G5 iMac, only in 20" that I'm having screen problems with, and had the back off it the other night and I remember seeing a PRAM battery mounted on the logic board. Since I've gotten no suggestions to my discussion thread on that topic, I was considering replacing my PRAM battery and see if it would help me. Not sure that it would, but it would be an inexpensive, low risk option to try.