// START: fontsizer
function getCookieData(name) {
	var keyName = 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(keyName) == 0) return c.substring(keyName.length,c.length);
	}
	return null;
}

function setMyFontsize(that)
{
  	var myfontsize = that.id;
	document.cookie = 'fontsize='+myfontsize+'; expires=Thu, 2 Aug 2099 00:00:00 UTC; path=/';	
  	setFontsize(myfontsize);
}

function setFontsize(myfontsize)
{
	if(myfontsize == "")
		return;
	
	var styles = new Array('size-m', 'size-l', 'size-xl');
	
	//werte zurücksetzen
	for(var i=0; i<styles.length; i++)
	{
		var elemName = styles[i];
		var temp = document.getElementById(elemName);
		temp.className = elemName;
	}
	
	var elem = document.getElementById("site");
	
	var fontSize = "1em";
	if(myfontsize == 'size-l')
	{
		fontSize = "1.25em";
	}
	else if(myfontsize == 'size-xl')
	{
		fontSize = "1.5em";
	}
	elem.style.fontSize = fontSize;
	document.getElementById(myfontsize).className = myfontsize+ " choosen";
}

var windowLastCall;
function showLarge(imgFileName, width, height)
{
	var targetWidth = Math.floor(width*1);
	var targetHeight = Math.floor(height*1);
	
	if(windowLastCall != undefined)
	{
		windowLastCall.close();
	}
	
	imgFileName = "http://www.blackforest-hotels-badenweiler.de/index.php?article_id=25&imgfile="+imgFileName;
	
	var options = 'width='+targetWidth+',height='+targetHeight+',resizable=yes,screenX=150,screenY=100,status=no';
	var largePic = window.open(imgFileName,'largePic',options);
	largePic.focus();
	
	windowLastCall = largePic;
}
