NEW detachWindow procedure to detach the initial popup