Mary, how long ago did you have your logic board / midframe replaced? Some of the early replacements (up to at least early May this year) had issues of their own. See
http://discussions.info.apple.com/webx?linkprocess_@@.68b73a56
There are other things that can cause these problems, of course. You might want to check out
http://docs.info.apple.com/article.html?artnum=106464
So can external devices in some circumstances. USB hubs of particular brands are a common source of issues. Try disconnecting everything except the mouse and keyboard.
But if it hasn't run right for the six months since you purchased it, take it back. The chances are that it needs some serious attention. Your computer has a 12 month hardware warranty, and the "extended repair program" for iMac G5's adds even more time to this.
Cheers
Rod