ASPxClientTimer = _aspxCreateClass(ASPxClientControl, {
 constructor: function(name) {
  this.constructor.prototype.constructor.call(this, name);
  this.interval = 60000;
  this.clientEnabled = true;
  this.timerID = -1;
  this.Tick = new ASPxClientEvent();
 }, 
 Initialize: function() {
  if (this.clientEnabled)
   this.Start();     
  this.constructor.prototype.Initialize.call(this);
 },
 GetStateInputElement: function(index){
  return _aspxGetElementById(this.name + "S");
 },  
 Start: function() {  
  this.Stop();
  this.timerID = _aspxSetInterval("aspxTTick(\"" + this.name + "\")", this.interval);
 },
 Stop: function() {   
  if(this.timerID == -1) return;
  this.timerID = _aspxClearInterval(this.timerID);
 }, 
 DoTick: function() {  
  var processOnServer = this.RaiseTick();      
  if(processOnServer)
   this.SendPostBack("TICK");
 }, 
 GetStateString: function(){
  return (this.clientEnabled ? "1" : "0") + ";" + this.interval;
 },
 UpdateState: function() {
  var element = this.GetStateInputElement();
  if (element != null) 
   element.value = this.GetStateString();
 },
 RaiseTick: function() {
  var processOnServer = this.IsServerEventAssigned("Tick");
  if(!this.Tick.IsEmpty()) {
   var args = new ASPxClientProcessingModeEventArgs(processOnServer);
   this.Tick.FireEvent(this, args);
   processOnServer = args.processOnServer;
  }
  return processOnServer;
 },
 GetEnabled: function() {
  return this.clientEnabled;
 },
 SetEnabled: function(enabled) { 
  if (enabled == this.clientEnabled) return;
   if (enabled)
   this.Start();
   else 
   this.Stop();     
   this.clientEnabled = enabled;
   this.UpdateState();
 },
 GetInterval: function() {
  return this.interval;
 },
 SetInterval: function(interval) {
  if (interval < 1) return;
  this.interval = interval; 
  if (this.clientEnabled) {
   this.Stop();
   this.Start();
  }     
  this.UpdateState();
 } 
});
function aspxTTick(name){
 var timer = aspxGetControlCollection().Get(name);
 if(timer != null) timer.DoTick();
}

