If I understand you correctly, it works in normal window mode, but not in pop-up mode? I didn't see the pop-up part in your original post - is that a requirement? If so, why?
When it breaks, how does it break?
Do you still have the problem with the window not rendering correctly? If so, is...