/*
** -----------------------------------------------------------------------------
**
**                             ñ»ãÒüåÞä ËÝá§Ðüâú
**                             -----------------
**                          GUSE Technologies, Inc.
**     Sinhan B/D 3F 645-14, Yoksam-dong, Kangnam-Ku, Seoul, 135-080 Korea
**
**  (@)Copyright 2000, GUSE Technologies, Inc.  All rights reserved.
**  Proprietary information of GUSE Technologies, Inc.
**  Unauthorized copying, adaption, display, use or disclosure is prohibited.
**
**  ÀÌ ÇÁ·Î±×·¥Àº (ñ»)ËÝá§Ðüâú¿¡ ÀÇÇØ ÀÛ¼º µÇ¾ú½À´Ï´Ù.
**  ÀÌ ÇÁ·Î±×·¥ÀÇ ¼ÒÀ¯±ÇÀº (ñ»)ËÝá§Ðüâú¿¡ ±Í¼ÓµÇ¸ç, (ñ»)ËÝá§ÐüâúÀÇ Çã°¡ ¾øÀÌ´Â
**  º¹»ç, º¯°æ, »ç¿ëµÉ ¼ö ¾ø½À´Ï´Ù.
**
** -----------------------------------------------------------------------------
**
**  ÆÄÀÏ¸í      : common.js
**  ¹öÁ¯        : 1.0
**  ±â´É        : Client¿¡¼­ÀÇ µ¥ÀÌÅÍ Á¦¾î ±â´ÉÀ» ´ã´çÇÑ´Ù.
**  ÀÛ¼ºÀÏÀÚ    : 2000-10-26
**  ÀÛ¼ºÀÚ      : ±è¿ëÃ¶
**  º¯°æÀÏ/³»¿ª : 2000-11-11(Á¤±Ù¾Ö) openSubWindow¸Þ¼Òµå Ãß°¡
**				: 2000-11-11(±è¿ëÃ¶) => Function Ãß°¡
**							getFindControlValue(Æû°´Ã¼,'Control¸í') -> Æû°´Ã¼¿¡ Á¸ÀçÇÏ´Â Control¿¡ ´ëÇÑ Value¸¦ ¸®ÅÏÇÑ´Ù.
**							setClearControl(Æû°´Ã¼) -> Æû°´Ã¼¿¡ Á¸ÀçÇÏ´Â ControlÀ» ÃÊ±âÈ­ ½ÃÅ²´Ù.(´Ü Combo´Â '0' Index¿¡ µÐ´Ù.)
**				  2000-11-16(Á¤±Ù¾Ö) checkEqualLen¼öÁ¤ return °ªÀ» message·Î ÇÑ´Ù.
**				  2000-11-17(Á¤±Ù¾Ö) list box ¿¡ °ª Ãß°¡, »èÁ¦, clear ±â´ÉÃß°¡
**  Âü°í»çÇ×    : 2000-11-21(Á¤±Ù¾Ö) checkAlpaNumeric Ãß°¡
**									date¿¡ °üÇÑ ÇÔ¼ö Ãß°¡
**									str2date(sDate): stringÀ» date°´Ã¼·Î ¹Ù²ãÁÝ´Ï´Ù.
**									valiDate	   :privateÇÔ¼ö ÀÔ´Ï´Ù.
**									isDate
**									checkDate
**									dateDiff(sDate1,sDate2) sDate1-sDate2ÀÇ Â÷¸¦ ±¸ÇÕ´Ï´Ù.
**				  2000-11-23(Á¤±Ù¾Ö) noEnter Ãß°¡ enterÅ° ¹ß»ý½Ã ¸·¾ÆÁØ´Ù.
**				  2001-01-29(±è¿ëÃ¶) str2number() functionÃß°¡
**				  2001-02-08(±è¿ëÃ¶) cursorWait(), cursorArrow() functionÃß°¡
**                2003-01-15(dsyoon) maspRT(val, pos, setType) : ¼ýÀÚÀÇ ¹Ý¿Ã¸² ¶Ç´Â Àý»è
**                2003-02-05(±èÇÑÀÏ) getWantDayOfWeek(yyyy, mm, dd) : ³¯Â¥¸¦ ÀÔ·Â½Ã ¿äÀÏÀ» ¸®ÅÏ
**                2003-02-08(dsyoon) getDateName(dateStr) : ³¯Â¥ ex)"2003-03-23"ÀÇ ¿äÀÏ ¸®ÅÏ
** -----------------------------------------------------------------------------
*/

	var doc = document;
	var msg = '';
	var cnt = 0;

	// css Á¤ÀÇ
	var input_disabled			= 'disabledtxt';
	var input_disabledNumber	= 'disablednum';
	var input_number			= 'numtype';

	//¸Þ¼¼Áö
	var MSG_ERR_LEN_LONG  		= " °ªÀÇ ±æÀÌ°¡ ³Ê¹« ±é´Ï´Ù!";
	var MSG_ERR_LEN_SHORT 		= " °ªÀÇ ±æÀÌ°¡ ³Ê¹« Âª½À´Ï´Ù!";
	var MSG_ERR_LEN_EQUAL 		= " °ªÀÇ ±æÀÌ°¡ ¸ÂÁö ¾Ê½À´Ï´Ù!";
	var MSG_ERR_ALPA_NUM_TYPE 	= " ¿µ¹®,¼ýÀÚÇüÀ» ÀÔ·ÂÇÏ½Ê½Ã¿À!";
	var MSG_ERR_DATE_TYPE 		= " ³¯Â¥Çü °ªÀ» ÀÔ·ÂÇÏ½Ê½Ã¿À! (¿¹) 2000-01-01"

	//µ¥ÀÌÅÍ Å¸ÀÔ
	var TAG_DATE 				= "D"; // ³¯Â¥Çü
	var TAG_NUM  				= "N"; // ¼ýÀÚÇü
	var TAG_INT  				= "I"; // Á¤¼öÇü
	var TAG_CHR  				= "C"

//////////////////////// ÇÁ·Î±×·¥ ´ÜÀ§ ¸Þ½ÃÁö  /////////////////////////////////
//¼º°ø
var PROC_SUCC_INSERT = " µî·ÏµÇ¾ú½À´Ï´Ù. "
var PROC_SUCC_UPDATE = " ¼öÁ¤µÇ¾ú½À´Ï´Ù. "
var PROC_SUCC_DELETE = " »èÁ¦µÇ¾ú½À´Ï´Ù. "

//½ÇÆÐ
var PROC_FAIL_INSERT = " µî·ÏÀÌ ½ÇÆÐÇÏ¿´½À´Ï´Ù! "
var PROC_FAIL_UPDATE = " ¼öÁ¤ÀÌ ½ÇÆÐÇÏ¿´½À´Ï´Ù! "
var PROC_FAIL_DELETE = " »èÁ¦°¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù! "

//È®ÀÎ
var CONFIRM_ASK_INSERT  = " µî·ÏÇÏ½Ã°Ú½À´Ï±î? "
var CONFIRM_MSG_ASK_UPDATE  = " ¼öÁ¤ÇÏ½Ã°Ú½À´Ï±î? "
var CONFIRM_MSG_ASK_DELETE  = " »èÁ¦ÇÏ½Ã°Ú½À´Ï±î? "

//¿ä±¸
var PLEASE_WAIT    = " Àá½Ã¸¸ ±â´Ù·Á ÁÖ½Ê½Ã¿À. "

//ÀÔ·Â¿¡·¯
var ERR_DATA_NULL_TYPE = " °ªÀ» ÀÔ·ÂÇÏ½Ê½Ã¿À! "
var ERR_DATA_DATE_TYPE = " ³¯Â¥Çü °ªÀ» ÀÔ·ÂÇÏ½Ê½Ã¿À! (¿¹) 2000-01-01"
var ERR_DATA_NUM_TYPE  = " ¼ýÀÚÇü °ªÀ» ÀÔ·ÂÇÏ½Ê½Ã¿À! "
var ERR_DATA_INT_TYPE  = " Á¤¼öÇü °ªÀ» ÀÔ·ÂÇÏ½Ê½Ã¿À! "
var ERR_DATA_LEN_LONG  = " °ªÀÇ ±æÀÌ°¡ ³Ê¹« ±é´Ï´Ù! "
var ERR_DATA_LEN_SHORT = " °ªÀÇ ±æÀÌ°¡ ³Ê¹« Âª½À´Ï´Ù! "
var ERR_DATA_LEN_EQUAL = " °ªÀÇ ±æÀÌ°¡ ¸ÂÁö ¾Ê½À´Ï´Ù! "
var ERR_DATA_LEN_RANGE = " °ªÀÇ ±æÀÌ°¡ ¹üÀ§¸¦ ¹þ¾î ³µ½À´Ï´Ù! "
var ERR_DATA_VAL_LARGE = " °ªÀÌ ³Ê¹« Å®´Ï´Ù! "
var ERR_DATA_VAL_SMALL = " °ªÀÌ ³Ê¹« ÀÛ½À´Ï´Ù! "
var ERR_DATA_VAL_EQUAL = " °ªÀÌ ¸ÂÁö ¾Ê½À´Ï´Ù! "
var ERR_DATA_VAL_RANGE = " °ªÀÌ ¹üÀ§¸¦ ¹þ¾î ³µ½À´Ï´Ù! "
/////////////////////////////////////////////////////////////////////////////////

		

/*********************************************************************
*************************     EnterÅ° ÀÌº¥Æ®     *********************
/********************************************************************/
// ½ºÅ©·Ñ¸µ
self.onError=null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;
<!-- STALKER CODE -->
function heartBeat() {
	var diffX = 0, diffY = 0;
if(IE) {
diffY = typeof(document.body)=="undefined" || document.body == null?0:document.body.scrollTop;
diffX = 0;
}
if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
if(diffY != lastScrollY) {
percent = .1 * (diffY - lastScrollY);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) {
	if (typeof(document.all.floater) == "undefined" || document.all.floater == null) {
	} else 	document.all.floater.style.pixelTop += percent;
}
if(NS) document.floater.top += percent;
lastScrollY = lastScrollY + percent;
}
if(diffX != lastScrollX) {
percent = .1 * (diffX - lastScrollX);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) {
	if (typeof(document.all.floater) == "undefined" || document.all.floater == null) {
	} else 	document.all.floater.style.pixelLeft += percent;
}
if(NS) document.floater.top += percent;
lastScrollY = lastScrollY + percent;
}
}
if(NS || IE) action = window.setInterval("heartBeat()",1);

