OOP Javascript parent Object method or Object?
<pre><code>var O = {

    elements: {

        main: function() { return jQuery("#main"); },
        footer: function() { return jQuery("#footer"); }
    },

    main: function(html) {

        return (this.elements.main());
    },


    style: {

        setMaincolor: function() {

            // TypeError: Cannot call method 'main' of undefined
            return (this.elements.main());

        }

    }    

};
</code></pre>

<p>so;  I'm  O.style Object parents Objects ????   </p>

<pre><code>O.style.setMaincolor() // TypeError: Cannot call method 'main' of undefined
O.main() // [&lt;div id=​"main"&gt;​&lt;/div&gt;​]
</code></pre>

<p>setMaincolor method return this to O Object </p>
