function CProgress(element_id)
{
	this.element;
	
	this.tid;
	this.enddelay;
	this.startdelay;

	this.shouldhide;

	var ths=this;
	
	this.progress=function(ths)
	{
		if(ths.shouldhide){
			if(ths.enddelay>0){
				ths.enddelay--;
			}
			else{
				ths.element.style.display="none";
				if(ths.tid){
					clearInterval(ths.tid);
					return;
				}
			}
		}
		else{
			
			if(ths.startdelay>0){
				ths.startdelay--;
				return;
			}
			else{
				ths.element.innerHTML="Kérem várjon...";
				ths.element.style.display="block";
			}
		}
		//ths.element.innerHTML=ths.curcolor;
		clienth=window.innerHeight?window.innerHeight:document.documentElement.clientHeight;
		clientw=window.innerWidth?window.innerWidth:document.documentElement.clientWidth;
		x=clientw/2-ths.element.clientWidth/2;
		y=document.documentElement.scrollTop+clienth/2-ths.element.clientHeight/2;
		ths.element.style.top=y+"px";
		ths.element.style.left=+x+"px";
		
	}
	
	this.element=document.getElementById(element_id);
	
	this.enable=function()
	{
		this.startdelay=0;
		if(this.tid){
			clearInterval(this.tid);
		}
		this.shouldhide=false;
		this.tid=setInterval(function(){ths.progress(ths);},100,this.element);
	}
	
	this.disable=function()
	{
		this.shouldhide=true;
		this.enddelay=10;
		this.element.innerHTML="Rendben, termék a kosárban.";
		ths.element.style.display="block";
		
	}
}
