$(document).ready(function()
{
$(\"#create-user\").button().click(function()
{
$(\"#dialog-form\").load(\'test.html\').dialog({ modal:true, });
SimpleModal will automatically bind the close function (using the onclick event) to any element inside the dialog with the simplemodal-close class.
In addition, you can programmatically close the currently opened dialog by calling $.modal.close();
This means: in your closeWindow()-function, you could simply enter the line:
$.modal.close();