It sounds as if you're trying to simply install an older Mac OSX version onto your Mac that's running Mountain Lion (if your profile is correct and you're running 10.8.2). You can't do this if you've booted from your current internal hard drive.
What you need to do is boot from the CD that came with your Mac, and to do this you need to hold down the C key and restart your Mac. Keep holding the C key down until you know you're running from the CD, not your internal drive.
Once you've booted with that CD, you should see a menu at the top. You'll want to choose Utilities, then Disk Utility...then Erase to erase your hard drive. If you're concerned about some sort of computer forensic expert gaining access to data on this drive (even though you erased it) you'll want to choose Security Options and do one pass of zeroes. Note this will take a while, but it would prevent all but the most determined from being able to read any of your old data. If you're a bit paranoid, you can choose a higher level of security, but be aware that the higher secure erase you perform will dramatically increase the time needed to complete it.
Once your disk is properly erased and formatted, you would then simply choose Install OSX from the window on your display to install the version of OSX that came with your iMac.
What you don't want to do is reinstall Mountain Lion using Recovery mode. Doing so will leave Mountain Lion tied to your AppleID...not too helpful for it's new owner.