A jQuery UI Dialog question

A jQuery UI Dialog question

I use several Dialogs on my app, for several different stuff. Everything is working fine.
The only question I have is how can I close all the dialogs at once ??

  1. $(".ui-dialog").each(function(){ $(this).dialog("close"); });

Is not working

  1. $(".ui-dialog").each(function(){ $(this).dialog("destroy").remove(); });

Works but when I open again the little Dialog I have with an input select with a change handler binded, it doesn't work, the change handler I mean.

So any clues ??
Thanks in advance !!!