
	function TextCaption()
	{
	    this.x = 0;
	    this.y = 0;
		this.width = 0;
		this.height = 0;
		this.position = "relative";
		this.name = "";
		this.index = 0;
		this.align = "left";
		this.text = "";
		this.forecolor = "#000000";
		this.font = "Arial";
		this.fontsize = 12;
		this.parentDiv = 'myDiv';
		this.cursor = "default";
	}
	
	TextCaption.prototype.BuildMe = function(){

		var txt = document.createElement("div");
		this.htmlelement = txt;
		document.getElementById(this.parentDiv).appendChild(txt);
		this.PaintMe();
	}
	
	TextCaption.prototype.PaintMe = function(){
		var divText;
		this.contentDiv = "TextCaption" + this.index;
		divText = "<div id='TextCaption" + this.index + "' ";
		divText += "onclick='myArray[" + this.index + "].OnClick();' ";
		divText += "style=\"color:" + this.forecolor + ";";
		divText += "position:" + this.position + ";";
		divText += "left:" + this.x + ";";
		divText += "top:" + this.y + ";";
		divText += "cursor: default;";
		if(this.width>0){
			divText += "width:" + this.width + ";";
		}
		if(this.height>0){
			divText += "height:" + this.height + ";";
		}
		divText += "float:left;";
		divText += "text-align:" + this.align + ";";
		divText += "font-family:" + this.font + ";";
		divText += "font-size:" + this.fontsize + ";";
		divText += "\">";
		divText += this.text;
		divText += "</div>";
		
		this.htmlelement.innerHTML = divText;
	}
	
	TextCaption.prototype.OnClick = function(){
		eventHandler(this.name,"click");
	}
	
	TextCaption.prototype.SetText = function(sText){
		var textElement = document.getElementById("TextCaption" + this.index);
		textElement.innerHTML = sText;
	}
