//Var min and max are set to equal 75% minimum font size, and 125% maximum font size.
var min=75;
var minF=70;
var max=130;
var maxF=100;

//THE SCRIPT TO INCREASE THE FONT SIZE OF ALL TAGS WITH A CLASS NAME OF "SIZEABLE."

//Gather all "p" tags and loop through.  Replace whatever units are being used ( font is currently set with "pt") with percentages, and place it in the variable "s."  
function increaseFontSize() {
   var p = document.getElementsByTagName("*");
   for(i=0; i < p.length; i++) {
//We're looking for the font size of all "p" tags.
		if(p[i].className=="sizeable") {
      if(p[i].style.fontSize) {
//The parseInt command takes the number of the font size of all "p" tags, and replaces the unit ("pt") with percentages and places it into the variable "s."
         var s = parseInt(p[i].style.fontSize.replace("pt","%"));
      } 
	 else {
//Our starting point will be 100%.  The font will increase 5% with each click until it reaches 125%.
         var s = 100;
      }
// "s" (100) is equal to s + 5 if s is not at its max of 125.  So it increments by 5 % until it reaches 125%
      if(s!=max) {
//  s = s + 5 or  (100 + 5 = 105%)
         s += 5;
      }
//The font size of the "p" elements is defined as "s%." The number of "s" in percentages.  105%.
      p[i].style.fontSize = s+"%"
		}
		if(p[i].className=="featureInfo") {
      if(p[i].style.fontSize) {
//The parseInt command takes the number of the font size of all "p" tags, and replaces the unit ("pt") with percentages and places it into the variable "s."
         var s = parseInt(p[i].style.fontSize.replace("pt","%"));
      } 
	 else {
//Our starting point will be 100%.  The font will increase 5% with each click until it reaches 125%.
         var s = 70;
      }
// "s" (100) is equal to s + 5 if s is not at its max of 125.  So it increments by 5 % until it reaches 125%
      if(s!=maxF) {
//  s = s + 5 or  (100 + 5 = 105%)
         s += 5;
      }
//The font size of the "p" elements is defined as "s%." The number of "s" in percentages.  105%.
      p[i].style.fontSize = s+"%"
		}
	}
}

function decreaseFontSize() {
   var p = document.getElementsByTagName("*");
   for(i=0; i < p.length; i++) {
	if(p[i].className=="sizeable") {
       if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("pt","%"));
      } 
	 else {
         var s = 100;
      }
      if(s!=min) {
         s -= 5;
      }
//The font size of the "p" elements is defined as "s%." The number of "s" in percentages.  95%.
      p[i].style.fontSize = s+"%"
		}   
	if(p[i].className=="featureInfo") {
       if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("pt","%"));
      } 
	 else {
         var s = 70;
      }
      if(s!=minF) {
         s -= 5;
      }
//The font size of the "p" elements is defined as "s%." The number of "s" in percentages.  95%.
      p[i].style.fontSize = s+"%"
		}
	}
}

//THIS JUST PUTS EVERYTHING BACK TO 100%

function restore() {
	var p = document.getElementsByTagName("*");
		for(var i = 0; i < p.length; i++) {
			if(p[i].className=="sizeable") {
				p[i].style.fontSize = "100%";
				}
			if(p[i].className=="featureInfo") {
				p[i].style.fontSize = "70%";
				}
			}
		}
		
//Loop thru all of the tag names in the document and find all that have a class name of "bigText."  
//When found, attach an onClick event to the element, which will now command the "increaseParaSize" function (finding all class names of "bigTextPara" and increasing fonts by 25%).  
//This is done by "giving" the "fuseOnclick" function to the "increaseParaSize" function thru the return command.
//The opposite is done by finding all elements with a class name of "smallText," and handing this over to the "decreaseParaSize" funciton.
function fuseOnclick() {
	var elements = document.getElementsByTagName("*");
		for (var i = 0; i < elements.length; i++) {
			if(elements[i].className == "bigText") {
				elements[i].onclick = function() {
				return increaseFontSize(this);
			}
		}
			if(elements[i].className == "smallText") {
				elements[i].onclick = function() {
				return decreaseFontSize(this);
			}
		}
			if(elements[i].className == "restore") {
				elements[i].onclick = function() {
				return restore(this);
				}
			}    
		}
}

addLoadEvent(fuseOnclick);
		
		
		
		
		
		
		
		
		
		
		
		
		