function getPosition(e)
{
	var left = 0;
	var top  = 0;

	while (e.offsetParent)
	{
		left += e.offsetLeft;
		top  += e.offsetTop;
		e     = e.offsetParent;
	}

	left += e.offsetLeft;
	top  += e.offsetTop;

	return {x: left, y: top};
}

function posSearch()
{
	var pos = getPosition(document.getElementById('searchcontrolanchor'));
	$('#search').css('position', 'absolute');
	$('#search').css('left', pos.x + 'px');
	$('#search').css('top', pos.y + 'px');
}

function isIE()
{
	return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
}

function isNumberKey(evt)
{
	var charCode = (evt.which) ? evt.which : event.keyCode
	
	if (charCode > 31 && (charCode < 48 || charCode > 57))
		return false;

	return true;
}

