Added a function to position the dialogs.