I recommend the Minify tool, which merges and reduces all your JS files, so you only need one tag <script src="/min/f=mod1.js,mod2.js,mod3.js" type="text/javascript"></script> .
You can store your JS files, but you want to, even outside the root website, and it does not matter, because they will simply be referenced in the PHP associative array in the Minify groupsConfig.php file. I would recommend this specifically for your situation. For instance:
'js' => array( '//Scripts/Cart/cartScript.js', '//Scripts/tiny_mce/common.js', '//Scripts/weblog.js',
Then your script tag will look like this:
<script src="/min/g=js" type="text/javascript"></script>
After Minify combines and minimizes your code, it will cache it on your server so that subsequent requests get into the cache file, so PHP will not need to be processed. Of course, the main advantage of this tool is that your users only download one JavaScript file from your server instead of having to open multiple http connections to download multiple files, which is usually the main deterrent.
http://code.google.com/p/minify/
source share