//////////////////////////////////////////////////////
//  StepperClass
//////////////////////////////////////////////////////
function steperClass(){
	this.timerID = undefined;
	this.timeItems = new Array();
	this.name = "";
	this.running = false;
	this.waitTime = 5;
}

	steperClass.prototype.addItem=function(newItem){
		this.timeItems.push(newItem)
	}

	steperClass.prototype.clear=function(){
		this.stop()
		clearTimeout(this.timerID);
		this.timeItems.length = 0;
	}
	steperClass.prototype.stop=function(){
		this.running = false
	}

	steperClass.prototype.start=function(){
		this.running = true;
		this.tick();
	}

	steperClass.prototype.tick=function(){
	var again = false;
		this.timerID  = setTimeout(this.name + ".tick()", this.waitTime);
		for (var i = 0; i < this.timeItems.length; i++)
		{
		  if (this.timeItems[i].timeTick())
			again = true;
		}

		if((again == false)||(this.running == false)){
			clearTimeout(this.timerID)
		}
	};

//////////////////////////////////////////////////////
