function setTextSize(size) {
	if(size == 0)
		size = parseInt(jQuery.cookie("font-size"));
	
	switch (size) {
	case 1:
		jQuery('body').css('font-size', '0.9em');
		jQuery('.contboxr').css('font-size', '0.88em');
		jQuery.cookie("font-size", size, { path: '/' });
		break;
	case 2:
		jQuery('body').css('font-size', '1.0em');
		jQuery('.contboxr').css('font-size', '0.9em');
		jQuery.cookie("font-size", size, { path: '/' });
		break;
	case 3:
		jQuery('body').css('font-size', '1.1em');
		jQuery('.contboxr').css('font-size', '0.92em');
		jQuery.cookie("font-size", size, { path: '/' });
		break;
	default:
		break;
	}
}

jQuery(document).ready(function($){
	// Lupe auf Topup-Bildern
   	$("a.top_up").append('<span style="position: absolute;"><img width="32" height="32" border="0" alt="Bild vergr&ouml;&szlig;ern" src="fileadmin/templates/grafiken/magnifier.png"></span>');
	$("a.top_up").children("span").hide();    		
   		
   	$("a.top_up").hover(function(){
		var position = $(this).children("img:first").position();
		var w = $(this).children("img:first").width();
		var h = $(this).children("img:first").height();
		
		$(this).children("span").css({'top' : position.top + h -40, 'left' : position.left + w -40});
       			$(this).children("span").fadeIn(200);
   		},function(){
       			$(this).children("span").fadeOut(50);
   	});
	
	//Groesser-kleiner
	// evtl. vorhandener Wert aus coockie uebernehmen
	setTextSize(0);
	
	$(".font-size-standard").click(function() { setTextSize(1); return false; });
	$(".font-size-middle").click(function() { setTextSize(2); return false;});
	$(".font-size-big").click(function() { setTextSize(3); return false;});
	
	$(".Keine-Linien-hover").tableHover({rowClass: 'hover', spanRows: true, spanCols: true});
	$(".Blaue-Linien-hover").tableHover({rowClass: 'hover', spanRows: true, spanCols: true});
	$(".kal_around").tableHover({rowClass: 'hover', spanRows: true, spanCols: true});
});
