KindEditor.ready(function (K) {
   var editor = K.editor({
     cssPath : '/cneditor/plugins/code/prettify.css',
     uploadJson : '/cneditor/asp/upload_json.asp',
     allowFileManager : true
   });
K('#insertfile').click(function() {
   editor.loadPlugin('image', function() {
     editor.plugin.imageDialog({
	 showRemote : false,
     imageUrl : K('#img').val(),
     clickFn : function(url, title, width, height, border, align) {
        K('#img').val(url);
        editor.hideDialog();
     }
    });
   });
});
});