//À§Ä¡Àâ±â
function centerWindow() {
var xMax = document.body.clientWidth
var xOffset = (xMax+955)/2
var divMenu = document.all['floater'].style;
//	divMenu.left = 970;
//	divMenu.top = 250;
	divMenu.top = 400;
    divMenu.left = xOffset;
// if(xMax>908)
// {
//  divMenu.top = 250;
//  divMenu.left = xOffset;
// }
}

  var tabIndex    = 0;
  var gIndex      = 1;
  var controlName = new Array();
  var controlCode = new Array();

  function maspEnterFocus(){

    var form = document.myform;

    if(event.keyCode == 13){

      //gIndex = gIndex-1; //ÀÌ ¹®ÀåÀ» Áö¿ï·Á¸é ¾Æ·¡ (document.onkeydown = focus;)¸¦ »èÁ¦ÇÑ´Ù. ÀÌº¥Æ®°¡ µÎ¹ø ¸ÔÀ¸¹Ç·Î

      for(var i=0; i< controlName.length; i++){
        if(this.name == controlName[i]){
          gIndex = i + 1;
          break;
        }
      }

      if(gIndex == controlCode.length) gIndex = 0;
      tabIndex = controlCode[gIndex];
      form.elements[tabIndex].focus();
      if(form.elements[tabIndex].type == 'text'){
        form.elements[tabIndex].select();
      }
      gIndex++;
      return true;
    }
    else if(event.keyCode == 123){
      // ALT + F1 Key Event
      // MyMenu ½ÇÇà
      if( top.MYMENU != null ){
        top.MYMENU.focus();
      }
      else{
        top.topmenu.openIT();
      }
    }

  }

  function maspEnterEvent(){

    var form = document.myform;
    var inx  = 0;

    for(var i=0; i<form.elements.length; i++){

      if( form.elements[i].disabled == false &&
         (form.elements[i].type == 'text'    || form.elements[i].type == 'radio'      ||
         form.elements[i].type == 'checkbox' || form.elements[i].type == 'select-one' ||
         form.elements[i].type == 'file'     || form.elements[i].type == 'button')){

         controlCode[inx] = i;
         controlName[inx] = form.elements[i].name;
         inx++;
         form.elements[i].onkeydown = maspEnterFocus;
      }
    }
    tabIndex = controlCode[gIndex];
  }
    //document.onkeydown = focus;


  //---------------------------------------------------------------------------------------------------
  //lst_frame¿¡¼­ con_frame Á¶È¸±â´É È£Ãâ½Ã Á¤·ÄÄÃ·³, Á¤·Ä¼ø¼­, ÇöÀçÆäÀÌÁö¿¡ °üÇÑ ¼³Á¤À» ÇÑ´Ù
  //2003-02-20 ÀÌÁ¤È£ ¼öÁ¤(command¿¡·¯)
  //---------------------------------------------------------------------------------------------------
  function maspHref(ahref){

    var target;
    var indexof;

    if(top.content == null){

       if(parent.con_frame == null){
         var con_form = parent.document.myform;
       }
       else{
         var con_form = parent.con_frame.document.myform;
       }

    }
    else{

       var con_form = top.content.con_frame.document.myform;

    }

    if(ahref.indexOf("&target=") == -1){

      target = '_self';
    }
    else{

      target  = ahref.substring(ahref.indexOf("&target=") + 8);
      indexof = target.indexOf("&");
      target  = target.substring(0, indexof);

      if(target == '' || target == null){

        target = '_self';
      }
    }

    //---------------------------------------------
    //ahref¿¡ listcount°¡ Æ÷ÇÔµÇ¾úÀ» °æ¿ì ¿¡·¯ ¹æÁö
    //---------------------------------------------
    var listcnt = ahref.indexOf("&listcount=");

    if(listcnt != '-1'){
      var command = ahref.substring(ahref.indexOf("?command=") + 9, ahref.indexOf("&listcount="));
    }
    else{
      var command = ahref.substring(ahref.indexOf("?command=") + 9, ahref.indexOf("&orderby="));
    }

    var order   = ahref.substring(ahref.indexOf("&orderby=")     + 9);
    var direc   = order.substring(order.indexOf("&direction=")   + 11);
    var curpg   = direc.substring(direc.indexOf("&curpage=")     + 9);

    order       = order.substring(0, order.indexOf("&direction="));
    direc       = direc.substring(0, direc.indexOf("&curpage="));

    con_form.orderby.value   = order;
    con_form.direction.value = direc;
    con_form.curpage.value   = curpg;

    var form = document.myform;

    if(document.myform.command != null){
       form.command.value = command;
    }

    form.method = "post";
    form.action = ahref;

    //----------------------------------------------------
    //targetÀÌ ÀÏÄ¡ÇÏÁö ¾ÊÀ» °æ¿ì´Â ¼­ºí¸´¿¡¼­µµ ¼öÁ¤ ¿äÇÔ
    //----------------------------------------------------
    form.target  = target;
    form.submit();

  }


  /******************************************************************************************
  //lst_frame¿¡¼­ con_frame Á¶È¸±â´É È£Ãâ½Ã Á¤·ÄÄÃ·³, Á¤·Ä¼ø¼­, ÇöÀçÆäÀÌÁö¿¡ °üÇÑ ¼³Á¤À» ÇÑ´Ù
  /*****************************************************************************************/
  function maspHrefNoOrder(ahref){

    var target;
    var indexof;

    if(top.content == null){

       if(parent.con_frm == null){
         var con_form = document.myform;
       }
       else{
         var con_form = parent.con_frm.document.myform;
       }

    }
    else{

       var con_form = top.con_frm.document.myform;

    }

    if(ahref.indexOf("&target=") == -1){

      target = 'lst_frm';
    }
    else{

      target  = ahref.substring(ahref.indexOf("&target=") + 8);
      indexof = target.indexOf("&");
      target  = target.substring(0, indexof);

      if(target == '' || target == null){

        target = 'lst_frm';
      }
    }

    var order   = ahref.substring(ahref.indexOf("&orderby=")     + 9);
    var direc   = order.substring(order.indexOf("&direction=")   + 11);
    var curpg   = direc.substring(direc.indexOf("&curpage=")     + 9);
    order       = order.substring(0, order.indexOf("&direction="));
    direc       = direc.substring(0, direc.indexOf("&curpage="));

    //con_form.orderby.value = order;
    con_form.direction.value = direc;
    con_form.curpage.value = curpg;

    var form     = top.con_frm.document.myform;
    form.method  = "post";
    form.action  = ahref;
    //targetÀÌ ÀÏÄ¡ÇÏÁö ¾ÊÀ» °æ¿ì´Â ¼­ºí¸´¿¡¼­µµ ¼öÁ¤ ¿äÇÔ.
    form.target  = target;
    form.submit();

    //alert(order);
    //alert(direc);
    //alert(curpg);

  }


  /******************************************************************************************
  //dat_frame¿¡¼­ con_frame Á¶È¸±â´É È£Ãâ½Ã Á¤·ÄÄÃ·³, Á¤·Ä¼ø¼­, ÇöÀçÆäÀÌÁö¿¡ °üÇÑ ¼³Á¤À» ÇÑ´Ù
  //2004-01-26 ¹Ú½Â¿ë ¼öÁ¤(con_frameÀÌ ¾Æ´Ñ dat_frame¿¡ Ã³¸®)
  /*****************************************************************************************/
  function maspHrefNoOrder2(ahref){

    var target;
    var indexof;


    if(top.content == null){

       var con_form = parent.con_frame.document.myform;

    }
    else{

       var con_form = top.content.con_frame.document.myform;

    }

    if(ahref.indexOf("&target=") == -1){

      target = 'dat_frame';
    }
    else{

      target  = ahref.substring(ahref.indexOf("&target=") + 8);
      indexof = target.indexOf("&");
      target  = target.substring(0, indexof);

      if(target == '' || target == null){

        target = 'dat_frame';
      }
    }

    var order   = ahref.substring(ahref.indexOf("&orderby2=")     + 10);
    var direc   = order.substring(order.indexOf("&direction2=")   + 12);
    var curpg   = direc.substring(direc.indexOf("&curpage2=")     + 10);
    order       = order.substring(0, order.indexOf("&direction2="));
    direc       = direc.substring(0, direc.indexOf("&curpage2="));


    //con_form.orderby.value = order;
    //con_form.direction.value = direc;
    //con_form.curpage.value = curpg;

    var form     = document.myform;

    form.direction2.value = direc;
    form.curpage2.value   = curpg;

    form.method  = "post";
    form.action  = ahref;
    //targetÀÌ ÀÏÄ¡ÇÏÁö ¾ÊÀ» °æ¿ì´Â ¼­ºí¸´¿¡¼­µµ ¼öÁ¤ ¿äÇÔ.
    form.target  = target;
    form.submit();

    //alert(order);
    //alert(direc);
    //alert(curpg);

  }
  /******************************************************************************************
  //lst_frame¿¡¼­ con_frame Á¶È¸±â´É È£Ãâ½Ã Á¤·ÄÄÃ·³, Á¤·Ä¼ø¼­, ÇöÀçÆäÀÌÁö¿¡ °üÇÑ ¼³Á¤À» ÇÑ´Ù
  /*****************************************************************************************/
  function maspHrefNoOrder3(ahref){
    var form     = document.myform;

    var order   = ahref.substring(ahref.indexOf("&orderby=")     + 9);
    var direc   = order.substring(order.indexOf("&direction=")   + 11);
    var curpg   = direc.substring(direc.indexOf("&curpage=")     + 9);
    order       = order.substring(0, order.indexOf("&direction="));
    direc       = direc.substring(0, direc.indexOf("&curpage="));

    form.direction.value = direc;
    form.curpage.value = curpg;

    form.method  = "post";
    form.target  = '_self';
    form.action  = ahref;
    form.submit();
  }


   //µµ¿ò¸» À©µµ¿ì¸¦ ¿ÀÇÂÇÑ´Ù
  function maspHelp(programID){

    var locposition = funcCurLocation();  // ½ÃÀÛÀ§Ä¡¿¡ µû¸¥ °æ·Î¼³Á¤.
    var url = locposition + "help/" + programID + ".html";

    UserWin=window.open(url, programID + "_Help","toolbar=no,width=940,height=700,left=0,top=0,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");

    if(UserWin != null){
      UserWin.opener=self;
    }
    return;
  }

  //ÀÎ¼â Ã¢À»¶ç¿î´Ù.
  function funcPrint(command, target) {
    var con_form = top.content.con_frame.document.myform;

    var URL, WINPROPERTIES;
    con_form.command.value = command;

    URL = '<%= myMasp.JSP_PATH %>blank.html'
    WINPROPERTIES = 'toolbar=no,width=800,height=600'
                  + ', location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=0,top=0';

    UserWin=window.open(URL, target, WINPROPERTIES);

    if (UserWin != null) {
      UserWin.opener=self;
    }
    return;
  }

  //Ç°¸ñºÐ·ùÄÚµå º¹ÇÕ°Ë»ö À©µµ¿ì¸¦ ¿ÀÇÂÇÑ´Ù
  function funcCommodityWindow(){

    var form                = document.myform;
    var self_locname        = "" + document.location;
	 var pos                 = 0;

    form.method             = "post";
    form.command.value      = "LISTWIN";

   // frm.jsp¿¡¼­ con.jsp¸¦ ¹Ù·Î È£ÃâÇÏ´Â °æ¿ì, °æ·Îº¯°æ.
	 pos = self_locname.indexOf('jsp');

    // JSP¿¡¼­ ½ÃÀÛÇÒ °æ¿ì
    if(pos == -1){

      UserWin=window.open("../jsp/blank.html","commoditywindow","width=540,height=700,left=0,top=0,scrollbars=yes,resizable=yes,toolbar=no");
      form.action = '../servlet/mfginv.INV135';
    }
    // SERVLET¿¡¼­ ½ÃÀÛÇÒ °æ¿ì
    else{

      UserWin=window.open("../blank.html","commoditywindow","width=540,height=700,left=0,top=0,scrollbars=yes,resizable=yes,toolbar=no");
      form.action = '../../servlet/mfginv.INV135';
    }

    if(UserWin != null){
      UserWin.opener=self;
    }

    form.target = 'commoditywindow';
    form.submit();

  }

  //Ç°¸ñÄÚµå, °Å·¡Ã³ µî ÄÚµå¼º ÀÚ·á Áß Ã¼Å©µÈ ¸ñ·ÏÀ» ¸¸µç´Ù
  //SQL¹®ÀÇ IN(,,,) Àý¿¡¼­ »ç¿ëÇÒ ¼ö ÀÖµµ·Ï ÇÑ´Ù
  //form : FORM°´Ã¼
  function maspCheckedCode(formStr, codeStr){

    var object    = null;
    var code      = null;
    var objForm   = null;
    var returnStr = "";
    var firstChk  = false;

    objForm       = eval(formStr);

    for(i=1; i<=objForm.sizes.value; i++){

    	object = eval(formStr + ".proctype" + i);

      // ÄÚµå°¡ Ã¼Å©µÇ¾î ÀÖÀ¸¸é ¸ñ·ÏÀ» ¸¸µé¾î³½´Ù
      if(object.disabled == false && object.checked == true){

        firstChk   = true;

        code       = eval(formStr + "." + codeStr + i);
      	returnStr += "'" + code.value + "'" + ",";
      }
    }

    if(firstChk == true){

      returnStr = "(" + returnStr.substring(0, returnStr.lastIndexOf(',')) + ")";
    }
    else{

      returnStr = "";
    }
    return returnStr;
  }


  //Ç°¸ñÁ¤º¸Á¶È¸ »ó¼¼È­¸é À©µµ¿ì¸¦ ¿ÀÇÂÇÑ´Ù
  function funcItemInfoWindow(partcode){

    var form                = document.myform;

    form.method             = "post";
    form.command.value      = "DETAIL";

    form.partcode.value     = partcode;

    UserWin=window.open("../jsp/blank.html","iteminfowindow","width=860,height=600,left=0,top=0,scrollbars=yes,resizable=yes,toolbar=no");
    if(UserWin != null){
      UserWin.opener=self;
    }
    form.target = 'iteminfowindow';
    form.action = '../servlet/mfginv.INV135';
    form.submit();
  }


/****************************************
¸Þ¼¼ÁöÃ³¸®
****************************************/
function putMsg(pMsg, pAtt){
	msg = msg + repMsg(pMsg,pAtt);
}

function repMsg(pStr, pAtt){
	if (pStr == '') {
		return '';
	}

	cnt = cnt + 1;

	if (pAtt != '') {
		return  cnt + '. ' + pAtt + ' ==> ' + pStr + '\n';
	}
	else {
		return pStr + '\n';
	}
}

function getMsg() {
	return msg;
}

function initMsg() {
	msg 	= '';
	cnt 	= 0;
}

function isMsg() {
	if ((msg == '')||(msg == null)) {
		return false;
	}
	else {
		return true;
	}
}

/**************************************************************
DATA CHECK
***************************************************************/
//null check
function isNull(val) {
	var esc = val.match(/\S/);

	if (esc == '' || esc == null) {
		return true ;
	}
	else {
		return false;
	}
}

function checkNull(val) {
	var esc = val.match(/\S/);

	if (esc == '' || esc == null) {
		return '°ªÀ» ÀÔ·ÂÇÏ½Ê½Ã¿À!' ;
	}
	else {
		return '';
	}
}

function isObjNull(obj) {

	if (obj != 'undefined' && obj != null) {
		return true ;
	}
	else {
		return false;
	}
}

//number
function isNumber(val) {
	var sVal1, sVal2;

	if (isNaN(val)) {
		sVal1 	= val.split(",");
		sVal2 	= "";

		for (i = 0; i < sVal1.length; i++) {
			sVal2 += sVal1[i];
		}

		if (isNaN(sVal2)) {
			return false ;
		}
		else {
			return true ;
		}
	}
	else {
		return true;
	}
}

