function findPosX(obj) {
	var curleft = 0;
	if (obj.offsetParent) {
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
		
	if(typeof(document.body.currentStyle) != 'undefined') {
		curleft += parseInt(document.body.currentStyle.marginLeft);
	}		
	
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent) {
		while (obj.offsetParent) {
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
		
	if(typeof(document.body.currentStyle) != 'undefined') {
		curtop += parseInt(document.body.currentStyle.marginTop);
	}
	
	return curtop;
}

