function Version2BindSelect(a){BindSelect.call(this,a.url,a.selectlist,a.checkdata,{},a.paramsabbr,a.paramsgos,a.encoding,a.separatedcolor);this._operationObj_=a}Version2BindSelect.prototype=new BindSelect;
Version2BindSelect.prototype.AddOption=function(a,b){var e=this._operationObj_;a=a.toLowerCase();var c=document.getElementById(this.SelectList[a].selectid);if(!(!c||c.nodeName.toLowerCase()!="select")){typeof e.beforeChange=="function"&&e.beforeChange(a,this.SelectList[a].selectid,b);this.BindDefaultValue(a);var h=this.SelectList[a];if(b!=null){var f={},g=0;for(var k in b){var d=b[k];d=d.goid;if(!(typeof d=="undefined"||d==null))if(typeof f[d]=="undefined"){f[d]=1;g++}}f={};var p=document.createDocumentFragment(),
q=0,r={};for(k in b){d=b[k];if(d!=null){var l=d[h.value],m=d[h.text];if(a=="master"||a=="producer")m=d.tSpell+" "+m;if(!(l==null||l==""||m==null||m=="")){var n=d.goid;if((a=="master"||a=="producer")&&r[d.tSpell]==null){r[d.tSpell]="";q++}l={value:l,text:m};if((a=="master"||a=="producer")&&q%2==0)l.bgcolor=this.optionBackColor;if(g>=2&&f[n]==null){f[n]=1;n=this.groupOprtionStyle;n.text=d.goname;p.appendChild(DomHelper.createGroupOption(n))}p.appendChild(DomHelper.createOption(l))}}}c.appendChild(p);
f=this.getRelatObjctType(a,1);var i=this;if(f!=null){c.onchange=function(){i.DropDownChange(a,h.value)};this.BindDefaultValue(f)}window.setTimeout(function(j,s,t){return function(){var o=false;if(typeof i.SelectList[j].initValue!="undefined"&&i.SelectList[j].initValue!=null){c.value=i.SelectList[j].initValue;i.SelectList[j].initValue=0;o=true}typeof t.afterChange=="function"&&t.afterChange(j,i.SelectList[j].selectid,b);if(o&&s!=null){o=i.GetValueObject(j);o!=null&&i.BindList(s,o.id)}}}(a,f,e),1)}}};
Version2BindSelect.prototype.getDefaultValue=function(a){if(typeof this.SelectList[a].dvalue!="undefined"&&this.SelectList[a].dvalue!=null)return this.SelectList[a].dvalue;switch(a){case "producer":return{value:"0",text:"\u8bf7\u9009\u62e9\u5382\u5546"};case "master":return{value:"0",text:"\u8bf7\u9009\u62e9\u54c1\u724c"};case "brand":return{value:"0",text:"\u8bf7\u9009\u62e9\u54c1\u724c"};case "serial":return{value:"0",text:"\u8bf7\u9009\u62e9\u7cfb\u5217"};case "cartype":return{value:"0",text:"\u8bf7\u9009\u62e9\u8f66\u6b3e"};
default:return null}};var Version2ButtonOnClick=function(a,b){if(!(typeof a=="undefined"||a==null||typeof b=="undefined"||b==null||typeof b.paramslist=="undefined"||b.paramslist==null)){this._bindSelectObject_=a;this._LinkConfig_=b}};Version2ButtonOnClick.prototype.Init=function(){this._bindSelectObject_.BindList();this.InitClick()};
Version2ButtonOnClick.prototype.InitClick=function(){if(!(typeof this._LinkConfig_=="undefined"||this._LinkConfig_==null||typeof this._LinkConfig_.paramslist=="undefined"||this._LinkConfig_.paramslist==null)){var a=this;for(var b in this._LinkConfig_.paramslist){var e=document.getElementById(b);e&&DomHelper.addEvent(e,this._LinkConfig_.event,function(c){return function(){a.Click(c)}}(b),false)}}};
Version2ButtonOnClick.prototype.BindUrl=function(a,b,e){if(a==null||b==null||e=="")return"";var c=a.url,h=b.GetValueObject(e);if(h==null)return"";var f;for(var g in a)if(g!="url")if(g=="definedparam")for(var k in a[g]){f=new RegExp("@"+k+"@","gi");c=c.replace(f,a[g][k])}else if(g=="parent")c=this.UrlReplace(c,a[g],b,e);else{f=new RegExp("@"+g+"@","gi");var d=h[a[g]];if(!(typeof d=="undefined"||d==null)){d=d.replace(new RegExp("/","gi"),"");c=c.replace(f,d)}}return c};
Version2ButtonOnClick.prototype.UrlReplace=function(a,b,e){if(!(a==""||typeof b=="undefined"||b==null)){for(var c in b){var h=e.GetValueObject(c);for(var f in b[c]){pattern=new RegExp("@"+f+"@","gi");var g=h[b[c][f]];if(!(typeof g=="undefined"||g==null)){if(f=="name")g=g;a=a.replace(pattern,g)}}}return a}};
Version2ButtonOnClick.prototype.Click=function(a){if(a!=""){a=this._LinkConfig_.paramslist[a];if(a!=null){var b="";for(var e in a){if(e=="default"){b=a[e].url;for(var c in a[e].definedparam){pattern=new RegExp("@"+c+"@","gi");b=b.replace(pattern,a[e].definedparam[c])}break}if(!(typeof this._bindSelectObject_=="undefined"||this._bindSelectObject_==null)){var h=this._bindSelectObject_.GetValue(e);if(!(typeof h=="undefined"||parseInt(h)==0)){b=this.BindUrl(a[e],this._bindSelectObject_,e);break}}}if(b!=
"")if(typeof this._LinkConfig_.gotype=="undefined"||this._LinkConfig_.gotype==null||this._LinkConfig_.gotype==1)window.open(b,"","","");else if(this._LinkConfig_.gotype==2)window.location=b;else window.location.replace(b)}}};

