//--------------------------------------------
// Usage:
// resizeFont("+") => larger font
// resizeFont("-") => smaller font
// setFont()  => Inintial font
//--------------------------------------------
/* ÆùÆ® »çÀÌÁî ÀÚµ¿ ¼³Á¤À¸·Î ÆäÀÌÁö ºä¿¡¼­ »çÀÌÁî Á¦´ë·Î Ç¥Çö ¾ÈµÇ´Â Çö»ó
document.write("<style type=text/css> \
.content, .content a, .content a:visited { font-size:10pt; color:#222222; line-height:1.4; } \
</style>");
*/
var nowFontSize = 10 ; // Same size as above style
var fontObj ;

var expTime = new Date() ;
    expTime.setTime(expTime.getTime()+(24*60*60*1000*30)) ; // 30 days
var cName = "fontSize" ;
var cNameStr, cNameVal ;


function getCookie(arg){
 cNameStr = arg + "=" ;
 if (document.cookie){
   cStr_start = document.cookie.indexOf(cNameStr) ;
   if (cStr_start != -1){
    cStr_start += cNameStr.length ;
    cStr_end = document.cookie.indexOf(";", cStr_start) ;
    if (cStr_end == -1) cStr_end = document.cookie.length ;
    cNameVal = document.cookie.substring(cStr_start, cStr_end) ;
   }
 }
 if (cNameVal) return cNameVal ;
 else return null ;
}

function resizeFont(value){
 if (document.getElementById) fontObj = document.getElementById("autoFontArea").style ;
 else if (document.all) fontObj = document.all("autoFontArea").style ;
 // Font Resize
 if (value == "-"){
  if (nowFontSize < 9) return ;
  fontObj.fontSize = nowFontSize-1 + "pt" ;
  nowFontSize = eval(nowFontSize-1) ;
 }else if (value == "+"){
  if (nowFontSize >= 21) return ;
  fontObj.fontSize = nowFontSize+1 + "pt" ;
  nowFontSize = eval(nowFontSize+1) ;
 }
 // Save in Cookie
 document.cookie = cName + "=" + nowFontSize + "; path=/" + "; expires=" + expTime.toGMTString() ;
}

function setFont(){
 if (document.getElementById) fontObj = document.getElementById("autoFontArea").style ;
 else if (document.all) fontObj = document.all("autoFontArea").style ;
 // Use cookie values if available
 if (getCookie(cName)!=null) {
  getCookie(cName) ;
  nowFontSize = eval(cNameVal) ;
  fontObj.fontSize = nowFontSize + "pt" ;
 }
}
