$(document).ready(function() {
	// See which font size the user wants
	//$("a#text_default").click(function() { setFontSize(68.8); return false });
	//$("a#text_large").click(function() { setFontSize(95); return false });
	$("a#header_text_default").click(function() { 
		setFontSize(75, 48, 17); 
		return false 
	});
	
	$("a#header_text_large").click(function() { 
		setFontSize(95, 42, 19);
		return false 
	});

	// Set the font size and set a cookie
	function setFontSize(size, entry, head) {
		$("body").animate({fontSize: size+"%"}, 500).fadeIn("slow");
		$("#header .entry").animate({top: entry + "px"}, 500);
		$('.opening h2').animate({fontSize: head + 'px'}, 500).fadeIn("slow");
		createCookie(size);
		}

	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=/";
		}
	var font_size = $.cookie('font_size');
	if (font_size == '75') {
		$('body').css("font-size","75%");
		$('#header .entry').css({'top': '48px'}); 
		$('.opening h2').css({'font-size': '17px'});
	}
	if (font_size == '95') {
		$('body').css("font-size","95%");
		$('#header .entry').css({'top': '42px'});
		$('.opening h2, ').css({'font-size': '19px'});
	}

	
});