var PageUtil = {
  getPageWidth: function() {
	var xScroll;

	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		alert();
		xScroll = document.body.scrollWidth;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
	}

	var winWidth = PageUtil.getWindowWidth();

	if(xScroll < winWidth){
		pageWidth = winWidth;
	} else {
		pageWidth = xScroll;
	}

    return pageWidth;
  },

  getPageHeight: function() {
	var yScroll;

	if (window.innerHeight && window.scrollMaxY) {
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		yScroll = document.body.offsetHeight;
	}

    var winHeight = PageUtil.getWindowHeight();
	if(yScroll < winHeight){
		pageHeight = winHeight;
	} else {
		pageHeight = yScroll;
	}

    return pageHeight;
  },

  getWindowWidth: function() {
	var windowWidth;
	if (self.innerHeight) {	// all except Explorer
      return self.innerWidth;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
      return document.documentElement.clientWidth;
	} else if (document.body) { // other Explorers
      return document.body.clientWidth;
	}
  },

  getWindowHeight: function() {
	var windowHeight;
	if (self.innerHeight) {	// all except Explorer
      return self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
      return document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
      return document.body.clientHeight;
	}
  },

  getPageCenter: function() {
	var vector = new Object();
	vector.x = Math.round(PageUtil.getPageWidth()/2);
	vector.y = Math.round(PageUtil.getPageHeight()/2);
	return vector;
  },

  getWindowCenter: function() {
	var vector = new Object();
	vector.x = Math.round(PageUtil.getWindowWidth()/2);
	vector.y = Math.round(PageUtil.getWindowHeight()/2);
	return vector;
  }

}
