var fontSize =12;
function loadFontSize()
	//get font size from a cookie
	{
	tempArray = document.cookie.split(";");		
	for (tA = 0; tA < tempArray.length; tA++)
			{
			if (tempArray[tA].indexOf('fontSize') > -1) //found the font section in cookie
				{
				fontValue = tempArray[tA].split("=")
				fontSize = parseInt(fontValue[1]);
				lineHeight = fontSize+Math.round(.3*fontSize);
				}
		}
 }
	
function eventFaceLarger()
	{
	//fontSize = document.getElementById("story").style.fontSize;
	fontSize = fontSize+2;

	if (fontSize > 26) {fontSize = 26;}
	
	setFaceSize()
	}
	
	
function eventFaceSmaller()
	{
		//fontSize = document.getElementById("story").style.fontSize;
	fontSize = fontSize-2
	if (fontSize < 9) fontSize = 9;
	
	setFaceSize();
	}


function setFaceSize()
	{
	lineHeight = fontSize+Math.round(.3*fontSize);
		obj = document.getElementById("story");
		obj.style.fontSize = fontSize+"px";
		obj.style.lineHeight = lineHeight+"px"
	 saveFaceSize();
	}
	
function saveFaceSize()
	{
 var expire = new Date ();
   	expire.setTime (expire.getTime() + (6000 * 24 * 3600000)); //expires in 6 days from users clock
   	expire = expire.toGMTString();
	document.cookie="fontSize="+fontSize+"; path=/; expires="+expire;

	}
loadFontSize();
