
function PositionedElement(value, parent)
{
	if(typeof(value) == "string")
	{
		this.Element = document.createElement(value);
		if(parent) parent.appendChild(this.Element);
	}
	else
	{
		this.Element = value;
	}
}
function PositionedElement.prototype.Left()
{
	return this.Element.offsetLeft + this.Element.offsetParent.offsetLeft;
}
function PositionedElement.prototype.HorizontalCenter()
{
	return this.Left() + this.HalfWidth();
}
function PositionedElement.prototype.Right()
{
	return this.Left() + this.Width();
}
function PositionedElement.prototype.Top()
{
	return this.Element.offsetTop + this.Element.offsetParent.offsetTop;
}
function PositionedElement.prototype.VerticalCenter()
{
	return this.Top() + this.HalfHeight();
}
function PositionedElement.prototype.Bottom()
{
	return this.Top() + this.Height();
}
function PositionedElement.prototype.Width()
{
	return this.Element.offsetWidth;
}
function PositionedElement.prototype.HalfWidth()
{
	return Math.round(this.Width()/2);
}
function PositionedElement.prototype.Height()
{
	return this.Element.offsetHeight;
}
function PositionedElement.prototype.HalfHeight()
{
	return Math.round(this.Height()/2);
}
function PositionedElement.prototype.SetLeft(value)
{
	return this.Element.style.pixelLeft = value;
}
function PositionedElement.prototype.SetTop(value)
{
	return this.Element.style.pixelTop = value;
}
function PositionedElement.prototype.SetWidth(value)
{
	return this.Element.style.pixelWidth = value;
}
function PositionedElement.prototype.SetHeight(value)
{
	return this.Element.style.pixelHeight = value;
}
function PositionedElement.prototype.Move(x, y)
{
	this.SetLeft(x);
	this.SetTop(y);
}
function PositionedElement.prototype.Delete()
{
	this.Element.parentNode.removeChild(this.Element);
}
