split dialog.js off, deleted unnecessary files