// JavaScript Document
//Script to alter the text size on a page//
//Call the javascript function as a link (one link to increase another to decrease) see below// 
//<a href="javascript:decreaseFontSize();">-</a> <a href="javascript:increaseFontSize();">+</a>//
//NOTE: This script only works on pixel sized fonts and the tag it will work between is set on this line: 
//var p = document.getElementsByTagName('p'); ie: p is the paragraph tag//

var min=8;
var max=18;
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 = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = 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 = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}