var fontpx1 = 12; // alapértelmezés szerint ekkora betűkkel írunk
var fontpx2 = 14; 
var minpx = 11; // a legkisebb fontméret
var maxpx = 18; // a legnagyobb fontméret

function changeFont(dif) {
var obj;
leftdiv= new Array("leftbox2", "leftbox3");
maindiv= new Array( "mainbox1", "mainbox2",  "mainbox3", "mainbox4", "contentbox");
if (dif==0) {
	
	for (i in leftdiv){
		obj = document.getElementById(leftdiv[i]);
		if (obj) obj.style.fontSize = 12 + "px";
		fontpx1=12;
	}
	for (i in maindiv){
		obj = document.getElementById(maindiv[i]);
		if (obj) obj.style.fontSize = 14 + "px";
		fontpx2=14;
	}
}
else {
	var newpx1 = fontpx1 + dif;
	var newpx2 = fontpx2 + dif;
	
	if (newpx1 >= minpx && newpx1 <= maxpx) {
		for (i in leftdiv){
			obj = document.getElementById(leftdiv[i]);
			if (obj) obj.style.fontSize = newpx1 + "px";
		}
		fontpx1 = newpx1
	}
	if (newpx2 >= minpx && newpx2 <= maxpx) {
		for (i in maindiv){
			obj = document.getElementById(maindiv[i]);
			if (obj) obj.style.fontSize = newpx2 + "px";
		}
		fontpx2 = newpx2
	}
}
}

function initPage() {
    // kitesszük a két "gombot"
    var tb = '<img src="/images/design/aaa.png" border="0" usemap="#aaa">'
	tb    += '<map name="aaa">'
	tb    += '<area shape="rect" coords="0,0,32,22" href="#" id="fontdec" title="Decrease fonts">'
	tb    += '<area shape="rect" coords="33,0,65,22" href="#" id="fontorig" title="Original fonts">'
	tb    += '<area shape="rect" coords="66,0,98,22" href="#" id="fontinc" title="Encrease fonts">'
	tb    += '</map>'
    document.getElementById("header3").innerHTML = tb;
    
    document.getElementById("fontinc").onclick=function() { changeFont(+1); return false; }
	document.getElementById("fontorig").onclick=function() { changeFont(0); return false; }
    document.getElementById("fontdec").onclick=function() { changeFont(-1); return false; }
}

window.onload = initPage;
