//'==================================================================================================================
//' Project     : Àå¾È½Ç¾÷
//' Sub System  : common/js
//' Title       : ÀÚ¹Ù½ºÅ©¸³Æ® °øÅëÇÔ¼öÆÄÀÏ
//' Description : ÀüÃ¼ÆäÀÌÁö¿¡¼­ »ç¿ëµÇ´Â ÀÚ¹Ù½ºÅ©¸³Æ® °øÅëÇÔ¼ö¸¦ ¸ð¾Æ³õÀº ÆÄÀÏÀÔ´Ï´Ù.
//' ÀÛ¼ºÀÚ      : °­Èñ
//' ¼Ò ¼Ó       : ÅÂÈñÀÎÅÍ³Ý
//' ÀÏ ÀÚ       : 2006.10.03 ÃÖÃÊÀÛ¼º            
//'             : 
//'             : 
//' »ç¿ëÅ×ÀÌºí  : 
//' »ç¿ëSP      : 
//'==================================================================================================================
//'
//' ÇÔ¼öÃß°¡½Ã ¹Ýµå½Ã ÁÖ¼®À¸·Î Comment¸¦ ´Þ¾ÆÁÖ¼¼¿ä
//' 1. ÇÔ¼ö¸í
//' 2. ÇÔ¼ö¼³¸í
//' 3. ÀÛ¼ºÀÚ¼º¸í
//' 4. ÀÛ¼ºÀÏÀÚ
//'



//******************************************************************************************
// ÀÚ¹Ù½ºÅ©¸³Æ® (common.js)
// confirm_delete(url)  - ÀÚ·á »èÁ¦½Ã »èÁ¦ È®ÀÎ ¸Þ½ÃÁö¸¦ º¸¿©ÁÖ°í, È®ÀÎ ÈÄ »èÁ¦ ÆäÀÌÁö url·Î ÀÌµ¿
// isEmpty(str)      - ¹Þ¾Æ¿Â ¹®ÀÚ¿­¿¡ °ªÀÌ ¼³Á¤µÇ¾î ÀÖ´ÂÁö Ã¼Å© (Return : true ¹®ÀÚ¿­ÀÌ ºó ¹®ÀÚ¿­ )
// getStrLen(str)    - String ¹®ÀÚ¿­À» ÆÄ¶ó¹ÌÅÍ·Î ¹Þ¾Æµé¿© byte ¼ö¸¦ ¸®ÅÏÇÑ´Ù (Return : String Byte ¼ö)
// openPopup(url, id, width, height) - ¸Þ´º¹Ù, ½ºÅ©·Ñ¹Ù, »óÅÂ¹Ù ¾ø´Â ÆË¾÷Ã¢À» ¶ç¿î´Ù (id:window name)
// isBlank(str)      - ÆÄ¶ó¹ÌÅÍ·Î ¹ÞÀº ¹®ÀÚ¿­ Áß¿¡ °ø¹éÀÌ Æ÷ÇÔµÇ¾î ÀÖ´ÂÁö Ã¼Å© °ø¹éÀÌ Æ÷ÇÔµÇ¾îÀÖÀ¸¸é ¿¡·¯ ¸Þ½ÃÁö ¹Ú½º º¸¿©ÁÜ (Return : true °ø¹éÀ» Æ÷ÇÔ)
// isAlphanumeric(s)  - ÆÄ¶ó¹ÌÅÍ·Î ¹ÞÀº ¹®ÀÚ¿­ Áß ¿µ¹®ÀÚ, ¼ýÀÚ ÀÌ¿ÜÀÇ ¹®ÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖ´ÂÁö Ã¼Å©
// isLetter(c)      - ÆÄ¶ó¹ÌÅÍ·Î ¹ÞÀº ¹®ÀÚ°¡ ¿µ¹®ÀÚ ÀÎÁö Ã¼Å© ( Return true ¿µ¹®ÀÚ )
// isDigit(c)      - ÆÄ¶ó¹ÌÅÍ·Î ¹ÞÀº ¹®ÀÚ°¡ ¼ýÀÚ ÀÎÁö Ã¼Å©  ( Return true ¼ýÀÚ )
// isKorean(str)    - ÆÄ¶ó¹ÌÅÍ·Î ¹ÞÀº ¹®ÀÚ¿­ Áß¿¡ ÇÑ±ÛÀÌ ¾Æ´Ñ ¹®ÀÚ°¡ ÀÖ´ÂÁö Ã¼Å© ( Return true ÇÑ±ÛÀÌ¸é )
// strCharByte(chStr)  - ¹ÙÀÌÆ®¼ö (ÇÑ±Û:return 2)
// isSpecialChar(str)  - ÆÄ¶ó¹ÌÅÍ·Î ¹ÞÀº ¹®ÀÚ¿­ Áß¿¡ Æ¯¼ö¹®ÀÚ ¾Æ´Ñ ¹®ÀÚ°¡ ÀÖ´ÂÁö Ã¼Å© (Return true Æ¯¼ö¹®ÀÚ¸¦ Æ÷ÇÔ)
// isNumber(str)    - ¼ýÀÚ Ã¼Å© (¼ýÀÚÀÌ¸é return true)
// isEmail(str)      - ¹Þ¾ÆµéÀÎ ¹®ÀÚ¿­¿¡ '@'¿Í'.' Ã¼Å© ( µÑ´Ù ÀÖÀ¸¸é return true )
// chkJumin(strRegNo1, strRegNo2) - ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å© (Return true ÁÖ¹Î¹øÈ£ Ã¼Å© ¼º°øÀÏ °æ¿ì )
// img_act(imgName, img)   - mouseover
// img_inact(imgName, img) - mouseout
//    <a href="¸µÅ©»çÀÌÆ®" onmouseover="img_act('img1')"ÀÌ¹ÌÁö ½ÇÇà onmouseout="img_inact('img1')">
//    <img src="tomcat.gif" border="0" name="img1"></a>
//
// blankToUnderbar(lim)  <input type="button" onclick="blankToUnderbar(this.form.aa)" value="test">
//    ÀÎÀÚÀÇ °ªÀ» ¹è¿­È­ ½ÃÄÑ¼­ ±×»çÀÌÀÇ °ª¿¡ °ø¹éÀÌ ÀÖÀ¸¸é °ø¹éÀ» ¾ð´õ¹Ù·Î Ç¥½Ã

