There is a handy piece of code to close other pop ups as the current one is opened.

Undocumented-and-advanced-features
item #10