most likely, your iMac has been plagued by the common failing of the motherboards capacitors. this happens alot in imac G5's and may result in no display, freezing and eventually not turning on. hope this helps, you can buy replacement capacitors, and solder them on yourself (some soldering skill required) for more info, you can google it, but there are repair kits on ebay. also, to check, open the back of the computer, check the capacitors on the motherboard, and see if they are damaged or ruptured. here is a link to a picture of bad capacitors:
http://www.jasongraphix.com/static/uploads/bad_capacitors.jpg
if any capacitors are damaged as such, you will need ro replace them to save the computer. of just replace the logic board.