var min=12;
var max=20;

var hmin=18;
var hmax=26;

function increaseFontSize() {
   var p = document.getElementsByTagName('body');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var ps = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var ps = 12;
      }
      if(ps!=max) {
         ps += 2;
      }
      p[i].style.fontSize = ps+"px"
   }
   
   var hp = document.getElementsByTagName('h2');
   for(i=0;i<hp.length;i++) {
      if(hp[i].style.fontSize) {
         var hps = parseInt(hp[i].style.fontSize.replace("px",""));
      } else {
         var hps = 18;
      }
      if(hps!=hmax) {
         hps += 4;
      }
      hp[i].style.fontSize = hps+"px"
   }

}

function decreaseFontSize() {
   var p = document.getElementsByTagName('body');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var ps = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var ps = 12;
      }
      if(ps!=min) {
         ps -= 2;
      }
      p[i].style.fontSize = ps+"px"
   }

   var hp = document.getElementsByTagName('h2');
   for(i=0;i<hp.length;i++) {
      if(hp[i].style.fontSize) {
         var hps = parseInt(hp[i].style.fontSize.replace("px",""));
      } else {
         var hps = 18;
      }
      if(hps!=hmin) {
         hps -= 4;
      }
      hp[i].style.fontSize = hps+"px"
   }

}
