// JavaScript Document

var min=8;
var max=18;
function enlargeFont() {
   var p = getElements();
   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 shrinkFont() {
   var p = getElements();
   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"
   }   
}
function resetFont() {
	var p = getElements();
	for(i=0;i<p.length;i++) {
		p[i].style.fontSize = "12px";	
	}
}
function getElements() {
	var arr = new Array();
	var p = document.getElementsByTagName('p');
	//alert(p);
	var li = document.getElementsByTagName('li');
	//alert(li);
	var h1 = document.getElementsByTagName('h1');
	var h2 = document.getElementsByTagName('h2');
	var h3 = document.getElementsByTagName('h3');
	
	for (i=0; i<p.length; i++) {
		arr.push(p[i]);
	}
	for (i=0; i<li.length; i++) {
		arr.push(li[i]);
	}
	/*for (i=0; i<h1.length; i++) {
		arr.push(h1[i]);
	}
	for (i=0; i<h2.length; i++) {
		arr.push(h2[i]);
	}
	for (i=0; i<h3.length; i++) {
		arr.push(h3[i]);
	}*/
	return arr;
}