Fix for popups in a jquery ui dialog

Here is the PR vs the 1.4.5 branch


Note, I am investigating a similar issue in Firefox, but it happens when clicking and of the toolbar buttons....currently the same fix doesn't seem to help. I will send another PR when I figure it out.