Call dijit.Dialog from method?

Hi, I have an action that runs a JavaScript method. In the method, I have the following code:
new dijit.Dialog({title: "apa", style: "width: 800px"});
When running it, dijit.Dialog isn't found, so it returns an exception. How do I load dijit in the context of a method?