 
 //=====ÃÊ±âÈ­=====//
 initFont();
// ===============//


// ============================ 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 = 10;  
    }                        
    setFont(article_fontSize);
  }
	
  function setFont(article_fontSize,id) { 
	
	 if(document.getElementById(id) !=null  && id !='contBoard' && id !='contGen' && id !='cont' ){	
		document.getElementById(id).style.fontSize = article_fontSize+"pt";  		
	}else{
		try {
			if(document.getElementById("contBoard") != null){
				document.getElementById("contBoard").style.fontSize = article_fontSize+"pt";
			}else if(document.getElementById("contGen") != null){
				document.getElementById("contGen").style.fontSize = article_fontSize+"pt";
			}else if(document.getElementById("cont") != null){
				document.getElementById("cont").style.fontSize = article_fontSize+"pt";
			}
		}catch(e){
		}
	}
	setFontCookie(article_fontSize);
  }	
	
  function setFontCookie(article_fontSize) {

    var expiry = new Date();
    var path = "/";
    //var domain = ".nfrdi.re.kr";  /
    var domain = "localhost";  
    var secure = "";

    expiry.setTime(expiry.getTime() + 90 * (24 * 60 * 60 * 1000));
    setCookie("article_fontSize",article_fontSize,expiry,path,domain,secure);

  }	
	
  function fontPlus(id) {		

	if(id == null){ id = 'contGen';	}

	if(isNaN(article_fontSize) == true) {article_fontSize = 10;  }
	
	//alert(article_fontSize);

	if (article_fontSize < 17) {  
      article_fontSize = article_fontSize + 1; 
      setFont(article_fontSize, id); 
    }
  }

  function fontMinus(id) {

	if(id == null){ id = 'contGen';	}

	if(isNaN(article_fontSize) == true) {article_fontSize = 10;  }

    if (article_fontSize > 9) {  
      article_fontSize = article_fontSize - 1; 
      setFont(article_fontSize, id); 
    }
  }	
   
// ============================ End :: Font °ü·Ã ÇÔ¼ö =============================

function printOpenPage(printPage, printThis, headFile)  {
    document.domain="nfrdi.re.kr";
	var w=700;
	var h=400;
	var winname='PrintPopWindow';
	var winprops = 'height='+h+',width='+w+',toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no';

	win = window.open (printPage + "?contPop="+printThis+"&headFile="+headFile, winname, winprops); 
}


function setFontSize(a,zoomArea){
	var defaultFontSize = 1;//em
	var minFontSize = 0.5;//em
	var maxFontSize = 2;//em
	if(!zoomArea){//È®´ëÃà¼Ò¿µ¿ª ÁöÁ¤ ¾øÀ¸¸é
		zoomArea = document.getElementById("printBody");//±âº» È®´ëÃà¼Ò¿µ¿ªÀº ¼­ºê º»¹®
		if(!zoomArea) zoomArea = document.getElementById("wrap");//¸ÞÀÎÀÏ °æ¿ì
	}
	if(zoomArea){
		if(!a) zoomArea.style.fontSize = parseFloat(defaultFontSize)+"em";//±âº»°ª
		else {
			var objFontSize = zoomArea.style.fontSize;
			if (!objFontSize) objFontSize = parseFloat(defaultFontSize)+"em";
			var checkFontSize = (Math.round(12*parseFloat(objFontSize))+(a*2))/12;
			if (checkFontSize >= maxFontSize) { checkFontSize = maxFontSize; zoomArea.style.fontSize = checkFontSize+"em"; alert("´õÀÌ»ó  È®´ë ÇÒ ¼ö ¾ø½À´Ï´Ù."); }
			else if (checkFontSize <= minFontSize) { checkFontSize = minFontSize; zoomArea.style.fontSize = checkFontSize+"em"; alert("´õÀÌ»ó Ãà¼Ò ÇÒ ¼ö ¾ø½À´Ï´Ù."); }
			else { zoomArea.style.fontSize = checkFontSize+"em"; }
		}
	}
}


function setFontSize1(a,zoomArea){
	var defaultFontSize = 1;//em
	var minFontSize = 0.5;//em
	var maxFontSize = 2;//em
	if(!zoomArea){//È®´ëÃà¼Ò¿µ¿ª ÁöÁ¤ ¾øÀ¸¸é
		zoomArea = document.getElementById("wrapper");//±âº» È®´ëÃà¼Ò¿µ¿ªÀº ¼­ºê º»¹®
		if(!zoomArea) zoomArea = document.getElementById("wrap");//¸ÞÀÎÀÏ °æ¿ì
	}
	if(zoomArea){
		if(!a) zoomArea.style.fontSize = parseFloat(defaultFontSize)+"em";//±âº»°ª
		else {
			var objFontSize = zoomArea.style.fontSize;
			if (!objFontSize) objFontSize = parseFloat(defaultFontSize)+"em";
			var checkFontSize = (Math.round(12*parseFloat(objFontSize))+(a*2))/12;
			if (checkFontSize >= maxFontSize) { checkFontSize = maxFontSize; zoomArea.style.fontSize = checkFontSize+"em"; alert("´õÀÌ»ó  È®´ë ÇÒ ¼ö ¾ø½À´Ï´Ù."); }
			else if (checkFontSize <= minFontSize) { checkFontSize = minFontSize; zoomArea.style.fontSize = checkFontSize+"em"; alert("´õÀÌ»ó Ãà¼Ò ÇÒ ¼ö ¾ø½À´Ï´Ù."); }
			else { zoomArea.style.fontSize = checkFontSize+"em"; }
		}
	}
}

function setFontSize2(a,zoomArea){
	var defaultFontSize = 1;//em
	var minFontSize = 0.5;//em
	var maxFontSize = 2;//em
	if(!zoomArea){//È®´ëÃà¼Ò¿µ¿ª ÁöÁ¤ ¾øÀ¸¸é
		zoomArea = document.getElementById("containerSub");//±âº» È®´ëÃà¼Ò¿µ¿ªÀº ¼­ºê º»¹®
		if(!zoomArea) zoomArea = document.getElementById("container");//¸ÞÀÎÀÏ °æ¿ì
	}
	if(zoomArea){
		if(!a) zoomArea.style.fontSize = parseFloat(defaultFontSize)+"em";//±âº»°ª
		else {
			var objFontSize = zoomArea.style.fontSize;
			if (!objFontSize) objFontSize = parseFloat(defaultFontSize)+"em";
			var checkFontSize = (Math.round(12*parseFloat(objFontSize))+(a*2))/12;
			if (checkFontSize >= maxFontSize) { checkFontSize = maxFontSize; zoomArea.style.fontSize = checkFontSize+"em"; alert("´õÀÌ»ó  È®´ë ÇÒ ¼ö ¾ø½À´Ï´Ù."); }
			else if (checkFontSize <= minFontSize) { checkFontSize = minFontSize; zoomArea.style.fontSize = checkFontSize+"em"; alert("´õÀÌ»ó Ãà¼Ò ÇÒ ¼ö ¾ø½À´Ï´Ù."); }
			else { zoomArea.style.fontSize = checkFontSize+"em"; }
		}
	}
}


