Reordered onOpen callback trigger

In a popup, if we set focus on an object in the onOpen handler,
we lose focus in the open() call due to the call to appendTo (line
114).