function checkNumber(val) {
	if(isNumber(val)) {
		return '';
	}
	else {
		return '¼ýÀÚÇü°ªÀ» ÀÔ·ÂÇÏ½Ê½Ã¿À!';
	}
}

function str2number(val) {
	var sVal1, sVal2;

	if (isNaN(val)) {
		sVal1 = val.split(",");
		sVal2 = "";

		for(i = 0; i < sVal1.length; i++) {
			sVal2 += sVal1[i];
		}
		return sVal2 ;
	}
	else {
		return val;
	}
}

//±æÀÌ°¡ °°ÀºÁö °Ë»ç
function checkEqualLen(val,len) {
	if (len != val.length) {
		return MSG_ERR_LEN_EQUAL + "Çã¿ë±æÀÌ: " + len;
	}
	else {
		return '';
	}
}

function isEqualLen(val,len) {
	if (len != val.length) {
		return false
	}
	else {
		return true;
	}
}

// ¿µ¼ýÀÚ ¿©ºÎ °Ë»ç
function isAlpaNumeric(val) {
	var str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

	for (i=0; i< val.length; i++) {
		idcheck = val.charAt(i);

		if (str.indexOf(idcheck,0) == -1) {
			return false
		}
	}
	return true;
}

function checkAlpaNumeric(val) {
	if(isAlpaNumeric(val)) {
		return '';
	}
	else {
		return MSG_ERR_ALPA_NUM_TYPE;
	}
}

//±æÀÌ°¡ »çÀÌ°ª¿¡ ÀÖ´ÂÁö °Ë»ç
function checkBLen(s,n,m) {
	var c=0;

	for(i=0;i< s.length;i++) {
		if (escape(s.charAt(i)).length > 4) {
			c+=2;
		}
		else {
			c++;
		}

		if(c < n) {
			return MSG_ERR_LEN_SHORT + "(ÃÖ¼ÒÇã¿ë±æÀÌ: " + n;
		}
		else if(c > m) {
			return MSG_ERR_LEN_LONG  + "(ÃÖ´ëÇã¿ë±æÀÌ: " + m;
		}
		else {
			return '';
		}
	}
}

  //#########################################################################
  // ¼ýÀÚ°Ë»ç
  // ¼ýÀÚÃ¼Å©(¹üÀ§³»ÀÇ ¼ýÀÚ¿©ºÎ¿Í ³ÎÃ¼Å©)
  // ¿ÀºêÁ§Æ®ÀÇ °ªÀÌ ÁÖ¾îÁø ¹üÀ§³»ÀÇ ¼ýÀÚÀÎÁö CheckÇÏ´Â ÇÔ¼ö
  // ÆÄ¶ó¸ÞÅÍ´Â ¿ÀºêÁ§Æ®·Î Àü´Þ
  // #########################################################################
  function checkNumberRange(obj, comment, mendentory, startvalue, endvalue){
    obj.value       = trim(obj.value);               //°ø¹éÁ¦°Å
    var check_value = replaceString(obj.value, ",", ""); //ÄÞ¸¶Á¦°Å

    //obj.value = check_value; //ÀÓ½Ã·Î »ç¿ë(ÄÞ¸¶¸¦ ¾ø¾Ø´Ù)

    if(check_value.length == 0 && mendentory){
      alert(comment + " ÀÌ(°¡) ÀÔ·ÂµÇÁö ¾Ê¾Ò½À´Ï´Ù.\n" + comment + " Àº(´Â) ÇÊ¼ö ÀÔ·ÂÇ×¸ñÀÔ´Ï´Ù.\n\n ¿¹) 12");
      obj.focus();
      return false;
    }
    else if(check_value.length != 0){
      if(isNaN(check_value)){
        alert(comment + " Àº(´Â) ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.\n" + "¹®ÀÚ´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
        obj.focus();
        obj.select();
        return false;
      }else if(check_value < startvalue || check_value > endvalue){
      	 alert(comment + " Àº(´Â) '" + startvalue + "' ~ '" + endvalue + "' ÀÇ ¹üÀ§³»¿¡¼­ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù." );
      	 obj.focus();
         obj.select();
         return false;
      }
      else{
        return true;
      }
    }
    return true;
  }

// date Ã¼Å©
function str2date(sDate){
	//DISPLAY FORMAT¿¡ ÀÇÇØ¼­ parsingµÈ´Ù.
	//±âº»ÀûÀÌ date format==>YYYY-MM-DD
	var arrDate, yyyy, mm, dd, rtnDate;

	sDate=sDate.replace(/\s/g,""); // °ø¹éÁ¦°Å

	// YYYY-MM-DD Æ÷¸Ë°Ë»ç
	if (sDate.match(/\d+\-\d+\-\d+/g)!=sDate) return '';

	//DATE À¯È¿¼º°Ë»ç
	arrDate = sDate.split(/\-/g);
	yyyy	= parseInt(arrDate[0],10);
	mm		= parseInt(arrDate[1],10);
	dd		= parseInt(arrDate[2],10);

	if(valiDate(yyyy,mm,dd)) {
		rtnDate	=	new Date(yyyy,mm-1,dd);
		return rtnDate;
	}
	else{
		return '';
	}
}

//privateÇÔ¼ö
function valiDate(yyyy,mm,dd) {
	var dDate;

	dDate = new Date(yyyy,mm-1,dd);

	if (dDate=="NaN") return false;

	if ((yyyy == dDate.getFullYear()) && (mm == dDate.getMonth()+1) && (dd == dDate.getDate())) {
		return true;
	}
	else {
		return false;
	}
}

function isDate(sDate) {
	if (isNull(sDate)) return true;

	if (str2date(sDate)=='') {
		return false;
	}
	else {
		return true;
	}
}

function checkDate(sDate) {
	if (isNull(sDate)) return '';

	if(!isDate(sDate)) {
		return MSG_ERR_DATE_TYPE;
	}
	else {
		return '';
	}
}

    function setCookie(name,value) {
        var today = new Date();
        var expiry = new Date(today.getYear() +1,today.getMonth(),today.getDate());
        if (value != null && value != "" )
            document.cookie = name + "=" + escape(value) + "; expires=" + expiry.toGMTString();
            //document.cookie = name + "=" + value + "; expires=" + expiry.toGMTString();
    }

function dateFormat(sDate) {
	var arrDate,yyyy,mm,dd,rtnDate;

	sDate = sDate.replace(/\s/g,""); // °ø¹éÁ¦°Å

	if (sDate.match(/\d+\-\d+\-\d+/g)!=sDate) return '';

	arrDate = sDate.split(/\-/g);
	yyyy	=	arrDate[0];

	if(arrDate[1].length==1) arrDate[1]='0' + arrDate[1];
	if(arrDate[2].length==1) arrDate[2]='0' + arrDate[2];

	mm		=	arrDate[1];
	dd		=	arrDate[2];
	rtnDate =   yyyy + "-" + mm + "-" + dd;

	return rtnDate;
}

function dateDiff(sDate1,sDate2){
	var dDate1, dDate2, gap;

	dDate1	= str2date(sDate1);
	dDate2	= str2date(sDate2);
	gap 	= Date.parse(dDate1)-Date.parse(dDate2);

	return Math.floor(gap/(1000*60*60*24));
}

function addDate(sDate,incDay){
	var tmpDate1 ,tmpDate2, rtnValue;

	tmpDate1 = str2date(sDate);

	if (tmpDate1 == '') return'';

	tmpDate2 = new Date(tmpDate1.getYear(),tmpDate1.getMonth(),tmpDate1.getDate() + eval(incDay));

	if (tmpDate2 != "NaN") {
		rtnValue = dateFormat(tmpDate2.getFullYear() + "-" + eval(tmpDate2.getMonth()+1) + "-" + tmpDate2.getDate()) ;
	}
	else {
		rtnValue = '';
	}

	return rtnValue;
}


// #########################################################################
// ¹®ÀÚº¯È¯
function replaceString(org_str, find_str, replace_str){
	var pos = 0;
	pos = org_str.indexOf(find_str);

	while(pos != -1){
		pre_str  = org_str.substring(0, pos);
		post_str = org_str.substring(pos + find_str.length, org_str.length);
		org_str  = pre_str + replace_str + post_str;

		pos = org_str.indexOf(find_str);
	}
	return org_str;
}


   //-------------------------------------------------------------------
   // ¼öÄ¡°ªÀ» ¹Þ¾Æ¼­ 1000´ÜÀ§¿¡ ÄÞ¸¶¸¦ ºÙ¿©¼­ ¸®ÅÏÇÑ´Ù
   // -1234567890 ---> -1,234,567,890
   //  1234567890 --->  1,234,567,890
   //  12345.678  --->  12,345.678
   //  123        --->  123
   //  obj : ¼öÄ¡°ª
   //-------------------------------------------------------------------
   function setComma(obj){

     var dot_pos    = -1;
     var dot_value  = null;

     var commaValue  = null;
     var commaCount  = 0;

     var commaLen    = 0;
     var returnValue = '';

     var dot_pos     = obj.indexOf(".");
     if(dot_pos == -1){

       dot_value  = '';
       commaValue = obj;
     }
     else{

       dot_value  = obj.substring(dot_pos, obj.length);
       commaValue = obj.substring(0, dot_pos);
     }

     commaValue = replaceString(commaValue, ',', '');

     var minus_value = '';
     if(obj.indexOf("-") == -1){

       minus_value = "";
     }
     else{

       minus_value = "-";
       commaValue  = commaValue.substring(1, commaValue.length);
     }

     if(commaValue == '' || commaValue == null) return obj;
     if(commaValue.length <= 3)                 return obj;

     commaCount = parseInt((commaValue.length - 1) / 3);

     for(var i=1; i<=commaCount; i++){

       commaLen    = commaValue.length - ((i - 1) * 3);
       returnValue = ',' + commaValue.substring(commaValue.length - (i * 3), commaLen) + returnValue;

     }

     dot_pos = commaValue.length % 3;
     if(dot_pos == 0) dot_pos = 3;

     returnValue = minus_value + commaValue.substring(0, dot_pos) + returnValue + dot_value;

     return returnValue;
   }

/*****************************************************************
inputÀÇ enabled/ disabled
******************************************************************/
function enabled(obj,otype ){
	if (otype == TAG_CHR) {
		obj.className = '';
	}
	else if (otype == TAG_NUM) {
		obj.className = input_number;
	}

	obj.onfocus = obj.focus;
	obj.readOnly = false;
}

function disabled(obj,otype){
	if (otype == TAG_CHR) {
		obj.className =  input_disabled;
	}
	else if (otype == TAG_NUM) {
		obj.className =  input_disabledNumber;
	}

	obj.onfocus = obj.blur;
	obj.readOnly = true;
}

/************************************************************
form ¿¡ °üÇÑ ÇÔ¼ö
************************************************************/
function goForm(pForm,pAction,pTarget,pMethod){
	pForm.action = pAction;

	if (pMethod != '') pForm.method = pMethod;
	if (pTarget != '') pForm.target = pTarget;

	cursorWait();
	pForm.submit();
}

/*************************************************************
»õÃ¢ ¶ç¿ì±â sub window
**************************************************************/
function openSubWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}

function openSearchWindow(theURL) {
	window.open(theURL,'search',' scrollbars=yes,resizable=yes,width=605,height=400 ');
}
function openHelpWindow(theURL) {
	window.open(theURL,'help',' scrollbars=yes,resizable=yes,width=605,height=400 ');
}

/**********************************************************************
Æû°´Ã¼¿¡ Á¸ÀçÇÏ´Â Control¿¡ ´ëÇÑ Value¸¦ ¸®ÅÏÇÑ´Ù.
**********************************************************************/
function getFindControlValue(objForm, sControl) { 	// Æû°´Ã¼,'Control¸í'
	var iEleCnt, sControlValue;

	iEleCnt = objForm.elements.length;

	for (var i=0; i < iEleCnt; i++) {

        if (objForm.elements[i].name == sControl) {
        	sControlValue = objForm.elements[i].value;
        	return sControlValue;
        }
	}
    return '';
}

/************************************************************************
Æû°´Ã¼¿¡ Á¸ÀçÇÏ´Â ControlÀ» ÃÊ±âÈ­ ½ÃÅ²´Ù.(´Ü Combo´Â '0' Index¿¡ µÐ´Ù.)
	text
	textarea
	select-one
	checkbox
	radio
	hidden
	submit
	button
************************************************************************/
function setClearControl(objForm, bHiddenProc) {	// Æû°´Ã¼, Hidden°´Ã¼ Clear¿©ºÎ
	var iEleCnt, sControlValue;

	iEleCnt = objForm.elements.length;

	for( var i=0; i < iEleCnt; i++) {
        if (objForm.elements[i].type == 'text') {
        	objForm.elements[i].value = '';
        }
        else if (objForm.elements[i].type == 'textarea') {
        	objForm.elements[i].value = '';
        }
        else if (objForm.elements[i].type == 'select-one') {
        	objForm.elements[i].selectedIndex = 0;
        }
        else if (objForm.elements[i].type == 'checkbox') {
        	objForm.elements[i].checked = false;
        }
        else if (objForm.elements[i].type == 'radio') {
        	objForm.elements[i].checked = false;
        }
        else if (objForm.elements[i].type == 'hidden') {
        	if (bHiddenProc == true) {
        		objForm.elements[i].value = '';
        	}
        }
	}
}

