by setting dialog as a global you will lose the reference if you call this method a second time.

```
// first call
dialog = window.open(xxx)
// second call
dialog = window.open(aaa)
// how do we reference the first instance of the dialog?
```