// autotab(obj1, obj2 , len)  Æ÷Ä¿½º ÀÚµ¿À¸·Î ³Ñ±â±â  onkeyup ¿¡´Ù ÇÔ¼ö¸íÀ» Àû¾îÁÖ°í  ±×´ÙÀ½ (obj1,obj2,¾î´À½ÃÁ¡ºÎÅÍ Ä¿¼­ ÀÚµ¿ÀÌµ¿ÇÏ´Â±æÀÌÀÇ ¼ö¸¦ Àû¾î³õ´Â´Ù)
//     ex) <form name="myform">
//    <input type=text name=limht size=15 onkeyup="autotab('document.myForm.limht' ,'document.myForm.limpass', 5 )">
//    <input type=text name=limpass size=15 onkeyup="autotab('document.myForm.limpass' ,'document.myForm.limht', 5 )">

// cutFileName (value)
// showLayer(objLayer)  : Layer º¸ÀÌ±â/¼û±â±â
//**************************************************************************************************





//ÆË¾÷¶ç¿ì±â
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


//=========================================================================================================
// Function : checkChr
// Param : ¼ýÀÚÃ¼Å©
// Return :  true ¼ýÀÚÀÌ¸é
//           false  ¼ýÀÚ°¡ÀÌ³ª¸é
//Description : ¹Ù¾Æ¿Â°ªÀÌ ¼ýÀÚÀÎÁö Ã¼Å©.
//           

function checkChr(code)
{  
    if(((code<48) || (code>57)) && ((code<97) || (code>105)) ){ 
        alert("¼ýÀÚ¸¸ ÀÔ·Â°¡´É");  
        event.returnValue = false;
    }
}



// Function : isEmpty
// Param : str Ã¼Å©ÇÒ ¹®ÀÚ¿­
// Return :  true ¹®ÀÚ¿­ÀÌ ºó ¹®ÀÚ¿­ÀÌ¸é
//        false  ¹®ÀÚ¿­ÀÌ ºó ¹®ÀÚ¿­ÀÌ ¾Æ´Ï¸é
//Description : ¹Þ¾Æ¿Â ¹®ÀÚ¿­¿¡ °ªÀÌ ¼³Á¤µÇ¾î ÀÖ´ÂÁö Ã¼Å©ÇÑ´Ù.
//           Form Object¿¡ °ªÀÌ ÀÔ·Â µÇ¾ú´ÂÁö Ã¼Å©
function isEmpty(str) {
  var len = str.length ;
  var arr ;
  var bool ;
  bool = false ;

  if (len > 0) {
    arr = str.split(' ') ;

    for (i=0; i<arr.length; i++) {
      if (arr[i] == '') {
        bool = true
      } else {
        bool = false ;
        break;
      }
    }
  }
  else bool = true ;

  return bool ;
}

// Function : getStrLen
// Param : str Ä«¿îÆ®ÇÒ String
// Return : String Byte ¼ö (ÇÑ±ÛÀº 2byte)
// Description : String ¹®ÀÚ¿­À» ÆÄ¶ó¹ÌÅÍ·Î ¹Þ¾Æµé¿© byte ¼ö¸¦ ¸®ÅÏÇÑ´Ù.
function getStrLen(str) {
  var len=0, j;

  for (i=0, j=str.length; i<j; i++, len++) {
    if ( (str.charCodeAt(i)<0)||(str.charCodeAt(i)>127) ) {
      len = len+1;
    }
  }
  return len;
}

// Function : isEnglish
// Param c Ã¼Å©ÇÒ ¹®ÀÚ
// Return  true ¿µ¹®ÀÚÀÌ¸é
//        false ¿µ¹®ÀÚ ¾Æ´Ï¸é
// Description : ÆÄ¶ó¹ÌÅÍ·Î ¹ÞÀº ¹®ÀÚ°¡ ¿µ¹®ÀÚ ÀÎÁö Ã¼Å©
function isEnglish(c)
{
  return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) )
}

// Function isDigit
// Param c Ã¼Å©ÇÒ ¹®ÀÚ
// Return  true ¼ýÀÚ¸é
//        false ¼ýÀÚ ¾Æ´Ï¸é
// Description : ÆÄ¶ó¹ÌÅÍ·Î ¹ÞÀº ¹®ÀÚ°¡ ¼ýÀÚ ÀÎÁö Ã¼Å©
function isDigit(c)
{
  return ((c >= "0") && (c <= "9"))
}

// Function isKorean
// Param str Ã¼Å©ÇÒ ¹®ÀÚ¿­
// Return  true ÇÑ±ÛÀÌ¸é
//        false ÇÑ±Û ÀÌ¿ÜÀÇ ¹®ÀÚ¸¦ Æ÷ÇÔÇÏ°í ÀÖÀ¸¸é
// Description : ÆÄ¶ó¹ÌÅÍ·Î ¹ÞÀº ¹®ÀÚ¿­ Áß¿¡ ÇÑ±ÛÀÌ ¾Æ´Ñ ¹®ÀÚ°¡ ÀÖ´ÂÁö Ã¼Å©
function isKorean(str)
{
  if(!isSpecialChar(str)) {
    for (i = 0; i < str.length; i++) {
      ch = escape(str.charAt(i));        //ISO-Latin-1 ¹®ÀÚ¼ÂÀ¸·Î º¯°æ
      if (strCharByte(ch) == 2) return true;
    }
  }
    return false;
}

