function set_cookie(name,value) {
		expire_date = new Date();
		in_one_year = expire_date.getTime() + (365 * 24 * 60 * 60 * 1000);
		expire_date.setTime(in_one_year);
		document.cookie = name + "=" + value + "; expires=" + expire_date.toGMTString() + ";path=/;";
}

function read_cookie_value(cookie_name) {
		if(document.cookie.match(cookie_name)) {
				cookie_name_length = cookie_name.length;
				var cookie_position = document.cookie.indexOf(cookie_name);
				var start_value_reading = cookie_position + cookie_name_length + 1;
				var interim_value = document.cookie.substr(start_value_reading);
				var position_next_separator = interim_value.indexOf(";");

				if(position_next_separator != "-1") {
						var stop_value_reading = position_next_separator;
						var cookie_value = document.cookie.substr(start_value_reading,stop_value_reading);
				} else {
						var cookie_value = document.cookie.substr(start_value_reading);
				}
				return cookie_value;
		}
}


function change_body_font(span) {
		font_size = span.substr(5,7);
		new_font_size = font_size.replace("_",".");
		set_cookie("accessibility_font_size",new_font_size);
		location.reload();
}

function show_font_switcher() {
		document.write("<div class=\"fontsizeswitcher\">");
		document.write("<a href=\"javascript:history.go(0)\" id=\"font_1_0\" class=\"normal\" onclick=\"change_body_font(this.id);\" onkeypress=\"this.onclick\" title=\"kleine Schriftgr&ouml;&szlig;e\">A<\/a>");
		document.write("<a href=\"javascript:history.go(0)\" id=\"font_1_1\" class=\"big\" onclick=\"change_body_font(this.id);\" onkeypress=\"this.onclick\" title=\"normale Schriftgr&ouml;&szlig;e\">A<\/a>");
		document.write("<a href=\"javascript:history.go(0)\" id=\"font_1_3\" class=\"bigger\" onclick=\"change_body_font(this.id);\" onkeypress=\"this.onclick\" title=\"gro&szlig;e Schriftgr&ouml;&szlig;e\">A<\/a>");
		document.write("<\/div>");
}

function apply_accessibility_font() {
		cookie_value = read_cookie_value("accessibility_font_size");
		document.getElementById("wrapper").style.fontSize = cookie_value + "em";
}