How to find a dialog without using an id

How to find a dialog without using an id


Hi Guys :)
I've noticed that in the process of jQuery UI creating and marking up
dialogs,
it changes the structure of the document, placing the new dialogs at
the
bottom of the body. This is giving me grief because I don't use id's
on
these dialogs, and when I need to provide a selector to attach the
behaviour
to open the dialog to the link, I can't find my dialog, which is
referenced
relatively.
$('#results .versionDialog').dialog({
autoOpen: false,
width: 600
});
$('#results .dialogLink').click(function(e){
$(this).parent().parent().find('.versionDialog').dialog('open');
return false;
});