Dialog attaching to document causes problems for reloaded ajax divs

Dialog attaching to document causes problems for reloaded ajax divs

In the jquery-ui-1.7.1 when a dialog is created, it gets appended to the document body (line 4168: uiDialog = (this.uiDialog = $('<div/>')) .appendTo(document.body) ).
This causes problems when the dialog is defined on a page that gets loaded into a div  (within the document body) using ajax because the dialog gets appended to the body which
is 'above' the div, if the ajax div page gets reloaded, multiple identical (same id too) dialogs get created and appended to the containing document body, which causes problems.
There are workarounds, such as to define the dialog in the containing page, but is there a reason why the dialog is always appended to the document body?
- Eric