var 分类={};分类.分类选择={"元素":{"主窗体":null},"创建窗口":function(a){var b=new Boxy(this.返回Html({"关闭函数":function(){b.hide()},"回调函数":function(c){a=a||null;a!=null&&a(c);b.hide()},"点击分类":function(){$(分类.分类选择.元素.主窗体).parent().animate({scrollLeft:$(分类.分类选择.元素.主窗体).parent().scrollLeft()*1+160+"px"},300)},"关闭按钮":true}),{modal:true,afterHide:function(){$(b.boxy).remove()},draggable:false,innerStyle:"width:450px;height:220px;overflow-x:auto; white-space:nowrap;position:relative;",title:"选择分类"})},"获取分类列表":function(a){a=a||null;var b;if(a==null)b="";else b=$(a).val();$.ajax({url:"/feileiguanli/huoqufenleiliebiao",type:"POST",data:"feilei="+b,id:a,success:function(f){var d=0,c=[],e=false,a;if(this.id==null){a=$(分类.分类选择.元素.主窗体);$(分类.分类选择.主窗体).each(function(){if($("select",this).length==0)a=$(this)})}else a=$(this.id).parent().parent().parent();c[d++]='<div><select onchange="分类.分类选择.获取分类列表(this);" size="11">';if(b!="")c[d++]='<option selected="selected" value="null" >不选</option>';var j=0;for(var g in f)if(!isNaN(g)){j++;c[d++]="<option ";if(!e&&this.id==null)c[d++]='selected="selected"';c[d++]=' value="'+f[g].分类名称+'">'+f[g].分类名称+"</option>";e=true}c[d++]="</select></div>";this.id!=null&&$(this.id).parent().nextAll().remove();e&&$(".feileilist",a).append(c.join(""));if(this.id==null)if(j==0){$(".btn",a).html("没有分类，请先去<a href='/feileiguanli/index' target='blank'>添加分类</a>");return}else{分类.分类选择.获取分类列表($("select",a).last());var h=[],k=0;h[k++]='<span class="btn1"><span class="bgFFF"><input value="确定" type="button" onclick="分类.分类选择.确定();"/></span></span>';if(分类.分类选择.关闭按钮)h[k++]='<span style="width:40px;display:inline-block;"></span><span class="btn2"><span class="bgFFF"><input value="关闭" type="button" onclick="分类.分类选择.关闭();"/></span></span>';$(".btn",a).html(h.join())}var i=$("select",a).last().parent().position().left*1-5;if(i<0)i=155;$(".btn",a).width(i+"px");分类.分类选择.点击分类!=null&&分类.分类选择.点击分类()}})},"确定":function(c){var a=[],b=this.元素.主窗体;if(c!=null)b=c;$(".feileilist select",$(b)).each(function(b){if($(this).val()!="null")a[b]=$(this).val()});this.回调函数!=null&&this.回调函数(a);this.关闭();return a},"关闭":function(){if(this.关闭函数!=null){$(this.元素.主窗体).remove();this.关闭函数()}this.关闭函数=null;this.回调函数=null},"关闭函数":null,"回调函数":null,"点击分类":null,"返回Html":function(a){var b=[],c=0;a=a||{};this.关闭函数=a.关闭函数||null;this.回调函数=a.回调函数||null;this.点击分类=a.点击分类||null;this.关闭按钮=a.关闭按钮||false;b[c++]='<div class="xuanzefeilei"><div class="feileilist"></div><div class="btn">';b[c++]="</div></div>";this.元素.主窗体=$(b.join(""));this.元素.主窗体.parent().ready(function(){分类.分类选择.获取分类列表(null)});return this.元素.主窗体}}