function strCharByte(chStr)
{
        if (chStr.substring(0, 2) == '%u') {
                if (chStr.substring(2,4) == '00')
                        return 1;
                else
                        return 2;        //ÇÑ±Û
        }
        else if (chStr.substring(0,1) == '%') {
                if (parseInt(chStr.substring(1,3), 16) > 127)
                        return 2;        //ÇÑ±Û
                else
                        return 1;
        }
        else {
                return 1;
        }
}

// Function isSpecialChar
// Param str Ã¼Å©ÇÒ ¹®ÀÚ¿­
// Return  true Æ¯¼ö¹®ÀÚ¸¦ Æ÷ÇÔÇÏ°í ÀÖÀ¸¸é
//        false Æ¯¼ö¹®ÀÚ¸¦ Æ÷ÇÔÇÏ°í ÀÖÁö ¾ÊÀ¸¸é
// Description : ÆÄ¶ó¹ÌÅÍ·Î ¹ÞÀº ¹®ÀÚ¿­ Áß¿¡ Æ¯¼ö¹®ÀÚ ¾Æ´Ñ ¹®ÀÚ°¡ ÀÖ´ÂÁö Ã¼Å©
function isSpecialChar(str)
{
  for (i = 0; i < str.length; i++) {
        asciiChar = str.charCodeAt(i);

    if ((asciiChar > 32 && asciiChar < 48) || (asciiChar > 57 && asciiChar < 65) || (asciiChar > 90 && asciiChar < 97)) return true ;
  }
  return false ;
}

function isNumber(str)
{
  for (i = 0; i < str.length; i++) {
        chr = str.charAt(i);

    if (!isDigit(chr)) return false ;
  }
  return true ;
}


function isFloat(str)
{
  for (i = 0; i < str.length; i++) {
        chr = str.charAt(i);

    if (!isNumeric(chr)) return false ;
  }
  return true ;
}

function isNumeric(c)
{
  return (((c >= "0") && (c <= "9")) || c == ".")
}

// Function : isEmail
// Param : str ÀÌ¸ÞÀÏ ¹®ÀÚ¿­
// Return :  true ÀÌ¸ÞÀÏ Ã¼Å© ¼º°øÀÏ °æ¿ì
//        false ÀÌ¸ÞÀÏ Ã¼Å© ½ÇÆÐÀÏ °æ¿ì
//Description
 function isEmail(str){
  for(var i=0;i<str.length;i++){
    if(str.substring(i+1,i+2)=='@'){
      var str_1='y';
    }
    if(str_1=='y' && str.substring (i,i+1)=='.'){
      return true;
    }
  }
  return false ;
}

// Function : isJumin
// Param : theForm FORM Object ÀÌ¸§
//         jumin1 ÁÖ¹Î¹øÈ£ Ã¹ÀÚ¸® Object ÀÌ¸§
//         jumin2 ÁÖ¹Î¹øÈ£ µÞÀÚ¸® Object ÀÌ¸§
// Return  true ÁÖ¹Î¹øÈ£ Ã¼Å© ¼º°øÀÏ °æ¿ì
//        false ÁÖ¹Î¹øÈ£ Ã¼Å© ½ÇÆÐÀÏ °æ¿ì
// Description
// ÁÖ¹Îµî·Ï¹øÈ£ À¯È¿¼º Ã¼Å©
function isJumin(strRegNo1, strRegNo2)
{
  var nCheckDigitFront, nCheckDigitBack;

  if (strRegNo1.substring(2,3) > 1)
    return false;

  if (strRegNo1.substring(4,5) > 3)
    return false;

  if (strRegNo2.substring(0,1) > 4
    || strRegNo2.substring(0,1) == 0) {
    return false;
  }

  var a1 = strRegNo1.substring(0,1)
  var a2 = strRegNo1.substring(1,2)
  var a3 = strRegNo1.substring(2,3)
  var a4 = strRegNo1.substring(3,4)
  var a5 = strRegNo1.substring(4,5)
  var a6 = strRegNo1.substring(5,6)
  nCheckDigitFront = (a1 * 2) + (a2 * 3) + (a3 * 4) + (a4 * 5) + (a5 * 6) + (a6 * 7);

  var b1 = strRegNo2.substring(0,1)
  var b2 = strRegNo2.substring(1,2)
  var b3 = strRegNo2.substring(2,3)
  var b4 = strRegNo2.substring(3,4)
  var b5 = strRegNo2.substring(4,5)
  var b6 = strRegNo2.substring(5,6)
  var b7 = strRegNo2.substring(6,7)

  nCheckDigitBack = nCheckDigitFront + (b1 * 8) + (b2 * 9) + (b3 * 2) + (b4 * 3) + (b5 * 4) + (b6 * 5);
  nCheckDigitBack = nCheckDigitBack % 11
  nCheckDigitBack = 11 - nCheckDigitBack
  nCheckDigitBack = nCheckDigitBack % 10

  if (nCheckDigitBack != b7)
    return false;
  else
    return true;
}


// ÀÌ¹ÌÁö ·Ñ¿À¹ö
// ÇÔ¼ö¸í : img_act
//         img_inact
// ¸¶¿ì½º¸¦ ¿Ã·ÈÀ»¶§ º¯ÇÏ´Â ÀÌ¹ÌÁö
// ±âº»°ªÀ¸·Î º¸¿©ÁÖ´Â ÀÌ¹ÌÁö
//------°è¼ÓÇØ¼­ img2   img3 À¸·Î Ãß°¡½ÃÅ³ ¼ö ÀÖ½À´Ï´Ù.--------
// ¸¶¿ì½º¸¦ ¿Ã¸®¸é ´Ù¸¥ ÀÌ¹ÌÁö¸¦ ÀÛµ¿½ÃÅµ´Ï´Ù.
// ¿ø»óÅÂ·Î º¹±¸ ÇÕ´Ï´Ù.
//<a href="¸µÅ©»çÀÌÆ®" onmouseover="img_act('img1')"ÀÌ¹ÌÁö ½ÇÇà onmouseout="img_inact('img1')"ÀÌ¹ÌÁö 1ÀÇ ÀÌ¹ÌÁö Á¾·á
//<img src="C:\Documents and Settings\Administrator\¹ÙÅÁ È­¸é\½ºÅ©¸³Æ® html\image\tomcat.gif" border="0" name="img1">
function img_act(imgName, img) {
   document [imgName].src = img;
}

