var IsIeBug = typeof document.body.style.maxHeight != "undefined";

function findPageHeight(){
  if (typeof window.innerHeight!='undefined') {
    return window.innerHeight;
  }
  if (document.documentElement && typeof
      document.documentElement.clientWidth!='undefined' &&
      document.documentElement.clientHeight!=0) {
    return document.documentElement.clientHeight;
  }
  if (document.body && typeof document.body.clientWidth!='undefined') {
    return document.body.clientHeight;
  }
  return (null);
}

function findPageWidth(){
  if (typeof window.innerWidth!='undefined') {
    return window.innerWidth;
  }
  if (document.documentElement && typeof
      document.documentElement.clientWidth!='undefined' &&
      document.documentElement.clientHeight!=0) {
    return document.documentElement.clientWidth;
  }
  if (document.body && typeof document.body.clientWidth!='undefined') {
    return document.body.clientWidth;
  }
  return (null);
}

function resize_all() {
  var Size = Math.sqrt(findPageWidth()*findPageHeight()/3000);
  if (Size < 10) Size = 10;
  if (Size > 40) Size = 40;
  RSize = parseInt(Size)+'px';
  document.body.style.fontSize = RSize;
}

function init_all() {
  window.onresize = resize_all;
  resize_all();
}
