// ============================ Start :: Cookie °ü·Ã ÇÔ¼ö =============================
function delCookie(name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function setCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1) endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function getCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg) return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
  }
  return null;
}
// ============================ End :: Cookie °ü·Ã ÇÔ¼ö =============================

// ============================ Start :: Font °ü·Ã ÇÔ¼ö =============================
  var article_fontSize = parseInt(getCookie("article_fontSize")); 		

  function initFont() { 
    if ( (article_fontSize < 10) || (article_fontSize > 18) || (isNaN(article_fontSize) == true)) {
      article_fontSize = 9;  // Æ¯º°ÇÑ, ÆùÆ®Å©±âÀÇ ÁöÁ¤ÀÌ ¾øÀ» °æ¿ì µðÆúÆ®·Î ÀúÀå(ÄíÅ°·Î)µÇ´Â ÆùÆ® »çÀÌÁî ÀÔ´Ï´Ù.	
    }                        // ÄíÅ°·Î ÀúÀåµÇ´Â °æ¿ì, ¾î¶² ½ºÅ¸ÀÏÅ¬·¡½ºº¸´Ù ¿ì¼±ÇÏ°Ô µË´Ï´Ù.
    setFont(article_fontSize);
  }
	
  function setFont(article_fontSize) { 		
    document.getElementById("setFontBody").style.fontSize = article_fontSize+"pt";  
    // ½ÇÁ¦ HTML ÆäÀÌÁö¿¡¼­, ÆùÆ®Á¶Á¤¿¡ »ç¿ëÇÒ ¿¤¸®¸ÕÆ® °ª:setFontBody (ÇÊ¿ä¿¡ µû¶ó ¿¤¸®¸ÕÆ® ÀÌ¸§ º¯°æ °¡´É)
    setFontCookie(article_fontSize);
  }	
	
  function setFontCookie(article_fontSize) {
    var expiry = new Date();
    var path = "/";
    var domain = "http://210.90.199.5/KO/";  // ´ÙÀ½ ½ºÅ©¸³Æ®¸¦ »ç¿ëÇÒ µµ¸ÞÀÎ¿¡ ¸Â°Ô »ç¿ëÇØ¾ß ÇÕ´Ï´Ù.
    var secure = "";

    expiry.setTime(expiry.getTime() + 90 * (24 * 60 * 60 * 1000));
    setCookie("article_fontSize",article_fontSize,expiry,path,domain,secure);
  }	
	
  function fontPlus() {		
    if (article_fontSize < 17) {  // ÃÖ´ë 17pt ±îÁö Å©±â¼³Á¤À» ÇÒ ¼ö ÀÖ½À´Ï´Ù.
      article_fontSize = article_fontSize + 1; 
      setFont(article_fontSize); 
    }
  }

  function fontMinus() {
    if (article_fontSize > 9) {  // ÃÖ¼Ò 9pt ±îÁö Å©±â¼³Á¤À» ÇÒ ¼ö ÀÖ½À´Ï´Ù.
      article_fontSize = article_fontSize - 1; 
      setFont(article_fontSize); 
    }
  }	
// ============================ End :: Font °ü·Ã ÇÔ¼ö =============================
