zul.utl.Timer=zk.$extends(zk.Widget,{_running:!0,_delay:0,$define:{repeats:_zkf=function(){this.desktop&&this._sync()},delay:_zkf,running:_zkf},play:function(){this.setRunning(!0)},stop:function(){this.setRunning(!1)},_sync:function(){this._stop();this._play()},_play:function(){if(this._running){var a=this.proxy(this._tmfn);this._repeats?(this._iid=setInterval(a,this._delay),zAu.onError(this.proxy(this._onErr))):this._tid=setTimeout(a,this._delay)}},_stop:function(){var a=this._iid;a&&(this._iid=
null,clearInterval(a));if(a=this._tid)this._tid=null,clearTimeout(a);zAu.unError(this.proxy(this._onErr))},_onErr:function(a,b){410!=b&&404!=b&&405!=b||this._stop()},_tmfn:function(){this._repeats||(this._running=!1);this.fire("onTimer",null,{ignorable:!0,rtags:{onTimer:1}})},redraw:function(){},bind_:function(){this.$supers(zul.utl.Timer,"bind_",arguments);this._visible=!1;this._running&&this._play()},unbind_:function(){this._stop();this.$supers(zul.utl.Timer,"unbind_",arguments)}});
