(function(f,g,$,h,j){$.extend(g,{SysfixMgr:g.winApp.getComponent("RSFixSys"),myInit:function(){this.show(600,500,0);this.stopAutoFireCheckbox=true;$("#main table").fixTableHead();this.ayncCheckbox();this.activeDrag(".dialogHead","mousedown").setPageInfo().initMultiCheckbox()},resize:g.commonResize,helper:{checkbox:{}},setPageInfo:function(){var a=this.SysfixMgr.getTrustedList(),html=[],k=0,i=0,n=a.count,listi;for(;i<n;i++){listi=a.getItem(i);html[k++]='<tr id="trb';html[k++]=listi.itemID;html[k++]='s';html[k++]=listi.exceptionID;html[k++]='"><td><p class="uncheck" val="';html[k++]=listi.itemID;html[k++]=',';html[k++]=listi.exceptionID;html[k++]='" id="listp';html[k++]=i;html[k++]='" title="';html[k++]=listi.exceptionName;html[k++]='">';html[k++]=listi.exceptionName;html[k++]='</p></td><td class="center" title="';html[k++]=listi.itemName;html[k++]='">';html[k++]=listi.itemName;html[k++]='</td><td class="center">';html[k++]=listi.time;html[k++]='</td></tr>';html.push();this.helper.checkbox['trb'+listi.itemID+'s'+listi.exceptionID]=0}$('#trustInfoList').append(html.join(''));a.count==0&&$('#checkAll').hide();$('#trustBtn').attr('disabled','disabled');return this},cacelTrust:function(a){var b=this.helper.checkbox,items=[];for(var x in b){if(b[x]==2){items[items.length]=x.replace('trb','').replace('s',',');$("#"+x).remove();delete b[x]}}if(items.length>0){this.SysfixMgr.cancelTrust(items.join('|'))}var c=this.SysfixMgr.getTrustedList();c.count==0?($('#checkAll').hide(),$('#trustBtn').attr('disabled','disabled')):($('#checkAll').removeClass('uncheck checke checked').addClass('uncheck'))},snycCheckAll:function(c){var d=this.helper.checkbox,i=0,N=0,M=0,n=0,m=0,css=["uncheck","checke","checked"],doStyle=function(a,b){a.removeClass(css.join(" ")).addClass(css[b])},setVal=c==j?-1:c;for(var x in d){setVal>=0&&(d[x]=setVal);d[x]>=0&&n++;d[x]==2&&m++}doStyle($("#checkAll"),m==0?0:n>m?1:2);$("#trustBtn")[m>0?"enabled":"disabled"]()},initMultiCheckbox:function(){var c=function(a){var b=a.hasClass("checked"),check=2;b?(check=0,a.removeClass("checked").addClass("uncheck")):a.removeClass("checke uncheck").addClass("checked");return check};$("#main").click(function(e){var a=$(e.target),tag=a[0].tagName.toLowerCase(),check,arr,gid,tr,lib=g;if(a[0].id=="checkAll"){check=c(a);arr=check==2?["checked","uncheck"]:["uncheck","checked"];lib.snycCheckAll(check);$("#trustInfoList").find("."+arr[1]).removeClass(arr[1]).addClass(arr[0]);return}a=a.closest("p");if(a.length==0)return;tag=a[0].id.substr(0,5);switch(tag){case"listp":if(!a.is("[class*=check]"))break;if(a[0].disabled)return;check=c(a);lib.helper.checkbox['trb'+a.attr("val").replace(',','s')]=check;lib.snycCheckAll();return}})}});$(function(){g.init()})})(window,Core,jQuery,LangPack);