

function tsinit()
{
	s = document.cookie + ";";
	i = s.indexOf("LGFCTS");
	if (i < 0) return;
	j = s.indexOf(";", i);
	if (j < 0) return;
	n = parseFloat(s.substr(i+7, j-i-7));
	if (n < 2 || n > 4) return;
	tschange(n);
}



function tschange(n)
{
	// Grab the area we want to resize
	e = document.getElementById("tscontent");
	if (e == null) return;
	
	// Update the cookie
	document.cookie = 'LGFCTS=' + n + '; expires=Fri, 3 Aug 2009 20:47:11 GMT; path=/;';

	// Set the display to show the cookie info
	if (document.getElementById("smalltext"))
	{
		if (n == 1) document.getElementById("smalltext").style.borderColor='#547FBD'; else document.getElementById("smalltext").style.borderColor='#ccc';
		if (n == 2) document.getElementById("mediumtext").style.borderColor='#547FBD'; else document.getElementById("mediumtext").style.borderColor='#ccc';
		if (n == 3) document.getElementById("largetext").style.borderColor='#547FBD'; else document.getElementById("largetext").style.borderColor='#ccc';
		if (n == 4) document.getElementById("extralargetext").style.borderColor='#547FBD'; else document.getElementById("extralargetext").style.borderColor='#ccc';
	}
	
	// Figure out the font size based on the option chosen
	if (n == 4)
		n = 140;
	else
		n = 90 + n * 10;
		
	// Set anything that can obviously be resized
	e.style.fontSize = n + "%";
				
}
