var min=13;
var max=22;
var minh=16;
var maxh=26;

$(function(){
		   
	$("#textsizeon").removeClass("hidden");
	$("#textsizeoff").addClass("hidden");
	
});

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("px",""));
      } else {
         var s = 13;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
	  if(p[i].style.lineHeight) {
         var s = parseInt(p[i].style.lineHeight.replace("px",""));
      } else {
         var s = 16;
      }
      if(s!=maxh) {
         s += 1;
      }
      p[i].style.lineHeight = s+"px"
   }
   
   var ul = document.getElementsByTagName('ul');
   for(i=0;i<ul.length;i++) {
      if(ul[i].style.fontSize) {
         var s = parseInt(ul[i].style.fontSize.replace("px",""));
      } else {
         var s = 13;
      }
      if(s!=max) {
         s += 1;
      }
      ul[i].style.fontSize = s+"px"
	  if(ul[i].style.lineHeight) {
         var s = parseInt(ul[i].style.lineHeight.replace("px",""));
      } else {
         var s = 16;
      }
      if(s!=maxh) {
         s += 1;
      }
      ul[i].style.lineHeight = s+"px"
   }
   
   var h1 = document.getElementsByTagName('h1');
   for(i=0;i<h1.length;i++) {
      if(h1[i].style.fontSize) {
         var s = parseInt(h1[i].style.fontSize.replace("px",""));
      } else {
         var s = 13;
      }
      if(s!=max) {
         s += 1;
      }
      h1[i].style.fontSize = s+"px"
	  if(h1[i].style.lineHeight) {
         var s = parseInt(h1[i].style.lineHeight.replace("px",""));
      } else {
         var s = 16;
      }
      if(s!=maxh) {
         s += 1;
      }
      h1[i].style.lineHeight = s+"px"
   }
}
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("px",""));
      } else {
         var s = 13;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
      if(p[i].style.lineHeight) {
         var s = parseInt(p[i].style.lineHeight.replace("px",""));
      } else {
         var s = 16;
      }
      if(s!=minh) {
         s -= 1;
      }
      p[i].style.lineHeight = s+"px"
   }   
   
   var ul = document.getElementsByTagName('ul');
   for(i=0;i<ul.length;i++) {
      if(ul[i].style.fontSize) {
         var s = parseInt(ul[i].style.fontSize.replace("px",""));
      } else {
         var s = 13;
      }
      if(s!=min) {
         s -= 1;
      }
      ul[i].style.fontSize = s+"px"
      if(ul[i].style.lineHeight) {
         var s = parseInt(ul[i].style.lineHeight.replace("px",""));
      } else {
         var s = 16;
      }
      if(s!=minh) {
         s -= 1;
      }
      ul[i].style.lineHeight = s+"px"
   }   
   
   var h1 = document.getElementsByTagName('h1');
   for(i=0;i<h1.length;i++) {
      if(h1[i].style.fontSize) {
         var s = parseInt(h1[i].style.fontSize.replace("px",""));
      } else {
         var s = 13;
      }
      if(s!=min) {
         s -= 1;
      }
      h1[i].style.fontSize = s+"px"
      if(h1[i].style.lineHeight) {
         var s = parseInt(h1[i].style.lineHeight.replace("px",""));
      } else {
         var s = 16;
      }
      if(s!=minh) {
         s -= 1;
      }
      h1[i].style.lineHeight = s+"px"
   } 
}
