var min=11;
var max=22;

if (getCookie("aw_fontsizecookie")>0 || getCookie("aw_fontsizecookie")<0)
{}
else
{
//	setCookie("aw_fontsizecookie", 0)
}

function increaseFontSize(dont_set_cookie) {
	if (!dont_set_cookie)
	{
	//	setCookie("aw_fontsizecookie", parseInt(getCookie("aw_fontsizecookie"))+1)
	}
   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"
   }
   var d = document.getElementsByTagName('div');
   for(i=0;i<d.length;i++) {
      if(d[i].style.fontSize) {
         var s = parseInt(d[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      d[i].style.fontSize = s+"px"
   }
   var h = document.getElementsByTagName('h2');
   for(i=0;i<h.length;i++) {
      if(h[i].style.fontSize) {
         var s = parseInt(h[i].style.fontSize.replace("px",""));
      } else {
         var s = 16;
      }
      if(s!=max) {
         s += 1;
      }
      h[i].style.fontSize = s+"px"
   }
   var t = document.getElementsByTagName('h3');
   for(i=0;i<t.length;i++) {
      if(t[i].style.fontSize) {
         var s = parseInt(t[i].style.fontSize.replace("px",""));
      } else {
         var s = 14;
      }
      if(s!=max) {
         s += 1;
      }
      t[i].style.fontSize = s+"px"
   }
   var l = document.getElementsByTagName('a');
   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"
   }
}

function decreaseFontSize(dont_set_cookie) {
	if (!dont_set_cookie)
	{
	//	setCookie("aw_fontsizecookie", parseInt(getCookie("aw_fontsizecookie"))-1)
	}
   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"
   }
   var d = document.getElementsByTagName('div');
   for(i=0;i<d.length;i++) {
      if(d[i].style.fontSize) {
         var s = parseInt(d[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      d[i].style.fontSize = s+"px"
   }
   var h = document.getElementsByTagName('h2');
   for(i=0;i<h.length;i++) {
      if(h[i].style.fontSize) {
         var s = parseInt(h[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      h[i].style.fontSize = s+"px"
   }
   var t = document.getElementsByTagName('h3');
   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"
   }
   var l = document.getElementsByTagName('a');
   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"
   }
}
/*
window.onload = function() {
	if (getCookie("aw_fontsizecookie")>0)
	{
		for(k=0;k<getCookie("aw_fontsizecookie");k++)
		{
			increaseFontSize(true)
		}
	}
	else if (getCookie("aw_fontsizecookie")<0)
	{
		for(k=getCookie("aw_fontsizecookie");k!=0;k++)
		{
			decreaseFontSize(true)
		}
	}
}*/
