function scaleWidth()
{
	var optimalLineLength = "36em";
	var extraAccounting = "6em";
	var minimumTextHeight = "14px";
	var windowWidth = document.body.clientWidth;
	var optimalSize = (windowWidth / (parseInt(optimalLineLength) + parseInt(extraAccounting))) - 8;

	if (optimalSize >= parseInt(minimumTextHeight))
	{
		document.body.style.fontSize = optimalSize + "px";
	}
	else
	{
		document.body.style.fontSize = parseInt(minimumTextHeight) + "px";
	}

	return true;
}

function textSize(size)
{
	var theContainer = document.getElementById("content");
	var increment = 0.1
	var currentSize = parseFloat(document.getElementById("content").style.fontSize);

	if (!currentSize)
	{
		currentSize = 0.8;
	}

	if (size == "smaller")
	{
		theContainer.style.fontSize = (currentSize - increment) + "em";
	}
	else
	{
		theContainer.style.fontSize = (currentSize + increment) + "em";
	}

	return true;
}
window.onload = scaleWidth;
window.onresize = scaleWidth;