function Label()
{
	var D;
	var D0;
	var T1;
	
	var P1 = 'transparent'			// BackgroundColor
	
	// Events
	var clickEvent;
	
	clickEvent = new Event('Click', null);
	
	this.Subscribe = function(type, fn, obj, override)
	{
		if (type == clickEvent.type)
		{
			clickEvent.subscribe(fn, obj, override);
		}
	}

	//T1 = 'The property is read/write for all objects except the following, for which it is read-only';
	//T1 = 'THE PROPERTY IS READ/WRITE FOR ALL OBJECTS EXCEPT THE FOLLOWING, for which it is read-only';
	T1 = '';

	D = this;

	this.IsMultiline = false;
	
	this.Parent = null;
	
	this.Left = 0;
	
	this.Top = 0;
	
	this.Font = 'normal 8pt Verdana';
	
	this.Width = 20;
	
	this.Height = 20;
	
	this.BackgroundColor = 'transparent';
	
	this.Position = 'absolute';
	
	this.Cursor = 'default';

	this.Color = '#000000';

	this.Initialize = function()
	{
		D0 = document.createElement('div');

		Refresh();

		D.Parent.appendChild(D0);
	}

	var Refresh = function()
	{
		if (D0)
		{
			D0.innerHTML = T1;

			D0.style.color = D.Color;
			
			D0.style.textAlign = 'left';
			
			D0.style.cursor = D.Cursor;
	    
		    if (! D0.style.cursor)
		    {
				D0.style.cursor = 'pointer';
		    }

			D0.style.font = D.Font;

			D0.style.backgroundColor = P1;

			D0.style.position = D.Position;

			D0.className = 'divElement';
			
			D0.style.overflow = 'hidden';
			
			if (D.Left)
			{
				D0.style.left = D.Left;
			}

			if (D.Top)
			{
				D0.style.top = D.Top;
			}

			D0.style.overflow = 'hidden';

			if (D.Width)
			{
				D0.style.width = D.Width;
			}
			else
			{
				D0.style.width = '';
			}

			if ((! D.IsMultiline) && (D.Height))
			{
				D0.style.height = D.Height;

				D0.style.lineHeight = D.Height + 'px';
			}
			else
			{
				D0.style.height = '';
				
				if (D.Height)
				{
					D0.style.lineHeight = D.Height + 'px';
				}
				else
				{
					D0.style.lineHeight = '';
				}
			}
			
			D0.onclick = LabelClicked;
		}
	}
	
	var LabelClicked = function()
	{
		clickEvent.fire();
	}

	this.SetProperty = function(property, value)
	{
		if (property == 'Text')
		{
			T1 = value;
			
			if (D0)
			{
				D0.innerHTML = T1;
			}
		}
		else if (property == 'BackgroundColor')
		{
			P1 = value;
			
			if (D0)
			{
				D0.style.backgroundColor = P1;
			}
		}
	}
	
	this.GetProperty = function(property)
	{
		if (property == 'Text')
		{
			return T1;
		}
		else
		{
			return null;
		}
	}
}
