function effects()
{
	this.active={};
	this.deactive={};
	
	this.activate=function(el)
	{
		var startcolor=new Array(255,255,255);
		var endcolor=new Array(200,200,200);
		var steps=20;
		var rcompl=Math.floor((startcolor[0]-endcolor[0])/20);
		var gcompl=Math.floor((startcolor[1]-endcolor[1])/20);
		var bcompl=Math.floor((startcolor[2]-endcolor[2])/20);
		
		if(!this.active['startcolor'])
		{
			this.active['startcolor']=startcolor;
			this.active['endcolor']=endcolor;
			this.active['momcolor']=startcolor;
			this.active['steps']=20;
			this.active['el']=el;
			window.setTimeout("core.effects.activate()",15);
		}
		else
		{
			if(this.active['steps']>0)
			{
				if(this.deactive['momcolor'])
				{
					this.deactive['momcolor'][0]+=rcompl;
					this.deactive['momcolor'][1]+=gcompl;
					this.deactive['momcolor'][2]+=bcompl;
					this.deactive['el'].style.background='#'+this.RGB2HTML(this.deactive['momcolor']);
				}
				this.active['steps']--;
				this.active['momcolor'][0]-=rcompl;
				this.active['momcolor'][1]-=gcompl;
				this.active['momcolor'][2]-=bcompl;
				if(!this.active['el'])
				{
					this.active={};
					this.deactive['el'].style.background='#'+this.RGB2HTML(startcolor);
					this.deactive={};
					return;
				}
				this.active['el'].style.background='#'+this.RGB2HTML(this.active['momcolor']);
				window.setTimeout("core.effects.activate()",15);
			}
			else
			{
				this.deactive=this.active;
				this.active={};
			}
		}
	};
	
	this.changebg=function(el)
	{
		var panelstate = el.className.indexOf('hover');
		if(panelstate > 0)
		{
			el.className = el.className.substr(0,panelstate);
		}
		else
		{
			el.className = el.className + 'hover';
		}
	}
	
	this.RGB2HTML=function(color)
	{
		var decColor = new Array(color[2].toString(16),color[1].toString(16),color[0].toString(16));
		decColor[0]=(decColor[0].length<2?"0"+decColor[0]:decColor[0]);
		decColor[1]=(decColor[1].length<2?"0"+decColor[1]:decColor[1]);
		decColor[2]=(decColor[2].length<2?"0"+decColor[2]:decColor[2]);
	    return decColor[0]+decColor[1]+decColor[2];
	}
	
	this.sleep=function(ms){
		var zeit=(new Date()).getTime();
		var stoppZeit=zeit+ms;
		while((new Date()).getTime()<stoppZeit){};
	} 
	
};

