You might also want to make Popups an object instead of an array, like so:
js code:
var Popups = {}; // empty popups container object
The reason for this is that when you assign an element on a given index, the engine will have to create empty elements for all unassigned indexes before that index. You can see this for yourself with this sample code:
js code:
// Create empty array
var myArray = [];
// Set the 10th element in the array
myArray[9] = "foo";
// Now look what happens
Debug.Trace("Length="+myArray.length);
Debug.Trace("Joined="+myArray.join());
// Output:
// Length=10
// Joined=,,,,,,,,,foo
As you can see, indexes 0 to 8 have to be assigned to undefined before index 9 can be set. We don't need this at all, and when working with big index numbers such as window handles which can range from 0 to 2,147,483,647 this may turn out pretty nasty.
I could be wrong about this though, however I still find using arrays for this case inappropriate. I find it to be better practice to assign to an object property when you only need a collection of items and don't actually need a numbered list. It won't cost you in file size either, since {} takes up as much bytes as [], so why not?