how to close a stateless form

how to close a stateless form

I have a stateless form that popups up on a condition. one of the buttons is to close the form. it dose not close. what am I missing..

openUrl("#Script:dialog.close", "same window");