String.prototype.endsWith = function(str)
{return (this.match(str+"$")==str)}

var min=10; var max=20; var minh1=14; var maxh1=25; var minh2=8; var maxh2=19; 
function increaseFontSize() {
	//getCurrentFontSize();
	var p = document.getElementsByTagName('p');
	for(i=0;i<p.length;i++) {if(!p[i].className || !p[i].className.endsWith("static"))
		{if(p[i].style.fontSize) { s = parseInt(p[i].style.fontSize.replace("px","")); } 
			  else {s = 13; }
			  if(s!=max) { s += 1; }
			  p[i].style.fontSize = s+"px";
			  p[i].style.lineHeight = s+6+"px";  
		}	
	}
	var h1 = document.getElementsByTagName('h1');
	for(i=0;i<h1.length;i++) {if(!h1[i].className || !h1[i].className.endsWith("static"))
		{if(h1[i].style.fontSize) {s = parseInt(h1[i].style.fontSize.replace("px","")); } 
			  else {s = 18; }
			  if(s!=maxh1) { s += 1; }
			  h1[i].style.fontSize = s+"px";
			  h1[i].style.lineHeight = s+6+"px";
		}	
	}
	var h2 = document.getElementsByTagName('h2');
	for(i=0;i<h2.length;i++) {if(!h2[i].className || !h2[i].className.endsWith("static"))
		{if(h2[i].style.fontSize) {s = parseInt(h2[i].style.fontSize.replace("px","")); } 
			  else {s = 12; }
			  if(s!=maxh2) { s += 1; }
			  h2[i].style.fontSize = s+"px";
			  h2[i].style.lineHeight = s+6+"px";
		}	
	}
	var li = document.getElementsByTagName('li');
	for(i=0;i<li.length;i++) {if(!li[i].className || !li[i].className.endsWith("static"))
		{if(li[i].style.fontSize) {s = parseInt(li[i].style.fontSize.replace("px","")); } 
			  else {s = 13; }
			  if(s!=max) { s += 1; }
			  li[i].style.fontSize = s+"px";
			  li[i].style.lineHeight = s+6+"px";
		}	
	}
	var td = document.getElementsByTagName('td');
	for(i=0;i<td.length;i++) {if(!td[i].className || !td[i].className.endsWith("static"))
		{if(td[i].style.fontSize) {s = parseInt(td[i].style.fontSize.replace("px","")); } 
			  else {s = 13; }
			  if(s!=max) { s += 1; }
			  td[i].style.fontSize = s+"px";
			  td[i].style.lineHeight = s+6+"px";
		}	
	}
	var a = document.getElementsByTagName('a');
	for(i=0;i<a.length;i++) {if(!a[i].className || !a[i].className.endsWith("static"))
		{if(a[i].style.fontSize) {s = parseInt(a[i].style.fontSize.replace("px","")); } 
			  else {s = 13; }
			  if(s!=max) { s += 1; }
			  a[i].style.fontSize = s+"px";
			  a[i].style.lineHeight = s+6+"px";
		}	
	}
	var label = document.getElementsByTagName('label');
	for(i=0;i<label.length;i++) {if(!label[i].className || !label[i].className.endsWith("static"))
		{if(label[i].style.fontSize) {s = parseInt(label[i].style.fontSize.replace("px","")); } 
			  else {s = 13; }
			  if(s!=max) { s += 1; }
			  label[i].style.fontSize = s+"px";
			  label[i].style.lineHeight = s+3+"px";
		}	
	}
	var input = document.getElementsByTagName('input');
	for(i=0;i<input.length;i++) {if(!input[i].className || !input[i].className.endsWith("static"))
		{if(input[i].style.fontSize) {s = parseInt(input[i].style.fontSize.replace("px","")); } 
			  else {s = 13; }
			  if(s!=max) { s += 1; }
			  input[i].style.fontSize = s+"px";
			  input[i].style.height = s+6+"px";
		}
	}
	var select = document.getElementsByTagName('select');
	for(i=0;i<select.length;i++) {if(!select[i].className || !select[i].className.endsWith("static"))
		{if(select[i].style.fontSize) {s = parseInt(select[i].style.fontSize.replace("px","")); } 
			  else {s = 13; }
			  if(s!=max) { s += 1; }
			  select[i].style.fontSize = s+"px";
			  select[i].style.height = s+6+"px";
		}
	}
	if (document.getElementById('captcha-input'))
	{var elem = document.getElementById('captcha-input');
	if(elem.style.fontSize) {s = parseInt(elem.style.fontSize);} 
			  else {s = 13;}
			  if(s!=max) { s += 1;}
			  elem.style.marginTop = s*6 + "px";
	}
	/*var tag = document.getElementsByTagName('p');
	for(i=0;i<tag.length;i++) {if(!tag[i].className || !tag[i].className.endsWith("static"))
		{
			if(tag[i].style.fontSize) {
			s = parseInt(tag[i].style.fontSize.replace("px","")); 
			setCurrentFontSize(s);
			return;
			} 
		}
	}*/
}
function decreaseFontSize() {
	//getCurrentFontSize();
	var p = document.getElementsByTagName('p');
	for(i=0;i<p.length;i++) {
		if(!p[i].className || !p[i].className.endsWith("static"))
			{if(p[i].style.fontSize) {s = parseInt(p[i].style.fontSize.replace("px","")); } 
				else {s = 13;}
				if(s!=min) {s -= 1;}
				p[i].style.fontSize = s+"px";
				p[i].style.lineHeight = s+6+"px";
			}   
	}
	var h1 = document.getElementsByTagName('h1');
	for(i=0;i<h1.length;i++) {
		if(!h1[i].className || !h1[i].className.endsWith("static"))
			{if(h1[i].style.fontSize) {s = parseInt(h1[i].style.fontSize.replace("px","")); } 
			  else { s = 18;}
			  if(s!=minh1) { s -= 1; }
			  h1[i].style.fontSize = s+"px";
			  h1[i].style.lineHeight = s+6+"px";
			}	
	}
	var h2 = document.getElementsByTagName('h2');
	for(i=0;i<h2.length;i++) {
		if(!h2[i].className || !h2[i].className.endsWith("static"))
			{if(h2[i].style.fontSize) {s = parseInt(h2[i].style.fontSize.replace("px","")); } 
			  else {s = 12; }
			  if(s!=minh2) { s -= 1; }
			  h2[i].style.fontSize = s+"px";
			  h2[i].style.lineHeight = s+6+"px";
		}	
	}
	var li = document.getElementsByTagName('li');
	for(i=0;i<li.length;i++) {if(!li[i].className || !li[i].className.endsWith("static"))
		{if(li[i].style.fontSize) {s = parseInt(li[i].style.fontSize.replace("px","")); } 
			  else {s = 13; }
			  if(s!=min) { s -= 1; }
			  li[i].style.fontSize = s+"px";
			  li[i].style.lineHeight = s+6+"px";
		}	
	}
	var td = document.getElementsByTagName('td');
	for(i=0;i<td.length;i++) {if(!td[i].className || !td[i].className.endsWith("static"))
		{if(td[i].style.fontSize) {s = parseInt(td[i].style.fontSize.replace("px","")); } 
			  else { s = 13; }
			  if(s!=min) { s -= 1; }
			  td[i].style.fontSize = s+"px";
			  td[i].style.lineHeight = s+6+"px";
		}	
	}
	var a = document.getElementsByTagName('a');
	for(i=0;i<a.length;i++) {if(!a[i].className || !a[i].className.endsWith("static"))
		{if(a[i].style.fontSize) {s = parseInt(a[i].style.fontSize.replace("px","")); } 
			  else { s = 13; }
			  if(s!=min) { s -= 1; }
			  a[i].style.fontSize = s+"px";
			  a[i].style.lineHeight = s+6+"px";
		}	
	}
	var label = document.getElementsByTagName('label');
	for(i=0;i<label.length;i++) {if(!label[i].className || !label[i].className.endsWith("static"))
		{if(label[i].style.fontSize) {s = parseInt(label[i].style.fontSize.replace("px","")); } 
			  else { s = 13; }
			  if(s!=min) { s -= 1; }
			  label[i].style.fontSize = s+"px";
			  label[i].style.lineHeight = s+3+"px";
		}	
	}
	var input = document.getElementsByTagName('input');
	for(i=0;i<input.length;i++) {if(!input[i].className || !input[i].className.endsWith("static"))
		{if(input[i].style.fontSize) {s = parseInt(input[i].style.fontSize.replace("px","")); } 
			  else { s = 13; }
			  if(s!=min) { s -= 1; }
			  input[i].style.fontSize = s+"px";
			  input[i].style.height = s+6+"px";
		}
	}
	var select = document.getElementsByTagName('select');
	for(i=0;i<select.length;i++) {if(!select[i].className || !select[i].className.endsWith("static"))
		{if(select[i].style.fontSize) {s = parseInt(select[i].style.fontSize.replace("px","")); } 
			  else { s = 13; }
			  if(s!=min) { s -= 1; }
			  select[i].style.fontSize = s+"px";
			  select[i].style.height = s+6+"px";
		}
	}
	if (document.getElementById('captcha-input'))
	{var elem = document.getElementById('captcha-input');
		if(elem.style.fontSize) {s = parseInt(elem.style.fontSize);} 
			  else { s = 13;}
			  if(s!=min) { s -= 1;}
			  elem.style.marginTop = s*6 + "px";
	}
	/*var tag = document.getElementsByTagName('p');
	for(i=0;i<tag.length;i++) {if(!tag[i].className || !tag[i].className.endsWith("static"))
		{
			if(tag[i].style.fontSize) {
			s = parseInt(tag[i].style.fontSize.replace("px","")); 
			setCurrentFontSize(s);
			return;
			} 
		}
	}*/
}

/*function setCurrentFontSize(s)
{
	var params=document.URL.split("?")[1];
	self.location.href = params + "?currentFontSize="+s;
}
function getCurrentFontSize()
{
	s = <?php $currentFontSize;  ?>;
	return s;
}*/


