How do I get a button inside a window to close the window?

In the given Windows sample “Attach Object and Adjust”
[url]http://www.dhtmlx.com/docs/products/dhtmlxWindows/samples/01_init/08_attach_object_adjust.html[/url] how would one code the cancel button to close the window? I have the submit button working submitting the form, but how do I get the cancel button to work?

You may call w1.close() on button click.

Thank you, that works great!