/************************************************************************
list box ¿¡ °ª Ãß°¡, »èÁ¦, clear ±â´É
	sObj 	: list box object
	sText 	: list box ÀÇ Text
	sValue	:list box ÀÇ value
************************************************************************/
function addList(sObj,sText,sValue) {

	sObj.options[sObj.options.length] = new Option(sText,sValue);

	return true
}

function delList(sObj,sValue) {

	for (var i=0 ; i < sObj.length;i++) {
		if (sObj.options[i].value == sValue) {
			sObj.options[i] = null;
			return true;
		}
	}
}

function clearList(sObj) {
	sObj.length =0;
	return true;
}

function noEnter() {
	if(event.keyCode == 13) {
		event.returnValue = false;
		return ;
	}
	return event.returnValue
}

function returnCheck(chkName){
    window.focus();
    var checkObj = eval("document.myform."+chkName);
	checkObj.checked = !checkObj.checked;
}

/************************************************************************
2001-02-09 Ãß°¡
È­¸éÀÇ bodyºÎºÐ¿¡ Å×ÀÌºíÀÌ Á¸ÇÏ´Â °æ¿ì¿¡ cursor¸¦ º¯È­½ÃÅ°´Â ±â´É.
************************************************************************/
function cursorWait() {
	var sObjFrame, sObjCursor, sCursorName;

	sObjFrame = top.frames["content"];

	if (sObjFrame != null) {
		sObjCursor = top.content.document.getElementById("tblBackGrd");

		if (sObjCursor != null) {
			top.content.document.all.tblBackGrd.style.cursor='wait';
		}
	}
}

function cursorArrow() {
	var sObjFrame, sObjCursor, sCursorName;

	sObjFrame = top.frames["content"];

	if (sObjFrame != null) {
		sObjCursor = top.content.document.getElementById("tblBackGrd");

		if (sObjCursor != null) {
			top.content.document.all.tblBackGrd.style.cursor='';
		}
	}
}


  //onKeyPress½Ã ³¯Â¥ ÇÊµå¿¡ ³âµµ ´ÙÀ½, ¿ù ´ÙÀ½¿¡ ´ë½¬(-)¸¦ Ã·°¡ÇÑ´Ù
  function maspDateDash(obj){

    if(obj.value.length == 4){
      obj.value = obj.value + '-';
    }
    if(obj.value.length == 7){
      obj.value = obj.value + '-';
    }
    if(obj.value.length > 4){
      //2001-12-31
      if(obj.value.substring(4,5) == '/' || obj.value.substring(4,5) == '.'){
        obj.value = obj.value.substring(0, 4) + '-';
      }
      if(obj.value.substring(7,8) == '/' || obj.value.substring(7,8) == '/'){
        obj.value = obj.value.substring(0, 7) + '-';
      }
    }
  }


  //onKeyPress½Ã ³¯Â¥ ÇÊµå¿¡ ³âµµ ´ÙÀ½, ¿ù ´ÙÀ½¿¡ ´ë½¬(-)¸¦ Ã·°¡ÇÑ´Ù
  function maspDateDash1(obj, yyyymm){

    var yyyy;
    var mm;
    var dd;

    if(obj.value.length == 2 || obj.value.length == 1){



      yyyy = yyyymm.substring(0, 4);
      mm   = yyyymm.substring(4, 6);

      if(obj.value.length == 1){

        dd   = '0' + obj.value;
      }
      else{

        dd   = obj.value;
      }

      if(!valiDate(yyyy,mm,dd)){

        obj.value = '';
        alert('Àû¿ë°¡´ÉÇÑ ³¯Â¥¸¦ »ý¼ºÇÒ ¼ö ¾ø½À´Ï´Ù');
        obj.focus();
        return false;
      }

      obj.value = yyyy + '-' + mm + '-' + dd;
    }

    if(obj.value.length == 4){

      yyyy = yyyymm.substring(0, 4);
      mm   = obj.value.substring(0,2);
      dd   = obj.value.substring(2,4);

      if(!valiDate(yyyy,mm,dd)){

        obj.value = '';
        alert('Àû¿ë°¡´ÉÇÑ ³¯Â¥¸¦ »ý¼ºÇÒ ¼ö ¾ø½À´Ï´Ù');
        obj.focus();
        return false;
      }

      obj.value = yyyy + '-' + mm + '-' + dd;
    }


    if(obj.value.length == 6){

      yyyy = yyyymm.substring(0, 2) + obj.value.substring(0,2);
      mm   = obj.value.substring(2,4);
      dd   = obj.value.substring(4,6);

      if(!valiDate(yyyy,mm,dd)){

        obj.value = '';
        alert('Àû¿ë°¡´ÉÇÑ ³¯Â¥¸¦ »ý¼ºÇÒ ¼ö ¾ø½À´Ï´Ù');
        obj.focus();
        return false;
      }

      obj.value = yyyy + '-' + mm + '-' + dd;
    }

    if(obj.value.length == 8){

      yyyy = obj.value.substring(0,4);
      mm   = obj.value.substring(4,6);
      dd   = obj.value.substring(6,8);

      if(!valiDate(yyyy,mm,dd)){

        obj.value = '';
        alert('Àû¿ë°¡´ÉÇÑ ³¯Â¥¸¦ »ý¼ºÇÒ ¼ö ¾ø½À´Ï´Ù');
        obj.focus();
        return false;
      }

      obj.value = yyyy + '-' + mm + '-' + dd;
    }
  }


function funcShowMsg()
{
    //ÃÖÃÊ lst_frameÀÌ ¾øÀ» °æ¿ì ¸®ÅÏ
    if(top.content.lst_frame.document.all["msg"] == null) return;

    var msg                 =   top.content.lst_frame.document.all["msg"];

    msg.style.pixelLeft     = (830-300)/2;
    msg.style.pixelTop      = (400-150)/2;

    msg.style.visibility    =   "visible";

    //timer=setTimeout("funcNothing()", 5000);

}

function funcHideMsg()
{

    //ÃÖÃÊ mst_frameÀÌ ¾øÀ» °æ¿ì ¸®ÅÏ
    if(top.content.lst_frame.document.all["msg"] == null) return;

    var msg                 =   top.content.lst_frame.document.all["msg"];

    msg.style.visibility    =   "hidden";

}

function funcLoadMsg()
{

     //ÃÖÃÊ mst_frameÀÌ ¾øÀ» °æ¿ì ¸®ÅÏ
    if(top.content.lst_frame.document.all["msg"] == null) return;

    //topmenu¿¡ ¼û±ä ÀÌ¹ÌÁö¸¦ °øÀ¯ÇÑ´Ù.
    top.content.lst_frame.document.waiting.src    = top.topmenu.document.waiting.src;

    var msg                 =   top.content.lst_frame.document.all["msg"];

    msg.style.visibility    =   "hidden";

}


//½Ã°£Áö¿¬½Ã »ç¿ëÇÏ´Â ºó Æò¼Ç
function funcNoting()
{

}


// ÅäÅ«¹®ÀÚ ÀÌÈÄÀÇ ÀÚ¸´¼ö ¸®ÅÏ
function funcTokenAfterLen(val, token){

  var index = val.indexOf(token);

  if(index == -1) return 0;

  var tokenAfterStr = val.substring(index + 1);
  return tokenAfterStr.length;
}

//---------------------------------------------------------------------------------
// ½Ç¼ö¸¦ ¹Ý¿Ã¸² ¶Ç´Â Àý»èÇÑ´Ù.
// default setType = 'round'
// val  : ¼ö(String),
// pos  : formatÇÒ À§Ä¡
//        ex) 1635.435
//                    ¼Ò¼ö2ÀÚ¸®·Î Æ÷¸Ë½Ã    pos=2
//                    ¼Ò¼ö1ÀÚ¸®·Î Æ÷¸Ë½Ã    pos=1
//                    Á¤¼ö 1ÀÚ¸®·Î·Î Æ÷¸Ë½Ã pos=0
//                    Á¤¼ö 10ÀÚ¸®·Î Æ÷¸Ë½Ã  pos=-1
//                    Á¤¼ö 100ÀÚ¸®·Î Æ÷¸Ë½Ã pos=-2
// setType : round(¹Ý¿Ã¸²) or trunc(Àý»è)
// return  : ¼ö(String),
//---------------------------------------------------------------------------------
function maspRT(val, pos, setType) {

    var isMinus = false; //minus°ª¿©ºÎ
    var dotpos  = -1;    //¼Ò¼öÁ¡À§Ä¡
    var intvar  = null;  //Á¤¼öºÎºÐ
    var decimal = null;  //¼Ò¼öºÎºÐ
    var size    = 0;     //¿ø·¡¹®ÀÚ¿­ÀÇ Á¤¼öºÎ³ª ¼Ò¼öºÎ ±æÀÌ
    var rtnval  = "";    //return value
    var tmp;

	var existComma = (val.indexOf(',')==-1)? false:true;//commaÁ¸Àç¿©ºÎ
	val = replaceString(val, ',','');
	if(isNaN(val))return 'noNumber';
	if(isNull(val))return '';

    val = parseFloat(val).toString();//"232."->232  ".4"->0.4

	if(val.indexOf('-')!=-1){
		val = val.substring(1, val.length);
		isMinus = true;
	}

	if(setType == null) setType='round';
	if(pos == null) pos=0;

	size = val.substring(val.indexOf(".")+1, val.length).length;

	if(setType=='trunc'){

		//----------------------------------------
		//Á¤¼öºÎ,¼Ò¼öºÎºÐ¸®
		//----------------------------------------
		dotpos = val.indexOf('.');

		if(dotpos > 0){
			intvar = val.substring(0, dotpos);
			decimal= val.substring(dotpos+1, val.length);

		    size = decimal.length;
			if(pos>=0){
				if(pos >= size){//substring index°í·Á
					pos = size;
					decimal= decimal.substring(0, size);
				}else decimal= decimal.substring(0, pos+1);
			}

		}else{
			intvar = val.substring(0, val.length);
			decimal="0";
		}

	}
  else if(setType=='ceil'){

    if(isMinus) val = val*(-1);

    //°°°Å³ª °¡Àå ±ÙÁ¢ÇÑ Å« Á¤¼ö
    rtnval = Math.ceil(val);
    return rtnval;

	}
	else{

		//------------------------------------------------------------------
		//¹Ý¿Ã¸²ÇÒ À§Ä¡¿¡ µû¶ó ´õÇÒ °ª(sAddnum) settingÇÏ¿© ¿ø·¡°ª¿¡ ´õÇÏ±â
	    //------------------------------------------------------------------
	    var fAddnum =0;
		var sAddnum ="";
	    var fVal    =parseFloat(val);
	    var sVal    ="";


		if(pos >=0) {
			sAddnum = "0.";
			for(var i=1; i<=pos; i++) {
				sAddnum +="0";
			}
			sAddnum +="5";

		}else{
			sAddnum = "5";
			for(var i=1; i<=(-(pos)-1); i++) {
				sAddnum +="0";
			}

		}
		fAddnum = parseFloat(sAddnum);

		fVal += fAddnum;
		sVal = fVal.toString();


		//----------------------------------------
		//Á¤¼öºÎ,¼Ò¼öºÎºÐ¸®
		//----------------------------------------
		dotpos = sVal.indexOf('.');

		if(dotpos > 0){
			intvar = sVal.substring(0, dotpos);
			decimal= sVal.substring(dotpos+1, sVal.length);

		    size = decimal.length;
			if(pos>=0){
				if(pos >= size){//substring index°í·Á
					pos = size;
					decimal= decimal.substring(0, size);
				}else decimal= decimal.substring(0, pos+1);
			}

		}else{
			intvar = sVal.substring(0, sVal.length);
			decimal="0";
		}

	}

	//----------------------------------------
	//Á¤¼öºÎ,¼Ò¼öºÎ formating
	//----------------------------------------
	//¼ýÀÚ±æÀÌº¸´Ù Æ÷¸ËÇÒ ÀÚ¸®¼ö°¡ Å¬¶§ ¿ø·¡¼ýÀÚ±æÀÌ±îÁö¸¸ Ç¥½ÃµÇµµ·Ï ex)324.43 round at 3 --> 324.43
	//¼Ò¼öºÎ ±æÀÌ(size):2 , Æ÷¸ËÀ§Ä¡(pos) : 3
	if(pos >size) pos=size;

	if(pos >=0){
		decimal = decimal.substring(0, pos);

		//ex)324.05996 round at 4 : 324.0400-->324.04°¡ µÇµµ·Ï
		if(decimal!="" || decimal!="0")	decimal = parseFloat("0." +decimal).toString();

	}else{

		decimal = "0";

		size = intvar.length;
		if(pos + size >=0)  tmp = intvar.substring(0, intvar.length + pos);//substring index°í·Á
		else tmp="";

		if(tmp=="") intvar="0";//Á¤¼öºÎºÐ±æÀÌº¸´Ù ÀÚ¸®¼ö°¡ Å¬¶§ ex)324.43 round at -4(Ãµ´ÜÀ§·Î ¹Ý¿Ã¸²½Ã)-->0

		var i=1;
		tmpsize = intvar.length-tmp.length;
		while(i <= tmpsize) {
			tmp += "0";
			i++;
		}
		intvar = tmp;
	}


	rtnval = (parseInt(intvar) + parseFloat(decimal) ).toString();

	if(!isNull(rtnval) && existComma) rtnval = setComma(rtnval);
	if(isMinus) rtnval = "-" + rtnval;

	return rtnval;

}



  //-----------------------------------------------------------------------
  // ±âÁ¸ ÇÁ·Î±×·¥À» ½Å±Ô Ã¢¿¡ ¶ç¿î´Ù
  //-----------------------------------------------------------------------
  function maspOpenWin(program, command, target, prop){

    var form                = document.myform;

    if(form.iswindow.value == "Y" || form.iswindow.checked){

      form.method             = "post";
      form.command.value      = command;
      form.program.value      = program;

      /*
      if(form.ismulti.value == "Y" || form.ismulti.checked){
        target = target + "_" + (Math.random() * 1000000000000000000);
      }
      */

      //-------------------------------------------------------------------
      // ¸ÖÆ¼ Ã¼Å©¸¦ ÇÏÁö ¾ÊÀº °æ¿ìµµ ¹«Á¶°Ç »õÃ¢¿¡¼­ ¶ç¿ìµµ·Ï Ã³¸®ÇÏ¿´À½.
      // opener°¡ ¾øÀ» °æ¿ì´Â »ç¾÷ºÎ¸¦ °¡Á®¿ÀÁö ¸øÇÏ¹Ç·Î ¿¡·¯¹ß»ýÇÑ´Ù.
      // ÀÓ½ÃÀûÀ¸·Î opener¸¦ Á¸ÀçÇÏ°Ô ÇÏ±â À§ÇØ¼­ »õÃ¢¿¡¼­ ¶ç¿ìµµ·Ï ÇÏ¿´À½.
      // ¼öÁ¤ : ±èÇÑÀÏ(2004.02.14)
      //-------------------------------------------------------------------
      target = target + "_" + (Math.random() * 1000000000000000000);


      UserWin=window.open("../jsp/blank.html", target, "toolbar=no,width=1000,height=650,top=0,left=0,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes");
      if(UserWin != null){
        UserWin.opener=self;
        //UserWin.focus();
      }


      form.target = target;
      form.action = '../servlet/mfglib.Gselect?command=open_window';//&program=' + program;

      form.submit();
    }
    else{

      form.method             = "get";
      form.command.value      = "";

      form.target = 'content';

      // ?°¡ µÎ¹øÀÌ»ó ³ª¿À´ÂÁö Ã¼Å©ÇÑ´Ù

      program   = metaReplaceString(program, "?iswin=window", "");

      var i = program.indexOf("?");

      if(i == -1) {                                 // ?°¡ ¾øÀ» ¶§
        program     = program + "?iswin=window";
      }else{                                        // ?°¡ ÀÖÀ» ¶§
        program     = program + "&iswin=window";
      }

      form.action = program;
      form.submit();
    }
  }

  //"2003-01-01"·Î ÀÔ·Â½Ã ¿äÀÏÀ» ¸®ÅÏ
  function getWantDay( sDate ){
  	var yyyy = sDate.substring(0,4);
  	var mm   = sDate.substring(5,7);
  	var dd   = sDate.substring(8,10);

  	return getWantDayOfWeek(yyyy, mm, dd);
  }

  //"2003","01","01"½ÄÀ¸·Î ÀÔ·Â½Ã ¿äÀÏÀ» ¸®ÅÏ
  function getWantDayOfWeek(yyyy, mm, dd){

    var cur_day   = parseInt(yyyy,10);
    var cur_month = parseInt(mm,10);
    var cur_year  = parseInt(dd,10);
    var tmp;

    //Significant value
    var sig_val;
    if(cur_month == 1)       sig_val = 0;
    else if(cur_month == 2)  sig_val = 3;
    else if(cur_month == 3)  sig_val = 3;
    else if(cur_month == 4)  sig_val = 6;
    else if(cur_month == 5)  sig_val = 1;
    else if(cur_month == 6)  sig_val = 4;
    else if(cur_month == 7)  sig_val = 6;
    else if(cur_month == 8)  sig_val = 2;
    else if(cur_month == 9)  sig_val = 5;
    else if(cur_month == 10) sig_val = 0;
    else if(cur_month == 11) sig_val = 3;
    else if(cur_month == 12) sig_val = 5;

    var val1 = mod((cur_year + parseInt(cur_year/4) + cur_day + sig_val),7);

    //Display the correct file
    if      (val1 == 0) tmp = "¿ù";
    else if (val1 == 1) tmp = "È­";
    else if (val1 == 2) tmp = "¼ö";
    else if (val1 == 3) tmp = "¸ñ";
    else if (val1 == 4) tmp = "±Ý";
    else if (val1 == 5) tmp = "Åä";
    else if (val1 == 6) tmp = "ÀÏ";

    return tmp;
  }

  function mod(x, x_div){
    for(var i=x; i>=x_div; i -= x_div);
    return i;
  }

