var defaultFontSize = 81.5;
var cookie_myfont_size = blogId+'_'+'myfont_size';
if( getCookie( cookie_myfont_size ) == null )
	var currentFontSize = defaultFontSize;
else
	var currentFontSize = parseInt( getCookie( cookie_myfont_size ) );

function revertFontSize()
{
	currentFontSize = defaultFontSize;
	changeFontSize(0);
	deleteCookie( cookie_myfont_size );
}

function changeFontSizeLarger()
{
	changeFontSize( 5 );
}

function changeFontSizeSmaller()
{
	changeFontSize( -5 );
}

function changeFontSize( difference )
{
	currentFontSize = currentFontSize + parseInt( difference );

	if( currentFontSize > 121.5 ) 
	{
		currentFontSize = 121.5;
	} else if( currentFontSize < 66.5 )
	{
		currentFontSize = 66.5;
	}
	setFontSize( currentFontSize );
	setCookie( cookie_myfont_size, currentFontSize, 3 );
}

function setFontSize( fontSize )
{
	document.body.style.fontSize = fontSize + '%';
}

function initialFontSize()
{
	setFontSize( currentFontSize );
}

window.onload = initialFontSize;