Combine JavaScript onload with namespace
<p>I am using a namespace to hold some functions in JavaScript, all of which I want to run with <code>window.onload</code>. If I do this, everything works as expected:</p>

<pre><code>SiteFn = {};

(function(context) {
    context.firstFn = function() {
        // do stuff
    };
    context.secondFn = function() {
        // do stuff
    };
})(SiteFn);

window.onload = function() {
    SiteFn.firstFn();
    SiteFn.secondFn();
};
</code></pre>

<p>However, when I try to group them into a single <code>init</code> function, it seems to get called <em>before</em> <code>window.onload</code>:</p>

<pre><code>SiteFn = {};

(function(context) {
    context.firstFn = function() {
        // do stuff
    };
    context.secondFn = function() {
        // do stuff
    };
    context.start = function() {
        context.firstFn();
        context.secondFn();
    };
})(SiteFn);

window.onload = SiteFn.start();
</code></pre>

<p>What am I doing wrong?</p>
