dialog.js for dialogbox control

JS core for dialogbox control
Merge pull request #112 from vabatta/patch-3

dialog.js for dialogbox control