What iMac is it?
What OS is it?
Does it have a CD tray, Has a Fan, or does it have Slot for the CD, NO Fan.
Obviously something is getting hot.
If the fan fails on an early iMac, it may be possible to have it replaced. On the Slot Loaders, you will have to find the cause of the overheating. It is not unusual for the HD to get hot, especially if it is not the one that shipped with the machine.
Make sure you have nothing blocking any of the vent holes.
Imac freezez up a while after is on, is there a fan inside, because i don't hear it working, and the case is too hot. Ca it be the problem? It freezez even if it is there stand alone.