$(document).ready(function() {
		// See which font size the user wants
		$("#text-resizer a").click(function() {
			switch ($(this).attr("class")) {
				case 'small'	: setFontSize(.8);	break;
				case 'large'	: setFontSize(1.2);	break;
				default			: setFontSize(1);	break;
			}
			return false;
		});

		// Set the font size and set a cookie
		function setFontSize(size) {
            $("body").animate({fontSize: size+"em"}, 500).fadeIn("slow");
			createCookie(size);
		}

		// Create and read coookies
		// Code functions by: Peter-Paul Koch
		// http://www.quirksmode.org/js/cookies.html
		function createCookie(value) {
			var date = new Date();
			date.setTime(date.getTime()+(30*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
			document.cookie = "font_size="+value+expires+"; path=/";
		}

		function readCookie() {
			var nameEQ = "font_size=";
			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(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
			}
			return 1;
		}	
    });
		