Create modalDialogue.js

Adding current js from master.