I have this function:
HTML Code:
function getScrollTop() {
	if (navigator.appName == "Microsoft Internet Explorer") {
		return document.body.scrollTop;
	} else {
		return window.pageYOffset;
	}
}
I picked it up somewhere. Now I'm using it like this:
HTML Code:
function recordScroll() {
	currentScroll = getScrollTop();
	alert(currentScroll);
}
With recordScroll being the window.onscroll event. But no matter where I am, currentScroll always gets set to 0.