**Edit:** well actually to be safe we should do precisely what they suggest, i.e.

`var y = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;`

because `pageYOffset` can be `0`. This shouldn't be much issue though because in all browsers I've checked, this implies also `document.documentElement.scrollTop === 0` but we never know.