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).
Merge pull request #1 from AsadR/patch-1

Reordered onOpen callback trigger