function img_inact(imgName, img) {
   document [imgName].src = img ;
}



// °ø¹éÀ» Underbar(_)·Î Ä¡È¯
//ÇÔ¼ö¸í : blank2underbar
//À§ÀÇ ¼Ò½º¸¦ ¼³¸íÇÏÀÚ¸é ÀÎÀÚÀÇ °ªÀ» ¹è¿­È­ ½ÃÄÑ¼­
//±×»çÀÌÀÇ °ª¿¡ °ø¹éÀÌ ÀÖÀ¸¸é
//°ø¹éÀ» ¾ð´õ¹Ù·Î Ç¥½ÃÇÏ¶ó´Â ÀÇ¹ÌÀÔ´Ï´Ù
//<nput type="button" onclick="blankToUnderbar(this.form.aa)" value="test">
//À§¿Í °°ÀÌ ÀÌ·±½ÄÀ¸·Î »ç¿ëÇÏ¸é µË´Ï´Ù
function blankToUnderbar(lim){
  str = new Array() ;
  var kStr = "" ;
  str = lim.split(" ") ;
  for ( i = 0 ; i<str.length ; i++ ) {
    if ( i == 0 ) kStr = str[i] ;
    else kStr = kStr + "_" + str[i] ;
  }
  return kStr ;
}

// Æ÷Ä¿½º ÀÚµ¿À¸·Î ³Ñ±â±â
// ÇÔ¼ö¸í : autotab
//<form name="myform"> ---- form name¿©±â¼­ Á¤ÀÇÇØÁØ°ÍÃ³·³ myformÀÌ¶ó°í Àâ°í
// <input type=text name=limht size=15 onkeyup="autotab('document.myForm.limht' ,'document.myForm.limpass', 5 )"></td>
// onkeyup ¿¡´Ù ÇÔ¼ö¸íÀ» Àû¾îÁÖ°í  ±×´ÙÀ½ (obj1,obj2,¾î´À½ÃÁ¡ºÎÅÍ Ä¿¼­ ÀÚµ¿ÀÌµ¿ÇÏ´Â±æÀÌÀÇ ¼ö¸¦ Àû¾î³õ´Â´Ù)
// <input type=text name=limpass size=15 onkeyup="autotab('document.myForm.limpass' ,'document.myForm.limht', 5 )">
function autotab(obj1, obj2 , len){
  if(eval(obj1 + ".value.length") >= len ){
    eval(obj2+ ".focus()");
  }
}

function cutFileName (value) {
  var name, path, pos, length ;

  length = value.length ;
  pos = value.lastIndexOf ("\\") ;
  //path = value.substr(0, pos) ;
  name = value.substr(pos + 1, length) ;

  return name ;
}

// ·¹ÀÌ¾î º¸¿©ÁÖ±â/¼û±â±â
// ÇÔ¼ö¸í : showLayer
// <span id="layerID" style="display:none;"></span>
// <a href="JavaScript:showLayer(document.all.layerID);">Show Layer</a>
// param : ·¹ÀÌ¾î ¾ÆÀÌµð
function showLayer(objLayer) {
  if (objLayer.style.display == "none") objLayer.style.display = "block" ;
  else objLayer.style.display = "none" ;
}

// ¼±ÅÃÇÑ ÅØ½ºÆ®ÀÇ ½ºÅ¸ÀÏ º¯°æ
// ¼±ÅÃÇÑ ÅØ½ºÆ®ÀÇ ½ºÅ¸ÀÏÀ» »ö»óÀ» ºí·ç, º¼µå·Î º¯È¯
// param obj : ¼±ÅÃÇÑ ÅØ½ºÆ® ÀÌ¸§
//       cnt : ÀüÃ¼ ÅØ½ºÆ® ¼ö
function changeClickedFontStyle(obj, cnt) {
  var objTmp ;
  //var i = cnt - 1 ;  
  for (var i=1; i<=cnt; i++) {    
    objTmp = eval("document.all.font_0" + i) ;
    objTmp.style.fontWeight = 'normal' ;  
  }  
  obj.style.fontWeight = 'bold' ;
  obj.style.color = '#1868D2' ;
}
function changeClickedFontStyle2(obj, cnt) {
  var objTmp ;
  //var i = cnt - 1 ;  
  for (var i=1; i<=cnt; i++) {    
    objTmp = eval("document.all.font_0" + i) ;
    objTmp.style.fontWeight = 'normal' ;  
  }  
  obj.style.fontWeight = 'bold' ;
  //obj.style.color = 'orange' ;
  obj.style.color = '#000000' ;
}

function OpenWindow(img_name, fname, w, h){
 try
 {
  var he, we
  var LeftPosition=(screen.width)?(screen.width-w)/2:100;
  var TopPosition=(screen.height)?(screen.height-h)/2:100;

 he = parseInt(h) + 30;
 we = parseInt(w);// + 20;

  var settings='width='+we+',height='+he+',top='+TopPosition+',left='+LeftPosition+',toolbar=no, location=no,directories=no, status=yes, menubar=no, scrollbars=no, status=no, resizable=yes';

    var urlname =  "/bigimg.asp?get_file_name="+ img_name+"&width="+w+"&height="+h;
    browsing_window = window.open(urlname, "browse_org",settings);
    browsing_window.focus();


 }
 catch(exception)
 {
  alert(fname+' À©µµ¿ì¸¦ ¿©´ÂÁß¿¡ ¿¡·¯°¡ ¹ß»ý ÇÏ¿´½À´Ï´Ù.');
 }
}

