function getAbsolutePos(obj) {
var position =
new Object;
position.x =
0;
position.y =
0;
if( obj )
{
position.x =
obj.offsetLeft + obj.clientLeft;
position.y =
obj.offsetTop + obj.clientTop;
if(
obj.offsetParent ) {
var parentpos
= getAbsolutePos(obj.offsetParent);
position.x +=
parentpos.x;
position.y +=
parentpos.y;
}
}
return
position;
}