var fontSize = 12;
var lineHeight = 22;

function saveFaceSize()
{
	/* ¸¸·á±â°£ 6 ÀÏÀ¸·Î ¼³Á¤ */
	var expire = new Date ();
   	expire.setTime (expire.getTime() + (6000 * 24 * 3600000)); 
   	expire = expire.toGMTString();
	document.cookie="fontSize="+fontSize+"; path=/; expires="+expire;
}
	
function setFaceSize()
{
	lineHeight = fontSize+Math.round(.3*fontSize);
	obj = document.getElementById("articleBody");
	obj.style.fontSize = fontSize+"px";
	obj.style.lineHeight = lineHeight+"px"

    saveFaceSize();
}

function fontLarger()
{
	fontSize = fontSize+2;

    if (( fontSize > 9) && ( fontSize < 12 ))
    {
        fontSize = 12;
    }	
    if (( fontSize > 12) && ( fontSize < 15 ))
    {
        fontSize = 15;
    }
    if (( fontSize > 15) && ( fontSize < 18 ))
    {
        fontSize = 18;
    }
    if (( fontSize > 18) && ( fontSize < 20 ))
    {
        fontSize = 20;
    }
    if (( fontSize > 20) && ( fontSize < 22 ))
    {
        fontSize = 22;
    }
    if (( fontSize > 23) && ( fontSize < 26 ))
    {
        fontSize = 26;
    }
	if (fontSize > 26) fontSize = 26;
	
	setFaceSize();
}
	
	
function fontSmaller()
{
	fontSize = fontSize-2

    if (( fontSize > 9) && ( fontSize < 15 ))
    {
       fontSize = 12;
    }
    if (( fontSize > 15) && ( fontSize < 18 ))
    {
       fontSize = 15;
    }
    if (( fontSize > 18) && ( fontSize < 20 ))
    {
       fontSize = 18;
    }
    if (( fontSize > 20) && ( fontSize < 22 ))
    {
       fontSize = 20;
    }
    if (( fontSize > 23) && ( fontSize < 26 ))
    {
       fontSize = 23;
    }
	
	if (fontSize < 12) fontSize = 12;
	
	setFaceSize();
}
	
function loadFontSize()
{
	tempArray = document.cookie.split(";");		
	for (tA = 0; tA < tempArray.length; tA++)
	{
		if (tempArray[tA].indexOf('fontSize') > -1) //found the font section in cookie
		{
			fontValue = tempArray[tA].split("=")
			fontSize = parseInt(fontValue[1]);
			lineHeight = fontSize+Math.round(.3*fontSize);
		}
	}
}

function OnPrint() {
   window.print();
}
function textInit()
{
    if (document.getElementById("articleBody") != null)
    {
	    loadFontSize();
    	setFaceSize();
    }
}
window.onload = textInit;