function OpenWindow1(popup_name, fname, w, h){ //ÀÎ¼öÀÎ°è ÆË¾÷Ã¢
// try
// {
  var LeftPosition=(screen.width)?(screen.width-w)/2:100;
  var TopPosition=(screen.height)?(screen.height-h)/2:100;

  var settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',toolbar=no, location=no,directories=no, status=yes, menubar=no, scrollbars=yes, status=no, resizable=no';

    var urlname = popup_name;
    var fnames = fname;
    browsing_window1 = window.open(urlname, fnames, settings);
    browsing_window1.focus();


// }
// catch(exception)
// {
 // alert(fname+' À©µµ¿ì¸¦ ¿©´ÂÁß¿¡ ¿¡·¯°¡ ¹ß»ý ÇÏ¿´½À´Ï´Ù.');
// }
}

function term_chk(str,chk) { //fterm:ºÎÅÍ±â°£ , tterm:±îÁö±â°£ , s:³â(y) ³â¿ù(m) ³â¿ùÀÏ(d)
  var s = str;
  var chk = chk;

  var fterm, tterm, dif_y, dif_m, ref_m, ref_m1, to_m, to_m1;

    if (s=="y") //¿¬µµ ¿À·ù
    {
      var fterm = document.frm.from_y.value;
      var tterm = document.frm.to_y.value;
    }
    if (s=="m") //¿¬¿ù
    {
      var fterm = document.frm.from_y.value + document.frm.from_m.value;
      var tterm = document.frm.to_y.value + document.frm.to_m.value;
    }
    if (s=="d") //³â¿ùÀÏ
    {
      var fterm = document.frm.from_y.value + document.frm.from_m.value + document.frm.from_d.value;
      var tterm = document.frm.to_y.value + document.frm.to_m.value + document.frm.to_d.value;
    }

  if (fterm > tterm) {
    if (s=="y") { //¿¬µµ ¿À·ù
      alert('±â°£ ³âµµ¸¦ È®ÀÎÇÏ¼¼¿ä.');
    }
    if (s=="m") { //¿¬¿ù
      alert('±â°£ ³âµµ/¿ùÀ» È®ÀÎ ÇÏ¼¼¿ä.');
    }
    if (s=="d") { //³â¿ùÀÏ
      alert('±â°£ ³âµµ/¿ù/ÀÏÀ» È®ÀÎÇÏ¼¼¿ä.');
    }
    return false;
  }
  else {
    dif_y = document.frm.to_y.value - document.frm.from_y.value; //±îÁö³â - ºÎÅÍ³â
    //st_ym = document.frm.from_y.value * 100 + document.frm.from_m.value;
    //alert(dif_y);
    if (dif_y > 0) { // ÇØ°¡ ¹Ù²ð¶§

      ref_m = document.frm.from_m.value;
      to_m = document.frm.to_m.value;
      if (ref_m < 10) {
        ref_m1 = ref_m.substring(1,2);
          //alert(ref_m);
      }
      else
      {
        ref_m1 = ref_m;
      }
      if (to_m < 10) {
        to_m1 = to_m.substring(1,2);
          //alert(ref_m);
      }
      else
      {
        to_m1 = to_m;
      }
      //alert("ref_m1="+ref_m1);
      //alert(dif_y);
      //alert(to_m1);
      //return false;
      //dif_m = parseInt( 12 - ref_m1 + 1 ) + (dif_y-1)*12 + parseInt(to_m1);
      dif_m = parseInt( 12 - ref_m1 + 1 ) + (dif_y-1)*12 + parseInt(to_m1);
      //alert(dif_m);
      //dif_m = eval(dif_m);
      if (dif_m > 12 && chk != "exc") { //±â°£ÀÌ 12°³¿ù ÃÊ°úÀÏ¶§
          alert('±â°£ 12°³¿ù ÃÊ°úÀÔ´Ï´Ù.');
          //history.go(-1);
          return false;
      }
    }

  } // Else End
}

// ½Ã½ºÅÛ¸í : °ø±Þ¾ÈÁ¤È­ ½Ã½ºÅÛ
// ÇÔ¼ö¸í   : termSupp_chk
// ÇÔ¼ö¼³¸í : Á¶È¸ ¹üÀ§ Ã¼Å© ¹× 13°³¿ù ÃÊ°ú Á¶È¸Á¶°Ç Â÷´Ü

function termSupp_chk(str,chk) { //fterm:ºÎÅÍ±â°£ , tterm:±îÁö±â°£ , s:³â(y) ³â¿ù(m) ³â¿ùÀÏ(d)
  var s = str;
  var chk = chk;

  var fterm, tterm, dif_y, dif_m, ref_m, ref_m1, to_m, to_m1;

    if (s=="m") //¿¬¿ù
    {
      var fterm = document.frm.from_y.value + document.frm.from_m.value;
      var tterm = document.frm.to_y.value + document.frm.to_m.value;
    }
    
  if (fterm > tterm) {    
    if (s=="m") { //¿¬¿ù
      alert('±â°£ ³âµµ/¿ùÀ» È®ÀÎ ÇÏ¼¼¿ä.');
    }    
    return false;
  }
  else {
    dif_y = document.frm.to_y.value - document.frm.from_y.value; //±îÁö³â - ºÎÅÍ³â
    
    if (dif_y > 0) { // ÇØ°¡ ¹Ù²ð¶§

      ref_m = document.frm.from_m.value;
      to_m = document.frm.to_m.value;
      if (ref_m < 10) {
        ref_m1 = ref_m.substring(1,2);
      }
      else
      {
        ref_m1 = ref_m;
      }
      if (to_m < 10) {
        to_m1 = to_m.substring(1,2);
      }
      else
      {
        to_m1 = to_m;
      }
      
      dif_m = parseInt( 12 - ref_m1 + 1 ) + (dif_y-1)*12 + parseInt(to_m1);
    
      if (dif_m > 13 && chk != "exc") { //±â°£ÀÌ 13°³¿ù ÃÊ°úÀÏ¶§
          alert('±â°£ 13°³¿ù ÃÊ°úÀÔ´Ï´Ù.');
          return false;
      }
    }

  } // Else End
}


