Is this 'ok' practice in Javascript?
<p>I have a wrapper function in JavaScript that provides some helpful methods for a .Net control embedded in a web page.
In order to enjoy the benefits of intellisense, I'd like to re-wrap the control each time I use the wrapper. (If I wrap it once and set it in a global variable, I lose intellisense the next time I use it in another function - at least in Visual Studio 2008):</p>

<pre><code>function onLoad() {
    var control = new Wrapper(form1.button1);
    control.SetColor("Red");
    // etc.
}

function onButton_Clicked() {
    var control = new Wrapper(form1.button1);
    control.SetBackColor("Blue");
    // etc.
}
</code></pre>

<p>So, to avoid re-creating the wrapper each time for the same control, I first check if it's already been created, and if so return that instance. Below is the pseudo JavaScript code:</p>

<pre><code>function Wrapper(control) {

    var i = Wrapper.Controls.IndexOf(control);
    if (i &gt;-1) { return Wrapper.Wrappers[i] };

    // Init stuff

    Wrapper.Controls.Push(control);
    Wrapper.Wrappers.Push(this);

}

Wrapper.prototype.SetColor = function(color) {}
Wrapper.prototype.SetBackColor = function(color) {}
...

Wrapper.Controls = new Array();
Wrapper.Wrappers = new Array();
</code></pre>

<p>If it is OK to do what I'm doing?  Is there a way to make the static variables, Wrapper.Controls &amp; Wrapper.Wrappers, private?</p>
