function getClientWidth() {
  if (typeof(window.innerWidth) == 'number') {
    return window.innerWidth;
  }
  else if (document.documentElement &&
          (document.documentElement.clientWidth)) {
    return document.documentElement.clientWidth;
  }
  else if (document.body && (document.body.clientWidth)) {
    return document.body.clientWidth;
  }
}

function getClientHeight() {
  if (typeof(window.innerWidth) == 'number') {
    return window.innerHeight;
  }
  else if (document.documentElement &&
          (document.documentElement.clientHeight)) {
    return document.documentElement.clientHeight;
  }
  else if (document.body && (document.body.clientHeight)) {
    return document.body.clientHeight;
  }
}

