Dialog moveToTop not working

Dialog moveToTop not working


I must be doing something wrong, but it's driving me nuts so hopefully
you guys can help me. I want to check to see if a dialog is open and
if it is it should move it to the top.
var dialogContainer = $j("#my-dialog-container");
if (dialogContainer.length && dialogContainer.dialog("isOpen")) {
dialogContainer.dialog("moveToTop");
}
On the "moveToTop" line, the javascript error I get is
"instance[options] is undefined".