// 更多栏目  begin
KindEditor.plugin('nsymore', function(K) {
			var self = this, name = 'nsymore',lang = self.lang(name + '.');
			self.plugin.nsymore = {
	            edit : function() {
		            var html = [
			            '<div style="padding:20px;">',
			            //width //height
			            '<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="600" maxlength="4" /> &nbsp; ',
			            '<input type="checkbox" class="ke-inline-block" id="ckbAuto" name="isAuto" title="文字头条、图文翻动、图文滚动、滚动公告、滚动图片链接、文字链接组、列表链接、今日导读、留言本、自定义表单栏目必须设置宽度">&nbsp;自适应 </input> &nbsp; &nbsp; &nbsp;',	
			            '<label style="width:100px;">'+lang.title+'</label>',	
			            '<input type="text" id="keTitle" class="ke-input-text ke-input-number" name="title" value="0" maxlength="4" /> ',            
			            '</div>',
			            '<div class="ke-dialog-row">',
			            '<label style="width:120px;">'+lang.isflag+'</label>',
			            '<select id="isflag" name="isflag">',
				        '<option value="1">' +lang.yes+ '</option>',
				        '<option value="0">' +lang.no+ '</option>',
				        '</select> &nbsp; &nbsp; ',
			            '<label style="width:120px;">'+lang.isnew+'</label>',
			            '<select id="isnew" name="isnew">',
				        '<option value="0">' +lang.no+ '</option>',
				        '<option value="1">' +lang.yes+ '</option>',
				        '</select> &nbsp; ',
				        '</div>',
				        '<div class="ke-dialog-row">',  
				        '<label style="width:120px;">'+lang.ishot+'</label>',
			            '<select id="ishot" name="ishot">',
				        '<option value="0">' +lang.no+ '</option>',
				        '<option value="1">' +lang.yes+ '</option>',
				        '</select> &nbsp; &nbsp; ',
				        '<label style="width:120px;">'+lang.istop+'</label>',
			            '<select id="istop" name="istop">',
				        '<option value="0">' +lang.no+ '</option>',
				        '<option value="1">' +lang.yes+ '</option>',
				        '</select> &nbsp; ',
				        '</div>',
			            '<div class="ke-dialog-row">',
			            '<label style="width:120px;">'+lang.isclick+'</label>',
			            '<select id="isclick" name="isclick">',
				        '<option value="0">' +lang.no+ '</option>',
				        '<option value="1">' +lang.yes+ '</option>',
				        '</select> &nbsp; &nbsp; ',
				        '<label style="width:120px;">'+lang.isdepartment+'</label>',
			            '<select id="isdepartment" name="isdepartment">',
				        '<option value="0">' +lang.no+ '</option>',
				        '<option value="1">' +lang.yes+ '</option>',
				        '</select> &nbsp; ',
				        '</div>',
				        '<div class="ke-dialog-row">',				        
				        '<label style="width:120px;">'+lang.ismore+'</label>',
			            '<select id="ismore" name="ismore">',
				        '<option value="0">' +lang.no+ '</option>',
				        '<option value="1">' +lang.moreTop+ '</option>',
				        '<option value="2">' +lang.moreBottom+ '</option>',
				        '</select> &nbsp; ',
				          '</div>',
			            '<div class="ke-dialog-row">',
				        '<label style="width:120px;">'+lang.istime+'</label>',
			            '<select id="istime" name="istime">',
			             '<option value="6">' +lang.yes6+ '</option>',
				        '<option value="0">' +lang.no+ '</option>',
				        '<option value="1">' +lang.yes1+ '</option>',
				        '<option value="2">' +lang.yes2+ '</option>',
				        '<option value="3">' +lang.yes3+ '</option>',
				        '<option value="4">' +lang.yes4+ '</option>',
				        '<option value="5">' +lang.yes5+ '</option>',
				        '<option value="7">' +lang.yes7+ '</option>',
				        '<option value="8">' +lang.yes8+ '</option>',
				        '<option value="9">' +lang.yes9+ '</option>',
				        '<option value="10">' +lang.yes10+ '</option>',
				        '<option value="11">' +lang.yes11+ '</option>',
				        '<option value="12">' +lang.yes12+ '</option>',
				        '<option value="13">' +lang.yes13+ '</option>',
				        '<option value="14">' +lang.yes14+ '</option>',
				        '<option value="15">' +lang.yes15+ '</option>',
				        '</select> &nbsp; ',
			            '</div>',
			            //更多栏目选择加载
			            '<div class="ke-dialog-row">',
			            '<label style="width:120px;">'+lang.artdesign+'</label>',
			            '<select id="artdesign" name="artdesign">',
				        '<option value="0">' +lang.no+ '</option>',
				        '<option value="1">' +lang.yes+ '</option>',
				        '</select> &nbsp; ',
			           // '<label>'+lang.more+'</label>
			           '<iframe id="d_nsymore" name="d_nsymore" frameborder="0" src="../Wpedt/WpdccEditor/plugins/nsymore/nsyitemmore.aspx" width="100%" height="50px" scrolling="no" ></iframe>',
			            '</div>',
			            '</div>'
		            ].join('');
		            var dialog = self.createDialog({
			            name : name,
			            width : 450,
			            title : self.lang(name),
			            body : html,
			            yesBtn : {
				            name : self.lang('yes'),
				            click : function(e) {
				                var width = widthBox.val(), artdesign = artdesignBox.val(),
        						isflag = isflagBox.val(),//flag
        						isnew = isnewBox.val(),
        						ishot = ishotBox.val(),
        						istop = istopBox.val(),
        						ismore = ismoreBox.val(),
        						isclick = isclickBox.val(),
        						istime = istimeBox.val(),
        						isdepartment = isdepartmentBox.val(),
        						title = titleBox.val();
					            if (!/^\d*$/.test(width)) {
						            alert(self.lang('invalidWidth'));
						            widthBox[0].focus();
						            return;
						            }
						       if (!/^\d*$/.test(title)) {
						            alert(self.lang('invalidTitle'));
						            titleBox[0].focus();
						            return;
					            }
					            
					            var artDesignTemplateId=1;
					            var artDesignTemplateName="";
					            try {
					                artDesignTemplateId = frames['d_nsymore'].myform.d_banner.value;
					                artDesignTemplateName=frames['d_nsymore'].myform.d_banner.options[frames['d_nsymore'].myform.d_banner.selectedIndex].text;//选中栏目的text
                                    
                                }catch(e){
                                    alert("error");
                                }
                                if(isAutoBox[0].checked)
                                {
					                var html = "<button id=\"QXNSY2005\" name=\"201?isArtDesign="+artdesign+"@width=auto@artDesignTemplateId="+artDesignTemplateId+"@en="+isnew+"@eh="+ishot+"@et="+istop+"@em="+ismore+"@ec="+isclick+"@ert="+istime+"@ed="+isdepartment+"@ef="+isflag+"@ti="+title+"\" style=\"WIDTH:auto;\" >"+lang.show+"  "+lang.width+"=auto "+lang.more+"="+artDesignTemplateName+"</button>";                                
                                }
                                else
                                {
					                var html = "<button id=\"QXNSY2005\" name=\"201?isArtDesign="+artdesign+"@width="+width+"@artDesignTemplateId="+artDesignTemplateId+"@en="+isnew+"@eh="+ishot+"@et="+istop+"@em="+ismore+"@ec="+isclick+"@ert="+istime+"@ed="+isdepartment+"@ef="+isflag+"@ti="+title+"\" style=\"WIDTH: "+width+"px;\" >"+lang.show+"  "+lang.width+"="+width+" "+lang.more+"="+artDesignTemplateName+"</button>";
					            }
					            self.insertHtml(html).hideDialog().focus();
				            }
			            }
		            }),
		            div = dialog.div,
		            widthBox = K('[name="width"]', div),
		            artdesignBox = K('[name="artdesign"]', div),
		            isflagBox = K('[name="isflag"]',div),
		            isnewBox = K('[name="isnew"]', div),
		            ishotBox = K('[name="ishot"]', div),
		            istopBox = K('[name="istop"]', div),
		            ismoreBox = K('[name="ismore"]', div),
		            isclickBox = K('[name="isclick"]', div),
		            istimeBox = K('[name="istime"]', div),
		            isdepartmentBox = K('[name="isdepartment"]', div),
		            isAutoBox = K('[name="isAuto"]', div),//自适应宽度参数
		            titleBox=K('[name="title"]',div);
		            //加载右键菜单
		            var img = self.plugin.getSelectedNsymore();
		            
			        if (img) {
				        widthBox.val(K.removeUnit(img.css('width')) ||  0);
				       
				        //读取修改参数
				        var names=img[0].name.split('?');
				        var URLParams = new Object() ;
                        var aParams =names[1].split('@') ;
                        for (i=0 ; i < aParams.length ; i++) {
	                        var aParam = aParams[i].split('=') ;
	                        URLParams[aParam[0]] = aParam[1] ;
	                    }
				        var lsIsArtDesign=URLParams["isArtDesign"];
				        var IsenableFlag=URLParams["ef"];
				        var lsenableNews=URLParams["en"];
				        var lsenableHot=URLParams["eh"];
				        var lsenableTop=URLParams["et"];
				        var lsenableMore=URLParams["em"];
				        var lsenableClick=URLParams["ec"];
				        var lsenableReleaseTime=URLParams["ert"];
				        var lsenableDepartment=URLParams["ed"];
				        var Title=URLParams["ti"];
				        
				        artdesignBox.val(lsIsArtDesign);
				        isflagBox.val(IsenableFlag);
				        isnewBox.val(lsenableNews);
				        ishotBox.val(lsenableHot);
				        istopBox.val(lsenableTop);
				        ismoreBox.val(lsenableMore);
				        isclickBox.val(lsenableClick);
				        istimeBox.val(lsenableReleaseTime);
				        isdepartmentBox.val(lsenableDepartment);
				        titleBox.val(Title);
				       if(URLParams["width"]=="auto")
				       {
				       isAutoBox[0].checked=true;
				       }
			        }
			        widthBox[0].focus();
			        widthBox[0].select();
		            
	            }
	            
            };
	    self.clickToolbar(name, self.plugin.nsymore.edit);
		});

// 更多栏目  end