document.observe('dom:loaded',function(){
initFontSize();
});

var FontBase=10;
var MaxFont = 16;
var MinFont = 8;
var FontIncrement=1;
var cookieFontBaseName = 'GGHWIAFontBase';
var cookieFontBase = GetCookie(cookieFontBaseName);
function initFontSize(){
	if(cookieFontBase){
		FontBase=cookieFontBase;
	}
	SetCookie(cookieFontBaseName,FontBase);
	setFontSize('init');	
}

function setFontSize(style){
	if(style=="bigger")	FontBase=parseFloat(FontBase) + parseInt(FontIncrement);
	else if(style=="smaller") FontBase=parseFloat(FontBase) - parseInt(FontIncrement);
	else FontBase=parseFloat(FontBase);
	// FontBase = Math.round(FontBase);
if(FontBase<MinFont) FontBase=MinFont;
if(FontBase>MaxFont) FontBase=MaxFont;
	$('wohneninderaue').style.fontSize = FontBase + 'px';
	SetCookie(cookieFontBaseName,FontBase);
return false;
}


function SetCookie(name, value, expires, path, domain, secure) {
	var expires = new Date();
	expires.setTime(expires.getTime()+(100*24*60*60*1000))
	var curCookie = name + "=" + escape(value) +
    	((expires) ? "; expires=" + expires.toGMTString() : "") +
      	"; path=" +  ((path) ? path : "/") +
      	((domain) ? "; domain=" +  domain : "") +
      	((secure) ? "; secure" : "");
     	//alert(curCookie);
	document.cookie = curCookie;
}

function GetCookie(name) {
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1) {
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	} else {
		begin += 2;
	}
	var end = document.cookie.indexOf(";", begin);
	if (end == -1){
		end = dc.length;
	}
	return unescape(dc.substring(begin + prefix.length, end));
}


function open_function(url,width,height,options) { 
	self.msgWindow = open(url, "Window", "width=" + width + ",height=" + height + ",screenX=" + (screen.width-width)/2 + ",screenY=" + (screen.height-height)/2 + ",dependent=yes" + ",left=" + (screen.width-width)/2 + ",top=" + (screen.height-height)/2 + options );
	if (self.msgWindow) { 
		self.msgWindow.focus();
		if (self.msgWindow.opener == null) self.msgWindow.opener = self;
	}
}

function get_url (url, k0 ,v0 ,k1 ,v1 ,k2 ,v2 ,k3 ,v3 ,k4 ,v4 ) { 
	if (k0 && v0) url += "?" + k0 + "=" + escape(v0); if (k1 && v1) url += "&" + k1 + "=" + escape(v1); 
	if (k2 && v2) url += "&" + k2 + "=" + escape(v2); if (k3 && v3) url += "&" + k3 + "=" + escape(v3);
	if (k4 && v4) url += "&" + k4 + "=" + escape(v4); 
	return url;
}
