// gerencia o tamanho das fontes através das tags

var min    = 8;
var max    = 16;
var difH2  = 3;
var difH4  = 0;

function increaseFontSize() {
   var p   = document.getElementsByTagName('p');
   var h2  = document.getElementsByTagName('h2');
   var h3  = document.getElementsByTagName('h3');
   var h4  = document.getElementsByTagName('h4');
   var h6  = document.getElementsByTagName('h6');
   
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 11;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize   = s+"px";
   }
   
   for(i=0;i<h2.length;i++) {
      if(h2[i].style.fontSize) {
         var s = parseInt(h2[i].style.fontSize.replace("px",""));
      } else {
         var s = 11;
      }
      if(s!=max) {
         s += 1;
      }
      h2[i].style.fontSize  = s+difH2+"px";
   }
   
   for(i=0;i<h3.length;i++) {
      if(h3[i].style.fontSize) {
         var s = parseInt(h3[i].style.fontSize.replace("px",""));
      } else {
         var s = 14;
      }
      if(s!=max) {
         s += 1;
      }
      h3[i].style.fontSize  = s+"px";
   }
   
   for(i=0;i<h4.length;i++) {
      if(h4[i].style.fontSize) {
         var s = parseInt(h4[i].style.fontSize.replace("px",""));
      } else {
         var s = 11;
      }
      if(s!=max) {
         s += 1;
      }
      h4[i].style.fontSize  = s+difH4+"px";
   }
   
   for(i=0;i<h6.length;i++) {
      if(h6[i].style.fontSize) {
         var s = parseInt(h6[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      h6[i].style.fontSize  = s+"px";
   }
   
}

function decreaseFontSize() {
   var p   = document.getElementsByTagName('p');
   var h2  = document.getElementsByTagName('h2');
   var h3  = document.getElementsByTagName('h3');
   var h4  = document.getElementsByTagName('h4');
   var h6  = document.getElementsByTagName('h6');
   
    for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 11;
      }
      if(s!=max) {
         s -= 1;
      }
      p[i].style.fontSize   = s+"px";
   }
   
   for(i=0;i<h2.length;i++) {
      if(h2[i].style.fontSize) {
         var s = parseInt(h2[i].style.fontSize.replace("px",""));
      } else {
         var s = 11;
      }
      if(s!=max) {
         s -= 1;
      }
      h2[i].style.fontSize  = s+difH2+"px";
   }
   
   for(i=0;i<h3.length;i++) {
	  if(h3[i].style.fontSize) {
         var s = parseInt(h3[i].style.fontSize.replace("px",""));
      } else {
         var s = 14;
      }
	  if(s!=max) {
         s -= 1;
      }
      h3[i].style.fontSize  = s+"px";
   }
   
   for(i=0;i<h4.length;i++) {
      if(h4[i].style.fontSize) {
         var s = parseInt(h4[i].style.fontSize.replace("px",""));
      } else {
         var s = 11;
      }
      if(s!=max) {
         s -= 1;
      }
      h4[i].style.fontSize  = s+difH4+"px";
   }
   
   for(i=0;i<h6.length;i++) {
      if(h6[i].style.fontSize) {
         var s = parseInt(h6[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s -= 1;
      }
      h6[i].style.fontSize  = s+"px";
   }
}


function NormalFontSize() {
   var p   = document.getElementsByTagName('p');
   var h2  = document.getElementsByTagName('h2');
   var h3  = document.getElementsByTagName('h3');
   var h4  = document.getElementsByTagName('h4');
   var h6  = document.getElementsByTagName('h6');
   for(i=0;i<p.length;i++) {
	   p[i].style.fontSize   = "11px";
   }
   for(i=0;i<h2.length;i++) {
	   h2[i].style.fontSize  = "11px";
   }   
   for(i=0;i<h3.length;i++) {
		h3[i].style.fontSize = "14px";
   }   
   for(i=0;i<h4.length;i++) {
	   h4[i].style.fontSize  = "12px";
   }   
   for(i=0;i<h6.length;i++) {
	   h6[i].style.fontSize = "12px";
   }
}