//function num_only(){
//  if((event.keyCode<48) || (event.keyCode>57)){
//    event.returnValue=false;
//  }
//}
// ¼ýÀÚ, '.'¸¸ ÀÔ·Â°¡´ÉÇÏµµ·Ï ¼öÁ¤
function num_only()
{
  //(((c >= "0") && (c <= "9")) || c == ".")
  if(((event.keyCode<48) && (event.keyCode != 46)) ||((event.keyCode>57) && (event.keyCode != 46)))
  {
    event.returnValue=false;
  }  
}

///* ÇÔ¼ö¸í  : add_comma                                    *
// * ¼³  ¸í  : ¼ýÀÚ¸¦ ÀÔ·ÂÇÏ¸é °¡°Ý¾ç½ÄÀ¸·Î ÄÞ¸¶¸¦ µ¡ºÙÀÓ        *
// * ÀÛ¼ºÀÏ  : 2003³â 2¿ù 4ÀÏ                                *
// * ÀÛ¼ºÀÚ  : Á¶»ó¹Î                                        *
// * ÀÎ  ÀÚ  : what - °´Ã¼                                   *  
// * °á°ú°ª  : ¾øÀ½                                          */
//

function strip_comma(data) {      /* ÀÔ·ÂµÈ °ª¿¡¼­ ÄÞ¸¶¸¦ ¶¼¾î³½´Ù. */
     var flag = 1;  // À½¼ö, ¾ç¼ö »óÅÂÇÃ·¡±× default: ¾ç¼ö(1) 
    var valid = "1234567890";
    var output = '';
  if ( data.charAt(0) == '-')       /* °è»ê½Ä¿¡¼­ ½á¸Ô¾î¾ß ÇÏ¹Ç·Î... */
  {
    //flag = 0;
    data = data.substring(1);
  }
    for (var i=0;  i<data.length; i++)
  {
       if (valid.indexOf(data.charAt(i)) != -1)
          output += data.charAt(i)
  }
  if ( flag == 1 ) 
      return  output;
  else if ( flag == 0 )
    return  ('-' + output);
} 

function add_comma(what) {          /* ÀÚ¸´¼ýÀÚ¿¡µû¶ó ÄÞ¸¶¸¦ ºÙÀÎ´Ù. */
    var flag = 1;  // À½¼ö, ¾ç¼ö »óÅÂÇÃ·¡±× default: ¾ç¼ö(1) 
    var data =  what.value;
    var len = data.length;
    
  if ( data.charAt(0) == '-' )
    {
      //flag = 0; //À½¼ö  
        data = data.substring(1);
    }    
    if (data.charAt(0) == '0' && data.charAt(1) == '-')
    {
      //flag = 0; 
  data = data.substring(2);
    }
       
    var number = Number(strip_comma(data)); //// ÄÞ¸¶¸¦ »èÁ¦ÈÄ ¼ýÀÚÇü½ÄÀ¸·Î º¯È¯!
    number = ''+number;
    if (number.length > 3)
     {
        var mod = number.length%3;
        var output = (mod > 0 ? (number.substring(0,mod)) : '');
        for (i=0 ; i < Math.floor(number.length/3) ; i++)
        {
            if ((mod ==0) && (i ==0))
                output+= number.substring(mod+3*i,mod+3*i+3);
            else
                output+= ',' + number.substring(mod+3*i,mod+3*i+3);
        }
        if ( flag == 0 ) 
        {
          what.value = '-' + output;
        }
        else    
          what.value = output;
    }
    else
    {
      if ( flag == 0 )
      {
            what.value = '-' + number;
      }     
      else 
           what.value = number;
    }  

  return number
}

// ÁÂÃø °ø¹éÁ¦°Å
function ltrim ( s ) {
  return s.replace( /^\s*/, "" );
}
// ¿ìÃø °ø¹éÁ¦°Å
function rtrim ( s ) {
  return s.replace( /\s*$/, "" );
}
// ÁÂÃø, ¿ìÃø °ø¹éÁ¦°Å
function trim ( s ) {
  return rtrim(ltrim(s));
}

// ±ÛÀÚ Àß¶ó¼­ º¸¿©ÁÖ°í Ç³¼± µµ¿ò¸»·Î Full ³×ÀÓ º¸¿©ÁÖ±â
function replaceNm(str,icnt)
{
 var replaceNm = "";
 if (str.length > icnt) 
  {
    replaceNm = "<a title='"+str+"' ><font color=646464>"+str.substring(0,icnt)+"..</a>";
  }  else {
    replaceNm = str;
  }
  return replaceNm;
}




//°ø¹éÆ÷ÇÔ Ã¼Å©
// 1. hasBlank(tmpStr)
// 2. tmpStr ¹®ÀÚ¿­ Áß¿¡ °ø¹éÀÌ Æ÷ÇÔµÇ¾î ÀÖ´ÂÁö¸¦ Ã¼Å©ÇÏ¿© Æ÷ÇÔµÇ¾î ÀÖÀ¸¸é true, ¾øÀ¸¸é false¸¦ ¸®ÅÏÇÕ´Ï´Ù.

