var fadefinish = 0;
var t;
function fade(id,opacityplus,eind)
{
  clearTimeout(t)
  var target = document.getElementById(id,eind);

  target.style.opacity = parseFloat(target.style.opacity)+(opacityplus/100);
  target.style.filter = 'alpha(opacity=' + Math.round((parseFloat(target.style.opacity)*100)+(opacityplus)) + ')';

  if (Math.round(parseFloat(target.style.opacity)*100) != eind)
  {
    t = setTimeout("fade('"+id+"',"+opacityplus+","+eind+")",20);
  }else{
	fadefinish = 1;
  }
}
	

function scroll(id,width,height,widthplus,heightplus)
{
	var redo = 0;
	var target = document.getElementById(id);

	if (parseFloat(target.style.width) < width)
	{
		target.style.width = parseFloat(target.style.width)+widthplus+"px";
		redo = 1;
	}

	if (parseFloat(target.style.height) < height)
	{
		target.style.height = parseFloat(target.style.height)+heightplus+"px";
		redo = 1;
	}
				
	if (redo == 1)
	{
		setTimeout("scroll('"+id+"',"+width+","+height+","+widthplus+","+heightplus+")",20);
	}
}
				
function move(id,x,y,xplus,yplus)
{
	var redo = 0;
	var target = document.getElementById(id);

	if (parseFloat(target.style.left) != x)
	{
		if (x < parseFloat(target.style.left))
		{
			target.style.left = parseFloat(target.style.left)-xplus+"px";
		}
						
		if (x > parseFloat(target.style.left))
		{
			target.style.left = (parseFloat(target.style.left)+xplus)+"px";
		}
		redo=1;
	}
				
	if (parseFloat(target.style.top) != y)
	{
		if (y < parseFloat(target.style.top))
		{
			target.style.top = parseFloat(target.style.top)-yplus+"px";
		}
						
		if (y > parseFloat(target.style.top))
		{
			target.style.top = (parseFloat(target.style.top)+yplus)+"px";
		}
		redo=1;
	}
				
	if (redo == 1)
	{
		setTimeout("move('"+id+"',"+x+","+y+","+xplus+","+yplus+")",20);
	}
}

function delay(functie,tijd)
{
  setTimeout(functie,tijd);
}
				
function backgroundcolor(id,kleur)
{
	document.getElementById(id).style.backgroundColor = kleur;
}
