// 设为首页 #1 begin
KindEditor.plugin('nsysethomepage', function(K) {
			var self = this, name = 'nsysethomepage',lang = self.lang(name + '.');
			self.plugin.nsysethomepage = {
	            edit : function() {
		            var html = [
			            '<div style="padding:20px;">',
			            //width
			            '<div class="ke-dialog-row">',
			            '<label for="keWidth" style="width:60px;">'+lang.width+'</label>',
			            '<input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="100" maxlength="4" /> ',
			            '</div>',
			            //height
			            '<div class="ke-dialog-row">',
			            '<label for="keHeight" style="width:60px;">'+lang.height + '</label>',
			            '<input type="text" id="keHeight" class="ke-input-text ke-input-number" name="height" value="25" maxlength="4" /> ',
			            '</div>',
			            '</div>'
		            ].join('');
		            var dialog = self.createDialog({
			            name : name,
			            width : 300,
			            title : self.lang(name),
			            body : html,
			            yesBtn : {
				            name : self.lang('yes'),
				            click : function(e) {
        						var width = widthBox.val(),height = heightBox.val();
					            if (!/^\d*$/.test(width)) {
						            alert(self.lang('invalidWidth'));
						            widthBox[0].focus();
						            return;
					            }
					            if (!/^\d*$/.test(height)) {
						            alert(self.lang('invalidHeight'));
						            heightBox[0].focus();
						            return;
					            }
					            var html = "<button id=\"QXNSY2005\" name=\"007?width="+width+"@height="+height+"\" style=\"WIDTH: "+width+"px; HEIGHT: "+height+"px\" >"+lang.show+"</button>";
					            self.insertHtml(html).hideDialog().focus();
				            }
			            }
		            }),
		            div = dialog.div,
		            widthBox = K('[name="width"]', div),
		            heightBox = K('[name="height"]', div);
		            //加载右键菜单
		            var img = self.plugin.getSelectedNsysethomepage();
		            
			        if (img) {
				        widthBox.val(K.removeUnit(img.css('width')) ||  0);
				        heightBox.val(K.removeUnit(img.css('height')) || 0);
			        }
			        widthBox[0].focus();
			        widthBox[0].select();
		            
	            }
	            
            };
	    //加载控件
	    self.clickToolbar(name, self.plugin.nsysethomepage.edit);
		});

// 设为首页 #1 end