font scale


  
  function fontScale() {  // causes layout problems in FireFox that get fixed if browser's Reload is used; same may be true of other Gecko-based browsers
          if (!s5mode) return false;
          var vScale = 22;  // both yield 32 (after rounding) at 1024x768
          var hScale = 32;  // perhaps should auto-calculate based on theme's declared value?
          if (window.innerHeight) {
                  var vSize = window.innerHeight;
                  var hSize = window.innerWidth;
          } else if (document.documentElement.clientHeight) {
                  var vSize = document.documentElement.clientHeight;
                  var hSize = document.documentElement.clientWidth;
          } else if (document.body.clientHeight) {
                  var vSize = document.body.clientHeight;
                  var hSize = document.body.clientWidth;
          } else {
                  var vSize = 700;  // assuming 1024x768, minus chrome and such
                  var hSize = 1024; // these do not account for kiosk mode or Opera Show
          }
          var newSize = Math.min(Math.round(vSize/vScale),Math.round(hSize/hScale));
          fontSize(newSize + 'px');
          if (isGe) {  // hack to counter incremental reflow bugs
                  var obj = document.getElementsByTagName('body')[0];
                  obj.style.display = 'none';
                  obj.style.display = 'block';
          }
  }