function hasBlank(tmpStr) {
  if (tmpStr.indexOf(" ") >= 0) {
    return true;
  } else {
    return false;
  }
}

//¿øÇÏ´Â ¹®ÀÚ ÀÌ¿ÜÀÇ ¹®ÀÚ ÀÔ·Â Ã¼Å©

function allowedStringCheck(str,refStr) {
  var tempStr = refStr;
  var a = 0;
  for (i = 0; i < str.length; i++) {
    if (tempStr.indexOf(str.substring(i,i+1)) == -1) {
      a++;
    }
  }
  if (a == 0) {  
    return true;
  } else {
    return false;
  }
}

//Progress Bar¸¦ ³ªÅ¸³»´Â Ã¢À» call ÇÏ´Â ÇÔ¼ö
function ShowProgress()
{
  strAppVersion = navigator.appVersion;
  
  if (strAppVersion.indexOf('MSIE') != -1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4) {

    winstyle = "dialogWidth=385px; dialogHeight:150px; center:yes";
    window.showModelessDialog("/common/asp/show_progress.asp?nav=ie", null, winstyle);
  }
  else {

    winpos = "left=" + ((window.screen.width-380)/2) + ",top=" + ((window.screen.height-110)/2);
    winstyle="width=380,height=110,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no,copyhistory=no," + winpos;
    window.open("/common/asp/show_progress.asp?nav=ns",null,winstyle);
  }
  
  return true;
}

//Å¾¸Þ´º ¸µÅ©
function TopMenuAction(tmpPgmLevel, tmpPgmId, tmpPrmUrl) {
  var path
    ButtonOn(tmpPgmId);
    path = "/pagelink_top.asp?pgm_id=" + tmpPgmId;
    top.f_main.location.href = path;
//    top.center.location.replace(path);
}

//¿ÞÂÊ¸Þ´º ¸µÅ©
function LeftMenuAction(tmpPgmLevel, tmpPgmId, tmpRoleCd, tmpPrmUrl, tmpHdlYn) {
  var path
    path = "/redirect.asp?pgm_level=" + tmpPgmLevel + "&pgm_id=" + tmpPgmId + "&role_cd=" + tmpRoleCd + "&prm_url=" + tmpPrmUrl + "&hdl_yn=" + tmpHdlYn;
    top.f_main.location.href = path;
//    window.open(path);
//    top.center.main.location.replace(path);
}

//¸Þ´º ¸µÅ©
function MenuAction(tmpPgmId, tmpPgmUrl) {
  var path
    path = "/pagelink.asp?pgm_id=" + tmpPgmId + "&prm_url=" + tmpPgmUrl;
    location.href = path;
}

//³¯Â¥À¯È¿¼º °Ë»ç

function isDate(obj) {
  var input = obj.value.replace(/-/g,"");
  var inputYear = input.substr(0,4);
  var inputMonth = input.substr(4,2) - 1;
  var inputDate = input.substr(6,2);
  var resultDate = new Date(inputYear, inputMonth, inputDate);
  if ( resultDate.getFullYear() != inputYear ||
       resultDate.getMonth() != inputMonth ||
       resultDate.getDate() != inputDate) {
    obj.value = "";
    return false;
  } else {
    obj.value = inputYear + "-" + input.substr(4,2) + "-" + inputDate;
    return true;
  }
}

//°Ô½ÃÆÇÆÄÀÏ ´Ù¿î·Îµå

function BoardFileDown(tmpBordDiv, tmpBordSeq, tmpFileSeq) {
    var path;
    path = "/board/brd/bobr_file_download.asp?bord_div=" + tmpBordDiv + "&bord_seq=" + tmpBordSeq + "&file_seq=" + tmpFileSeq;
//    window.open(path,"FILEDOWN","width=10,height=10");
    b_iframe.location.href = "/common/asp/set_log.asp";     //ÆäÀÌÁö ·Î±× ±â·ÏÀ» À§ÇÑ ÆäÀÌÁö È£Ãâ
    document.location.href = path;
}

function ShowLoadingBar() {
    try {
        var sWidth = 1024;
        var sHeight = 700;
        var fPosStartTop = window.screenTop;
        var fPosStartLeft = window.screenLeft;
        var imageWidth = 279;
        var imageHeight = 102;
        var divPosTop = 0;
        var divPosLeft = 0;
        
        divPosTop = Math.round((sHeight - fPosStartTop - imageHeight) / 2)
        divPosLeft = Math.round((sWidth - fPosStartLeft - imageWidth) / 2)

        document.all.loadingBar.style.top = divPosTop;
        document.all.loadingBar.style.left = divPosLeft;
        document.all.loadingBar.style.display = "inline";
    } catch (exception) {
    }
}

function HideLoadingBar(tmpType) {
    try {
        if (tmpType == "samepage") {
            document.all.loadingBar.style.display = "none";
        } else if (tmpType == "iframe") {
            parent.loadingBar.style.display = "none";
        }
    } catch (exception) {
    }
}

/* ·Î±×ÀÎ */
function login(){
    var obj
        obj = document.form;
    if (isEmpty(obj.web_id.value)) {
            alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
            obj.web_id.focus();
            return
        }
    if (isEmpty(obj.web_pass.value)) {
            alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
            obj.web_pass.focus();
            return
        }
    
        enableForm(obj);
        obj.submit();
    }

