//Å¾¸Þ´º ºÎºÐ °Ë»ö
function check_search(TheForm) {

		if(TheForm.query.value.length == 0){
        	alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä!");
            TheForm.query.focus();
            return false;
		}
}



//ÆäÀÌÁöÀÌµ¿
function PageMove(e)
{
	boardform.page.value = e;
	boardform.Dir.value = 0;
	boardform.submit();
}



// ±Û¾¾ ÆùÆ® Á¶Àý ½ºÅ©¸³Æ®
function getFontCookie() {
var search = 'news_font_size=';
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search);
if (offset != -1) {
offset += search.length;
end = document.cookie.indexOf(';', offset);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(offset, end));
}
else return 12;
}
else return 12;
}

function sizeFont(cnjid,size) {

var lineHeight;
var fontSize = parseInt(getFontCookie());
cnjstr = document.getElementById(cnjid);

if (size > 0) {
	if (fontSize <= 13) { 
		fontSize = fontSize + size;
		lineHeight = fontSize+Math.round(1.1*fontSize);
	}
} else {
	if (fontSize > 12) {
	fontSize = fontSize + size;
	lineHeight = fontSize+Math.round(1.1*fontSize);
	}
}

cnjstr.style.fontSize = fontSize + "px"; // ÆùÆ®Å©±â Àû¿ë

// ÄíÅ°·Î ÆùÆ® Å©±â ±â¾ï
document.cookie = 'news_font_size='+fontSize+'; path=/; expires=Sun Dec 31 23:59:59 GMT 2010';
}










var nowFontSz = 11 ; // À§ CSSÀÇ article°ú °°Àº Font Å©±â
var nowlineHei= 2 ; // À§ CSSÀÇ article°ú °°Àº Font Çà°£
var fontObj ;

var expTime = new Date() ;
    expTime.setTime(expTime.getTime()+(24*60*60*1000*365)) ; // 365ÀÏ°£ Àû¿ë
var cName1 = "fontSz" ;
var cName2 = "fontHei" ;
var cNameStr, cNameVal ;



function getCookie(){
 cNameStr = arguments[0] + "=" ;
 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 fontSz(){
 if (document.getElementById) fontObj = document.getElementById("fontSzArea").style ;
 else if (document.all) fontObj = document.all("fontSzArea").style ;
 // Font Resize
 if (arguments[0] == "-"){
  if (nowFontSz <= 9) return ;
  fontObj.fontSize = nowFontSz-1 + "pt" ;
  nowFontSz = eval(nowFontSz-1) ;

  if(nowFontSz < 13){
	  fontObj.lineHeight = nowlineHei+0.2 ;
	  nowlineHei = nowlineHei+0.2 ;
  }

 }else if (arguments[0] == "+"){
  if (nowFontSz >= 21) return ;
  fontObj.fontSize = nowFontSz+1 + "pt" ;
  nowFontSz = eval(nowFontSz+1) ;

  if(nowFontSz < 13){
	  fontObj.lineHeight = nowlineHei-0.2 ;
	  nowlineHei = nowlineHei-0.2 ;
 }  

 }
 // ResizeµÈ FontÀÇ °ªÀ» ÄíÅ°¿¡ Àû¿ë
 document.cookie = cName1 + "=" + nowFontSz + "; path=/" + "; expires=" + expTime.toGMTString() ;
 document.cookie = cName2 + "=" + nowlineHei + "; path=/" + "; expires=" + expTime.toGMTString() ;
}



function fontSet(){
 if (document.getElementById) fontObj = document.getElementById("fontSzArea").style ;
 else if (document.all) fontObj = document.all("fontSzArea").style ;
 // ÄíÅ°¿¡ Font°ª ÀÖÀ»½Ã Font¿¡ Àû¿ë
 if (getCookie(cName1)!=null || getCookie(cName2)!=null){
  getCookie(cName1) ;
  nowFontSz = eval(cNameVal) ;
  fontObj.fontSize = nowFontSz + "pt" ;
  getCookie(cName2) ;
  nowlineHei= eval(cNameVal) ;
  fontObj.lineHeight = nowlineHei ;
 }
}
