 const_size = 70;
 const_size_step = 10;
 max_size = 300;
 min_size = 40;

window.onload = InitStartSize;

function InitStartSize()
{
	size = parseInt(readCookie("size"));
	if(!size)
	{
		setCookie("size", const_size, 30);
		size = const_size;
	}
	
	document.body.style.fontSize = size+"%";
}

function textVerkleinern()
{
	size = parseInt(readCookie("size"));
	if(!size || size>min_size)
		size = (!size) ? const_size : (size - const_size_step);
	setCookie("size", size, 30);
	
	document.body.style.fontSize = size + "%";
}

function textVergrossern()
{
	size = parseInt(readCookie("size"));
	
	if(!size || size<max_size)
		size = (!size) ? const_size : (size + const_size_step);
	setCookie("size", size, 30);
	
	document.body.style.fontSize = size + "%";
}

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+"; path=/";
}

function readCookie(name) {
	var cookieValue = null;
	var search = name + "=";
		if(document.cookie.length > 0)
		{ 
			offset = document.cookie.indexOf(search);
			if (offset != -1)
			{ 
				offset += search.length;
				end = document.cookie.indexOf(";", offset);
				if (end == -1) end = document.cookie.length;
				cookieValue = unescape(document.cookie.substring(offset, end))
			}
		}
	return cookieValue;
}

function setCookie(name,value,days)
{
	eraseCookie(name);
	createCookie(name,value,days);
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function openPopUp(url)
{
	wWidth=300;
	wHeight=155;
	myWin=window.open(url, 'windowPopUp','width='+wWidth+'px,height='+wHeight+'px,resizable,scrollbars=0');
	myWin.moveTo((screen.width/2)-(500/2),(screen.height/2)-(wHeight/2));
	myWin.focus();
	return false;
}

function OpenParagraph(obj)
{
	oDiv = obj.parentNode.parentNode;
	if(oDiv.className.indexOf("aufklapItemActive")>-1)
		oDiv.className = "aufklapItem";
	else
		oDiv.className = "aufklapItemActive";
		
}