// Copyright 2003 Eddie Traversa
// http://www.dhtmlnirvana.com/
// free to use as long as this copyright notice stays intact
var tags = new Array( 'div','td','tr','p','b','table','strong','emphasis','a','h4','pre','sub','sup','i','th','cp','ul','ol','li','dt','dd','span','sup','label');
var pixelArray =  new Array('11','12','13');
var emArray =  new Array('0.7','0.9','1.0');

var initSize = 0;

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+";";
}

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 eraseCookie(name) {
	createCookie(name,0,-1);
}

function fontreload(unit) {
	//ha nem létezik a cookie létrehozza
	if(readCookie('fontS') == 0) {
		createCookie(name,0,-1);	
	}

	//ha létezik a cookie akkor betűméretnövelés
	if(document.cookie && readCookie('fontS') != 0) {

		//beolvassa a cookieban tárolt fontméretet
		var size = readCookie('fontS');
		
		//stringet számmá alakítja
		parseInt(size);
		

		if(document.getElementById('text-content')) {
		
			getBody2 = document.getElementById('text-content');
			
			if( getBody2 != null)
			{
				for (i = 0 ; i < tags.length ; i++ ) {
					
					var getallTags = getBody2.getElementsByTagName(tags[i]);
					for (k = 0 ; k < getallTags.length ; k++) 
					if ( getallTags[k].style.fontSize )
						getallTags[k].style.fontSize = (unit=='px') ? pixelArray[size]+unit: emArray[size]+unit;
					else 						
						getallTags[k].style['fontSize'] = (unit=='px') ? pixelArray[size]+unit: emArray[size]+unit;
					}
			footBottom();
			}
		}
	
	}
	
}


function fontSizer(inc,unit) 
{
	if (!document.getElementById) 
		return;
		
		parseInt(initSize);
		
		if(document.cookie && readCookie('fontS') != null ) {
		initSize = readCookie('fontS');
		}
		parseInt(initSize);
		
	var size = initSize;
		parseInt(size);
		
		if (inc == -1) {
			size = size - 1;
			if (size == -1 ) {
			size = 0;
			}
		}
			
		if(inc == 1) {
		size = size + 1;
			if(size == 0 || size == 01 ) {
			size = 1;
			}
		
			if (size > 2 || size == 3 ) {
			size = 2;
			}
		}
		
//		createCookie('fontS',0,10);
		initSize = size;
		createCookie('fontS',size,10);

		getBody2 = document.getElementById('level-3-text');
		if( getBody2 != null)
		{
		for (i = 0 ; i < tags.length ; i++ ) {
			getallTags = getBody2.getElementsByTagName(tags[i]);
			for (k = 0 ; k < getallTags.length ; k++) { 
				getallTags[k].style.fontSize = (unit=='px') ? pixelArray[size]+unit: emArray[size]+unit;
			}
		}
	}

	// 2009.07.27. - IE8-ban bizonyos oldalaknál a szöveg összecsúszott; a tartalom js-sel történő újrabeillesztése oldotta meg a problémát, viszont ez elrontotta azon formos oldalak működését, amelyek elején témaválasztó select volt.
	if ( is.ie8 && !hasClass( document.body, 'ugyfelszolgalat' ) && !hasClass( document.body, 'valsagkezeles' ) ) {
		document.getElementById('level-3-text').innerHTML += '';
	}
	
}