﻿/* Common javascript functions here */

var min=80;
var max=130;

function increaseFontSize() {
   var p = document.getElementsByTagName('p');          
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("%",""));
      } else {
         var s = 95;
      }
      if(s!=max) {
         s += 10;
      }
      p[i].style.fontSize = s+"%"
   }
   var h = document.getElementsByTagName('h1');          
   for(i=0;i<h.length;i++) {
      if(h[i].style.fontSize) {
         var s = parseInt(h[i].style.fontSize.replace("%",""));
      } else {
         var s = 95;
      }
      if(s!=max) {
         s += 10;
      }
      h[i].style.fontSize = s+"%"
   }
   var hhh = document.getElementsByTagName('h3');          
   for(i=0;i<hhh.length;i++) {
      if(hhh[i].style.fontSize) {
         var s = parseInt(hhh[i].style.fontSize.replace("%",""));
      } else {
         var s = 95;
      }
      if(s!=max) {
         s += 10;
      }
      hhh[i].style.fontSize = s+"%"
   }
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("%",""));
      } else {
         var s = 95;
      }
      if(s!=min) {
         s -= 10;
      }
      p[i].style.fontSize = s+"%"
   }   
   var h = document.getElementsByTagName('h1');
   for(i=0;i<h.length;i++) {
      if(h[i].style.fontSize) {
         var s = parseInt(h[i].style.fontSize.replace("%",""));
      } else {
         var s = 95;
      }
      if(s!=min) {
         s -= 10;
      }
      h[i].style.fontSize = s+"%"
   }   
   var hhh = document.getElementsByTagName('h3');
   for(i=0;i<hhh.length;i++) {
      if(hhh[i].style.fontSize) {
         var s = parseInt(hhh[i].style.fontSize.replace("%",""));
      } else {
         var s = 95;
      }
      if(s!=min) {
         s -= 10;
      }
      hhh[i].style.fontSize = s+"%"
   }   
}
