Timer.TIMER_EVENT="timer";function Timer(){var timer=this;var intervalo=0,ativado=false;var execucao;function __Constructor(vIntervalo){setIntervalo(vIntervalo)}this.intervalo=function(vIntervalo){if(vIntervalo==null){return intervalo}setIntervalo(vIntervalo)};this.ativado=function(vAtivado){if(vAtivado==null){return ativado}ativado=Boolean(vAtivado);if(!ativado){execucao=clearTimeout(execucao)}else{if(!execucao){executar()}}};function executar(){if(ativado&&intervalo>0){var evt=new Evento("timer");evt.disparar(timer);execucao=setTimeout(executar,intervalo)}else{execucao=clearTimeout(execucao)}}function setIntervalo(vIntervalo){if(vIntervalo>=0){intervalo=vIntervalo}else{throw new Error("Intervalo invalido!")}}__Constructor.apply(this,arguments)};
