Added pageload method to dialog.js to reapply event listeners