If it's still under warranty, take it into Apple. Your iMac is the same one I have and I recently had to take it in twice in a four month period for a problem with the capacitors bulging. It should be covered under this program:
http://docs.info.apple.com/article.html?artnum=302181
I know that you're under warranty, but even for those under warranty and not within the range of serial numbers, Apple is replacing the components free of charge under this program because the problem has been rampant with all of the iMac G5 systems.