encapsulating javascript inside a namespace
<p>I'm looking to encapsulate my javascript inside a namespace like this:</p>

<pre><code>MySpace = {

   SomeGlobal : 1,
   A: function () { ... }, 
   B: function () { ....; MySpace.A(); .... },
   C: function () { MySpace.SomeGlobal = 2;.... }
}
</code></pre>

<p>Now imagine that instead of a few lines of code, I have about 12K lines of javascript with hundreds of functions and about 60 globals. I already know how to convert my code into a namespace but I'm wondering if there's a quicker way of doing it than going down 12K lines of code and adding <code>MySpace.</code> all over the place.</p>

<p>Please let me know if there's a faster way of doing this.
Thanks for your suggestions.</p>
