/**
* find the x position of an object, relative to the viewport
* code copied from quirksmode.org
* @param obj object to find x position for
*/
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;
return curleft;
}
/**
* find the y position of an object, relative to the viewport
* code copied from quirksmode.org
* @param obj object to find y position for
*/
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;
return curtop;
}