/*$(document).ready(function(){$("a.fontsize").click(function(){var thesize=0;var alt=$(this).attr("alt");if($.cookie("cfa_fontsize")!=null){var size=$.cookie("cfa_fontsize");var lineheight=$.cookie("cfa_lineheight")}else{var size=12;var lineheight=18;$.cookie("cfa_fontsize",size,"{expires: 100}");$.cookie("cfa_lineheight",lineheight,"{expires: 100}")}thesize=parseInt(size);thelineheight=parseInt(lineheight);if(alt=="reset"){thesize=12;thelineheight=18}if(alt=="minus"){thesize=thesize-1;thelineheight=thelineheight-1}if(alt=="plus"){thesize=thesize+1;thelineheight=thelineheight+1}if(thesize>16){thesize=thesize-1;thelineheight=thelineheight-1}if(thesize<9){thesize=thesize+1;thelineheight=thelineheight+1}$("p").css({fontSize:thesize+"px"});$("p").css({lineHeight:thelineheight+"px"});$.cookie("cfa_fontsize",thesize,"{expires: 100}");$.cookie("cfa_lineheight",thelineheight,"{expires: 100}")});if($.cookie("cfa_fontsize")!=null){var size=$.cookie("cfa_fontsize");var lineheight=$.cookie("cfa_lineheight");$("p").css({fontSize:size+"px"});$("p").css({lineHeight:thelineheight+"px"})}});*/
$(document).ready(function() {
	if($("a.fontsize").length > 0) {	
		$("a.fontsize").click(function() {
			
			var thesize = 0;
			var alt = $(this).attr("alt");
			
			if($.cookie("cfa_fontsize") != null) {
 				var size = $.cookie("cfa_fontsize");
 				var lineheight = $.cookie("cfa_lineheight");
 			}
 			else {
 				var size = 12;
 				var lineheight = 18;
 				$.cookie("cfa_fontsize",size,"{expires: 100}");
 				$.cookie("cfa_lineheight",lineheight,"{expires: 100}");
 			}
 			
 			thesize = parseInt(size);
 			thelineheight = parseInt(lineheight);
 			
 			if(alt == "reset") { thesize = 12; thelineheight = 18; }
 			if(alt == "minus") { thesize = thesize - 1; thelineheight = thelineheight - 1; }
 			if(alt == "plus") { thesize = thesize + 1; thelineheight = thelineheight + 1; }
 			
 			if(thesize > 16) { thesize = thesize - 1; thelineheight = thelineheight - 1; }
 			if(thesize < 9) { thesize = thesize + 1; thelineheight = thelineheight + 1; }
 			
 			thelineheight = (thelineheight == 0) ? 18 : thelineheight;
 			
			$("p").css({fontSize:thesize+"px"});
			$("p").css({lineHeight:thelineheight+"px"});
			
			//alert(thesize);
			
			$.cookie("cfa_fontsize",thesize,"{expires: 100}");
			$.cookie("cfa_lineheight",thelineheight,"{expires: 100}");
		});
	}	
		
	if($.cookie("cfa_fontsize") != null) {
		var size = $.cookie("cfa_fontsize");
		var lineheight = parseInt($.cookie("cfa_lineheight"));
		
		thelineheight = (lineheight == 0) ? 18 : lineheight;
		
		$("p").css({fontSize:size+"px"});
		$("p").css({lineHeight:thelineheight+"px"});
	}
});

