// Gaia Ajax Widgets Copyright (C) 2007 - 2008 Gaiaware AS. details at http://ajaxwidgets.com/
Gaia.Timer=Class.create();Object.extend(Gaia.Timer.prototype,Gaia.Control.prototype);Object.extend(Gaia.Timer.prototype,{initialize:function(element,options){this.initializeTimer(element,options);},initializeTimer:function(element,options){this.initializeControl(element,options);Gaia.Control._registeredInvisibleControls.push(this);this.element={id:element};if(this.options.enabled)
this._startTimer();},setEnabled:function(value){var shouldStart=(value==true)&&this.options.enabled!=true;this.options.enabled=value;if(shouldStart)
this._startTimer();return this;},setVisible:function(value){return this;},destroy:function(){this.setEnabled(false);for(var idx=0,length=Gaia.Control._registeredInvisibleControls.length;idx<length;++idx){if(Gaia.Control._registeredInvisibleControls[idx]==this)
break;}
if(idx<length)
Gaia.Control._registeredInvisibleControls.splice(idx,1);Gaia.Control._registeredControls.unset(this.element.id);},setMilliseconds:function(value){this.options.milliseconds=value;return this;},_startTimer:function(){setTimeout(this._tick.bind(this),this.options.milliseconds);},_tick:function(){if(this.options.enabled){Gaia.Control.callControlMethod.bind(this)('TickMethod',null,function(){if(this.options.enabled==true)
this._startTimer();}.bind(this),null,true);}},_getElementPostValue:function(){return'';}});Gaia.Timer.browserFinishedLoading=true;