Splitting code in to multiple files for easier management
<p>I am currently using jQuery to write an online application, that started off with a couple of lines of code, and have quickly now become over a 1000 lines.</p>

<p>My code's structure is simple. I have a window.load which wraps my javascript, and inside it I start adding my click event handlers, and the various functions that makeup my application.</p>

<pre><code>$(window).load(function(){
   // Code goes here...
});
</code></pre>

<p>My code functions can definitely be grouped into categories; e.g. 5 functions perform animation, 12 are event handlers, etc.</p>

<p>I would like to group the functions in their own js files, and import them individually. I can later use my CMS engine to concatenate and compress the files on the fly.</p>

<p>What is the best way in doing so. I am thinking that maybe I can give some of my functions their own namespace for further clarity; e.g. all animation functions are prefixed with ANIMATION - ANIMATION.moveDiv1(), ANIMATION.moveDiv2, MYEVENT.div1Clicked, etc.</p>
