JavaScript and subscribing to Events
<p>I have something like this in a JavaScript control that someone I with (short of asking the guy as he's on holiday)  how does one subscribe to this event. </p>

<pre><code>if(typeof(pnlDialog.onclose) == 'function')
     pnlDialog.onclose();
</code></pre>

<p>I thought it was something like, but havent been successful. </p>

<pre><code>var mycontrol = document.getElementById('myDialog');
mycontrol.attachEvent('onclose', function() 
{
         alert('closed');
});
</code></pre>