function enableForm(obj) {
        for (i=0;i<obj.length;i++) {
            if (obj[i].disabled) {
                obj[i].disabled = false;
            }
        }
    }


    function TabButton(btnNo, btnCnt) {
        for (i=0;i<btnCnt + 1;i++) {
            if (i == btnNo) {
                ButtonOn(i);
            } else {
                ButtonOff(i);
            }
        }
    }

    function ButtonOn(btnNo) {
        var objTable, objBtnL, objBtnR, objLink
        objTable = eval("document.all.MNU_" + btnNo);
        objBtnL = eval("document.all.MNUL_" + btnNo + "");
        objBtnR = eval("document.all.MNUR_" + btnNo + "");
        objLink = eval("document.all.LNK_" + btnNo + "");
        objTable.className = "site_link_tab_on";
        objLink.className = "link_tab_on";
        objBtnL.src = "/img/tab_left_on.gif";
        objBtnR.src = "/img/tab_right_on.gif";
    }

    function ButtonOff(btnNo) {
        var objTable, objBtnL, objBtnR, objLink
        objTable = eval("document.all.MNU_" + btnNo);
        objBtnL = eval("document.all.MNUL_" + btnNo + "");
        objBtnR = eval("document.all.MNUR_" + btnNo + "");
        objLink = eval("document.all.LNK_" + btnNo + "");
        objTable.className = "site_link_tab";
        objLink.className = "link_tab";
        objBtnL.src = "/img/tab_left_on.gif";
        objBtnR.src = "/img/tab_right_on.gif";
    }



function goSubmit_Cost(){
obj = document.frmBoard;
obj.action = "Cost_WriteOk.asp";
if (isEmpty(obj.tit_cntn.value)) {
    alert("±ÛÁ¦¸ñÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
    obj.tit_cntn.focus();
    return;
    }

if (isEmpty(obj.Name.value)) {
    alert("ÀÌ¸§À» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
    obj.Name.focus();
    return;
    }

if (isEmpty(obj.Phone.value)) {
    alert("¿¬¶ôÃ³¸¦ ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
    obj.Phone.focus();
    return;
    }

if (isEmpty(obj.bord_cntn.value)) {
    alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
    obj.bord_cntn.focus();
    return;
    }
    obj.submit();
}

function goList_Cost(intPage){
location.href="./Cost_List.asp?intPage="+intPage
}

function goDel_Cost(Bord_Seq,intPage){
if (confirm("»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")) {
        location.href="./Cost_Del.asp?Bord_Seq="+Bord_Seq+"&intPage="+intPage
    }
}

function goAgree_Cost(Bord_Seq,intPage,Treat_Yn){
    location.href="./Cost_Treat.asp?Bord_Seq="+Bord_Seq+"&intPage="+intPage+"&Treat_Yn="+Treat_Yn
}

function goWrite_Print(Mode,Bord_Div){
    location.href="./Print_Write.asp?Mode="+Mode+"&Bord_Div="+Bord_Div
}

function goSubmit_Print(){
obj = document.frmBoard;
obj.action = "Print_WriteOk.asp";
if (isEmpty(obj.tit_cntn.value)) {
    alert("±ÛÁ¦¸ñÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
    obj.tit_cntn.focus();
    return;
    }


if (isEmpty(obj.File_Nm.value)) {
    alert("ÆÄÀÏÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
    obj.File_Nm.focus();
    return;
    }
    obj.submit();
}

function goEditSubmit_Print(){
obj = document.frmBoard;
obj.action = "Print_WriteOk.asp";
if (isEmpty(obj.tit_cntn.value)) {
    alert("±ÛÁ¦¸ñÀ» ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
    obj.tit_cntn.focus();
    return;
    }

    obj.submit();
}

function goList_Print(Bord_Div,intPage){
location.href="./Print_List.asp?Bord_Div="+Bord_Div+"&intPage="+intPage
}

function goEdit_Print(Mode,Bord_Div,Bord_Seq,intPage){
    location.href="./Print_Write.asp?Mode="+Mode+"&Bord_Div="+Bord_Div+"&Bord_Seq="+Bord_Seq+"&intPage="+intPage
}

function goDel_Print(Bord_Div,Bord_Seq,intPage){
location.href="./Print_Del.asp?Bord_Div="+Bord_Div+"&Bord_Seq="+Bord_Seq+"&intPage="+intPage
}


function searchit(){
obj = document.frm;
obj.action = "janghan_05.asp";
if (isEmpty(obj.keyword.value)) {
    alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
    obj.keyword.focus();
    return;
    }
    obj.submit();
}

function goPrint_ifrm(Bord_Div,Bord_Seq,intPage){
ifrmview.location.href="./Ifrm_Print_View.asp?Bord_Div="+Bord_Div+"&Bord_Seq="+Bord_Seq+"&intPage="+intPage;
return;
}

function goList_Notice(Bord_Div,intPage){
location.href="./janghan_05.asp?Bord_Div="+Bord_Div+"&intPage="+intPage
}

function goView_Bord(Bord_Div,Bord_Seq){
location.href="/janghan/janghan_05_Visit_Ok.asp?Bord_Div="+Bord_Div+"&Bord_Seq="+Bord_Seq
}




//Äü¸Þ´º¿ë
var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isNS = navigator.appName == "Netscape";

function getRef(id) {
	if (isDOM) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
}

function getSty(id) {
	x = getRef(id);
	return (isNS4 ? getRef(id) : getRef(id).style);
}

var scrollerHeight = 245;
var puaseBetweenImages = 3000;
var imageIdx = 0;

function moveRightEdge() {

	var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;

	if (isNS4) {
		yMenuFrom   = divTop.top;
		yMenuTo     = windows.pageYOffset;   // À§ÂÊ À§Ä¡
	} else if (isDOM) {
		yMenuFrom   = parseInt (divTop.style.top, 10);
		yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop); // À§ÂÊ À§Ä¡
	}
	timeoutNextCheck = 500;

	if (yMenuFrom != yMenuTo) {
		yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 20);
		if (yMenuTo < yMenuFrom)
			yOffset = -yOffset;
		if (isNS4)
			divTop.top += yOffset;
		else if (isDOM)
			divTop.style.top = parseInt (divTop.style.top, 10) + yOffset;
			timeoutNextCheck = 10;
	}
	setTimeout ("moveRightEdge()", timeoutNextCheck);
}

