function getScreenX(e) {
	var left = 0;
	if (e.offsetParent) {
		do {
				left += e.offsetLeft;
		} while (e = e.offsetParent);
	}
	return left;
}

function getScreenY(e) {
	var top = 0;
	if (e.offsetParent) {
		do {
				top += e.offsetTop;
		} while (e = e.offsetParent);
	}
	return top;
}

function getScrollY() {
	var y = 0;
	if (typeof(window.pageYOffset) == 'number') {
		y = window.pageYOffset;
	} else if (document.body && document.body.scrollTop) {
		y = document.body.scrollTop;
	} else if (document.documentElement && document.documentElement.scrollTop) {
		y = document.documentElement.scrollTop;
	}
	return y;
}

function getScrollX() {
	var x = 0;
	if (typeof(window.pageXOffset) == 'number') {
		x = window.pageXOffset;
	} else if (document.body && document.body.scrollLeft) {
		x = document.body.scrollLeft;
	} else if (document.documentElement && document.documentElement.scrollLeft) {
		x = document.documentElement.scrollLeft;
	}
	return x;
}

function getScreenHeight() {
	var h = 0;
	if (window.innerHeight) {
		h = window.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		h = document.documentElement.clientHeight;
	} else if (document.body && document.body.clientHeight) {
		h = document.body.clientHeight;
	}
	return h;
}

function getScreenWidth() {
	var w = 0;
	if (window.innerWidth) {
		w = window.innerWidth;
	} else if (document.documentElement && document.documentElement.clientWidth) {
		w = document.documentElement.clientWidth;
	} else if (document.body && document.body.clientWidth) {
		w = document.body.clientWidth;
	}
	return w;
}
