// Notes for the findPos function:
// * This does *not* work on objects with
// position: fixed, as such objects don't
// have offset parents!!!
// * Be sure to feed target[0] into this,
// rather than just target!!!
function findPos(obj) {
var curleft = 0;
var curtop = 0;
if (obj.offsetParent) {
do {
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
} while ((obj = obj.offsetParent));
return [curleft, curtop];
}
}