function initDialog(dojoDialog) {
	dojoDialog.show = function(){
		// summary:
		//		Display the dialog
		if(this.open){ return; }
		
		// first time we show the dialog, there's some initialization stuff to do			
		if(!this._alreadyInitialized){
			this._setup();
			this._alreadyInitialized=true;
		}
	
		this._modalconnects.push(dojo.connect(window, "onscroll", this, "layout"));
		this._modalconnects.push(dojo.connect(window, "onresize", this, function(){
			// IE gives spurious resize events and can actually get stuck
			// in an infinite loop if we don't ignore them
			var viewport = dijit.getViewport();
			if(!this._oldViewport ||
					viewport.h != this._oldViewport.h ||
					viewport.w != this._oldViewport.w){
				this.layout();
				this._oldViewport = viewport;
			}
		}));
		this._modalconnects.push(dojo.connect(dojo.doc.documentElement, "onkeypress", this, "_onKey"));
	
		dojo.style(this.domNode, {
			visibility:""
		});
		
		if(this._fixSizes){
			dojo.style(this.containerNode, { // reset width and height so that _size():marginBox works correctly
				width:"auto",
				height:"auto"
			});
		}
		
		this.open = true;
		this._onShow(); // lazy load trigger
	
		this._size();
		this._position();
		dijit._underlay.show();

		this._savedFocus = dijit.getFocus(this);
	};

	dojoDialog.hide = function(){
		// summary:
		//		Hide the dialog
	
		// if we haven't been initialized yet then we aren't showing and we can just return		
		if(!this._alreadyInitialized){
			return;
		}

		dojo.style(this.domNode, {
			visibility: "hidden",
			top: "-9999px"
		});

		dijit._underlay.hide();
		
		if (this._scrollConnected){
			this._scrollConnected = false;
		}
		dojo.forEach(this._modalconnects, dojo.disconnect);
		this._modalconnects = [];
		if(this.refocus){
			this.connect(this._fadeOut,"onEnd",dojo.hitch(dijit,"focus",this._savedFocus));
		}
		if(this._relativePosition){
			delete this._relativePosition;	
		}
		this.open = false;
	};
}
	