var fontMax = 22;
var fontMin = 8;
var fontAct = 12;

function setFontSize(ident) {
	if (ident == 'default') {
		document.body.style.fontSize = 12 + 'px';
		fontAct = 12;
	}
	else if (ident == 'bigger') {
		
		fontAct += 2;

		if (fontAct <= fontMax) {
			document.body.style.fontSize = fontAct + 'px';
		}
		else {
			document.body.style.fontSize = fontMax + 'px';
			fontAct = fontMax;
		}
		
	}
	else if (ident == 'smaller') {
		fontAct -= 2;
		if (fontAct >= fontMin) {
			document.body.style.fontSize = fontAct + 'px';
		}
		else {
			document.body.style.fontSize = fontMin + 'px';
			fontAct = fontMin;
		}
	}
	//alert(fontAct);
	//im cookie speichern
	document.cookie = "FontSize=" + fontAct;
	//alert(document.cookie);
}
function initFontSize() {
	var cookie = document.cookie;
	var a_all_cookies = document.cookie.split( ';' );
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		a_temp_cookie = a_all_cookies[i].split( '=' );
		//alert (a_temp_cookie[0]);
		//white space trim
		if (a_temp_cookie[0].replace(/^\s+|\s+$/g, '') == "FontSize") {
			document.body.style.fontSize = a_temp_cookie[1].replace(/^\s+|\s+$/g, '') + 'px';
			fontAct = parseInt(a_temp_cookie[1].replace(/^\s+|\s+$/g, ''));
		}
	}
}
