A couple of things, when replying to a post please click Reply in the post you are replying to, otherwise we cannot tell who your communication is directed to.
Second I would recommend running Apple Hardware Test in Extended Mode at least 3 times, if errors appear then you know you have a hardware issue. We cannot always interpret the codes on this forum because Apple does not publish them, however any codes with HDD in them indicate it's the HD. You can also run Disk Utility from the Restore partition on your iMac and run Repair Disk, if errors appear you may be able to repair it. However if errors continue to come up or you cannot even get into the Recovery partition then it's almost certainly the HDD. By the way if you don't know how to access AHT or the Recovery Partion please look over:
http://support.apple.com/kb/HT1509
To restart in recovery, reboot your computer and hold down Command-R after the chime (you can also use the traditional Option-key holddown, which will show all your bootable volumes including Recovery). Before long, the gray linen background appears and the Mac OS X Utilities window pops up