//testing
window.onload = function(){new helloWorld();};

/*
 * the helloWorld object!
 */
function helloWorld()
{
	// private vars
	var b, p;
	var cmd, stdout;
	var i;

	// constructor begin
	b = new gui();
	p = new paragraph();
	p.setClass('console');
	p.addText('$ ');
	b.addChild(p);
	cmd = "helloworld.sh";
	stdout = "hello, world";
	i = 0;
	window.setTimeout(play, 2000);
	// constructor end

	// plays through issuing cmd
	function play() {
		if(i<cmd.length) {
			p.addText(cmd.charAt(i));
			i++;
			window.setTimeout(play, 250);
		} else {
			p.addChild(new br());
			p.addText(stdout);
			p.addChild(new br());
			p.addText('$');
		}
	}
}

