function _getTotalHeight() {

  // firefox is ok
  var height = document.documentElement.scrollHeight;

  // now IE 7 + Opera with "min window"
  if(document.documentElement.clientHeight > height ) {
    height  = document.documentElement.clientHeight;
  }
  // last for safari
  if(document.body.scrollHeight > height) {
    height = document.body.scrollHeight;
  }
  
  return height;
  //alert(height);
}

function _getWinHeight(){
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	} else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		} else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	
	return windowHeight;
	//alert(windowHeight);
}
function _getScroll(){
	var scrOfX = 0, scrOfY = 0;
	if (typeof(window.pageYOffset) == 'number') {
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	}
	else 
		if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
			//DOM compliant
			scrOfY = document.body.scrollTop;
			scrOfX = document.body.scrollLeft;
		}
		else 
			if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
				//IE6 standards compliant mode
				scrOfY = document.documentElement.scrollTop;
				scrOfX = document.documentElement.scrollLeft;
			}
			
	//return [scrOfX, scrOfY];
	return scrOfY;
	//alert(scrOfY);
}
