Bw.Widgets.TextEditor =
{
	superclassName: "Bw.Widgets.Textfield",
	selfclassName: "Bw.Widgets.TextEditor",
	
	create: function (val)
	{
		var obj = document.createElement ("div");
		
		if (val) obj.setAttribute ("value", val);
		
		Bw.Core.bootstrap (obj, "Bw.Widgets.TextEditor");
		
		return obj;
	},

	initialize: function ()
	{
			var val = this.innerHTML;
			this.innerHTML = "";
			
			Bw.Widgets.Textfield.initialize.call (this);
			
			if (val != "") this.setValue (val);
			
			return false;
	},

	draw: function ()
	{
		var f = document.createElement ("textarea");
		with (f.style)
		{
			var w = this.style.width;
			var h = this.style.height;
		
			width = (w != "") ? w : "100%";
			height = (h != "") ? h : "200px";
			overflow = "auto";
		}
		
		return f;
	}
};

