NEWS FLASH! IT CAN'T BE DONE! Here's the link to encode source code:
http://www.dynamicdrive.com/dynamicindex9/encrypter.htm
but, it can be decoded at the same page. The problem is, the browser needs to be able to read the code. You can't encrypt the code and have it decoded server-side because HTML is never served live. It's always downloaded and cached and read from cache.
So, in conclusion: Forget about ecrypting your source.