

var CookieLoaded 		= false;
var FontSizeDefault = 100;
var FontSizeCurrent = FontSizeDefault;
var FontSizeStep		= 10;
var FontSizeMax			= 170;
var FontSizeMin			= 80;


function revertStyles(){
	FontSizeCurrent = FontSizeDefault;
	changeFontSize(0);
}
function changeFontSize(sizeDifference){
	FontSizeCurrent = parseInt(FontSizeCurrent) + parseInt(sizeDifference * FontSizeStep);
	if(FontSizeCurrent > FontSizeMax){
		FontSizeCurrent = FontSizeMax;
	}else if(FontSizeCurrent < FontSizeMin){
		FontSizeCurrent = FontSizeMin;
	}
	setFontSize(FontSizeCurrent);
};
function setFontSize(fontSize){
	// Mal im Ernst, Freunde: wozu brauchen wir das hier ...
	var stObj = (document.getElementById) ? document.getElementById('content_area') : document.all('content_area');
	// ... wenn am Ende dann doch die ganze Seite angepasst wird??? ;-)
	document.body.style.fontSize = fontSize + '%';
	//alert (document.body.style.fontSize);
};


function toggleColors(){
	if(currentStyle == 'White'){
		setColor('Black');
	} else {
		setColor('White');
	}
}


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 expires = "";
  document.cookie = name + '=' + value + expires + '; path=/';
};
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;
};


window.onload = setUserOptions;
function setUserOptions() {
	if (!CookieLoaded) {
		cookie = readCookie('fontSize');
		FontSizeCurrent = cookie ? cookie : FontSizeDefault;
		setFontSize(FontSizeCurrent);
		CookieLoaded = true;
	}
}


window.onunload = saveSettings;
function saveSettings() {
  createCookie('fontSize', FontSizeCurrent, 365);
}
