It might be your video card or faulty RAM, actually. I'm surprised no one has mentioned this.
A while ago my power supply caught on fire
and it burned a whole bunch of stuff like my motherboard etc. My video card still worked but would cause my computer to freeze up a lot, especially when I looked at flash etc. However, a lot of the time it would freeze up for no apparent reason. Buying a new video card fixed the problem.
Video cards aren't extremely cheap but, depending on how old yours is, I'd bet that was the problem. If not, I'd say it's most likely RAM.
Your faulty CD-ROM should have nothing to do with this. If your computer doesn't recognize it, it won't do anything except not work. It isn't imperative to the operation of your other computer peripherals. As someone previously mentioned, it could be bad blocks on your harddrive but they tend to give more signals before the crap out and you said scandisk showed no problems.