// JavaScript Document
function changeFontSize(abzac,step) {
	step = parseInt(step,10);
	if (step == 100) {
		var vlad = document.getElementById(abzac);
		var curFont = parseInt(vlad.style.fontSize,10);
		var ln = document.getElementById(abzac);
			ln.style.lineHeight = "13px";
			vlad.style.fontWeight = "100";
		var curLine = parseInt(ln.style.lineHeight,10);
		var p = document.getElementsByTagName('p');
		curFont = 12;
		step = 1;
				for(var i = 0; i < p.length; i++) { // Для каждого тега <p>
					p[i].style.lineHeight = (curLine+step+3) + 'px';
					p[i].style.fontSize = (curFont+step) + 'px';
				}
	} else {
		var vlad = document.getElementById(abzac);
		var curFont = parseInt(vlad.style.fontSize,10);
		var ln = document.getElementById(abzac);
			ln.style.lineHeight = "13px";
			vlad.style.fontWeight = "100";
		var curLine = parseInt(ln.style.lineHeight,10);
		var p = document.getElementsByTagName('p');
		for(var i = 0; i < p.length; i++) { // Для каждого тега <p>
			if ((curFont<=17 ) && (curFont>10)) {
				vlad.style.fontSize = (curFont+step) + 'px';
				if ((curFont<14) && (curFont>12)) {
					p[i].style.lineHeight = (curLine+step+5) + 'px';
					p[i].style.fontSize = (curFont+step) + 'px';
				} else if (curFont>=14) {
					p[i].style.lineHeight = (curLine+step+10) + 'px';
					p[i].style.fontSize = (curFont+step) + 'px';
				} else if (curFont<=12) {
					p[i].style.lineHeight = (curLine+step+3) + 'px';
					p[i].style.fontSize = (curFont+step) + 'px';
				}
			} else {
				curFont = 12;
				step = 1;
				vlad.style.fontSize = (curFont+step) + 'px';
				vlad.style.lineHeight = (curLine+step+3) + 'px';
			}
		}
	}
}
