/* get absolute coordinates */
// absolute X of the element (from top of the page)
function getX(el)
{
	if (typeof(el) == 'undefined') return 0;
	
	var x = el.offsetLeft;
	var el = el;
	
	while (el = el.offsetParent) x += el.offsetLeft;
	
	return x;
}

// absolute Y of the element (from top of the page)
function getY(element)
{
	if (element === undefined) return 0;
	var y = element.offsetTop;
	var el = element;
	
	while (el = el.offsetParent) y += el.offsetTop;
	
	return y;
}
