Create dialog.js

Main javascript file for dialog.