Error 21 is described as "unknown boot error", which isn't very helpful for you. Error 18 indicates that the kernel it's trying to load is an invalid format, which would suggest to me that the file is corrupted.
My best guess at this point is that you might have physical problems with the RAM or Hard drive. You can diagnose this using the Ubuntu CD.
RAM: Boot to the CD and select "test memory" from the initial menu.
Hard drive: Boot the CD all the way to the desktop. Open a terminal window and enter this command:
That should tell you if you have bad sectors on the hard drive and how many.
sudo badblocks -v /dev/sda
Let us know what you discover.