function checkFontSize()
{
	try
	{
		// Do this onload
		var receivedCookieData = getCookie("fontsize");

		if (receivedCookieData != null)
		{
			if(receivedCookieData == "small")
			{
				smallFont();
			}
			if(receivedCookieData == "med")
			{
				medFont();
			}
			if(receivedCookieData == "large")
			{
				largeFont();
			}
		}
		else
		{
			smallFont();
		}
	}
	catch(ex)
	{
	}	
}

// Get cookie function - Return the value of the cookie
function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

function smallFont()
{
	// Change the current font size and write the value back to cookie
	document.body.style.fontSize = '60%';
	document.cookie = "fontsize=small";
}

function medFont()
{
	// Change the current font size and write the value back to cookie
	document.body.style.fontSize = '80%';
	document.cookie = "fontsize=med";
}

function largeFont()
{
	// Change the current font size and write the value back to cookie
	document.body.style.fontSize = '100%';
	document.cookie = "fontsize=large";
}