CKEDITOR.plugins.add( 'embedpicture', {
    requires: 'widget',
    icons: 'embedpicture',
    init: function( editor ) {
   	 	CKEDITOR.document.appendStyleSheet(this.path + "css/embedpicture.css");
        CKEDITOR.dialog.add( 'embedpicture', this.path + 'dialogs/embedpicture.js' );
        CKEDITOR.dialog.add( 'formplugin', this.path + 'dialogs/jquery.form.min.js' );
        editor.widgets.add( 'embedpicture', {
            button: 'Embed picture',
            template:
                '<div class="embedpicture"></div>',
            parts: {	pictureblock: 'div.embedpicture'	},
            requiredContent: 'div(embedpicture)',
            dialog: 'embedpicture',
            upcast: function( element ) {
                return element.name == 'div' && element.hasClass( 'embedpicture' );
            },
            allowedContent: '*',
            init: function() {
				this.setData('pictureblock', this.data.pictureblock);
            },
            data: function() {
            	if (this.data.pictureblock!=undefined)
            	{	this.parts.pictureblock.setHtml(this.data.pictureblock);  	}
            }
        } );
    }
} );