function getDisplayDims() {
	var CANVAS = new Object();
  var CWidth, CHeight, CScrollX, CScrollY;

  if (typeof self.innerWidth != 'undefined') {
    CWidth = self.innerWidth;
    CHeight = self.innerHeight;
    CScrollX = window.pageXOffset;
    CScrollY = window.pageYOffset;
  } else if (document.documentElement && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth !== 0) {
    CWidth = document.documentElement.clientWidth + 16;
 	  CHeight = document.documentElement.clientHeight - 1;
   	if (CWidth==0) {
   	  CWidth = document.body.clientWidth + 16;
     	CHeight = document.body.clientHeight - 1;
    }
 	  CScrollX = document.body.scrollLeft +
   	           document.documentElement.scrollLeft;
    CScrollY = document.body.scrollTop +
 	             document.documentElement.scrollTop;
	} else if (document.body && typeof document.body.clientWidth != 'undefined') {
 	  CWidth = document.body.clientWidth + 16;
    CHeight = document.body.clientHeight - 1;
 	  CScrollX = document.body.scrollLeft;
   	CScrollY = document.body.scrollTop;
	}
  CANVAS.left    = CScrollX;
  CANVAS.right   = CWidth + CScrollX;
  CANVAS.top     = CScrollY;
  CANVAS.bottom  = CHeight + CScrollY;
  CANVAS.xMiddle = Math.round(CWidth/2) + CScrollX;
  CANVAS.yMiddle = Math.round(CHeight/2) + CScrollY;
  return CANVAS;
}
