How do I access the outer property from inside?
<p>Hi I am trying to emulate a bookcase. My problem is how to access this.MAX_WIDTH from inside object method Add()... ??? :-( how?</p>

<pre><code>function bookCase(){
    this.bcname="new Book Case 1";
    this.showName=function(){return this.name;}
    this.MAX_WIDTH=50;      // 0 for unlimited :-)
    this.MAX_HEIGHT=0;      // Unlimited by default :-)
    this.MAX_SHELVES=0;         // Unlimited No. of Shelves by Default :-)
    this.currrWidth = 0;        // Nothing Kept Yet :-)
    this.currrHeight= 0;        // Nothing Kept Yet :-)
    this.currWidth=0;   


    this.showCapacity = function(MW,MH,MS){
                        var ReturnVal="";
                        if(MW){    if(ReturnVal!="")
                            {
                                ReturnVal =","+ ReturnVal + this.MAX_WIDTH;

                             } else {
                                    ReturnVal = ReturnVal + this.MAX_WIDTH;

                                }
                        }
                        if(MH){    if(ReturnVal!="")
                            {
                                ReturnVal = ReturnVal + "," + this.MAX_HEIGHT;
                             } else {ReturnVal = ReturnVal + this.MAX_HEIGHT;}
                        }
                        if(MS){    if(ReturnVal!="")
                            {
                                ReturnVal = ReturnVal + "," + this.MAX_SHELVES;
                             } else {ReturnVal = ReturnVal + this.MAX_SHELVES;}
                        }
                        if(!MW&amp;&amp;!MH&amp;&amp;!MS){return this.MAX_WIDTH + "," + this.MAX_HEIGHT + "," + this.MAX_SHELVES;}

                        return ReturnVal;
                    }
    this.shelf =
    {
        books : new Array(),
        book : 
        {
            add : function(Place,Width)
            {
                if(window.bookCase.MAX_WIDTH &gt; Width)
                {
                    this.books[Place]=Width; alert("book Added");
                }
                else {alert("No Space In BookShelf: Max Width is "+window.bookCase.MAX_WIDTH); alert(window.bookCase.bcname);}

            }
        }


    }

}

var bookStack = new Array();
    bookStack[0] = 10;
    bookStack[1] = 20;
/*  bookStack[2] = 20;
    bookStack[3] = 10;
    bookStack[4] = 10;
    bookStack[5] = 10;
    bookStack[6] = 10;
    bookStack[7] = 10;
    bookStack[8] = 10;
    bookStack[9] = 10;
    bookStack[10] = 10;

*/
var foo = new bookCase;
var LC =0;

for(LC=0;LC&lt;=bookStack.length;LC++)
{
    foo.shelf.book.add(LC,bookStack[LC]);
}
</code></pre>
