first version of dialogs.js