// 详细标题 #1 begin
KindEditor.plugin('nsytitle', function(K) {
			var self = this, name = 'nsytitle',lang = self.lang(name + '.');
			self.plugin.nsytitle = {
	            edit : function() {
		            var html = [
			            '<div style="padding:20px;">',
			            //width
			            '<div class="ke-dialog-row">',
			            '<label for="keWidth" style="width:30px;">'+lang.width+'</label>',
			            '<input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="500" maxlength="4" /> &nbsp; ',
			            '<input type="checkbox" class="ke-inline-block" id="ckbAuto" name="isAuto" title="图文翻动、图文滚动、滚动公告、滚动图片链接、文字链接组、列表链接、今日导读、留言本、自定义表单栏目必须设置宽度">&nbsp;自适应</input>',			            
			            '</div>',
			            '</div>'
		            ].join('');
		            var dialog = self.createDialog({
			            name : name,
			            width : 220,
			            title : self.lang(name),
			            body : html,
			            yesBtn : {
				            name : self.lang('yes'),
				            click : function(e) {
        						var width = widthBox.val();
					            if (!/^\d*$/.test(width)) {
						            alert(self.lang('invalidWidth'));
						            widthBox[0].focus();
						            return;
					            }
					            if(isAutoBox[0].checked)
					            { 
					                var html = "<button id=\"QXNSY2005\" name=\"101?width=auto\" style=\"WIDTH: auto; "+"\" >"+lang.show+" "+lang.width+"=auto</button>";
					            }
					            else
					            {
					                var html = "<button id=\"QXNSY2005\" name=\"101?width="+width+"\" style=\"WIDTH: "+width+"px; "+"\" >"+lang.show+" "+lang.width+"="+width+"</button>";					            
					            }
					            self.insertHtml(html).hideDialog().focus();
				            }
			            }
		            }),
		            div = dialog.div,
		            widthBox = K('[name="width"]', div);
		            isAutoBox=K('[name="isAuto"]',div);//自适应宽度参数
		            //加载右键菜单
		            var img = self.plugin.getSelectedNsytitle();
		            
			        if (img) {
				        widthBox.val(K.removeUnit(img.css('width')) ||  0);
				        if(img.css('width')=="auto")
				       {
				       isAutoBox[0].checked=true;
				       }
			        }
			        widthBox[0].focus();
			        widthBox[0].select();
		            
	            }
	            
            };
	    //加载控件
	    self.clickToolbar(name, self.plugin.nsytitle.edit);
		});

// 详细标题 #1 end