var fontSize = 90;
var fontOriginal = fontSize;
var minFont = 70;
var maxFont = 110;


function saveFontSize()
{
	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+"; expires="+expire+"; path=/";
}


function loadFontSize()
{
	tempArray = document.cookie.split(";");
	for (tA = 0; tA < tempArray.length; tA++){
		if (tempArray[tA].indexOf('fontSize') > -1) {
			fontValue = tempArray[tA].split("=");
			fontSize = parseInt(fontValue[1]);
		}
	}
}


function setFontSize()
{
	loadFontSize()
	obj = document.getElementById('playground');
	obj.style.fontSize = fontSize+"%";
}


function plus()
{
	obj = document.getElementById('playground');
	fontSize = obj.style.fontSize;
	fontSize = parseInt(fontSize);
	if (fontSize < maxFont) {
		fontSize = fontSize + 10;
	}
	obj.style.fontSize = fontSize+"%";
	saveFontSize();
}



function minus()
{
	obj = document.getElementById('playground');
	fontSize = obj.style.fontSize;
	fontSize = parseInt(fontSize);
	if (fontSize > minFont) {
		fontSize = fontSize - 10;
	}
	obj.style.fontSize = fontSize+"%";
	saveFontSize()
}



function original()
{
	obj = document.getElementById('playground');
	fontSize = fontOriginal;
	obj.style.fontSize = fontSize+"%";
	saveFontSize()
}


window.onload=new Function("setFontSize();");

