
	function TextButton()
	{
	    this.x = 0;
	    this.y = 0;
		this.width = 0;
		this.height = 0;
		this.position = "relative";
		this.name = "";
		this.index = 0;
		this.align = "center";
		this.text = "";
		this.javarun = "";
		this.offcolor = "#000000";
		this.oncolor = "#ff0000";
		this.font = "Arial";
		this.fontsize = 12;
		this.parentDiv = 'myDiv';
	}
	
	TextButton.prototype.BuildMe = function(){

		var txt = document.createElement("div");
		this.htmlelement = txt;
		document.getElementById(this.parentDiv).appendChild(txt);
		this.PaintMe();
	}
	
	TextButton.prototype.PaintMe = function(){
		var divText;
		
		divText = "";
		divText += "<div id='TextButton" + this.index + "' style=\"position:"+this.position+"; left:"+this.x+"px; top:"+this.y+"px; width:"+this.width+"px; height:"+this.height+"px; font-family:"+this.font+"; font-size:"+this.fontsize+"px; text-align:"+this.align+"; \">";
		divText += "<span onclick='myArray[" + this.index + "].OnClick();' style=\"color:"+this.offcolor+";cursor:pointer;\" onMouseOver=\"this.style.color='"+this.oncolor+"'\" onMouseOut=\"this.style.color='"+this.offcolor+"'\">";
		divText += this.text;
		divText += "</div>";
		
		this.htmlelement.innerHTML = divText;
	}
	
	TextButton.prototype.OnClick = function(){
		eventHandler(this.name,"click");
	}

