If you have a standard apache config, DON'T put your js files in the cgi-bin as the server may try to evaluate them as CGI executables. Instead, what I normally do is make a /js/ directory under the document root, and put them all there, along with a /css/ directory for my stylesheets, etc.
__________ Systems development is like banging your head against a wall...
It's usually very painful, but if you're persistent, you'll get through it.