//--------------------------------------------------------------------
//ÇØ´ç ³¯Â¥ÀÇ ¿äÀÏ °¡Á®¿À±â
//	dateObj.getDay() : 0(ÀÏ), 1(¿ù), 2(È­), 3(¼ö), 4(¸ñ), 5(±Ý), 6(Åä)
//--------------------------------------------------------------------
var	dayName	= new Array	("ÀÏ","¿ù","È­","¼ö","¸ñ","±Ý","Åä");

function getDateName(dateStr){
	var objDate = null;

	//dateÇüÀÌ¸é str2date
	if(isDate(dateStr)) objDate = str2date(dateStr);

	if(objDate !=null) return dayName[objDate.getDay()];
	else return "noDate";
}

//--------------------------------------------------------------------
//Ç°¸ñº¹»ç Ã¢À» ¶ç¿î´Ù
//--------------------------------------------------------------------
function funcExecPartsCopy(){

  var form = document.myform;

  form.method        = "post";
  form.target        = 'copy_window';
  form.command.value = 'copy_form';

  UserWin=window.open("../jsp/blank.html",'copy_window',"width=1000,height=500,left=0,top=0,scrollbars=no,status=yes,resizable=yes,toolbar=no");
  if(UserWin != null){
    UserWin.opener=self;
    form.target = 'copy_window';
  }

  form.action = "../servlet/mfginv.INV101";
  form.submit();
  UserWin.focus();
}

//--------------------------------------------------------------------
//Ç°¸ñ½Å±Ôµî·Ï Ã¢À» ¶ç¿î´Ù
//--------------------------------------------------------------------
function funcExecPartsInsert(){

  var form = document.myform;

  form.method        = "post";
  form.target        = 'insert_window';
  form.command.value = 'insert_form';

  UserWin=window.open("../jsp/blank.html",'insert_window',"width=1000,height=700,left=0,top=0,scrollbars=yes,status=yes,resizable=yes,toolbar=no");
  if(UserWin != null){
    UserWin.opener=self;
    form.target = 'insert_window';
  }

  form.action = "../servlet/mfginv.INV101";
  form.submit();
  UserWin.focus();
}


//--------------------------------------------------------------------
//»ç¾÷ºÎ,MyData°ü·Ã ½ºÅ©¸³Æ®Ãß°¡(2003-12-29 ÀÌÁ¤È£ Ãß°¡)
//--------------------------------------------------------------------
function funcCheckWindow(){

  var form = document.myform;

  if(form.framedivno != null && form.mydataflag != null){

    // ÀÏ¹ÝÀûÀÎ È­¸éÀÇ °æ¿ì
    if(top.topmenu.document.myform != null){
      form.framedivno.value = top.topmenu.document.myform.framedivno.value;
      form.mydataflag.value = top.topmenu.document.myform.mydata.checked ? "Y" : "";
    }

    // MyMenu ¹× FAQ¿¡¼­ »ç¿ëÇÏ´Â °æ¿ì
    else if(top.opener.top.myform != null){
      form.framedivno.value = top.opener.top.document.myform.framedivno.value;
      form.mydataflag.value = top.opener.top.document.myform.mydataflag.value;
    }

    else if(top.opener.top.topmenu != null){

      // »õÃ¢¿¡¼­ ´Ù½Ã »õÃ¢À» ¶ç¿ö ½ÃÀÛÇÏ´Â È­¸éÀÇ °æ¿ì
      if(top.opener.top.topmenu.document.myform == null){
        form.framedivno.value = top.opener.top.content.con_frame.document.myform.framedivno.value;
        form.mydataflag.value = top.opener.top.content.con_frame.document.myform.mydataflag.value;
      }
    }

    else if(top.opener.top.topmenu == null){
      //alert("³ªÀÇ ¸Þ´º»ç¿ë¿¡¼­ ´Ù½Ã »õÃ¢À» ¶ç¿ï °æ¿ì »ç¾÷ºÎµ¥ÀÌÅÍ´Â Àû¿ëÀÌ ¾ÈµË´Ï´Ù!\n³ªÀÇ ¸Þ´º¿¡ ¹Ù·Î Ãß°¡ÇØ¼­ »ç¿ëÇÏ¼¼¿ä!");
      //form.framedivno.value = top.opener.top.content.con_frame.document.myform.framedivno.value;
      //form.mydataflag.value = top.opener.top.content.con_frame.document.myform.mydataflag.value;
    }

    // »õÃ¢¿¡¼­ ½ÃÀÛÇÏ´Â °æ¿ì È­¸éÀÇ °æ¿ì
    else{
      form.framedivno.value = top.opener.top.topmenu.document.myform.framedivno.value;
      form.mydataflag.value = top.opener.top.topmenu.document.myform.mydata.checked ? "Y" : "";
    }

  }

}

//--------------------------------------------------------------------
// from find.js
//--------------------------------------------------------------------
  // ÇÁ·Î±×·¥ ½ÃÀÛ¿¡ µû¸¥ °æ·Î¸¦ ¼öÁ¤ÇÑ´Ù.
  function funcCurLocation(){

    var  form  = document.myform;

    var self_locname = "" + document.location;
    var pos          = 0;

    // frm.jsp¿¡¼­ con.jsp¸¦ ¹Ù·Î È£ÃâÇÏ´Â °æ¿ì, °æ·Îº¯°æ.(2004.06 ÀÌÁ¤È£)
    pos = self_locname.indexOf('jsp');

    if(pos == -1)  var url = "../";      // SERVLET¿¡¼­ ½ÃÀÛÇÒ °æ¿ì
    else           var url = "../../";   // JSP¿¡¼­ ½ÃÀÛÇÒ °æ¿ì

    return url;

  }


/*********************************************************************
*************************     ±âÅ¸Ã¼Å©     ***************************
/********************************************************************/


