javascript variable variable names and global scope (pinesnotify)
<p>I'm using pines notify (somewhat irrelevant to my issue, I imagine) to create notifications on the change event of a drop down list. On the server side, the change is saved to a database, then when the save is complete - I wish to remove the notification (or do something else depending on the result).</p>

<p>The problem is in creating the notification object in a way that I can later reference it (to remove it).</p>

<p>My intended solution would obtain the id of the dropdownlist, prepend 'pn' to it and use that as the variable name, much like</p>

<pre><code>var pnid = 'pn' + $('#mydropdown').attr('id');
notifications[pnid] = createNotification();
</code></pre>

<p>In the codebehind I can create javascript code knowing what the notification object will be called.  However I'm struggling with my 'notifications' object.. I've tried this[notifications], window[notifications] etc. to no avail (ie I cannot later reference this object to interact with it) . I'm creating that object outside of any functions like so</p>

<pre><code>var notifications = {};
</code></pre>

<p>Am I going about this the completely wrong way?</p>
