Puedes usar una función como esta para obtener la posición:
Código PHP:
function getElementPosition(elem) {
var offsetTrail = elem;
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" && navigator.appName=="Microsoft Internet Explorer" ) {
offsetLeft += parseInt(document.body.leftMargin);
offsetTop += parseInt(document.body.topMargin);
}
return {left:offsetLeft, top:offsetTop};
}
//uso: posicionX=getElementPosition(document.getElementById('idCapa')).left;