function objectControl(objectName)
{
	this.objectName = objectName;

	this.isIE = _objectControl_isIE;
	this.isNN = _objectControl_isNN;
	this.isW3C = _objectControl_isW3C;

	this.getX = _objectControl_getX;
	this.getY = _objectControl_getY;
	this.setX = _objectControl_setX;
	this.setY = _objectControl_setY;

	this.getLink = _objectControl_getLink;

	this.clip = _objectControl_clip;
	this.hide = _objectControl_hide;
	this.show = _objectControl_show;
}


function _objectControl_isIE()
{
	if (document.all) return(true);
	return(false);
}

function _objectControl_isNN()
{
	if (document.layers) return(true);
	return(false);
}

function _objectControl_isW3C()
{
	if (document.getElementById) return(true);
	return(false);
}

function _objectControl_getLink()
{
	var link = null;

	if (this.isW3C())
	{
		link = eval('document.getElementById("' + this.objectName + '")');
	} else
	if (this.isIE())
	{
		link = eval("document.all." + this.objectName);
	} else
	if (this.isNN())
	{
		link = eval("document." + this.objectName);
	}


	return(link);
}

function _objectControl_getX()
{
	var offsetX = 0;

	targetLink = this.getLink();

	while (targetLink.offsetParent)
	{
		offsetX += targetLink.offsetLeft;
		targetLink = targetLink.offsetParent;
	}

	return(offsetX);
}

function _objectControl_getY()
{
	var offsetY = 0;

	targetLink = this.getLink();

	while (targetLink.offsetParent)
	{
		offsetY += targetLink.offsetTop;
		targetLink = targetLink.offsetParent;
	}

	return(offsetY);
}

function _objectControl_setX(newX)
{
	targetLink = this.getLink();
	targetLink.style.left = newX;
}

function _objectControl_setY(newY)
{
	targetLink = this.getLink();
	targetLink.style.top = newY;
}


function _objectControl_clip(newX, newY, width, height)
{
	var ref = this.getLink();

	if (this.W3C())
	{
		ref.style.clip = "rect(" + newY + " " + (newX+width) + " " + (newY+height) + " " + newX + ")";
	} else
	if (this.isIE())
	{
		ref.style.clip = "rect(" + newY + " " + (newX+width) + " " + (newY+height) + " " + newX + ")";
	}
}


function _objectControl_show()
{
	var ref = this.getLink();

	if (this.isIE()) ref.style.visibility = "visible";
}

function _objectControl_hide()
{
	var ref = this.getLink();

	if (this.isIE()) ref.style.visibility = "hidden";
}
