External JS file not finding controls, but work with quickwatch
<p>I have the following code in my aspx file:</p>

<pre><code>var blah = "&lt;%= lblErrorsMain.ClientID %&gt;"
</code></pre>

<p>and here is the external js file:</p>

<pre><code>function ShowShowScans2() {
    oWebDialogWindow2 =  document.getElementById(blah);
    oWebDialogWindow2.set_windowState($IG.DialogWindowState.Normal);
    return false;
}
</code></pre>

<p>When the code runs, it always bombs out at the oWebDialogWindow2.set_windowState($IG.DialogWindowState.Normal) that Microsoft JScript runtime error: Unable to get value of the property 'set_windowState': object is null or undefined.
When I break into the code and hover over oWebDialogWindow2, it's null. But, when I open a quickwatch window and do document.getElementById(blah), I get access to the object.  What is going on?</p>
