Created a DialogBuilder object, but having issues with subscribing/unsubscribing to dialog events
I would refactor it into a plugin that takes the content as an option. Then you will have two instances of "dialog controllers" each with its own events.

Have a look at the "plugin with data" example in the jQuery docs.

http://docs.jquery.com/Plugins/Authoring#Data

You'd set it up like

&lt;div id="addTaskDialog"&gt;&lt;/div&gt;
&lt;div id="addOrderDialog"&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
//...
$("#addTaskDialog").workflowDialog({model:"NewTaskDetailsModel.js"});
$("#addOrderDialog").workflowDialog({model:"NewOrderDetailsModel.js"});
// attach events to either
&lt;/script&gt;


Otherwise I'd switch to $.unbind followed by $.bind in the subscribe functions.