// JavaScript Document

function setCookie(entry, 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 = entry+"="+value+expires;
}

function readCookie(entry) {
  var nameEq = entry + "=";
  var cookieEntry = document.cookie.split(';');
  for(var i=0;i < cookieEntry.length;i++) {
	var c = cookieEntry[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;
}

function setFontSize(value) {
	var fontSize='8pt';
	var fontSize2 = '7pt';
	if (value==1) {
		fontSize='8pt';
		fontSize2 = '7pt';
	}
	if (value==2) {
		fontSize='9pt';
		fontSize2 = '8pt';
	}
	if (value==3) {
		fontSize='10pt';
		fontSize2 = '9pt';
	}
	if (document.getElementById('contentright')) {
		document.getElementById('contentright').style.fontSize = fontSize;
		document.getElementById('menuitems').style.fontSize = fontSize;
		document.getElementById('availableRooms').style.fontSize = fontSize2;
		document.getElementById('content').style.fontSize = fontSize2;
		setCookie("fontsize", value, 365);
	}
}

function writeFSContainer() {	
	if (navigator.cookieEnabled) {
		document.write('<div id="changefontsize">');
		document.write('<a style="cursor:pointer" onclick="setFontSize(1);" title="Schriftgröße klein" class="size1">A</a>&nbsp;&nbsp;&nbsp;');
		document.write('<a style="cursor:pointer" onclick="setFontSize(2);" title="Schriftgröße mittel" class="size2">A</a>&nbsp;&nbsp;&nbsp;');
		document.write('<a style="cursor:pointer" onclick="setFontSize(3);" title="Schriftgröße groß" style="font-size: 1.4em;" class="size3">A</a>');
		document.write('</div>');
			
		var fontSize = readCookie("fontsize");
		return fontSize;
	} else
		return 1;
}