// #####################################################################
// ¶óµð¿À(radio) Ã¼Å©
// #####################################################################
function checkRadio(obj, str){

  for(var i=0; i<obj.length; i++){
    if(obj[i].checked == true)    return true;
  }

  alert(str + "¸¦(À») ¼±ÅÃÇÏ¼¼¿ä\n" + str + "´Â(Àº) ÇÊ¼ö¼±ÅÃ Ç×¸ñÀÔ´Ï´Ù");
  return false;
}


 //----------------------------------------------------------------------------------------------------
  //----------------------------------------------------------------------------------------------------
  //-- µé¾î¿Â ÀÚ¸®¼ö Ã¼Å©
  //--
  //-- ÀÎÀÚ
  //-- Obj           : °´Ã¼
  //-- startLength   : ÀÚ¸®¼öºÎÅÍ(0ÀÌ¸é endLength±îÁö¸¸
  //-- endLength     : ÀÚ¸®¼ö±îÁö(0ÀÌ¸é startLengthºÎÅÍ ¹«ÇÑ´ë
  //-- comment       : head¸í
  //-- mendentory    : ÇÊ¼ö¿©ºÎ
  //----------------------------------------------------------------------------------------------------
  //----------------------------------------------------------------------------------------------------
  function checkLength(Obj, startLength, endLength, comment, mendentory){

      //2004-10-08 YDS ObjectÀÇ typeÃ¼Å©ÇÏ¿© hiddenÀÌ¸é focusÀÌµ¿ ¾ÈÇÔ
      var objtype     = Obj.type;
      var canFocus    = true;
      if(objtype=="hidden") canFocus = false;


      var data_length =  Obj.value.length;
      //-----------------------------
      //³â¿ùÀÏÀÌ ÀÔ·ÂµÇ¾ú´ÂÁö Check
      //ÇÊ¼ö ÀÔ·ÂÇ×¸ñÀÏ °æ¿ì
      //-----------------------------
      if(data_length == 0   && mendentory) {
          var mesg = "";
          if(startLength ==  endLength && startLength != 0){
              mesg = ""+startLength+"ÀÚ¸®";
          }
          else if(startLength!=0 && endLength !=0){
              mesg = ""+startLength+"ÀÚ¸®ÀÌ»ó " +endLength +"ÀÚ¸®ÀÌÇÏ";
          }
          else if(startLength==0){
              mesg = "" +endLength +"ÀÚ¸®ÀÌÇÏ";
          }
          else if(endLength ==0){
              mesg = ""+startLength+"ÀÚ¸®ÀÌ»ó";
          }


          alert(comment + " ÇÊµå°¡ ÀÔ·ÂµÇÁö ¾Ê¾Ò½À´Ï´Ù.\n" +
                comment + " ´Â(Àº) "+mesg+" ÇÊ¼ö ÀÔ·ÂÇ×¸ñÀÔ´Ï´Ù.\n  ");


          if(canFocus) Obj.focus();
      }
      else if(data_length != 0){
          if(startLength==0 && endLength ==0){
              return true;
          }
          else if(startLength ==  endLength && startLength !=  data_length){
              alert(comment + "ÀÇ ÀÔ·Â°ªÀº ±æÀÌ "+startLength+"ÀÚ¸®°¡ ÀÔ·ÂµÇ¾î¾ß ÇÕ´Ï´Ù.\n");
              if(canFocus) Obj.focus();
              if(canFocus) Obj.select();
          }
          else if(startLength==0 && endLength < data_length){
              alert(comment + "ÀÇ ÀÔ·Â°ªÀº ±æÀÌ "+endLength+"ÀÚ¸®ÀÌÇÏ ÀÔ·ÂµÇ¾î¾ß ÇÕ´Ï´Ù.\n");
              if(canFocus) Obj.focus();
              if(canFocus) Obj.select();
          }
          else if(startLength > data_length  && endLength == 0){
              alert(comment + "ÀÇ ÀÔ·Â°ªÀº ±æÀÌ "+startLength+"ÀÚ¸®ÀÌ»ó  ÀÔ·ÂµÇ¾î¾ß ÇÕ´Ï´Ù.\n");
              if(canFocus) Obj.focus();
              if(canFocus) Obj.select();
          }
          else if((startLength > data_length) || (data_length > endLength)){
              if(startLength !=0 && endLength !=0)    {
                  alert(comment + "ÀÇ ÀÔ·Â°ªÀº ±æÀÌ "+startLength+"ÀÚ¸®ÀÌ»ó "+endLength+"ÀÚ¸®ÀÌÇÏ°¡ ÀÔ·ÂµÇ¾î¾ß ÇÕ´Ï´Ù.\n");
                  if(canFocus) Obj.focus();
                  if(canFocus) Obj.select();
              }
              else{
                  return true;
              }
          }
          else{
            return true;
          }
      }
      else{
          return true;
      }

      return false;
  }


  //----------------------------------------------------------------------------------------------------
  //----------------------------------------------------------------------------------------------------
  //-- Email Ã¼Å©
  //----------------------------------------------------------------------------------------------------
  //----------------------------------------------------------------------------------------------------
  function check_Email(obj, comment,mendentory){

      var data = obj.value;

      if(obj.value.length == 0 && mendentory){
          alert(comment + " e-mailÇÊµå°¡ ÀÔ·ÂµÇÁö ¾Ê¾Ò½À´Ï´Ù.\n" +
                comment + " e-mailÇÊµå´Â ÇÊ¼ö ÀÔ·ÂÇ×¸ñÀÔ´Ï´Ù.\n\n ");
          obj.focus();
          return false;
      }
      else if(obj.value.length != 0){
          var sign = data.indexOf("@");
          var dot = data.indexOf(".");

          if(sign == -1 || dot == -1){
              alert(comment + " e-mail ÁÖ¼Ò Çü½ÄÀÌ Àß¸øµÇ¾ú½À´Ï´Ù. (xxx@yyy.co.kr) ");
              obj.focus();
              obj.select();
              return false;
          }
      }
      return true;
  }


  //----------------------------------------------------------------------------------------------------
  //----------------------------------------------------------------------------------------------------
  //-- ÀÏ¹Ý ÅØ½ºÆ®ÀÇ ÀÔ·Â¿©ºÎ Ã¼Å©
  //----------------------------------------------------------------------------------------------------
  //----------------------------------------------------------------------------------------------------
  function check_text(obj,comment){

      if(obj.value == '' || obj.value.length == 0){
          alert(comment + " ÇÊµå°¡ ÀÔ·ÂµÇÁö ¾Ê¾Ò½À´Ï´Ù.\n" +
                comment + " ÇÊµå´Â ÇÊ¼ö ÀÔ·ÂÇ×¸ñÀÔ´Ï´Ù.\n\n ");
          obj.focus();
          obj.select();
          return false;
      }
      return true;
  }

 function checkText(obj,comment){
 	  var objvalue = trim(obj.value);

 	  if(objvalue == '' || objvalue.length == 0){
 	    alert(comment + " ÇÊµå°¡ ÀÔ·ÂµÇÁö ¾Ê¾Ò½À´Ï´Ù.\n" +
		  comment + " ÇÊµå´Â ÇÊ¼ö ÀÔ·ÂÇ×¸ñÀÔ´Ï´Ù.\n\n ");

      if(obj.type != "hidden"){
		    obj.focus();
		    obj.select();
		  }

		  return false;
	  }
	  return true;
  }

  //----------------------------------------------------------------------------------------------------
  //----------------------------------------------------------------------------------------------------
  //-- ¿ÀºêÁ§ÀÇ °ªÀÌ ¹üÀ§¸¦ ÁöÁ¤ÇÒ °æ¿ì ½ÃÀÛ°ª°ú Á¾·á°ªÀÇ ¹üÀ§¸¦ CheckÇÏ´Â ÇÔ¼ö
  //-- ÆÄ¶ó¸ÞÅÍ´Â ¿ÀºêÁ§Æ®·Î Àü´Þ, Çü½Ä¿¡ ¸ÂÁö ¾ÊÀ¸¸é False ¸®ÅÏ
  //----------------------------------------------------------------------------------------------------
  //----------------------------------------------------------------------------------------------------
  function check_Range(startObj, endObj, comment){
      if(startObj.value > endObj.value){
          alert(comment + " ¹üÀ§ÀÇ ½ÃÀÛ°ªÀÌ Á¾·á°ªº¸´Ù Å­´Ï´Ù.\n½ÃÀÛ°ª°ú Á¾·á°ªÀ» È®ÀÎ¹Ù¶ø´Ï´Ù.\n");
          startObj.focus();
          startObj.select();
      }
      else{
          return true;
      }
      return false;
  }

  //----------------------------------------------------------------------------------------------------
  //----------------------------------------------------------------------------------------------------
  //-- ¹ßÇà¸Å¼ö °ª¿¡ ´ëÇØ CheckÇÏ´Â ÇÔ¼ö
  //-- ¿ÀºêÁ§Æ®
  //----------------------------------------------------------------------------------------------------
  //----------------------------------------------------------------------------------------------------
  function check_PrintCnt(obj, comment, mendentory){
      //ÇÊ¼ö ÀÔ·ÂÇ×¸ñÀÏ °æ¿ì
      if((obj.value.length == 0) && mendentory){
          alert(comment + " ÇÊµå°¡ ÀÔ·ÂµÇÁö ¾Ê¾Ò½À´Ï´Ù.\n" +
                comment + " ÇÊµå´Â ¹ßÇà½Ã ÇÊ¼ö ÀÔ·ÂÇ×¸ñÀÔ´Ï´Ù.\n\n ¿¹) 3");
          obj.focus();
          obj.select();
      }
      else if(isNaN(obj.value)){
          alert(comment + "Àº ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.\ÀÔ·Â°ªÀ» È®ÀÎ¹Ù¶ø´Ï´Ù.\n\n ¿¹) 3");
          obj.focus();
          obj.select();
      }
      else if(obj.value < 1 || obj.value > 3){
          alert(comment + "´Â 1 ~ 3±îÁö ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.\nÈ®ÀÎ ÈÄ ´Ù½Ã ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
          obj.focus();
          obj.select();
      }
      else{
          return true;
      }
      return false;
}


  // ----------------------------------------
  // ´ñ±Û±æÀÌ Á¦ÇÑ
  // ----------------------------------------
  function check_msglen(frm,id,lenStr){

  	var length = calculate_msglen(document.getElementById(frm).value);
  	document.getElementById(id).innerHTML = length;

  	if (length > lenStr) {
  		alert("ÃÖ´ë "+lenStr+" ¹ÙÀÌÆ®±îÁö ³²±â½Ç ¼ö ÀÖ½À´Ï´Ù.\r\nÃÊ°úµÈ " + (length - lenStr) + "¹ÙÀÌÆ®´Â ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù.");
  		document.getElementById(frm).value = assert_msglen(document.getElementById(frm).value, lenStr, id);
  	}

  }

  // ----------------------------------------
  // ´ñ±Û±æÀÌ °è»ê
  // ----------------------------------------
  function calculate_msglen(message)
  {
  	var nbytes = 0;
  	for (i=0; i<message.length; i++) {
  		var ch = message.charAt(i);
  		if (escape(ch).length > 4) {
  			nbytes += 2;
  		} else if (ch != "\r") {
  			nbytes++;
  		}
  	}
  	return nbytes;
  }

  function assert_msglen(message, maximum, id)
  {
  	var inc = 0;
  	var nbytes = 0;
  	var msg = "";
  	var msglen = message.length;
  	for (i=0; i<msglen; i++) {
  		var ch = message.charAt(i);
  		if (escape(ch).length > 4) {
  			inc = 2;
  		} else if (ch != "\r") {
  			inc = 1;
  		}
  		if ((nbytes + inc) > maximum) {
  			break;
  		}
  		nbytes += inc;
  		msg += ch;
  	}
  	document.getElementById(id).innerHTML = nbytes;
  	return msg;
  }

  // --------------------------------------------------------------
  // --------------------------------------------------------------
  // PMS°ü·Ã Ãß°¡(ÀÌÁ¤È£)
  // --------------------------------------------------------------
  // --------------------------------------------------------------
  //¼±ÅÃ Ã¼Å©¹Ú½º¸¦ ÀüÃ¼ ¼±ÅÃÇÏ´ø°¡ ÇØÁ¦½ÃÅ²´Ù
  //form : FORM°´Ã¼
  function maspProctypeSelect(form){

    var object = null;
    if(form.checkall.value == "TRUE"){
    	form.checkall.value = "FALSE";
    }
    else{
      form.checkall.value = "TRUE";
    }

    for(i=1; i<=form.sizes.value; i++){

    	object = eval("form.proctype" + i);
      if(form.checkall.value == "TRUE" && object.disabled == false){
      	object.checked = true;
      }
      else{
        object.checked = false;
      }
    }
    return;
  }

  //´ÙÁßÃ³¸® Ã¼Å©¹Ú½º ¸ñ·Ï¿¡¼­ Ã¼Å©µÈ °ÍÀÌ Á¸ÀçÇÏ´ÂÁö È®ÀÎÇÑ´Ù
  function maspProctypeChecked(form){

    var object = null;

    for(i=1; i<=form.sizes.value; i++){

    	object = eval("form.proctype" + i);
      if(object.checked == true) return true;
    }
    alert("¼±ÅÃµÈ Ç×¸ñÀÌ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù. Ç×¸ñÀ» ¼±ÅÃÇÏ½Ê½Ã¿À");
    return false;
  }
  
  //------------------------------
  // ÀÌ¹ÌÁö¹Ì¸®º¸±â
  //------------------------------  
  function image_preview(id, src){
    id.src = src;
    imgControlImgSize(id);
    id.style.display = "";
  }  
  
  function imgControlImgSize(id){
    if(id.width > 316)
      id.width = 316;
     if(id.height > 289)
      id.height = 289;  
  }
  



/////////////////////////////////////////////////////////////////////////////////////////////////////
// Àü¿ª»ó¼ö
var DATE_SEPARATOR = "/";						// ³¯Â¥ ±¸ºÐÀÚ

// Validation Check Message
var MSG_VC_NULL = " Ç×¸ñÀº ÇÊ¼öÀÔ·Â ÀÔ´Ï´Ù";			// Not Null
var MSG_VC_CODE = " Ç×¸ñÀº $1 ÀÚ¸® ÀÔ´Ï´Ù";			// ÄÚµå
var MSG_VC_FLOAT = " Ç×¸ñÀº ÃÖ´ë ¼Ò¼öÁ¡À§ $1 ÀÚ¸®, ¼Ò¼öÁ¡¾Æ·¡ $2 ÀÚ¸® ÀÔ´Ï´Ù ";	// ¼Ò¼ö
var MSG_VC_DATE = " Ç×¸ñÀÌ À¯È¿ÇÑ ³¯Â¥°¡ ¾Æ´Õ´Ï´Ù\n\n¿¹) 2005³â 1¿ù 31ÀÏ : 20050131";	// ³¯Â¥
var MSG_VC_PHONE = " Ç×¸ñÀº 9 ÀÚ¸® ÀÌ»ó ÀÔ´Ï´Ù";		// ÀüÈ­¹øÈ£


// ºÎºÐ ¹®ÀÚ¿­ º¯°æ
function replaceAll (
	sOrg	,	// ¿øº» ¹®ÀÚ¿­
	sOld	,	// º¯°æ´ë»ó ¹®ÀÚ¿­
	sNew		// º¯°æÇÒ ¹®ÀÚ¿­
) {
        var sRet = "";
        var idxS = 0;
        var idxE = 0;
        var nLenOld = sOld.length;
        
        if(sOrg == null || sOrg.length == 0)
            return sOrg;
        
        while((idxE = sOrg.indexOf(sOld, idxS)) >= 0) {
            sRet += sOrg.substring(idxS, idxE);
            sRet += sNew;
            
            idxS = idxE + nLenOld;
        }
        sRet += sOrg.substring(idxS, sOrg.length);
        
        return sRet;
}

// ´Þ·Â ÆË¾÷
function openCalendar(
	input	// ³¯Â¥°ªÀÌ ÀÔ·ÂµÉ InputTag
) {
	var str = eval(input + ".value");
	var url = "../common/calendar.jsp?input=" + input + "&str=" + str;
	
	openCenter(url, "calendar", 220, 260);
}

// È­¸é Áß¾Ó¿¡ ÆË¾÷
function openCenter(
	url		,	// ÆäÀÌÁö URL
	name	, 	// ÆË¾÷À§µµ¿ì ¸í
	width	, 	// ÆË¾÷ °¡·Î±æÀÌ
	height		// ÆË¾÷ ¼¼·Î±æÀÌ
) {
	var w=width, h=height;
	var x = (screen.width - w)/2;
	var y = (screen.height - h)/2;
	
	window.open(url, name,
		"left="+x+",top="+y+",width="+w+",height="+h+",location=0,menubar=0,resizable=0,scrollbars=0,status=1,titlebar=0,toolbar=0");
}

String.prototype.trim = function()
{
  return this.replace(/(^\s*)|(\s*$)/gi, "");
}
// ÁÂ¿ì °ø¹éÁ¦°Å
function trim(str){ 
	return str.replace(/(^\s*)|(\s*$)/g, "");
}

// ÀÔ·Â Ä³·µÀ» inputÀÇ ¸¶Áö¸·À¸·Î ÀÌµ¿
function moveCaretLast(
	input		// Input Tag
) {
	var range = input.createTextRange();
    range.collapse(false);
    range.select();
}

// ÇÊ¼öÀÔ·Â (Validation Check)
function vcNull(
	input	,	// Input Tag
	title		// Ç×¸ñ¸í
) {
	if(trim(input.value) == "") {
		alert(title + MSG_VC_NULL);
		input.focus();
		
		return true;
	} else {
		return false;
	}
}

// ÄÚµå (Validation Check)
function vcCode(
	bNotNull	,	// ³ÎÃ¼Å© ±¸ºÐ : true=Ã¼Å©, fals=ºñÃ¼Å©
	input		,	// Input Tag
	title		, 	// Ç×¸ñ¸í
	format			// ÄÚµåÇü½Ä
) {
	if(bNotNull == true) {
		if(vcNull(input, title))
			return true;
	}

	var len = replaceAll(format,"-","").length;
	var strLen = replaceAll(input.value,"-","").length;

	if(input.value.length > 0 && strLen != len) {
		alert(title + replaceAll(MSG_VC_CODE, "$1", len));	
		input.focus();
		
		return true;
	} else {
		return false;
	}
}

// ¼Ò¼ö (Validation Check)
function vcFloat(
	bNotNull	,	// ³ÎÃ¼Å© ±¸ºÐ : true=Ã¼Å©, fals=ºñÃ¼Å©
	input 		,	// Input Tag
	title 		,	// Ç×¸ñ¸í
	upLen		,	// ÃÖ´ë ¼Ò¼öÁ¡À§ ÀÚ¸®¼ö 		
	downLen			// ÃÖ´ë ¼Ò¼öÁ¡¾Æ·¡ ÀÚ¸®¼ö
) {
	if(bNotNull == true) {
		if(vcNull(input, title))
			return true;
	}

	if(input.value == "")
		return false;
		
	var idxPoint = input.value.indexOf('.');
	if(idxPoint < 0) idxPoint = input.value.length;
	var valUpLen = idxPoint;
	var valDownLen = input.value.length - idxPoint -1;
	
	if(valUpLen > upLen || valDownLen > downLen) {
		var msg = replaceAll(MSG_VC_FLOAT, "$1", upLen);
		msg = replaceAll(msg, "$2", downLen);
		
		alert(title + msg);	
		input.focus();
		
		return true;
	} else {
		return false;
	}	
}

// ³¯Â¥ (Validation Check)
function vcDate(
	bNotNull	,	// ³ÎÃ¼Å© ±¸ºÐ : true=Ã¼Å©, fals=ºñÃ¼Å©
	input 		,	// Input Tag
	title 			// Ç×¸ñ¸í
) {
	if(bNotNull == true) {
		if(vcNull(input, title))
			return true;
	}
	
	if(input.value == "")
		return false;
	
	var str = replaceAll(input.value,DATE_SEPARATOR,"");
	
	if(str.length < 8) {
		alert(title + MSG_VC_DATE);	
		input.focus();
		
		return true;
	}	

	var dt = new Date(str.substring(0, 4), str.substring(4, 6)-1, str.substring(6));

  	if( dt.getFullYear() != str.substring(0, 4)
   		|| dt.getMonth() != (str.substring(4, 6)-1)
   		|| dt.getDate()  != str.substring(6)
   	) {
		alert(title + MSG_VC_DATE);	
		input.focus();
		
		return true;
	} else {
		return false;
	}	
}

// ÀüÈ­¹øÈ£ (Validation Check)
function vcPhone(
	bNotNull	,	// ³ÎÃ¼Å© ±¸ºÐ : true=Ã¼Å©, fals=ºñÃ¼Å©
	input 		,	// Input Tag
	title 			// Ç×¸ñ¸í
) {
	if(bNotNull == true) {
		if(vcNull(input, title))
			return true;
	}

	if(input.value.length > 0 && input.value.length < 11) {
		alert(title + MSG_VC_PHONE);	
		input.focus();
		
		return true;
	} else {
		return false;
	}
}

// »óÅÂ¹Ù¿¡ ¸µÅ©°¡ ³ªÅ¸³ªÁö ¾Êµµ·Ï ¸·À½
function hidestatus() {
	window.status='';
	return true;
}
if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
document.onmouseover=hidestatus
document.onmouseout=hidestatus

// ¸Þ´º°ü·Ã ÇÔ¼ö
function menuOver(caller, idx) {
	caller.className = "menuover";
	subShow(idx);
}
function menuOut(caller, idx) {
	caller.className = "menuout";
	subHidden(idx);
}
function subOver(caller) {
	caller.className = "subover";
}
function subOut(caller) {
	caller.className = "subout";
}
function subShow(idx) {
	var subLayer = eval("subLayer" + idx);
	var subFrame = eval("document.all.subFrame" + idx);
	
	subFrame.style.width = subLayer.clientWidth;
	subFrame.style.height = subLayer.clientHeight;
	subFrame.style.visibility = "visible";
	subLayer.style.visibility = "visible";
}
function subHidden(idx) {
	var subLayer = eval("subLayer" + idx);
	var subFrame = eval("document.all.subFrame" + idx);
	
	subLayer.style.visibility = "hidden";
	subFrame.style.visibility = "hidden";
}
function menuClick(mainmenucode, submenucode, url) {
	var form = document.myform;
	
	form.mainmenucode.value = mainmenucode;
	form.submenucode.value  = submenucode;
	form.action = url + "?mainmenucode=" + mainmenucode + "&submenucode=" + submenucode;
	form.target = "_self";
	form.submit(); 
}  


//***************************************************************************
// µ¿Àû »ý¼º <TD> ¾ÈÀÇ ¼Ó¼ºÀ» À§ÇÑ Àü¿ª ¹è¿­
//***************************************************************************
var gTD_ALIGN = new Array();

//***************************************************************************
// µ¿Àû »ý¼º <TD> ¾ÈÀÇ ³»¿ëÀ» À§ÇÑ innerHTML
//***************************************************************************
var gTD_innerHTML = new Array();

//***************************************************************************
// ¼±ÅÃ Ã¼Å©¹Ú½º°¡ Ã¼Å©µÇ¾úÀ» ¶§ÀÇ <tr> ¹è°æ»ö
//***************************************************************************
var gTR_SEL_COLOR = "#ccccff";



	// **********************************************************************
    // Å×ÀÌºí °´Ã¼¸¦ ¹Þ¾Æ¼­ µ¿ÀûÀ¸·Î ÇÏ³ªÀÇ ÇàÀ» Ãß°¡ÇÑ´Ù
	// **********************************************************************
    function funcDynamicTable2(tblObject, rowProperty, columnCount){

        var tbody           = document.getElementById(tblObject).getElementsByTagName("TBODY")[0];
        var row             = document.createElement("<TR "+rowProperty+">");

        row.onmouseover     = function(){document.getElementById(tblObject).clickedRowIndex=this.rowIndex};

        for(var i = 1; i <= columnCount; i++){

            var col = document.createElement("<TD>");

            col.style.textAlign = gTD_ALIGN[i].substring(0, gTD_ALIGN[i].indexOf(';')    );
            col.style.width     = gTD_ALIGN[i].substring(   gTD_ALIGN[i].indexOf(';') + 1);
            col.innerHTML       = gTD_innerHTML[i];

            row.appendChild(col);
        }

        tbody.appendChild(row);

      //document.getElementById(tblObject).children(0).appendChild(row);
      //td1.insertAdjacentHTML('beforeEnd', td1body);

        //----------------------------------------------------
        // °øÅë ÄÃ·³ ¹è¿­ÀÇ °ªÀ» ´Ù¸¥ ¿ëµµ¸¦ À§ÇØ ÃÊ±âÈ­½ÃÅ²´Ù
        //----------------------------------------------------
        gTD_ALIGN.length     = 0;
        gTD_innerHTML.length = 0;
    }
    
    
	// **********************************************************************
    // 2ºÐÇÒµÈ Å×ÀÌºíÀÇ ½ºÅ©·Ñ Ã³¸®
	// **********************************************************************
    function funcBodyScroll2(){

        var sctop  = event.srcElement.scrollTop;
        var scleft = event.srcElement.scrollLeft;
        var header = document.all("header");

        header.scrollLeft=scleft;
    }


	// **********************************************************************
    // 2ºÐÇÒµÈ Å×ÀÌºíÀÇ »çÀÌÁî ÀçÁ¶Á¤
	// **********************************************************************
    function funcDoResize2(){

        var NaviHeight   = 40;
        var ButtonHeight = 40;
        var MasterHeight = 0; //Window ¿ÀÇÂ ½Ã ¸¶½ºÅ¸ È­¸éÀÌ ÀÖÀ» °æ¿ì

        if( document.all["win_master"]   != null) MasterHeight = document.all["win_master"].scrollHeight;

      //if( document.all["navi"]   != null)   NaviHeight   = document.all["navi"].scrollHeight;
      //if( document.all["button"] != null)   ButtonHeight = document.all["button"].scrollHeight;

        var BottomHeight = eval(MasterHeight) + eval(NaviHeight) + eval(ButtonHeight) + eval(document.all["header"].scrollHeight) + 2;

        if(eval(document.body.clientHeight) < eval(BottomHeight))    document.all["body"].style.height= 0;
        else                                                         document.all["body"].style.height= eval(document.body.clientHeight) - eval(BottomHeight);

        var BodyStyleHeight  = replaceString(document.all["body"].style.height, "px", "");
        var BodyStyleWidth   = replaceString(document.all["body"].style.width,  "px", "");
        var BodyScrollHeight = document.all["body"].scrollHeight;
        var BodyScrollWidth  = document.all["body"].scrollWidth;

        var CompHeight       = eval(BodyStyleHeight) - eval(BodyScrollHeight);
        var CompWidth        = eval(BodyStyleWidth ) - eval(BodyScrollWidth );

        // ·¹ÀÌ¾î ½ºÅ©·Ñ °¡·Î°ªÀº = 16px
        // body ·¹ÀÌ¾îÀÇ ¼³Á¤µÈ ³ôÀÌ(BodyStyleHeight) > È°¼ºÈ­µÈ ½ºÅ©·ÑÀÇ ³ôÀÌ(BodyScrollHeight)  ÀÌ°í,
        // body ·¹ÀÌ¾îÀÇ ¼³Á¤µÈ °¡·Î(BodyStyleWidth)  < È°¼ºÈ­µÈ ½ºÅ©·ÑÀÇ °¡·Î(BodyScrollWidth)   ÀÌ¸é,
        // body ·¹ÀÌ¾îÀÇ ¼¼·Î½ºÅ©·ÑÀº ºñÈ°¼ºÈ­ µÇ¹Ç·Î »ó´ÜÀÇ header ·¹ÀÌ¾îÀÇ ½ÇÁ¦ °¡·Î°ªÀ» ÃÖ´ëÇã¿ëÄ¡ÀÎ ÇÁ·¹ÀÓÀÇ °¡·Î°ª¿¡¼­ '12'¸¦ »«´Ù.
        // ±× ¿ÜÀÇ °æ¿ì¿¡´Â ¸ðµÎ °¡·Î,¼¼·Î ½ºÅ©·ÑÀÌ ¸ðµÎ È°¼ºÈ­ µÇ¹Ç·Î '28'À» »«´Ù

        if(CompHeight >= 0){
            //»õÃ¢À¸·Î ÇÁ·Î±×·¥À» ¶ç¿ï °æ¿ì, ºê¶ó¿ìÀúÀÇ ÃÖ´ëÄ¡¿¡ ´ëÇÏ¿© °ªÀ» È¯»êÇÑ´Ù.
            document.all["header"].style.width = eval(document.body.clientWidth) - 12;
            document.all["body"].style.width   = eval(document.body.clientWidth) - 12;
        }
        else{
            //»õÃ¢À¸·Î ÇÁ·Î±×·¥À» ¶ç¿ï °æ¿ì, ºê¶ó¿ìÀúÀÇ ÃÖ´ëÄ¡¿¡ ´ëÇÏ¿© °ªÀ» È¯»êÇÑ´Ù.
            document.all["header"].style.width = eval(document.body.clientWidth) - 28;
            document.all["body"].style.width   = eval(document.body.clientWidth) - 12;
        }
    }


	// **********************************************************************
    // 4ºÐÇÒµÈ Å×ÀÌºíÀÇ ½ºÅ©·Ñ Ã³¸®
	// **********************************************************************
    function funcBodyScroll4(){

        var sctop   = event.srcElement.scrollTop;
        var scleft  = event.srcElement.scrollLeft;
        var header2 = document.all("header2");

        header2.scrollLeft=scleft;
        body.scrollTop=sctop;
    }

	// **********************************************************************
    // 4ºÐÇÒµÈ Å×ÀÌºíÀÇ »çÀÌÁî ÀçÁ¶Á¤
	// **********************************************************************
    function funcDoResize4(){

        var NaviHeight   = 40;
        var ButtonHeight = 40;
        var MasterHeight = 0; //Window ¿ÀÇÂ ½Ã ¸¶½ºÅ¸ È­¸éÀÌ ÀÖÀ» °æ¿ì

      //if( document.all["win_master"] != null) MasterHeight = document.all["win_master"].scrollHeight;
      //if( document.all["navi"]       != null) NaviHeight   = document.all["navi"].scrollHeight;
      //if( document.all["button"]     != null) ButtonHeight = document.all["button"].scrollHeight;

        var BottomHeight = eval(MasterHeight) + eval(NaviHeight) + eval(ButtonHeight) + eval(document.all["header"].scrollHeight) + 2;

        // body ·¹ÀÌ¾îÀÇ ½ÇÁ¦ ³ôÀÌ°ªÀÌ À½¼öÀÏ °æ¿ì 0pxÀ¸·Î °íÁ¤ÇÑ´Ù.
        if(eval(document.body.clientHeight) < eval(BottomHeight)){
            document.all["body" ].style.height= 0;
            document.all["body2"].style.height= 0;
        }
        else{
            document.all["body" ].style.height= eval(document.body.clientHeight) - eval(BottomHeight);
            document.all["body2"].style.height= eval(document.body.clientHeight) - eval(BottomHeight);
        }

        var BodyStyleHeight   = replaceString(document.all["body" ].style.height, "px", "");
        var BodyStyleHeight2  = replaceString(document.all["body2"].style.height, "px", "");
        var BodyStyleWidth    = replaceString(document.all["body" ].style.width,  "px", "");
        var BodyStyleWidth2   = replaceString(document.all["body2"].style.width,  "px", "");
        var BodyScrollHeight2 = document.all["body2"].scrollHeight;
        var BodyScrollWidth2  = document.all["body2"].scrollWidth;

        var CompHeight        = eval(BodyStyleHeight2) - eval(BodyScrollHeight2);
        var CompWidth         = eval(BodyStyleWidth2 ) - eval(BodyScrollWidth2 );

        if(CompWidth < 0)    CompHeight = CompHeight - 16;

        var HeaderStyleWidth  = replaceString(document.all["header"].style.width,  "px", "");

        // ·¹ÀÌ¾î ½ºÅ©·Ñ °¡·Î°ªÀº = 16px
        // body ·¹ÀÌ¾îÀÇ ¼³Á¤µÈ ³ôÀÌ(BodyStyleHeight) > È°¼ºÈ­µÈ ½ºÅ©·ÑÀÇ ³ôÀÌ(BodyScrollHeight)  ÀÌ°í,
        // body ·¹ÀÌ¾îÀÇ ¼³Á¤µÈ °¡·Î(BodyStyleWidth)  < È°¼ºÈ­µÈ ½ºÅ©·ÑÀÇ °¡·Î(BodyScrollWidth)   ÀÌ¸é,
        // body ·¹ÀÌ¾îÀÇ ¼¼·Î½ºÅ©·ÑÀº ºñÈ°¼ºÈ­ µÇ¹Ç·Î »ó´ÜÀÇ header ·¹ÀÌ¾îÀÇ ½ÇÁ¦ °¡·Î°ªÀ» ÃÖ´ëÇã¿ëÄ¡ÀÎ ÇÁ·¹ÀÓÀÇ °¡·Î°ª¿¡¼­ '12'¸¦ »«´Ù.
        // ±× ¿ÜÀÇ °æ¿ì¿¡´Â ¸ðµÎ °¡·Î,¼¼·Î ½ºÅ©·ÑÀÌ ¸ðµÎ È°¼ºÈ­ µÇ¹Ç·Î '28'À» »«´Ù
        // °íÁ¤Æ²ÀÇ bodyÃø ³ôÀÌ´Â ºñ°íÁ¤Æ²ÀÇ ÁÂ¿ì½ºÅ©·Ñ Á¸Àç¿©ºÎ¿¡ µû¶ó '16'À» »«´Ù.

        if(CompHeight >= 0){
            //»õÃ¢À¸·Î ÇÁ·Î±×·¥À» ¶ç¿ï °æ¿ì, ºê¶ó¿ìÀúÀÇ ÃÖ´ëÄ¡¿¡ ´ëÇÏ¿© °ªÀ» È¯»êÇÑ´Ù.
            document.all["header2"].style.width = eval(document.body.clientWidth) - eval(HeaderStyleWidth) - 12;
            document.all["body2"].style.width   = eval(document.body.clientWidth) - eval(HeaderStyleWidth) - 12;
        }
        else{
            //»õÃ¢À¸·Î ÇÁ·Î±×·¥À» ¶ç¿ï °æ¿ì, ºê¶ó¿ìÀúÀÇ ÃÖ´ëÄ¡¿¡ ´ëÇÏ¿© °ªÀ» È¯»êÇÑ´Ù.
            document.all["header2"].style.width = eval(document.body.clientWidth) - eval(HeaderStyleWidth) - 28;
            document.all["body2"].style.width   = eval(document.body.clientWidth) - eval(HeaderStyleWidth) - 12;
        }

        if(CompWidth >= 0){
            //»õÃ¢À¸·Î ÇÁ·Î±×·¥À» ¶ç¿ï °æ¿ì, ºê¶ó¿ìÀúÀÇ ÃÖ´ëÄ¡¿¡ ´ëÇÏ¿© °ªÀ» È¯»êÇÑ´Ù.
            document.all["body"].style.height = eval(document.body.clientHeight) - eval(BottomHeight);
        }
        else{
            //»õÃ¢À¸·Î ÇÁ·Î±×·¥À» ¶ç¿ï °æ¿ì, ºê¶ó¿ìÀúÀÇ ÃÖ´ëÄ¡¿¡ ´ëÇÏ¿© °ªÀ» È¯»êÇÑ´Ù.
            //°íÁ¤Æ²ÀÇ bodyÃø ³ôÀÌ´Â ºñ°íÁ¤Æ²ÀÇ ÁÂ¿ì½ºÅ©·Ñ Á¸Àç¿©ºÎ¿¡ µû¶ó '16'À» »«´Ù.
            document.all["body"].style.height = eval(document.body.clientHeight) - eval(BottomHeight) - 16;
        }
    }

// -----------------------------------------------------------------------------
// ¸Þ½ÃÁö º¸ÀÌ±â
// -----------------------------------------------------------------------------
function planMsg(msg)
{
    if( document.all["popmsg"] == null ) return;

    var content =  "<table border='0' cellpadding='5' cellspacing='1' bgcolor='#009999'>    ";
        content += "    <tr>                                                                ";
        content += "        <td bgcolor='#FFFFEE' align='left' valign='center'>             ";
        content += "            <font color='#555588'>" + msg + "</font>                    ";
        content += "        </td>                                                           ";
        content += "    </tr>                                                               ";
        content += "</table>                                                                ";

    popmsg.style.position    = "absolute";
    popmsg.style.visibility  = "visible";
    popmsg.style.left        = window.event.x;
    popmsg.style.top         = window.event.y;

    document.all["popmsg"].innerHTML = content;
}

// -----------------------------------------------------------------------------
// ¸Þ½ÃÁö °¨Ãß±â
// -----------------------------------------------------------------------------
function offMsg()
{
    if( document.all["popmsg"] == null ) return;

    var content = "";

    popmsg.style.position            = "absolute";
    popmsg.style.visibility          = "hidden";

    document.all["popmsg"].innerHTML = content;
}


	// **********************************************************************
	// È­¸é»óÀÇ ¼±ÅÃ Ã¼Å©¹Ú½º(proctype)°¡ ¼±ÅÃµÇ¾úÀ» ¶§ <tr>À» ¹ÝÀü½ÃÅ²´Ù
	// **********************************************************************
	function funcSelectRow(obj){

        window.focus();

        if(obj.checked){
            obj.parentElement.parentElement.style.backgroundColor = '#CCCCFF';
        }
        else{
            obj.parentElement.parentElement.style.backgroundColor='';
        }
    }


  /*
 * È­¸é °Ë»öÇÊÅÍ View ÇÔ¼ö
 * @param : 
   @ ¼³¸í) ÆäÀÌÁö tab Å¸ÀÌÆ²¿¡ mn_view(); ÀÌº¥Æ® Àû¿ë
         ex) <span style='cursor:hand;' onclick='javascript:mn_view();'>Æ¯ÇãÁ¦¾È</span>
*/
  function mn_view() {
    if(document.all.searchFilter.style.display == 'none') {
      document.all.searchFilter.style.display = '';
    } else {
      document.all.searchFilter.style.display = 'none';
    }
  }

  /**
 *  @desc   : È­¸é Áß¾Ó¿¡  ÆË¾÷Ã¢À» ¿¬´Ù.
 *	omOpenPopupCenter(url, windowName,windowWidth, windowHeight, windowFeatures);
 *  @ parameter : sTargetPath : ÇØ´ç popupÃ¢ÀÇ ½ÇÁ¦ ÆäÀÌÁö °æ·Î
                           windowName : ¿ÀÇÂµÉ windowÀÇ ÀÌ¸§
                           windowWidth : Ã¢ÀÇ ³ÐÀÌ
                           windowHeight : Ã¢ÀÇ ³ôÀÌ
                           windowFeatures : Ã¢ÀÇ ¼Ó¼º
 * windowFeaturesÀÇ ³»¿ëÀº ÀÏ¹Ý windowÀÇ Å©±â¸¦ Á¦¿ÜÇÑ ¼Ó¼º°ª°ú µ¿ÀÏÇÏ´Ù.
 * @return : void
 */
function omOpenPopupCenter(obj, windowName, windowWidth, windowHeight, windowFeatures) {
	try {
		if( windowFeatures == null || windowFeatures == "" )
			windowFeatures = "toolbar=no,directories=no,status=no,scrollbars=no,resize=no,menubar=no";

    var xPos = (screen.availWidth  - windowWidth) / 2;
    var yPos = (screen.availHeight - windowHeight) / 2;

		window.open( "" , windowName, "top=" + yPos + ",left=" + xPos + ",width=" + windowWidth + ",height=" + windowHeight + "," + windowFeatures);

    obj.method        = 'post';
    obj.target        = windowName;

    obj.submit();

	} catch(errorObject) {
	}
}

function gfn_checkJumnin(num) {
    if(num==''){
        alert("ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
        return false;
    }
    if(num.length!=13){
        alert ("ÁÖ¹Îµî·Ï¹øÈ£¸¦ 13ÀÚ¸® ¼ýÀÚ·Î ÀÔ·ÂÇÏ½Ê½Ã¿À.");
        return false;
    }
    if(allnum(num) == false){
        alert("ÁÖ¹Îµî·Ï¹øÈ£´Â ¼ýÀÚ¸¸ ÀÔ·ÂÀÌ °¡´ÉÇÕ´Ï´Ù.");
        return false;
    }
    var ssn1 = num.substring(0, 6);
    var ssn2 = num.substring(6, 13);
    if((ssn1.length==6) &&(ssn2.length==7)){
        var ssn=ssn1+ssn2;
        a = new Array(13);
        for (var i=0; i < 13; i++) {
            a[i] = parseInt(ssn.charAt(i));
        }
          var k = 11 - (((a[0] * 2) + (a[1] * 3) + (a[2] * 4)
          + (a[3] * 5) + (a[4] * 6) + (a[5] * 7)
          + (a[6] * 8) + (a[7] * 9) + (a[8] * 2)
          + (a[9] * 3) + (a[10] * 4) + (a[11] * 5))
          % 11);
        if (k > 9){
            k -= 10;
        }
        if (k == a[12]){
            return true;
        } else {
            alert ("Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ´Ï´Ù.\n\n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
            return false;
        }
    }
}

function allnum(str) {
    for (var i = 0 ; i < str.length ; i++) {
        var cv = str.charCodeAt(i);
        if (!(0x30 <= cv && cv <= 0x39)) {
            return false;
        }
    }
}

