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;
}
// Portable to virtually every browser, with a few caveates.
Portable to virtually every browser, with a few caveates.
Portable to virtually every browser with a few caveates .
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;
}
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 ; }
Portable to virtually every browser, with a few caveates.
Portable to virtually every browser with a few caveates .