There are tools available over the net for the process. Try searching for JsMinify and you will find some open source tools which you can use to minify the JS files, they rename most of your long variable names to short meaningless variables. It also increase your websites performance as the JS file size is greatly reduce.
But there is no way that you can encrypt JavaScript to the point that it will be impossible to retrieve. Encrypting it will only make it meaningless to the average user.
You can try Packer (dean.edwards.name/download/#packer) or YUI Compressor (julienlecomte.net/yuicompressor/).
I think there is no point encrypting your js can be easily decrypted, and/or uncompressed by average js developer