// findPos (from: http://www.quirksmode.org/js/findpos.html)

function findPos (obj)
{
	var	curleft = curtop = 0;

	if (obj && obj.offsetParent)
	{
		curleft = obj.offsetLeft;
		curtop = obj.offsetTop;

		while (obj = obj.offsetParent)
		{
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
	}

	return [curleft, curtop];
}

// From http://www.softcomplex.com/docs/get_window_size_and_scrollbar_position.html

function filterResults (n_win, n_docel, n_body)
{
	var n_result = n_win ? n_win : 0;

	if (n_docel && (!n_result || (n_result > n_docel)))
	{
		n_result = n_docel;
	}

	return (n_body && (!n_result || (n_result > n_body)) ? n_body : n_result);
}



