// Font-resizer 
// all values in em
var kbFontSizeDefault = 1.1;
var kbFontSizeMin = 0.6;
var kbFontSizeMax = 1.4;
var kbFontSizeIntervall = 0.1;

function getFontsize () {
	//return document.getElementsByTagName('body')[0].style.fontSize;
	return document.getElementById('contentcontainer').style.fontSize;
}

function setFontsize (size) {
	document.getElementById('contentcontainer').style.fontSize = size;
	elementRef = document.getElementById('main_content');
	for (var i = 0; i < elementRef.children.length; i++) {
          if (elementRef.children[i].tagName == "FORM") {
          }
	}
	
	void(0);
}

// main
function getCurrentFontSize () {
	var currentSizeTmp = getFontsize();
	if (currentSizeTmp == '') {
		currentSizeTmp = kbFontSizeDefault;
		setFontsize(kbFontSizeDefault+'em');
	}
	currentSizeTmp = currentSizeTmp.replace(/em/g, '');
	return Number(currentSizeTmp);
}

function decreaseFont () {
	var currentSize = getCurrentFontSize();
	if (currentSize > kbFontSizeMin) {
		currentSize = currentSize - kbFontSizeIntervall;
		setFontsize(currentSize+'em');
	}
	void(0);
}

function setnormalFont () {
	setFontsize(kbFontSizeDefault+'em');
	void(0);
}

function increaseFont () {
	var currentSize = getCurrentFontSize();
	if (currentSize < kbFontSizeMax) {
		currentSize = currentSize + kbFontSizeIntervall;
		setFontsize(currentSize+'em');
	}
	void(0);
} 
