What is best way to compress JavaScript?

I used compressor on JavascriptCompressor.com to compress overlib.js and effects.js from scriptaculos and when I used them compressed on my site they didn't worked.

Also I noticed that some compressors just eliminate all spaces, tabs and new lines from text, is that a good way to compress anything?

Is there free program that compress JavaScript?