function setFontSize( s )
{
	
	var content = document.getElementById('content');
	var p 		= content.getElementsByTagName('p');
	var span 	= content.getElementsByTagName('span');
	
	for(i=0;i<p.length;i++) {
		p[i].style.fontSize = s+"px"
	}
	for(i=0;i<span.length;i++) {
		span[i].style.fontSize = s+"px"
	}
	
	set_cookie( 'page_font_size', s, 2099, 1, 1);
	
	document.getElementById( "fontsizeselector11" ).style.color="#A0C2C1";
	document.getElementById( "fontsizeselector16" ).style.color="#A0C2C1";
	document.getElementById( "fontsizeselector22" ).style.color="#A0C2C1";
	document.getElementById( "fontsizeselector"+s ).style.color="#FFF";
}

function adjustFontSize()
{
	var s = get_cookie( 'page_font_size' );
	if( s )
	{
		setFontSize( s );
	}
	
	
}

//Via http://www.elated.com/articles/javascript-and-cookies/
function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure )
{
	
	var cookie_string = name + "=" + escape ( value );

	if ( exp_y )
	{
		var expires = new Date ( exp_y, exp_m, exp_d );
		cookie_string += "; expires=" + expires.toGMTString();
	}

	if ( path )
		cookie_string += "; path=" + escape ( path );

	if ( domain )
		cookie_string += "; domain=" + escape ( domain );

	if ( secure )
		cookie_string += "; secure";

	document.cookie = cookie_string;
}

//Via http://www.elated.com/articles/javascript-and-cookies/
function delete_cookie ( cookie_name )
{
	var cookie_date = new Date ( );  // current date & time
	cookie_date.setTime ( cookie_date.getTime() - 1 );
	document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}

//Via http://www.elated.com/articles/javascript-and-cookies/
function get_cookie ( cookie_name )
{
	var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );

	if ( results )
		return ( unescape ( results[2] ) );
	else
		return null;
}
