Javascript Library Quickstart
<p>I'm trying to build a Javascript library that will provide some functionality for a JQuery Plugin I'm putting together. </p>

<p>I got the following skeleton code from searching online although I'm not quite sure how it all works (I do know it's a closure). I've added my functions via declarations.</p>

<pre><code>(function(window, document, $) {

    function func_1(){
        return 1;
    }

    function func_2(){
        return 2;
    }

})(window, document, jQuery);
</code></pre>

<p>So I put the above code in a separate JS file and then source it in my HTML page, then I run try to run the function like so (Note: I have JQuery set up as well):</p>

<pre><code>&lt;script type="text/javascript"&gt;
        $(document).ready(function() {
            console.log(func_1());
        });
&lt;/script&gt;
</code></pre>

<p>However, I seem to be getting some errors in Firebug (<code>ReferenceError: func_1 is not defined</code>).</p>

<p>I have two questions:</p>

<ol>
<li>How do I call my functions?!</li>
<li>I'd like to be able to call the functions in the following format: <code>className.functionName()</code>. How do I restructure the skeleton code to enable me do this and, say, call my function like this: <code>Device.func_1()</code>?</li>
</ol>

<p>Thanks for your anticipated assistance.</p>
