$(top.document).ready(function () {   
   $(document).click(processAction);
function processAction(e){
    var clicked = e.target;
newDialog("You've Clicked On A Link !")
function newDialog(mytitle){
   var $dialog = $('<div id="myunique"></div>')
        .html("<a href='http://sss.com'>click</a>")
        .dialog({
            autoOpen: false,
            modal: true,
            title: mytitle
        });
    $dialog.dialog('open');
    return false
}
});
The problem I am having is that when I click anywhere in the dialog, a new dialog popups, and it seems to produce several of these in a row.
My goal is: catch all the clicks on page EXCEPT the elements inside the dialog.
 
     
    