


/* 
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      +  DESIGN © BY
      +  www.jentzschdesign.com
      +  Hartmut Jentzsch
      +  Burggraben 1
      +  D-53359 Rheinbach
      +  http://www.jentzschdesign.com
      +
      +  CODE © BY
      +  www.jentzschdesign.com
      +  Christoph Becker
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 */





function Cookiemanager(cookieName, setValue) {
	this.cookieName = cookieName;
	this.value = setValue;
	this.path = "/";
	this.expires = this.getExpires();
	window.unload = new Function(this.cookieName + ".setCookie(this.cookieName, this.value, this.expires);");
	this.getCookie(this.cookieName);
}

Cookiemanager.prototype.getExpires = function() {
	var cookieTime = new Date();
	var setCookieTime = cookieTime.getTime() + (7*24*60*60*1000); //entspricht 1 Woche
	cookieTime.setTime(setCookieTime);
	return cookieTime.toGMTString();
}

Cookiemanager.prototype.getCookie = function(cookieName) {
	var i;
	var loadCookies = document.cookie.split(";");
	var cookieAnzahl = loadCookies.length;
	for(i=0; i < cookieAnzahl; i++) {
		if(loadCookies[i].indexOf(cookieName) != -1) {
			cookie_split = loadCookies[i].split("=");
			return cookie_split[1];
		}
	}
	return null;
}

Cookiemanager.prototype.setCookie = function(cookieName, value) {
	this.value = value;
	//alert("Cookie Daten\n Cookie Name = " + this.cookieName + "\n Wert = " + this.value + "\n Expires = " + this.expires);
	document.cookie = cookieName + "=" + value + "; expires=" + this.expires + "; path=" + this.path;
}

var styleSwitch = new Cookiemanager("styleSwitch", "seniorenland");
var fontSize = new Cookiemanager("fontSize", 65);
