
function getXOffset(el, parent)
{
	x = 0;
	while(el)
	{
		if (el.id == parent.id)
			break;
		x += el.offsetLeft;
		el = el.offsetParent;
	}
	return x;
}

function getYOffset(el, parent)
{
	y = 0;
	while(el)
	{
		if (el.id == parent.id)
			break;
		y += el.offsetTop;
		el = el.offsetParent;
	}
	return y;
}

function getXCoord(el)
{
	return getXOffset(el, document.body);
}

function getYCoord(el)
{
	return getYOffset(el, document.body);
}

function simpleLayerShowInfo(el)
{
	if (!el)
		el = window.event.srcElement;
	var sInfo = "simple div: " + el.id + ", ";
	sInfo += el.offsetWidth + "," + el.offsetHeight + ", ";
	var background = document.getElementById("background");
	if (background)
		sInfo += getXOffset(el, background) + "," + getYOffset(el, background) + "\n";
	sInfo += "zIndex: " + el.style.width;
	//alert(sInfo);
	window.status = sInfo;
}