var min=8;
var max=18;

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}


function increaseFontSize() {
   var p = document.getElementsByTagName('p');
    var t = document.getElementsByTagName('td');
	var l = document.getElementsByTagName('li');
   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"
   }
      for(i=0;i<t.length;i++) {
      if(t[i].style.fontSize) {
         var s = parseInt(t[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      t[i].style.fontSize = s+"px"
   }
      for(i=0;i<l.length;i++) {
      if(l[i].style.fontSize) {
         var s = parseInt(l[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      l[i].style.fontSize = s+"px"
   }   
   createCookie('fontsize',s,0);
}

function decreaseFontSize() {
   var p = document.getElementsByTagName('p');
      var t = document.getElementsByTagName('td');
	var l = document.getElementsByTagName('li');
   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"
   }   
      for(i=0;i<t.length;i++) {
      if(t[i].style.fontSize) {
         var s = parseInt(t[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      t[i].style.fontSize = s+"px"
   } 
      for(i=0;i<l.length;i++) {
      if(l[i].style.fontSize) {
         var s = parseInt(l[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      l[i].style.fontSize = s+"px"
   }   
   createCookie('fontsize',s,0);
}
 function rememberFontSize() {
 var c = readCookie('fontsize');
 if (c) { 
 var p = document.getElementsByTagName('p');
      var t = document.getElementsByTagName('td');
	var l = document.getElementsByTagName('li');
 for(i=0;i<p.length;i++) {
      p[i].style.fontSize = c +"px"
 }
  for(i=0;i<t.length;i++) {
t[i].style.fontSize = c +"px"
  } 
for(i=0;i<l.length;i++) {
l[i].style.fontSize = c +"px"
 }
 }
 }