	Xsn.PasteDialog = function(config){
		
		Xsn.PasteDialog.superclass.constructor.call(this, this.id || Ext.id(), {
            modal: true,
            width: 650,
            height: 400,
            shadow:true,
            autoCreate: {tag: 'form', method:'POST', onSubmit:false},
			title: 'Plakken speciaal',
            animateTarget:null,
	        closable: false,
	        draggable:true,
	        resizable:false,
            collapsible:false,                
            center: {
                titlebar: false,
				autoScroll: false
            }
		});

        this.addKeyListener(27, this.hide, this);
        this.addButton(this.okButtonText || 'Ok', this.onSave, this);
		this.addButton(this.cancelButtonText || 'Annuleer', this.hide, this);

		this.editor = new Xsn.HtmlEditor(this.getLayout().getEl().createChild({tag:'div'}));
	    this.getLayout().add('center', new Ext.ContentPanel(this.editor.getEl(), {resizeEl: this.editor.getIFrame(), autoScroll:false, fitToFrame:true}));
		
	}

	Ext.extend(Xsn.PasteDialog, Ext.LayoutDialog, {
		callback : null,
		
		setHtml : function(html, css){
			this.editor.setHtml(html, css);
		},
		
		getHtml : function(){
			return this.editor.getHtml();			
		},
		
		onSave : function(){
			this.hide();
			if (this.callback) this.callback(this.getHtml());

		},
			
		show: function (callback, src){
		 	this.callback = callback;
		 	Xsn.PasteDialog.superclass.show.call(this, src);
		}
		
	});

