// text.js

//---------------------------------------------------------
function Text(o)
	{
	if (o.parent == undefined) o.parent = document.getElementsByTagName("body")[0];
	
	this.div = document.createElement("div");

	var s = this.div.style;
	if (o.onmousedown != undefined) this.div.onmousedown = o.onmousedown;
	s.position = "absolute";
	s.top = o.top;
	s.left = o.left;
	if (o.height != undefined) s.height = o.height;
	if (o.width != undefined) s.width = o.width;
	
	if (o.color != undefined) s.color = o.color;
	if (o.fontFamily != undefined) s.fontFamily = o.fontFamily;
	if (o.fontSize != undefined) s.fontSize = o.fontSize;
	if (o.fontWeight != undefined) s.fontWeight = o.fontWeight;  // (100-900) 400 is normal
	if (o.textAlign != undefined) s.textAlign = o.textAlign;
	if (o.cursor != undefined) s.cursor = o.cursor;

	if (o.text != undefined) {
		textElem = document.createTextNode(o.text);
		this.div.appendChild(textElem);
	}

	o.parent.appendChild(this.div);
	}

