function setFocus(id)
{
	var control = document.getElementById(id);
	if (control)
	{
		control.focus();
	}
}

function getElementPosition(element)
{
	var offsetTrail = element;
	var offsetLeft = 0;
	var offsetTop = 0;
	while (offsetTrail)
	{
		offsetLeft += offsetTrail.offsetLeft;
		offsetTop += offsetTrail.offsetTop;
		offsetTrail = offsetTrail.offsetParent;
	}
	if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined")
	{
		offsetLeft += document.body.leftMargin;
		offsetTop += document.body.topMargin;
	}
	return {left:offsetLeft, top:offsetTop};
}

