var ajaxTimer = new Class({
	Implements: [Options,Events],
	
	options: {
		init: 1000,
		jump: 1000,
		limit: 15000
	},
	
	initialize: function(url,options){
		this.setOptions(options);
		this.url = url;
		this.lastValue = "";
		this.update = this.options.init;
	},
	send: function(){
		var req = new Request({
			async: true,
			method: 'get',
			url: this.url,
			onFailure: function(){
				this.fireEvent('onFailure');
			}.bind(this),
			onRequest: function(){
				this.fireEvent('onRequest');
			
			}.bind(this),
			onComplete: function(response){
				this.fireEvent('onComplete',response);
				if (this.lastValue==response){
					if (this.update<this.options.limit){
						this.update = this.update + this.options.jump;
					}
				}else{
					this.update = this.options.init;
				}
				this.lastValue = response;
				this.timer = setTimeout(function(){this.send();}.bind(this),this.update);
			}.bind(this)
		}).send();
	}
});