implemented new document dialog.