Replace some 'dialog' code with 'popup'