/* 
This class makes the box animation that starts out as a line and then goes out 
it can be used one at a time
*/

function Box(namer, speed, width, height, incr, text)
{
	var x = 10;
	var y = 10;
	var width = width;
	var height = height;
	var name = namer;
	var speed = speed;
	var initID = 0;
	var increment = incr;
	var text = text;
	
	function growOut()
	{
		var box = document.getElementById(name);
		if(x < width)
		{
			x += incr;
			box.style.width = x + "px";
		}
		else if(y < height)
		{
			y += incr;
			box.style.height = y + 'px';
		}
		else
		{
			if(text)
				box.innerHTML = text;
			clearInterval(initID);
		}
	}
		
	this.makeItGrow = function()
	{
		document.getElementById(name).innerHTML = "";
		document.getElementById(name).style.width = 10 + "px";
		document.getElementById(name).style.height = 10 + "px";
		initID = setInterval(growOut, speed);
	}
	this.stopGrowth = function()
	{
		x = 10;
		y = 10;
		clearInterval(initID);	
	}
	this.changeText = function(textr)
	{
		text = textr;
	}
		
}


