How do I programmatically close a simple_dialog window I'm in D7

I open a simple dialog window with the simple dialog module, and i want to close the dialog programmatically.

I've tried this

// not working !
jQuery('#simple-dialog-container').dialog('close'); 


and this

jQuery(document).find('div.ui-dialog').remove();
jQuery(document).find('div.ui-widget-overlay').remove();
//This seems to work because the window disappears, but I can not open it again.


The X icon on the top-right do this proprely, but i can't catch the action 

Thank you for help
try this code using jquery,

jQuery('#simple-dialog-container').trigger('click'); 


change id/class to anchor.