function getYPosition(){ var top = window.pageYOffset || document.documentElement.scrollTop return top; }