(function(){function h(a,d,b,c){if(b[c]){var e={};e[a+d]=!0;b[c]=e}}function q(a,d,b){var c=d._cookies,e=function(k){return encodeURIComponent(k).replace(/['()]/g,escape).replace(/\*/g,"%2A").replace(/%(?:7C|60|5E)/g,unescape)};if(a.matches){var f="",g=1;if(zk.mobile){if(m&&n||!m&&!n)l={"-90":!0,90:!0};f=l[window.orientation]?"portrait":"landscape"}else f=jq.innerWidth()>jq.innerHeight()?"landscape":"portrait";window.devicePixelRatio&&(g=window.devicePixelRatio);a=[(new Date).getTimezoneOffset(),
screen.width,screen.height,screen.colorDepth,jq.innerWidth(),jq.innerHeight(),jq.innerX(),jq.innerY(),g.toFixed(1),f,zk.mm.tz.guess(),a.matches,b.substring(16)];d.command(b,{$ZKCLIENTINFO$:a});c.$contains(b)||c.push(b);document.cookie="ZKMatchMedia="+e(c);document.cookie="ZKClientInfo="+e(JSON.stringify(a))}else c.$remove(b),document.cookie="ZKMatchMedia="+e(c)}var p={},r=/ZKMatchMedia=([^;]*)/,l={0:!0,180:!0},m=jq.innerWidth()>jq.innerHeight(),n=l[window.orientation];zk.override(zk.Widget.prototype,
p,{$binder:function(){for(var a=this;a&&!a.$ZKBINDER$;a=a.parent);return a?(a._$binder||(a._$binder=new zkbind.Binder(a,this)),a._$binder):null},$afterCommand:function(a,d){var b=this.$binder();b&&b.$doAfterCommand(a,d)},unbind_:function(){this._$binder&&(this._$binder.destroy(),this._$binder=null);p.unbind_.apply(this,arguments)}});zkbind.$=function(a,d){if(d=zk.Widget.$(a,d))return d.$binder();zk.error("Not found ZK Binder with ["+a+"]")};zkbind.Binder=zk.$extends(zk.Object,{$init:function(a,d){this.$supers("$init",
arguments);this.$view=a;this.$currentTarget=d;this._aftercmd={};this._toDoUnAftercmd={};if(a.$ZKMATCHMEDIA$){var b=[],c=r.exec(document.cookie);c&&(c=c[1])&&(b=decodeURIComponent(c).trim().split(","));this._cookies=b;var e=this;b=[];for(c=0;c<a.$ZKMATCHMEDIA$.length;c++){var f=a.$ZKMATCHMEDIA$[c],g=window.matchMedia(f.substring(16));f=function(k){return function(t){q(t,e,k)}}(f);g.addListener(f);f(g);b.push({mql:g,handler:f})}this._mediaQueryLists=b}},after:function(a,d){!d&&jq.isFunction(a)&&(d=
a,a=this._lastcmd);var b=this._aftercmd[a];b?b.push(d):this._aftercmd[a]=[d];return this},unAfter:function(a,d){for(var b=this._aftercmd[a],c=b?b.length:0;c--;)if(b[c]==d)if(this._processingAfterCommand){var e=this._toDoUnAftercmd[a];e?e.push(d):this._toDoUnAftercmd[a]=[d]}else b.splice(c,1);return this},destroy:function(){this._aftercmd=null;if(null!=this._mediaQueryLists){for(var a=this._mediaQueryLists,d=0;d<a.length;d++)a[d].mql.removeListener(a[d].handler);this._cookies=this._mediaQueryLists=
null}this.$currentTarget=this.$view=null},command:function(a,d,b,c){var e=this.$view;b&&(b.duplicateIgnore&&h("onBindCommand$",a,b,"duplicateIgnore"),b.repeatIgnore&&h("onBindCommand$",a,b,"repeatIgnore"));zAu.send(new zk.Event(e,"onBindCommand$"+a,{cmd:a,args:d},zk.copy({toServer:!0},b)),void 0!=c?c:38);this._lastcmd=a;return this},globalCommand:function(a,d,b,c){var e=this.$view;b&&(b.duplicateIgnore&&h("onBindGlobalCommand$",a,b,"duplicateIgnore"),b.repeatIgnore&&h("onBindGlobalCommand$",a,b,"repeatIgnore"));
zAu.send(new zk.Event(e,"onBindGlobalCommand$"+a,{cmd:a,args:d},zk.copy({toServer:!0},b)),void 0!=c?c:38);this._lastcmd=a;return this},$doAfterCommand:function(a,d){var b=this._aftercmd[a],c=this._toDoUnAftercmd[a];this._processingAfterCommand=!0;for(var e=0,f=b?b.length:0;e<f;e++)b[e].apply(this,[d]);this._processingAfterCommand=!1;e=0;for(f=c?c.length:0;e<f;e++)this.unAfter(a,c[e]);this._toDoUnAftercmd[a]=[]},upload:function(a,d){var b=new FormData,c=new XMLHttpRequest,e=this.$view,f=e._sid?++e._sid:
e._sid=0;b.append("file",d);c.onload=function(){4===this.readyState&&(200===this.status?zAu.send(new zk.Event(e,"onBindCommandUpload$"+a,{cmd:a,sid:f},{toServer:!0})):zk.error(c.statusText))};zk.UploadUtils.ajaxUpload(e,c,b,f)}},{postCommand:function(a,d,b,c,e){(a=zk.Widget.$(a))&&(a=a.$binder())&&a.command(d,b,c,e)},postGlobalCommand:function(a,d,b,c,e){(a=zk.Widget.$(a))&&(a=a.$binder())&&a.globalCommand(d,b,c,e)}})})();
