/*
//this is how things were proceding before I gave up and consulted the internets
function toggleSize(element) {
	//alert("fred");
	if (element.name == "smaller") {
		//make smaller here
		alert(element.name);
	} else {
		//make larger here
		alert(element.name);
		//loop through the p tags
		var paragraphs = ""; 
		paragraphs = document.getElementsByTagName("p"); //getElementsByTagName("body"); //.
		for (var i=0;i<paragraphs.length;i++){
			//alert(paragraphs[i].name + ' ' + i);
			alert(paragraphs[i].length); //style.fontSize);
			//paragraphs[i].style.fontSize = 6;
			//alert(paragraphs[i].style.fontSize + ' ' + i);
		}
		//increase their size by 25%
	}
}
*/

/*The following code was appropriated appropriately 
from http://www.white-hat-web-design.co.uk/articles/js-fontsize.php

admittedly it doesn't quite satisfy the requirement, but it does sort of work 
and does what it does without resorting to any exotic archtectures
*/
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"
   }   
}
