open and close a window in the browser