function smoothAnimationHelper (start, end, speed) {
	var self = this;
	var i;
	
	
	this.init = function () {
		var startDistance = 0;
		var _speed = 1;
		while (_speed !== speed) {
			if (_speed < speed) {
				_speed *= 2;
				if (_speed > speed) {
					var clearSpeed = _speed;
					_speed = speed;
				}
			}
			startDistance += _speed
		}
		_speed = 1;
		var state = 0;
		
		
		i = window.setInterval(function () {
			if (state < startDistance) {
				_speed *= 2;
				if (_speed > speed) {
					_speed = speed;
				}
			}
			else if ((end - startDistance) <= state){
				if (clearSpeed > speed)
					_speed = speed;
				else
					_speed = clearSpeed;
				clearSpeed /= 2;
			}
			
			
			state += _speed;
			if (state > end)
				state = end;
			self.onStep(state, _speed);
			
			
			if (state >= end) {
				self.kill();
			}
		}, 30);
	};
	
	this.kill = function () {
		window.clearInterval(i);
		self.onReady();
	};
	
	this.onStep = function (nextValue, __speed) { };
	this.onReady = function () { };
	
	this.init();
}
