/**
 * Copyright (c) 2000 by LG EDS Systems Inc
 * All rights reserved.
 * 
 * »ç¹«¼Ò°ü¸®(OFM¿ë) ÀÚ¹Ù½ºÅ©¸³Æ® ÇÔ¼ö
 *
 * History :
 * 04/30/2001 Ver1.0 Hillsea Created
 * 05/25/2001 Daeho Edited
 *
 * @version 1.0, 04/30/2001
 * @author  Hillsea Bae, LG EDS Systems Inc
 */

/*
 * USED by AgtRegist.jsp
 * MADE by Daeho
 *
 * µî·ÏÇØ¾ßÇÒ agent¸¦ Ãâ·ÂÇÏ´Â È­¸éÀ» ¿ÀÇÂÇÑ´Ù.
 * 
 */

/*
 * USED by AgtRegist.jsp
 * MADE by Daeho
 *
 * agent»ó¼¼Á¤º¸È­¸éÀ¸·Î °¡±â
 * 
 */    
function go_AgtDetail(off_code)
{
    window.open("AgtDetail.jsp?off_code="+off_code,"AgtDetail","width=550,height=650, scrollbars=yes");
}

/*
 * USED by AgtSearch_disp.jsp
 * MADE by Daeho
 *
 * agentÁ¤º¸¸¦ ¼öÁ¤ÇÏ´Â È­¸éÀ¸·Î °¡±â
 * 
 */    
function go_AgtUpdate(off_code)
{
    parent.window.location.href = "AgtUpdate.jsp?off_code="+off_code;
}

/*
 * USED by AgtDetail.jsp
 * MADE by Daeho
 *
 * agentÁ¤º¸¸¦ ¼öÁ¤ÇÏ´Â È­¸éÀ¸·Î °¡±â
 * 
 */    
function go_AgtUpdate2(off_code)
{
    opener.parent.window.location.href = "AgtUpdate.jsp?off_code="+off_code;
    self.close();
}

/*
 * USED by AgtSearch_disp.jsp
 * MADE by Daeho
 *
 * agent°ü¸® È­¸é¿¡¼­ µî·ÏÈ­¸éÀ¸·Î °¡±â
 * 
 */    
 
function go_AgtInsert()
{
    parent.window.location.href="AgtRegist.jsp";
}

/*
 * USED by AgtDetail.jsp
 * MADE by Daeho
 *
 * agent°è¾àÇØÁö È­¸éÀ¸·Î °¡±â
 * 
 */    

function agt_cancel(off_code)
{
    if(confirm("È®ÀÎÀ» Å¬¸¯ÇÏ¸é °è¾àÀÌ ÇØÁöµË´Ï´Ù.\nÁ¤È®ÇÏ°Ô È®ÀÎÇÏ½Ã°í Å¬¸¯ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.")){
        window.location.href="AgtCancel_call.jsp?off_code="+off_code; 
    }
}

/*
 * USED by AgtDetail.jsp
 * MADE by Daeho
 *
 * agent°è¾àÀÌ·Â È­¸éÀ¸·Î °¡±â
 * 
 */    

function go_AgtCntrtHistoryList(off_code)
{
    window.location.href="AgtCntrtHistoryList.jsp?off_code="+off_code; 
}


/*
 * USED by AgtDetail.jsp
 * MADE by Daeho
 *
 * agent°è¾à°»½Å È­¸éÀ¸·Î °¡±â
 * 
 */    

function go_AgtCntrtUpdate(off_code)
{
    window.location.href="AgtCntrtUpdate.jsp?off_code="+off_code; 
}

/*
 * USED by AgtHistory.jsp
 * MADE by Daeho
 *
 * agent°è¾àÀÌ·Â»ó¼¼ È­¸éÀ¸·Î °¡±â
 * 
 */    

function go_AgtCntrtHistoryDetail(off_code,cntrt_no)
{    
    window.location.href="AgtCntrtHistoryDetail.jsp?off_code="+off_code+"&cntrt_no="+cntrt_no ; 
}

/*
 * USED by AgtCntrtUpdate_call.jsp
 * MADE by Daeho
 *
 * agent°è¾à°»½ÅÈÄ °»½ÅµÈ ³»¿ëÀ» º¼ ¼ö ÀÖ´Â »ó¼¼È­¸éÀ¸·Î °¡±â
 * 
 */    

function go_AgtDetailConfirm(off_code)
{    
    window.location.href="AgtDetail.jsp?off_code="+off_code ; 
}


/*
 * USED by LineInsert.jsp
 * MADE by Daeho
 *
 * ³ë¼±À» µî·ÏÇÏ´Â °æ¿ì
 * 
 */

function line_insert(line)
{
  //  alert('a');
  
   if(eval(line.off_count)!=null) {
       if (line.off_count.value==0) {
           alert('¸ÕÀú °æÀ¯Áö ¼ö¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä.');
           line.off_count.focus();
           return false;
       }   
    } // of if
    
     
    var count, strOff_code;
    count = line.stop_no.length;    
    
    if(checkNull(line.line_code.value)){
        alert("³ë¼±ÄÚµå¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.");
        line.line_code.focus();
        return false;
    }
    if(checkNull(line.line_name.value)){
        alert("³ë¼±¸íÀ» ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.");
        line.line_name.focus();
        return false;
    }       
    if(count==null) {
        if(checkNull(line.stop_no.value)) {
           alert("°æÀ¯¼ø¹øÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
           line.stop_no.focus();
           return false;
        }    
        if(checkNumber(line.stop_no.value)) {
           alert("¾Æ¶óºñ¾Æ ¼ýÀÚ¸¸ ÀÔ·Â°¡´É ÇÕ´Ï´Ù.");            
           line.stop_no.select();
           return false;
        }
        if(checkNull(line.off_code.value)) {
           alert("»ç¹«¼ÒÄÚµå¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
           line.off_code.focus();
           return false;
        }    
        if(checkNull(line.elapse_time_1.value)) {
           alert("°æÀ¯ ¼Ò¿ä½Ã°£À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
           line.elapse_time_1.focus();
           return false;
        }            
        if(checkNumber(line.elapse_time_1.value)) {
           alert("¾Æ¶óºñ¾Æ ¼ýÀÚ¸¸ ÀÔ·Â°¡´É ÇÕ´Ï´Ù.");            
           line.elapse_time_1.select();
           return false;
        }            
        if(checkNull(line.elapse_time_2.value)) {
           alert("°æÀ¯ ¼Ò¿ä½Ã°£À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
           line.elapse_time_2.focus();
           return false;
        }    
        if(checkNumber(line.elapse_time_2.value)) {
           alert("¾Æ¶óºñ¾Æ ¼ýÀÚ¸¸ ÀÔ·Â°¡´É ÇÕ´Ï´Ù.");            
           line.elapse_time_2.select();
           return false;
        }            
        if (line.elapse_time_1.value.length==1) line.elapse_time_1.value = "0" + line.elapse_time_1.value;        
        if (line.elapse_time_2.value.length==1) line.elapse_time_2.value = "0" + line.elapse_time_2.value;  
        
    } else {   
     
        for (i=0;i<count;i++) {        
            
            if(checkNull(line.stop_no[i].value)) {
                alert("°æÀ¯¼ø¹øÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
                line.stop_no[i].focus();
                return false;
             }    
             if(checkNumber(line.stop_no[i].value)) {
                alert("¾Æ¶óºñ¾Æ ¼ýÀÚ¸¸ ÀÔ·Â°¡´É ÇÕ´Ï´Ù.");            
                line.stop_no[i].select();
                return false;
             }
             if(checkNull(line.off_code[i].value)) {
                alert("»ç¹«¼ÒÄÚµå¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
                line.off_code[i].focus();
                return false;
             }    
             if(checkNull(line.elapse_time_1[i].value)) {
                alert("°æÀ¯ ¼Ò¿ä½Ã°£À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
                line.elapse_time_1[i].focus();
                return false;
             }            
             if(checkNumber(line.elapse_time_1[i].value)) {
                alert("¾Æ¶óºñ¾Æ ¼ýÀÚ¸¸ ÀÔ·Â°¡´É ÇÕ´Ï´Ù.");            
                line.elapse_time_1[i].select();
                return false;
             }            
             if(checkNull(line.elapse_time_2[i].value)) {
                alert("°æÀ¯ ¼Ò¿ä½Ã°£À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
                line.elapse_time_2[i].focus();
                return false;
             }    
             if(checkNumber(line.elapse_time_2[i].value)) {
                alert("¾Æ¶óºñ¾Æ ¼ýÀÚ¸¸ ÀÔ·Â°¡´É ÇÕ´Ï´Ù.");            
                line.elapse_time_2[i].select();
                return false;
             }            
             if (line.elapse_time_1[i].value.length==1) line.elapse_time_1[i].value = "0" + line.elapse_time_1[i].value;        
             if (line.elapse_time_2[i].value.length==1) line.elapse_time_2[i].value = "0" + line.elapse_time_2[i].value;                                                 
             
        }   // of for
            
        
        for (i=0;i<count;i++) {                
            
            for(j=0;j<count;j++) {
                
                if(i == j){
                    continue;
                } else {
                    if(line.off_code[i].value==line.off_code[j].value) {        
                        alert("»ç¹«¼ÒÄÚµå Áßº¹ÀÔ·Â µÇ¾ú½À´Ï´Ù. \nÈ®ÀÎÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.");
                        line.off_code[j].select();
                        return false;
                    }            
                }                
            }  // of for              
        } // of for
                                  
    } // end if
      
    line.submit();     
    
}

/*
 * USED by LineInsert.jsp
 * MADE by Daeho
 *
 * ³ë¼±°Ë»öÈ­¸éÀ¸·Î µ¹¾Æ´Ü´Ù
 * 
 */

function go_LineSearch()
{
    window.location.href='LineSearch.jsp';
}

/*
 * USED by LineSearch_disp.jsp
 * MADE by Daeho
 *
 * ³ë¼±»ó¼¼Á¤º¸ È­¸é ¿ÀÇÂ
 * 
 */

function open_LineDetailInfo(line_code)
{
    window.open("LineDetailInfo.jsp?line_code="+line_code, "LineDetailInfo", "width=500,height=500,scrollbar=yes");
}

/*
 * USED by LineDetailInfo.jsp
 * MADE by Daeho
 *
 * ³ë¼±Á¤º¸¼öÁ¤ È­¸éÀ¸·Î °¡±â
 * 
 */
function go_LineUpdate()
{
    var line_code;
    
    line_code = document.LineDetailInfo.line_code.value;    
    
    if(confirm("Á¤¸»·Î ¼öÁ¤ÇÏ½Ã°Ú½À´Ï±î?")){
        opener.parent.window.location.href="LineUpdate.jsp?line_code="+line_code;
        self.close();
    }
}

/*
 * USED by LineSearch_disp.jsp
 * MADE by Daeho
 *
 * ³ë¼±Á¤º¸¼öÁ¤ È­¸éÀ¸·Î °¡±â
 * 
 */
function go_LineUpdate2(line_code)
{    
    if(confirm("Á¤¸»·Î ¼öÁ¤ÇÏ½Ã°Ú½À´Ï±î?")){
        parent.window.location.href="LineUpdate.jsp?line_code="+line_code;
    }
}

/*
 * USED by LineSearch_disp.jsp
 * MADE by Daeho
 *
 * ³ë¼± ¸®½ºÆ® È­¸é¿¡¼­ »èÁ¦
 * 
 */
function lineDelete(line_code){

    if(confirm("Á¤¸»·Î »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")){
        parent.window.location.href = "LineDelete_call.jsp?line_code="+line_code ;
    }
} // of function

/*
 * USED by LineUpdate.jsp
 * MADE by Daeho
 *
 * ³ë¼±¿¡ ÇÑ »ç¹«¼Ò¸¦ Ãß°¡ÇÏ´Â È­¸éÀ» ¿ÀÇÂ
 * 
 */
function open_LineAddInsert(stop_no){
    var line_code, line_name, stop_no;
    line_code = document.LineUpdate.line_code.value;
    line_name = document.LineUpdate.line_name.value;    
    
    window.open("LineAddInsert.jsp?line_code="+line_code+"&line_name="+line_name+"&stop_no="+stop_no,"LineAddInsert","width=400,height=200");
} // of function


/*
 * USED by LineUpdate.jsp
 * MADE by Daeho
 *
 * ³ë¼±¿¡ ÇÑ »ç¹«¼Ò¸¦ Ãß°¡ÇÏ´Â È­¸éÀ» ¿ÀÇÂ
 * 
 */
function lineOffDelete(stop_no){
    var line_code, stop_no;
    line_code = document.LineUpdate.line_code.value;    
    if(confirm("Á¤¸»·Î »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")){
        window.location.href = "LineOffDelete_call.jsp?line_code="+line_code+"&stop_no="+stop_no;
    }
} // of function




/*
 * USED by LineInsert.jsp
 * MADE by Daeho
 *
 * ³ë¼±À» Ãß°¡·Î µî·ÏÇÏ´Â °æ¿ì
 * 
 */

function lineAddInsert(line)
{    
    if(checkNull(line.off_code.value)){
        alert("»ç¹«¼ÒÄÚµå¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.");
        line.off_code.focus();
        return false;
    }
    if(checkNull(line.elapse_time_1.value)){
        alert("°æÀ¯½Ã°£À» ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.");
        line.elapse_time_1.focus();
        return false;
    }
    if(checkNull(line.elapse_time_2.value)){
        alert("°æÀ¯½Ã°£À» ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.");
        line.elapse_time_2.focus();
        return false;
    }
    
    var time1, time2;
    time1 = line.elapse_time_1.value;
    time2 = line.elapse_time_2.value;
    if (time1.length==1) time1 = "0" + time1;
    if (time2.length==1) time2 = "0" + time2;    
    line.elapse_time.value = time1 + time2;        
    
    line.submit();
}



function return_url(url,target){
	if(target=="")
	{
		window.location.href=url;
	}
	else 
	{
		parent.window.location.href=url;
	}
}


/*
 * USED by OfficeInsert.jsp
 * MADE by Daeho
 *
 * »ç¹«¼Ò µî·Ï
 * 
 */
 
function chk_OfficeInsert(office)
{
    if(checkNull(office.off_code.value))
    {
        alert("ºÎ¼­ÄÚµå¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
        office.off_code.focus();
        return false;
    }
    if(office.off_code.value.length==6) {
    } else {
        alert("ºÎ¼­ÄÚµå´Â 6ÀÚ¸®ÀÔ´Ï´Ù.");
        office.off_code.select();
        return false;
    }    
    
    if(checkNull(office.off_name.value))
    {        
        alert("ºÎ¼­¸íÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
        office.off_name.focus();
        return false;
    }
    if(checkNull(office.tel_2.value) || checkNull(office.tel_3.value))
    {
        alert("ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");        
        office.tel_2.focus();
        return false;
    } else {
        office.tel.value = office.tel_1.value + "-" + office.tel_2.value + "-" + office.tel_3.value;    
    }
    
    if(checkNull(office.addr1.value) || checkNull(office.addr2.value))
    {
        alert("ÁÖ¼Ò¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");        
        office.addr1.focus();
        return false;
    }
    
    if(checkNull(office.fax_2.value) || checkNull(office.fax_3.value)){
    } else {
        office.fax.value = office.fax_1.value + "-" + office.fax_2.value + "-" + office.tel_3.value;
    }
    office.submit();               
}

/*
 * USED by OfficeInsert.jsp
 * MADE by Daeho
 *
 * »ç¹«¼Ò µî·Ï¿¡¼­ »ç¹«¼ÒÄÚµåÀÇ Áßº¹À» °Ë»ç
 * 
 */

function chk_off_code(){    
	var off_code;
	off_code = document.OfficeInsert.off_code.value;
	
	if(checkNull(off_code))
	{
		alert("»ç¹«¼ÒÄÚµå¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.");
		document.OfficeInsert.off_code.focus();
		return false;
	}
	if(off_code.length==6) {
    } else {
        alert("»ç¹«¼ÒÄÚµå´Â 6ÀÚ¸®ÀÔ´Ï´Ù.");
        document.OfficeInsert.off_code.select();
        return false;
    }    

	
    window.open("../ofm/Check_Office_code.jsp?off_code="+off_code,"chkOff_code","width=350,height=150");
}


/*
 * USED by OfficeInsert.jsp
 * MADE by Daeho
 *
 * »ç¹«¼Ò µî·Ï¿¡¼­ ºÎ¼­Ã£±â ¿ÀÇÂ   ==> common.js·Î ÀÌµ¿ 
 * 
 */

//function selectTeam(formname,target1,target2)
//{
//    var PopUp;
//    PopUp = "PopUp";
    
//    window.open("../mim/TeamSearch.jsp?formname="+formname+"&target1="+target1+"&target2="+target2+"&wintype="+PopUp, "TeamSearch", "width=500,height=600");
//}





////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////  mim.js¿¡¼­ ¿Å°Ü¿È 06/16/2001
///////////////////////////////////////////////////////////////////////////////////////
/*
 * USED by OfficeSearch_cond.jsp
 * MADE by hillsea
 *
 * Á¶È¸Å°ÀÇ ÀÔ·Â¿©ºÎ¸¦ Ã¼Å©
 * 
 * ¿¡·¯ È®ÀÎ ¿ä¸Á (´ëÈ£) 06/02
 */
function checkField(){
  //  var searchKey = OfficeSearchCond.SearchKey.value;  

/*    
    if( searchKey == "" ){
        alert( "Á¶È¸ÇÏ½Ç °ªÀ» ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À" );
        return false;
    } else if(searchKey.length < 2 ){
        alert( "ÃÖ¼Ò 2ÀÚ ÀÌ»ó ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À" );
        return false;        
    }// of if
*/    
    return true;
} // of checkField

/*
 * USED by OfficeSearch_disp.jsp
 * MADE by hillsea
 *
 * ¼±ÅÃµÈ »ç¹«¼ÒÄÚµå¿Í ÀÌ¸§À» È£ÃâÇÑ À©µµ¿ì¿¡ ³Ñ°ÜÁØ´Ù.
 * ÁÖ : È£ÃâÇÑ À©µµ¿ì¿¡´Â OfficeCode, OfficeName ÀÌ¶ó´Â TextField°¡ Á¸ÀçÇÏ¿©¾ß ÇÑ´Ù.
 * TODO : form name °ú ³Ö¾îÁÙ textfield¸íÀ» ÀÎ¼ö·Î ¹Þµµ·Ï ¼öÁ¤ÇÒ °Í
 * 
 */
function go_officeinsert()
{
    parent.window.location.href='../ofm/OfficeInsert.jsp';
}


/*
 * USED by OfficeSearch_disp.jsp
 * MADE by hillsea
 *
 * »õ PopupÀ©µµ¿ì¸¦ »ý¼ºÇÏ¿© ¼±ÅÃµÈ »ç¹«¼ÒÀÇ »ó¼¼Á¤º¸¸¦ º¸¿©ÁØ´Ù.
 * 
 */
function viewDetail(offcode, offname, type){

    window.open("OfficeDetail.jsp?off_type="+type+"&off_code="+offcode
               ,"OfficeDetail"
               ,"width=470,height=220"); 
}

/*
 * USED by OfficeSearch_disp.jsp
 * MADE by hillsea
 *
 * ¼öÁ¤¿©ºÎ¸¦ È®ÀÎÇÑ ÈÄ »ç¹«¼Ò¼öÁ¤È­¸éÀ» È£ÃâÇÑ´Ù.
 * 
 */
function callUpdate(offcode){
    
        parent.window.location.href = "OfficeUpdate.jsp?off_code="+offcode;
    
} // of function

/*
 * USED by OfficeUpdate.jsp
 * MADE by hillsea
 *
 * ¼öÁ¤À» Ãë¼ÒÇÏ¿´À» °æ¿ì Á¶È¸È­¸éÀ¸·Î µÇµ¹¸°´Ù.
 * 
 */
function cancelUpdate(){
    window.location.href = "OfficeSearch.jsp" ;
} // of function

/*
 * USED by OfficeInsert.jsp
 * MADE by hillsea
 *
 * »ç¹«¼Òµî·Ï¹öÆ° Å¬¸¯½Ã ÇÊ¼ö ÀÔ·ÂÇÊµå¸¦ Ã¼Å©ÇÏ°í,
 * DB Insert ¸ðµâÀ» È£ÃâÇÑ´Ù.
 * TODO : ÇÊ¼ö ÀÔ·ÂÇÊµå Á¤ÀÇ ÈÄ Ã¼Å© ÇÊ¿ä
 */
function confirmInsert(){
    //window.location.href("OfficeUpdate_call.jsp");
    return true;
} // of function

/*
 * USED by OfficeInsert.jsp
 * MADE by hillsea
 *
 * »ç¹«¼Ò¼öÁ¤È®ÀÎ¹öÆ° Å¬¸¯½Ã ÇÊ¼ö ÀÔ·ÂÇÊµå¸¦ Ã¼Å©ÇÏ°í,
 * DB Update ¸ðµâÀ» È£ÃâÇÑ´Ù.
 * TODO : ÇÊ¼ö ÀÔ·ÂÇÊµå Á¤ÀÇ ÈÄ Ã¼Å© ÇÊ¿ä
 */
function confirmUpdate(){
    //window.location.href("OfficeUpdate_call.jsp");
    return true;
} // of function

/*
 * USED by OfficeInsert.jsp
 * MADE by hillsea
 *
 * »èÁ¦¿©ºÎ¸¦ È®ÀÎÇÏ°í, 
 * DB Delete ¸ðµâÀ» È£ÃâÇÑ´Ù.
 * TODO : ÇöÀç´Â physical delete·Î Ã³¸®ÇÏ¿´À¸³ª
 *        logical delete·Î »èÁ¦ÇÊµåÃ³¸®¸¦ ÇÒ Áö È®ÀÎÇÒ °Í
 */
function confirmDelete(off_code){

    if(confirm("Á¤¸»·Î »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")){
        parent.window.location.href = "OfficeDelete_call.jsp?off_code="+off_code;
    }
} // of function

/*
 * USED by PostSearch.jsp
 * MADE by Á¤´ëÈ£
 *
 * ¿ìÆí¹øÈ£°Ë»ö window¿ÀÇÂ
 * @param form_name  : ºÎ¸ðÀ©µµ¿ìÀÇ form name
 * @param zipcode    : ¿ìÆí¹øÈ£ ÅØ½ºÆ®¹Ú½º ÀÌ¸§
 * @param addr1      : ±âº»ÁÖ¼Ò ÅØ½ºÆ®¹Ú½º ÀÌ¸§
 * 
 */
function open_post_search(form_name,zipcode,addr1,addr2){
    // ÆÄÀÏÀ§Ä¡ º¯°æ -> Newtype 05/23/2001    
    window.open("../etc/PostSearch.jsp?form_name="+form_name+"&zipcode="+zipcode+"&addr1="+addr1+"&addr2="+addr2,"post","scrollbars=yes,width=500,height=300");
}

/*
 * USED by PostSearch.jsp
 * MADE by ¹Ú¼º¿ì
 *
 * ¿ìÆí¹øÈ£°Ë»ö window¿ÀÇÂ(Áö¿ª¹øÈ£ ¼¼ÆÃ)
 * @param form_name  : ºÎ¸ðÀ©µµ¿ìÀÇ form name
 * @param zipcode    : ¿ìÆí¹øÈ£ ÅØ½ºÆ®¹Ú½º ÀÌ¸§
 * @param addr1      : ±âº»ÁÖ¼Ò ÅØ½ºÆ®¹Ú½º ÀÌ¸§
 * @param tel1       : ÀüÈ­¹øÈ£1 ¼±ÅÃ¹Ú½º ÀÌ¸§
 * @param tel2       : ÀüÈ­¹øÈ£2 ¼±ÅÃ¹Ú½º ÀÌ¸§
 * @param fax        : ÆÑ½º ¼±ÅÃ¹Ú½º ÀÌ¸§
 * 
 */
function open_post_search_ext(form_name,zipcode,addr1,addr2, tel1, tel2, fax){
    window.open("../etc/PostSearch.jsp?form_name="+form_name+"&zipcode="+zipcode+"&addr1="+addr1+"&addr2="+addr2+"&tel1="+tel1+"&tel2="+tel2+"&fax="+fax,
		        "post","scrollbars=yes,width=500,height=300");
}

/*
 * USED by PostSearch.jsp
 * MADE by ¹Ú¼º¿ì
 *
 * ¿ìÆí¹øÈ£°Ë»ö window¿ÀÇÂ(Áö¿ª¹øÈ£ ¼¼ÆÃ)
 * @param form_name  : ºÎ¸ðÀ©µµ¿ìÀÇ form name
 * @param zipcode    : ¿ìÆí¹øÈ£ ÅØ½ºÆ®¹Ú½º ÀÌ¸§
 * @param addr1      : ±âº»ÁÖ¼Ò ÅØ½ºÆ®¹Ú½º ÀÌ¸§
 * @param tel1       : ÀüÈ­¹øÈ£1 ¼±ÅÃ¹Ú½º ÀÌ¸§
 * @param tel2       : ÀüÈ­¹øÈ£2 ¼±ÅÃ¹Ú½º ÀÌ¸§
 * @param fax        : ÆÑ½º ¼±ÅÃ¹Ú½º ÀÌ¸§
 * 
 */
function open_post_search_ext2(form_name,zipcode,addr1,addr2, tel1, tel2, fax, off, route, salesrep, salesrepcode){
    window.open("../etc/PostSearch.jsp?form_name="+form_name+"&zipcode="+zipcode+"&addr1="+addr1+"&addr2="+addr2+"&tel1="+tel1+"&tel2="+tel2+"&fax="+fax+"&off="+off+"&route="+route+"&salesrep="+salesrep+"&salesrepcode="+salesrepcode,
		        "post","scrollbars=yes,width=500,height=300");
}

/*
 * USED by CusInsert_perAcc.jsp
 * MADE by ¹Ú¼º¿ì
 *
 * »ç¹«¼Ò°Ë»ö window¿ÀÇÂ
 * @param form_name  : ºÎ¸ðÀ©µµ¿ìÀÇ form name
 * @param centercode : »ç¹«¼ÒÄÚµå ÅØ½ºÆ®¹Ú½º ÀÌ¸§
 * 
 */
function open_center_search(form_name,centercode){
    window.open("../ofm/OfficeSearch.jsp?form_name="+form_name+"&centercode="+centercode+"&WType=popup"
			   ,"OfficeSearch"
			   ,"scrollbars=yes,width=700,height=500");
	// window.open("../ofm/OfficeSearch.jsp?form_name="+form_name+"&centercode="+centercode+"&WType=popup","OfficeSearch");
}


function put_centercode(centercode,form_name,p_centercode)
{
    eval("parent.window.opener." + form_name+"."+p_centercode).value = centercode;
	// alert(window.opener.frames.length);
    parent.window.close();
}

function open_center_search2(form_name, centercode, centername){
    window.open("../ofm/OfficeSearch.jsp?form_name="+form_name+"&centercode="+centercode+"&centername="+centername+"&WType=popup"
				,"OfficeSearch"
				,"scrollbars=yes,width=700,height=500");
	// window.open("../mim/OfficeSearch.jsp?form_name="+form_name+"&centercode="+centercode+"&WType=popup","OfficeSearch");
}

function put_centercode2(centercode,centername,form_name,p_centercode,p_centername)
{
    eval("parent.window.opener." + form_name+"."+p_centercode).value = centercode;
    eval("parent.window.opener." + form_name+"."+p_centername).value = centername;
	// alert(window.opener.frames.length);
    parent.window.close();
}


function movePage(form,link){    
    form.action=link;
    form.submit();   
}

function changePage(form, link){
    page = form.selectpage.selectedIndex + 1;
    newlink = link + "?page=" + page;

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

/*
 * USED by All
 * MADE by hillsea
 *
 * ÆäÀÌÁöÀÌµ¿ : Select(Option) Box¿¡¼­ ¿äÃ»ÇÑ °æ¿ì
 * 
 */
function changePage2(form, link){
    page = form.selectpage.selectedIndex + 1;
    newlink = link + "&page=" + page;

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

/*
 * USED BY LineInsert.jsp
 * MADE BY Á¤´ëÈ£
 * °æÀ¯Áö °¹¼ö¸¦ LineInser.jsp¿¡ ³Ñ°ÜÁÜ
 *
 */
function offCount(count)
{
    var iOff_count;
    var index;
    
//   iOff_count = 2;    
   
       
    for (var i = 0; i < count.options.length; i++) {
       index = count.options.selectedIndex;       
       iOff_count = count.options[index].value;
    }      
    
    window.location.href = 'LineInsert.jsp?off_count='+iOff_count;
}


///////////////////////////////////////////////////////////////////////
/////////////  AGENT¿Í °ü·ÃµÈ ÇÔ¼öµé //////////////////////////////////
//////////////////////////////////////////////////////////////////////
/*
 * USED by AgtRegist.jsp
 * MADE by Daeho
 *
 * µî·ÏÇØ¾ßÇÒ agent¸¦ Ãâ·ÂÇÏ´Â È­¸éÀ» ¿ÀÇÂÇÑ´Ù.
 * 
 */

function open_searchAgent(off_code,off_name,tel_1,tel_2,tel_3,fax_1,fax_2,fax_3,zipcode,addr1,addr2){
    window.open("AgentForInsert.jsp?input_off_code="+off_code
                                    +"&input_off_name="+off_name
                                    +"&input_tel_1="+tel_1
                                    +"&input_tel_2="+tel_2
                                    +"&input_tel_3="+tel_3
                                    +"&input_fax_1="+fax_1
                                    +"&input_fax_2="+fax_2
                                    +"&input_fax_3="+fax_3
                                    +"&input_zipcode="+zipcode
                                    +"&input_addr1="+addr1
                                    +"&input_addr2="+addr2
                ,"AgentForInsert","width=250,height=300,scrollbars=yes");
}

/*
 * USED by AgentForInsert.jsp
 * MADE by Daeho
 *
 * AgtRegist.jsp¿¡ Agent¿¡ °üÇÑ ±âº»Á¤º¸¸¦ »Ñ·ÁÁØ´Ù.
 * 
 */

function put_agent_value(input_off_code
                         ,input_off_name
                         ,input_tel_1
                         ,input_tel_2
                         ,input_tel_3
                         ,input_fax_1
                         ,input_fax_2
                         ,input_fax_3
                         ,input_zipcode
                         ,input_addr1
                         ,input_addr2
                         ,strOff_code
                         ,strOff_name                         
                         ,strTel_1
                         ,strTel_2
                         ,strTel_3
                         ,strFax_1
                         ,strFax_2
                         ,strFax_3
                         ,strZipcode
                         ,strAddr1
                         ,strAddr2){
          eval("opener.window.agent."+input_off_code).value = strOff_code;
          eval("opener.window.agent."+input_off_name).value = strOff_name;
          eval("opener.window.agent."+input_tel_1).value    = strTel_1;
          eval("opener.window.agent."+input_tel_2).value    = strTel_2;
          eval("opener.window.agent."+input_tel_3).value    = strTel_3;
          eval("opener.window.agent."+input_fax_1).value    = strFax_1;
          eval("opener.window.agent."+input_fax_2).value    = strFax_2;
          eval("opener.window.agent."+input_fax_3).value    = strFax_3;
          eval("opener.window.agent."+input_zipcode).value  = strZipcode;
          eval("opener.window.agent."+input_addr1).value    = strAddr1;
          eval("opener.window.agent."+input_addr2).value    = strAddr2;
          opener.window.agent.off_nickname.focus();
          self.close();          
}

/*
 * USED by AgtRegist.jsp
 * MADE by Daeho
 *
 * agentµî·Ï½Ã ÀÔ·Â³»¿ëÀ» Ã¼Å©ÇÏ¿© ÀÔ·ÂÇÑ´Ù.
 * 
 */
 function chk_form(agt)
 {
	var tel, fax, agent_trty_tel, agent_trty_h_phone;

	if(checkNull(agt.off_code.value)) 
	{
	    alert("AgentÄÚµå¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.");
	    agt.off_code.focus();
	    return false;
	}
	if(checkAlphaNum(agt.off_code.value)) 
	{
	    alert("AgentÄÚµå´Â ¼ýÀÚ³ª ¾ËÆÄºª¸¸ °¡´ÉÇÕ´Ï´Ù.");
	    agt.off_code.value = "";
	    agt.off_code.focus();
	    return false;
	}	
	if(checkNull(agt.off_name.value))
	{
	    alert("È¸»ç¸íÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	    agt.off_name.focus();
	    return false;
	}
	if(checkNull(agt.off_nickname.value))
	{
	    alert("AGENTÀÇ º°ÄªÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	    agt.off_nickname.focus();
	    return false;
	}	
	if(checkNull(agt.cust_ceo_name.value))
	{
	    alert("´ëÇ¥ÀÚ¸íÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	    agt.cust_ceo_name.focus();
	    return false;
	}
	if(checkNull(agt.tel_2.value) || checkNull(agt.tel_3.value))
	{
	    alert("ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	    agt.tel_2.focus();
	    return false;
	}
	if(checkNumber(agt.tel_2.value) || checkNumber(agt.tel_3.value))
	{
	    alert("¾Æ¶óºñ¾Æ ¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	    agt.tel_2.value = "";
	    agt.tel_2.focus();
	    return false;
	}	
	if(checkNull(agt.cust_id_number.value))
	{
	    alert("»ç¾÷ÀÚµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	    agt.cust_id_number.focus();
	    return false;
	}
	if(checkNull(agt.zipcode.value))
	{
	    alert("¿ìÆí¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	    agt.zipcode.focus();
	    return false;
	}
	if(checkNull(agt.addr2.value))
	{
	    alert("»ó¼¼ÁÖ¼Ò¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	    agt.addr2.focus();
	    return false;
	}
	if(checkNull(agt.agent_trty_email.value)) {
	    
	} else {
    	if(checkEmail(agt.agent_trty_email.value))
    	{
    	    alert("ÀÌ¸ÞÀÏ Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù.");
    	    agt.agent_trty_email.focus();
    	    return false;
    	}	
	}
	if(checkNull(agt.cntrt_no.value))
	{
		alert("°è¾à¼­¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		agt.cntrt_no.focus();
		return false;
	}
	if(checkAlphaNum(agt.cntrt_no.value)) 
	{
	    alert("°è¾à¼­¹øÈ£¸¦ ¼ýÀÚ³ª ¾ËÆÄºª¸¸ °¡´ÉÇÕ´Ï´Ù.");
	    agt.cntrt_no.value = "";
	    agt.cntrt_no.focus();
	    return false;
	}	
	if(checkNull(agt.cntrt_date.value))
	{
	    alert("°è¾àÀÏÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	    agt.cntrt_date.focus();
	    return false;
	}
	else if(checkNumSlash(agt.cntrt_date.value))
	{
	    alert("Á¤È®ÇÑ ³¯Â¥Çü½ÄÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	    agt.cntrt_date.focus();
	    return false;
	}
		    	    		    		
	if((checkNull(agt.cntrt_bdate.value)) || (checkNull(agt.cntrt_edate.value)))
	{
	    alert("°è¾à±â°£À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	    agt.cntrt_bdate.focus();
	    return false;
	}		    		
	else if( (checkNumSlash(agt.cntrt_bdate.value)) || (checkNumSlash(agt.cntrt_edate.value)) )
	{
	    alert("Á¤È®ÇÑ ³¯Â¥Çü½ÄÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	    agt.cntrt_bdate.focus();
	    return false;
	}
		
	
	//////// CARD¿äÀ²°ú DDX¿äÀ²ÀÇ À¯È¿¼º Ã¼Å© 	
	
	
    if(chk_card_ddx_trans(agt)==false){
        return false;
    }
    
        		
	////////////// ¿©±â±îÁö CARD, DDX ÇÈ¾÷(¹è´Þ) µ¥ÀÌÅ¸ À¯È¿¼º Ã¼Å©ÀÓ
		
	if ((checkNull(agt.tel_2.value)) || (checkNull(agt.tel_3.value))){
	    
	}
	else 
	{		    
    	tel = agt.tel_1.value + "-" + agt.tel_2.value + "-" + agt.tel_3.value;    	
    }
    
    if ((checkNull(agt.fax_2.value)) || (checkNull(agt.fax_3.value))){}
	else
	{	
	    if((checkNumber(agt.fax_2.value)) || (checkNumber(agt.fax_3.value)))
	    {
	        alert("¾Æ¶óºñ¾Æ ¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	        agt.fax_2.value = "";
	        agt.fax_3.value = "";
	        agt.fax_2.focus();
	        return false;
	    }
	    else
    	    fax = agt.fax_1.value + "-" + agt.fax_2.value + "-" + agt.fax_3.value;    	
    }
    
    if ((checkNull(agt.agent_trty_tel_2.value)) || (checkNull(agt.agent_trty_tel_3.value))){
        agent_trty_tel = "";
    } else {
        if((checkNumber(agt.agent_trty_tel_2.value)) || (checkNumber(agt.agent_trty_tel_3.value)))
	    {
	        alert("¾Æ¶óºñ¾Æ ¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	        agt.agent_trty_tel_2.value = "";
	        agt.agent_trty_tel_3.value = "";
	        agt.agent_trty_tel_2.focus();
	        return false;
	    }
	    else
            agent_trty_tel = agt.agent_trty_tel_1.value + "-" + agt.agent_trty_tel_2.value + "-" + agt.agent_trty_tel_3.value;
    }
    if ((checkNull(agt.agent_trty_h_phone_2.value)) || (checkNull(agt.agent_trty_h_phone_3.value))){
        agent_trty_h_phone = "";
    } else {
        if((checkNumber(agt.agent_trty_h_phone_2.value)) || (checkNumber(agt.agent_trty_h_phone_3.value)))
	    {
	        alert("¾Æ¶óºñ¾Æ ¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	        agt.agent_trty_h_phone_2.value = "";
	        agt.agent_trty_tel_3.value = "";
	        agt.agent_trty_h_phone_2.focus();
	        return false;
	    }
	    else
    	    agent_trty_h_phone = agt.agent_trty_h_phone_1.value + "-" + agt.agent_trty_h_phone_2.value + "-" + agt.agent_trty_h_phone_3.value;
    }
    
    
    // ¼ýÀÚ¿¡ ÄÞ¸¶¸¦ Á¦°ÅÇÑ´Ù.
    if(checkNull(agt.ddx_over_pup_charge.value)){}
    else {
        agt.ddx_over_pup_charge.value = removeComma(agt.ddx_over_pup_charge.value);
    }
    if(checkNull(agt.ddx_over_dlv_charge.value)){}
    else {
        agt.ddx_over_dlv_charge.value = removeComma(agt.ddx_over_dlv_charge.value);
    }                    
    if(checkNull(agt.deposit_amount.value)){}
    else {
        agt.deposit_amount.value = removeComma(agt.deposit_amount.value);
    }
    if(checkNull(agt.etc_charge1.value)){}
    else {
        agt.etc_charge1.value = removeComma(agt.etc_charge1.value);
    }
    if(checkNull(agt.etc_charge2.value)){}
    else {
        agt.etc_charge2.value = removeComma(agt.etc_charge2.value);
    }
    if(checkNull(agt.etc_charge3.value)){}
    else {
        agt.etc_charge3.value = removeComma(agt.etc_charge3.value);
    }
            
	agt.tel.value = tel;
	agt.fax.value = fax;
	agt.agent_trty_tel.value = agent_trty_tel;
	agt.agent_trty_h_phone.value = agent_trty_h_phone;

	agt.submit();
 }

//////// CARD¿äÀ²°ú DDX¿äÀ²ÀÇ À¯È¿¼º Ã¼Å© 	
function chk_card_ddx_trans(agt){
    
    var boCheck;
    boCheck = true;
    
    // ¼±ÅÃµÈ °è¾àÁ¾·ù¸¦ ÀÐ¾î¿Â´Ù.
    var index_cntrt_gubun, cntrt_gubun_value, index_cntrt_cmdt, cntrt_cmdt_value;
    
    index_cntrt_gubun = agt.cntrt_gubun.selectedIndex;
    cntrt_gubun_value = agt.cntrt_gubun.options[index_cntrt_gubun].value;
    
    // ¼±ÅÃµÈ °è¾àÇ°¸ñÀ» ÀÐ¾î¿Â´Ù.
    index_cntrt_cmdt = agt.cntrt_cmdt.selectedIndex;
    cntrt_cmdt_value = agt.cntrt_cmdt.options[index_cntrt_cmdt].value;   
	
	if(checkNull(cntrt_gubun_value)) {
	    alert("°è¾à±¸ºÐÀ» ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿ä.");
	    agt.cntrt_gubun.focus();
	    boCheck = false;
	    return boCheck;
	}
	
	if(cntrt_gubun_value=='3') {   // °£¼±À» ¼±ÅÃÇÑ °æ¿ì´Â Á¦¿ÜÇÑ´Ù.
	} else {
    	if(checkNull(cntrt_cmdt_value)) {
    	    alert("°è¾à´ë»óÀ» ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿ä.");
    	    agt.cntrt_cmdt.focus();
    	    boCheck = false;
    	    return boCheck;
    	}
	}
	
	if(cntrt_gubun_value=='1') {         // ÇÈ¾÷À» ¼±ÅÃ

        if(cntrt_cmdt_value=='1'){           // CARD¸¦ ¼±ÅÃ
        } else if(cntrt_cmdt_value=='2') {   // DDX¸¦ ¼±ÅÃ
            
            boCheck = chk_ddx_pup_charge_type1(agt);
        
        } else if(cntrt_cmdt_value=='9') {   // ¸ðµÎ¸¦ ¼±ÅÃ
        }        

    } else if(cntrt_gubun_value=='2') {  // ¹è´ÞÀ» ¼±ÅÃ
        
        if(cntrt_cmdt_value=='1'){           // CARD¸¦ ¼±ÅÃ
        
            boCheck = chk_card(agt);
        
        } else if(cntrt_cmdt_value=='2') {   // DDX¸¦ ¼±ÅÃ 
        
            boCheck = chk_ddx_dlv_charge_type1(agt);
        
        } else if(cntrt_cmdt_value=='9') {   // ¸ðµÎ¸¦ ¼±ÅÃ
        
            if(!(chk_card(agt)==true && chk_ddx_dlv_charge_type1(agt)==true)){                            
                boCheck = false;
            }                                
        }
    
    } else if(cntrt_gubun_value=='3') {  // °£¼±À» ¼±ÅÃ
        
        if(cntrt_cmdt_value=='1'){           // CARD¸¦ ¼±ÅÃ
        } else if(cntrt_cmdt_value=='2') {   // DDX¸¦ ¼±ÅÃ 
        } else if(cntrt_cmdt_value=='9') {   // ¸ðµÎ¸¦ ¼±ÅÃ
        }
    
        boCheck = chk_trans(agt);
    
    } else if(cntrt_gubun_value=='4') {  // ÇÈ¾÷+¹è´ÞÀ» ¼±ÅÃ

        if(cntrt_cmdt_value=='1'){           // CARD¸¦ ¼±ÅÃ
        } else if(cntrt_cmdt_value=='2') {   // DDX¸¦ ¼±ÅÃ 
        
            if(!(chk_ddx_pup_charge_type1(agt)==true && chk_ddx_dlv_charge_type1(agt)==true)){           
                boCheck = false;
            }
                    
        } else if(cntrt_cmdt_value=='9') {   // ¸ðµÎ¸¦ ¼±ÅÃ
        
            if(!(chk_ddx_pup_charge_type1(agt)==true && chk_ddx_dlv_charge_type1(agt)==true && chk_card(agt)==true)) {
                boCheck = false;
            }        
        }
    
    } else if(cntrt_gubun_value=='5') {  // ÇÈ¾÷+°£¼±À» ¼±ÅÃ
    
        if(cntrt_cmdt_value=='1'){           // CARD¸¦ ¼±ÅÃ
        } else if(cntrt_cmdt_value=='2') {   // DDX¸¦ ¼±ÅÃ 
        
            if(!(chk_ddx_pup_charge_type1(agt)==true && chk_trans(agt)==true)){
                boCheck = false;
            }            
        
        } else if(cntrt_cmdt_value=='9') {   // ¸ðµÎ¸¦ ¼±ÅÃ
        }
    
    } else if(cntrt_gubun_value=='6') {  // ¹è´Þ+°£¼±À» ¼±ÅÃ
    
        if(cntrt_cmdt_value=='1'){           // CARD¸¦ ¼±ÅÃ
        
            if(!(chk_card(agt)==true && chk_trans(agt)==true)){
                boCheck = false;
            }            
        
        } else if(cntrt_cmdt_value=='2') {   // DDX¸¦ ¼±ÅÃ 
        
            if(!(chk_ddx_dlv_charge_type1(agt)==true && chk_trans(agt)==true)){
                boCheck = false;
            }            
        
        } else if(cntrt_cmdt_value=='9') {   // ¸ðµÎ¸¦ ¼±ÅÃ
        
            if(!(chk_ddx_dlv_charge_type1(agt)==true && chk_card(agt)==true && chk_trans(agt)==true)){
                boCheck = false;
            }        
        }
    
    } else if(cntrt_gubun_value=='9') {  // ÇÈ¾÷+¹è´Þ+°£¼±À» ¼±ÅÃ
    
        if(cntrt_cmdt_value=='1'){           // CARD¸¦ ¼±ÅÃ
        } else if(cntrt_cmdt_value=='2') {   // DDX¸¦ ¼±ÅÃ 
        
            if(!(chk_ddx_pup_charge_type1(agt)==true && chk_ddx_dlv_charge_type1(agt)==true && chk_trans(agt)==true)){
                boCheck = false;
            }
            
        
        } else if(cntrt_cmdt_value=='9') {   // ¸ðµÎ¸¦ ¼±ÅÃ
        
            if(!(chk_ddx_pup_charge_type1(agt)==true && chk_ddx_dlv_charge_type1(agt)==true && chk_card(agt)==true && chk_trans(agt)==true)){
                boCheck = false;
            }
        }    
    }
    
    return boCheck;
}

// DDXÇÈ¾÷¿äÀ²Å¸ÀÔÀ» È®ÀÎÇÑ´Ù.
function chk_ddx_pup_charge_type1(agt){
   
   var boCheck;
   boCheck = true;
    
   if(agt.ddx_pup_charge_type1[0].checked)
   {
       if(checkNull(agt.ddx_charge_pup1.value))
       {
           alert("ÇÈ¾÷¿äÀ²À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
           agt.ddx_charge_pup1.focus();
           boCheck = false;
       }
       else 
       {
   	    agt.ddx_pup_charge_type.value = agt.ddx_pup_charge_type1[0].value;
   	    agt.ddx_charge_pup.value = removeComma(agt.ddx_charge_pup1.value);		
   	}		
   }
   else if(agt.ddx_pup_charge_type1[1].checked)
   {
       if(checkNull(agt.ddx_charge_pup2.value))
       {
           alert("ÇÈ¾÷¿äÀ²À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
           agt.ddx_charge_pup2.focus();
           boCheck = false;
       }
       else 
       {
   	    agt.ddx_pup_charge_type.value = agt.ddx_pup_charge_type1[1].value;
   	    agt.ddx_charge_pup.value = removeComma(agt.ddx_charge_pup2.value);		
   	}		
   }
   
   return boCheck;
}

// DDX¹è´Þ¿äÀ²Å¸ÀÔÀ» È®ÀÎÇÑ´Ù.
function chk_ddx_dlv_charge_type1(agt){
    
    var boCheck;
    boCheck = true;
    
    if(agt.ddx_dlv_charge_type1[0].checked){
        if(checkNull(agt.ddx_charge_dlv1.value))
        {
            alert("¹è´Þ¿äÀ²À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");    	        
            agt.ddx_charge_dlv1.focus();
            boCheck = false;
        } else {
    	    agt.ddx_dlv_charge_type.value = agt.ddx_dlv_charge_type1[0].value;
    	    agt.ddx_charge_dlv.value = removeComma(agt.ddx_charge_dlv1.value);		
    	}		
    } else {
        if(checkNull(agt.ddx_charge_dlv2.value))
        {
            alert("¹è´Þ¿äÀ²À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");    	        
            agt.ddx_charge_dlv2.focus();
            boCheck = false;
        } else {
    	    agt.ddx_dlv_charge_type.value = agt.ddx_dlv_charge_type1[1].value;
    	    agt.ddx_charge_dlv.value = removeComma(agt.ddx_charge_dlv2.value);		
    	}		
    }				
    
    return boCheck;
}

// Ä«µå¸¦ ¼±ÅÃÇÑ °æ¿ì
function chk_card(agt){
    
    var boCheck;
    boCheck = true;
    
    if(checkNull(agt.card_charge_dlv.value))
    {
        alert("¹è´Þ¿äÀ²À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");    	    
        agt.card_charge_dlv.focus();
        boCheck = false;
    }
    else 
    {    		    
        agt.card_charge_dlv.value = removeComma(agt.card_charge_dlv.value);		
    }		
    
    return boCheck;
}

// °£¼±À» ¼±ÅÃÇÑ °æ¿ì
function chk_trans(agt) {
    
    var boCheck;
    boCheck = true;
    
    if(checkNull(agt.trans_charge.value)){
        alert("¹è¼Û¿äÀ²À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
        agt.trans_charge.focus();
        boCheck = false;
    } else {
      agt.trans_charge.value = removeComma(agt.trans_charge.value);
    }
    
    return boCheck;
}

    
/*
 * USED by AgtCntrtUpdate.jsp
 * MADE by Daeho
 *
 * agent°è¾à°»½Å ³»¿ë Ã¼Æ® ÈÄ submit
 * 
 */
 function chk_AgtCntrtUpdate(agt)
 {		
    var boCheck = true;
    
    if(checkNull(agt.cntrt_no.value))
	{
		alert("°è¾à¼­¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä.");
		agt.cntrt_no.focus();
		return false;
	}
	if(checkAlphaNum(agt.cntrt_no.value)) 
	{
	    alert("°è¾à¼­¹øÈ£¸¦ ¼ýÀÚ³ª ¾ËÆÄºª¸¸ °¡´ÉÇÕ´Ï´Ù.");
	    agt.cntrt_no.value = "";
	    agt.cntrt_no.focus();
	    return false;
	}	
	if(checkNull(agt.cntrt_date.value))
	{
	    alert("°è¾àÀÏÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	    agt.cntrt_date.focus();
	    return false;
	}
	else 
	{
    	if(checkNumSlash(agt.cntrt_date.value))
    	{
    	    alert("Á¤È®ÇÑ ³¯Â¥Çü½ÄÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
    	    agt.cntrt_date.focus();
    	    return false;
    	}
    }    
		    	    		    		
	if((checkNull(agt.cntrt_bdate.value)) || (checkNull(agt.cntrt_edate.value)))
	{
	    alert("°è¾à±â°£À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	    agt.cntrt_bdate.focus();
	    return false;
	}		    		
	else if((checkNumSlash(agt.cntrt_bdate.value)) || (checkNumSlash(agt.cntrt_edate.value)))
	{
	    alert("Á¤È®ÇÑ ³¯Â¥Çü½ÄÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.");
	    agt.cntrt_bdate.focus();
	    return false;
	}
	
	
	//////// CARD¿äÀ²°ú DDX¿äÀ²ÀÇ À¯È¿¼º Ã¼Å© 	
	
	if(chk_card_ddx_trans(agt)==false){
	    boCheck = false;
	}	
        		
	////////////// ¿©±â±îÁö CARD, DDX ÇÈ¾÷(¹è´Þ) µ¥ÀÌÅ¸ À¯È¿¼º Ã¼Å©ÀÓ
	
			
	// ¼ýÀÚ¿¡ ÄÞ¸¶¸¦ Á¦°ÅÇÑ´Ù.
    if(checkNull(agt.ddx_over_pup_charge.value)){}
    else {
        agt.ddx_over_pup_charge.value = removeComma(agt.ddx_over_pup_charge.value);
    }
    if(checkNull(agt.ddx_over_dlv_charge.value)){}
    else {
        agt.ddx_over_dlv_charge.value = removeComma(agt.ddx_over_dlv_charge.value);
    }    
    if(checkNull(agt.deposit_amount.value)){}
    else {
        agt.deposit_amount.value = removeComma(agt.deposit_amount.value);
    }
    if(checkNull(agt.etc_charge1.value)){}
    else {
        agt.etc_charge1.value = removeComma(agt.etc_charge1.value);
    }
    if(checkNull(agt.etc_charge2.value)){}
    else {
        agt.etc_charge2.value = removeComma(agt.etc_charge2.value);
    }
    if(checkNull(agt.etc_charge3.value)){}
    else {
        agt.etc_charge3.value = removeComma(agt.etc_charge3.value);
    }					
    
    if(boCheck){    	        
	    agt.submit();
	} else {
	    return false;
	}		
 }

 
/*
 * USED by AgtRegist.jsp
 * MADE by Daeho
 *
 * agent µî·Ï¿¡¼­ agent codeÀÇ Áßº¹À» °Ë»ç
 * 
 */
 
function chk_agt_code(){    
	var agt_code;
	agt_code = document.agent.off_code.value;
	
	if(checkNull(agt_code))
	{
		alert("AgentÄÚµå¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.");
		document.agent.off_code.focus();
		return false;
	}
	if(checkAlphaNum(agt_code)) 
	{
	    alert("AgentÄÚµå´Â ¼ýÀÚ³ª ¾ËÆÄºª¸¸ °¡´ÉÇÕ´Ï´Ù.");
	    document.agent.off_code.value = "";
	    document.agent.off_code.focus();
	    return false;
	}
	
    window.open("../ofm/Check_Office_code.jsp?off_code="+agt_code,"chkAgt_code","width=350,height=150");
}

/*
 * USED by AgtRegist.jsp
 * MADE by Daeho
 *
 * agent µî·Ï¿¡¼­ °è¾à¼­¹øÈ£ÀÇ Áßº¹À» °Ë»ç
 * 
 */
 
function chk_cntrt_no(){    
	var cntrt_no;
	cntrt_no = document.agent.cntrt_no.value;
	
	if(checkNull(cntrt_no))
	{
		alert("°è¾à¼­¹øÈ£¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.");
		document.agent.cntrt_no.focus();
		return false;
	}
	if(checkAlphaNum(cntrt_no)) 
	{
	    alert("°è¾à¼­¹øÈ£¸¦ ¼ýÀÚ³ª ¾ËÆÄºª¸¸ °¡´ÉÇÕ´Ï´Ù.");
	    document.agent.cntrt_no.value = "";
	    document.agent.cntrt_no.focus();
	    return false;
	}
	
    window.open("../ofm/Check_Office_code.jsp?cntrt_no="+cntrt_no,"chkAgt_code","width=350,height=150");
}

/*
 * USED by AgtRegist.jsp
 * MADE by Daeho
 *
 * ±Ý¾×À» ÀÔ·Â½Ã Ãµ´ÜÀ§·Î ,(ÄÞ¸¶)¸¦ »ðÀÔÇÑ´Ù.
 * 
 */
function chkChar(data)
{
                        
    value = removeComma(data.value);
    
    if(value * 0 != 0)
    {
        data.value='';
    }
    else
    {
        data.value=getComma(value);
    }
    
}

/*
 * USED by AgtRegist.jsp
 * MADE by Daeho
 *
 * °è¾à±¸ºÐÀ» ¼±ÅÃ½Ã 
 * 
 */    
function change_cntrt_gubun(agt,strUpdate){
    
   if(strUpdate!="update"){
    agt.cntrt_cmdt.options[0].selected = true;
   }
   var index, cntrt_gubun_value;
   index = agt.cntrt_gubun.selectedIndex;
   cntrt_gubun_value = agt.cntrt_gubun.options[index].value;
  
   if(cntrt_gubun_value=='1') {             //ÇÈ¾÷À» ¼±ÅÃ½Ã    

       ddx_pup.style.visibility   = "visible";
       ddx_dlv.style.visibility   = "hidden";
       card_dlv.style.visibility  = "hidden";
       trans_dlv.style.visibility = "hidden";
       
       // °ø¹éÃ³¸®
       make_ddx_dlv_nbsp(agt);
       make_card_dlv_nbsp(agt);            
       make_trans_dlv_nbsp(agt);   
                 
   } else if(cntrt_gubun_value=='2') {      //¹è´ÞÀ» ¼±ÅÃ½Ã
   
       ddx_pup.style.visibility   = "hidden";
       ddx_dlv.style.visibility   = "visible";
       card_dlv.style.visibility  = "visible";
       trans_dlv.style.visibility = "hidden";
       
       // °ø¹éÃ³¸®
       make_ddx_pup_nbsp(agt);
       make_trans_dlv_nbsp(agt);
      
   } else if(cntrt_gubun_value=='3') {      //°£¼±À» ¼±ÅÃ½Ã
   
       ddx_pup.style.visibility   = "hidden";
       ddx_dlv.style.visibility   = "hidden";
       card_dlv.style.visibility  = "hidden";
       trans_dlv.style.visibility = "visible";
       
       // °ø¹éÃ³¸®
       make_ddx_pup_nbsp(agt);
       make_ddx_dlv_nbsp(agt);
       make_card_dlv_nbsp(agt);
       
   } else if(cntrt_gubun_value=='4') {      //ÇÈ¾÷+¹è´Þ ¼±ÅÃ½Ã
       
       ddx_pup.style.visibility   = "visible";
       ddx_dlv.style.visibility   = "visible";
       card_dlv.style.visibility  = "visible";
       trans_dlv.style.visibility = "hidden";      
       
       // °ø¹éÃ³¸®
       make_trans_dlv_nbsp(agt);
  
   } else if(cntrt_gubun_value=='5') {      //ÇÈ¾÷+°£¼± ¼±ÅÃ½Ã
       
       ddx_pup.style.visibility   = "visible";
       ddx_dlv.style.visibility   = "hidden";
       card_dlv.style.visibility  = "hidden";
       trans_dlv.style.visibility = "visible";     
       
       make_ddx_dlv_nbsp(agt);
       make_card_dlv_nbsp(agt);   
  
   } else if(cntrt_gubun_value=='6') {      // ¹è´Þ+°£¼± ¼±ÅÃ½Ã
       
       ddx_pup.style.visibility   = "hidden";
       ddx_dlv.style.visibility   = "visible";
       card_dlv.style.visibility  = "visible";
       trans_dlv.style.visibility = "visible";
       
       // °ø¹éÃ³¸®
       make_ddx_pup_nbsp(agt);
       
   } else if(cntrt_gubun_value=='9') {      // ¹è´Þ+¹è´Þ+°£¼± ¼±ÅÃ½Ã
       
       ddx_pup.style.visibility   = "visible";
       ddx_dlv.style.visibility   = "visible";
       card_dlv.style.visibility  = "visible";
       trans_dlv.style.visibility = "visible";                             
   }
} // of function

// DDXÇÈ¾÷¿äÀ²¿¡ ÀÖ´Â ¸ðµç TEXT¹Ú½º¸¦ °ø¹éÀ¸·Î ¸¸µç´Ù.
function make_ddx_pup_nbsp(agt){
    agt.ddx_charge_pup1.value     = "";
    agt.ddx_charge_pup2.value     = "";
    agt.ddx_pup_bweight.value     = "";
    agt.ddx_over_pup_charge.value = ""
}
// DDX¹è´Þ¿äÀ²¿¡ ÀÖ´Â ¸ðµç TEXT¹Ú½º¸¦ °ø¹éÀ¸·Î ¸¸µç´Ù.
function make_ddx_dlv_nbsp(agt){
    agt.ddx_charge_dlv1.value = ""; 
    agt.ddx_charge_dlv2.value = ""; 
    agt.ddx_dlv_bweight.value = ""; 
    agt.ddx_over_dlv_charge.value = ""; 
}
function make_card_dlv_nbsp(agt){
    agt.card_charge_dlv.value = "";
}
function make_trans_dlv_nbsp(agt){
    agt.trans_charge.value = "";
}

/*
 * USED by AgtRegist.jsp
 * MADE by Daeho
 *
 * °è¾à´ë»óÀ» ¼±ÅÃ½Ã 
 * 
 */    
function change_cmdt(agt) {        
    
    // ¼±ÅÃµÈ °è¾àÁ¾·ù¸¦ ÀÐ¾î¿Â´Ù.
    var index_cntrt_gubun, cntrt_gubun_value, index_cntrt_, cntrt_cmdt_value;
    
    index_cntrt_gubun = agt.cntrt_gubun.selectedIndex;
    cntrt_gubun_value = agt.cntrt_gubun.options[index_cntrt_gubun].value;
    
    // ¼±ÅÃµÈ °è¾àÇ°¸ñÀ» ÀÐ¾î¿Â´Ù.
    index_cntrt_cmdt = agt.cntrt_cmdt.selectedIndex;
    cntrt_cmdt_value = agt.cntrt_cmdt.options[index_cntrt_cmdt].value;    
    
    if(cntrt_gubun_value=='1') {   // ÇÈ¾÷À» ¼±ÅÃÇÑ °æ¿ì    
        if(cntrt_cmdt_value=='1') {   // CARD°¡ ¼±ÅÃµÈ °æ¿ì
        
            alert("CARD´Â ÇÈ¾÷ÀÌ ¾ø½À´Ï´Ù.");
            agt.cntrt_cmdt.options[0].selected = true;
            return false;                          
        } else if(cntrt_cmdt_value=='2') {    // DDX°¡ ¼±ÅÃµÈ °æ¿ì
                        
            
        } else if(cntrt_cmdt_value=='9') {    // ¸ðµÎ°¡ ¼±ÅÃµÈ °æ¿ì
            
            alert("ÇÈ¾÷ÀÎ °æ¿ì¿¡´Â ¸ðµÎ¸¦ ¼±ÅÃÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
            agt.cntrt_cmdt.options[0].selected = true;
            return false;
        
        } else if(eval(cntrt_cmdt_value)==null) {
                        
        }      
    } else if(cntrt_gubun_value=='2') {   // ¹è´ÞÀ» ¼±ÅÃÇÑ °æ¿ì
        if(cntrt_cmdt_value=='1') {     // Ä«µå°¡ ¼±ÅÃµÈ °æ¿ì
                        
            ddx_pup.style.visibility   = "hidden";
            ddx_dlv.style.visibility   = "hidden";
            card_dlv.style.visibility  = "visible";
            trans_dlv.style.visibility = "hidden";     
            
            // °ø¹éÃ³¸®
            make_ddx_pup_nbsp(agt);
            make_ddx_dlv_nbsp(agt);
            make_trans_dlv_nbsp(agt);             
            
        } else if (cntrt_cmdt_value=='2') {  // DDX°¡ ¼±ÅÃµÈ °æ¿ì
        
            ddx_pup.style.visibility   = "hidden";
            ddx_dlv.style.visibility   = "visible";
            card_dlv.style.visibility  = "hidden";
            trans_dlv.style.visibility = "hidden";   
            
            // °ø¹éÃ³¸®
            make_ddx_pup_nbsp(agt);
            make_card_dlv_nbsp(agt);
            make_trans_dlv_nbsp(agt);                 
            
        } else if (cntrt_cmdt_value=='9') {  // ¸ðµÎ°¡ ¼±ÅÃµÈ °æ¿ì
            
            ddx_pup.style.visibility   = "hidden";
            ddx_dlv.style.visibility   = "visible";
            card_dlv.style.visibility  = "visible";
            trans_dlv.style.visibility = "hidden";   
            
            //°ø¹éÃ³¸®
            make_ddx_pup_nbsp(agt);
            make_trans_dlv_nbsp(agt);                 
            
        }                
    } else if(cntrt_gubun_value=='3') {  // °£¼±ÀÌ ¼±ÅÃµÈ °æ¿ì
        if(cntrt_cmdt_value=='1') {  // Ä«µå°¡ ¼±ÅÃµÈ °æ¿ì
            
            alert("°£¼±ÀÎ °æ¿ì¿¡´Â Ä«µå¸¦ ¼±ÅÃÇÒ ¼ö ¾ø½À´Ï´Ù.");
            agt.cntrt_cmdt.options[0].selected = true;
            return false;
        
        } else if(cntrt_cmdt_value=='2') {  // DDX°¡ ¼±ÅÃµÈ °æ¿ì
        
            alert("°£¼±ÀÎ °æ¿ì¿¡´Â DDX¸¦ ¼±ÅÃÇÒ ¼ö ¾ø½À´Ï´Ù.");
            agt.cntrt_cmdt.options[0].selected = true;
            return false;
        
        } else if(cntrt_cmdt_value=='9') {  // ¸ðµÎ°¡ ¼±ÅÃµÈ °æ¿ì
        
            alert("°£¼±ÀÎ °æ¿ì¿¡´Â ¸ðµÎ¸¦ ¼±ÅÃÇÒ ¼ö ¾ø½À´Ï´Ù.");
            agt.cntrt_cmdt.options[0].selected = true;
            return false;        
        }                                
    } else if(cntrt_gubun_value=='4') {  // ÇÈ¾÷+¹è´ÞÀÌ ¼±ÅÃµÈ °æ¿ì
        if(cntrt_cmdt_value=='1') {  // Ä«µå°¡ ¼±ÅÃµÈ °æ¿ì
        
            alert("ÇÈ¾÷+¹è´ÞÀÎ °æ¿ì¿¡´Â CARD¸¦ ¼±ÅÃÇÒ ¼ö ¾ø½À´Ï´Ù.");
            agt.cntrt_cmdt.options[0].selected = true;
            return false;
                                
        } else if(cntrt_cmdt_value=='2') {  // DDX°¡ ¼±ÅÃµÈ °æ¿ì
        
            ddx_pup.style.visibility   = "visible";
            ddx_dlv.style.visibility   = "visible";
            card_dlv.style.visibility  = "hidden";
            trans_dlv.style.visibility = "hidden";      
            
            // °ø¹éÃ³¸®
            make_card_dlv_nbsp(agt);
            make_trans_dlv_nbsp(agt);
                         
            
        } else if(cntrt_cmdt_value=='9') {  // ¸ðµÎ°¡ ¼±ÅÃµÈ °æ¿ì
        
            ddx_pup.style.visibility   = "visible";
            ddx_dlv.style.visibility   = "visible";
            card_dlv.style.visibility  = "visible";
            trans_dlv.style.visibility = "hidden";    
            
            //°ø¹éÃ³¸®
            make_trans_dlv_nbsp(agt);                
            
        }                                
    } else if(cntrt_gubun_value=='5') {  // ÇÈ¾÷+°£¼±À» ¼±ÅÃÇÑ °æ¿ì
        if(cntrt_cmdt_value=='1') {  // Ä«µå°¡ ¼±ÅÃµÈ °æ¿ì
        
           alert("ÇÈ¾÷+°£¼±ÀÎ °æ¿ì¿¡´Â CARD¸¦ ¼±ÅÃÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
           agt.cntrt_cmdt.options[0].selected = true;
           return false;            
                                
        } else if(cntrt_cmdt_value=='2') {  // DDX°¡ ¼±ÅÃµÈ °æ¿ì
                      
            ddx_pup.style.visibility   = "visible";
            ddx_dlv.style.visibility   = "hidden";
            card_dlv.style.visibility  = "hidden";
            trans_dlv.style.visibility = "visible";   
            
            //°ø¹éÃ³¸®
            make_ddx_dlv_nbsp(agt);
            make_card_dlv_nbsp(agt);                  
            
        } else if(cntrt_cmdt_value=='9') {  // ¸ðµÎ°¡ ¼±ÅÃµÈ °æ¿ì
           
           alert("ÇÈ¾÷+°£¼±ÀÎ °æ¿ì¿¡´Â ¸ðµÎ¸¦ ¼±ÅÃÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
           agt.cntrt_cmdt.options[0].selected = true;
           return false;                 
            
        }  // of if
    } else if(cntrt_gubun_value=='6'){  // ¹è´Þ+°£¼±À» ¼±ÅÃÇÑ °æ¿ì
        if(cntrt_cmdt_value=='1') {  // Ä«µå°¡ ¼±ÅÃµÈ °æ¿ì
        
            ddx_pup.style.visibility   = "hidden";
            ddx_dlv.style.visibility   = "hidden";
            card_dlv.style.visibility  = "visible";
            trans_dlv.style.visibility = "visible";    
            
            // °ø¹éÃ³¸®
            make_ddx_pup_nbsp(agt);
            make_ddx_dlv_nbsp(agt);                 
                                
        } else if(cntrt_cmdt_value=='2') {  // DDX°¡ ¼±ÅÃµÈ °æ¿ì
            
            ddx_pup.style.visibility   = "hidden";
            ddx_dlv.style.visibility   = "visible";
            card_dlv.style.visibility  = "hidden";
            trans_dlv.style.visibility = "visible";  
            
            // °ø¹éÃ³¸®
            make_ddx_pup_nbsp(agt);
            make_card_dlv_nbsp(agt);                   
            
        } else if(cntrt_cmdt_value=='9') {  // ¸ðµÎ°¡ ¼±ÅÃµÈ °æ¿ì
           
            ddx_pup.style.visibility   = "hidden";
            ddx_dlv.style.visibility   = "visible";
            card_dlv.style.visibility  = "visible";
            trans_dlv.style.visibility = "visible";   
            
            //°ø¹éÃ³¸®
            make_ddx_pup_nbsp(agt);                  
            
        }  // of if
    
    } else if(cntrt_gubun_value='9') {   // ÇÈ¾÷+¹è´Þ+°£¼±À» ¼±ÅÃÇÑ °æ¿ì
    
        if(cntrt_cmdt_value=='1') {  // Ä«µå°¡ ¼±ÅÃµÈ °æ¿ì
        
            alert("°è¾à±¸ºÐÀÌ ÇÈ¾÷+¹è´Þ+°£¼±ÀÎ °æ¿ì¿¡´Â CARD¸¦ ¼±ÅÃÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
            agt.cntrt_cmdt.options[0].selected = true;
            return false;
                                
        } else if(cntrt_cmdt_value=='2') {  // DDX°¡ ¼±ÅÃµÈ °æ¿ì
            
            ddx_pup.style.visibility   = "visible";
            ddx_dlv.style.visibility   = "visible";
            card_dlv.style.visibility  = "hidden";
            trans_dlv.style.visibility = "visible"; 
            
            // °ø¹éÃ³¸®
            make_card_dlv_nbsp(agt);                    
            
        } else if(cntrt_cmdt_value=='9') {  // ¸ðµÎ°¡ ¼±ÅÃµÈ °æ¿ì
           
            ddx_pup.style.visibility   = "visible";
            ddx_dlv.style.visibility   = "visible";
            card_dlv.style.visibility  = "visible";
            trans_dlv.style.visibility = "visible";                                                         
            
        }  // of if    
    }     
}


/*
 * USED by AgtRegist.jsp
 * MADE by Daeho
 *
 * DDXÇÈ¾÷¿äÀ²¼±ÅÃ½Ã 
 * 
 */    
function reverse1(agt)
{
    // ¼±ÅÃµÈ °è¾àÁ¾·ù¸¦ ÀÐ¾î¿Â´Ù.
    var index_cntrt_cmdt, cntrt_cmdt_value;
        
    
    // ¼±ÅÃµÈ °è¾àÇ°¸ñÀ» ÀÐ¾î¿Â´Ù.
    index_cntrt_cmdt = agt.cntrt_cmdt.selectedIndex;
    cntrt_cmdt_value = agt.cntrt_cmdt.options[index_cntrt_cmdt].value;    
        
    
    if (cntrt_cmdt_value=='2' || cntrt_cmdt_value=='9') {
    
        if(agt.ddx_pup_charge_type1[0].checked)
        {
            //alert(agt.pup_charge_type1[0].value);
            agt.ddx_charge_pup1.readOnly     = false;
            agt.ddx_charge_pup2.readOnly     = true;
            agt.ddx_pup_bweight.readOnly     = true;       
            agt.ddx_over_pup_charge.readOnly = true;
            agt.ddx_charge_pup2.value        = "";
            agt.ddx_pup_bweight.value        = "";
            agt.ddx_over_pup_charge.value    = "";
            agt.ddx_charge_pup1.style.backgroundColor     = "#FFFFFF";  
            agt.ddx_charge_pup2.style.backgroundColor     = "#C5DCFA";  
            agt.ddx_pup_bweight.style.backgroundColor     = "#C5DCFA";  
            agt.ddx_over_pup_charge.style.backgroundColor = "#C5DCFA";  
            
        } else {
            //alert(agt.pup_charge_type1[1].value);
            agt.ddx_charge_pup1.readOnly     = true;    
            agt.ddx_charge_pup2.readOnly     = false;
            agt.ddx_pup_bweight.readOnly     = false;
            agt.ddx_over_pup_charge.readOnly = false;   
            agt.ddx_charge_pup1.value        = "";    
            agt.ddx_charge_pup1.style.backgroundColor     = "#C5DCFA";  
            agt.ddx_charge_pup2.style.backgroundColor     = "#FFFFFF";
            agt.ddx_pup_bweight.style.backgroundColor     = "#FFFFFF";
            agt.ddx_over_pup_charge.style.backgroundColor = "#FFFFFF";             
        } // of if
     } else {
        alert("°è¾à´ë»óÇ°¸ñ¿¡¼­ DDX³ª ¸ðµÎ¸¦ ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿ä.");
        return false;
    }
    
}

/*
 * USED by AgtRegist.jsp
 * MADE by Daeho
 *
 * DDX¹è´Þ¿äÀ²¼±ÅÃ½Ã 
 * 
 */    
function reverse2(agt)
{
    var index, cntrt_cmdt_value ;
    index = agt.cntrt_cmdt.selectedIndex;
    cntrt_cmdt_value = agt.cntrt_cmdt.options[index].value;    
    
    if (cntrt_cmdt_value=='2' || cntrt_cmdt_value=='9') {
        if(agt.ddx_dlv_charge_type1[0].checked)
        {
            agt.ddx_charge_dlv1.readOnly     = false;
            agt.ddx_charge_dlv2.readOnly     = true;
            agt.ddx_dlv_bweight.readOnly     = true;
            agt.ddx_over_dlv_charge.readOnly = true;
            agt.ddx_charge_dlv2.value        = "";
            agt.ddx_dlv_bweight.value        = "";
            agt.ddx_over_dlv_charge.value    = "";
            agt.ddx_charge_dlv1.style.backgroundColor     = "#FFFFFF";
            agt.ddx_charge_dlv2.style.backgroundColor     = "#C5DCFA";
            agt.ddx_dlv_bweight.style.backgroundColor     = "#C5DCFA";                                      
            agt.ddx_over_dlv_charge.style.backgroundColor = "#C5DCFA";
            
        } else {
            agt.ddx_charge_dlv1.readOnly     = true;
            agt.ddx_charge_dlv2.readOnly     = false;
            agt.ddx_dlv_bweight.readOnly     = false;
            agt.ddx_over_dlv_charge.readOnly = false;
            agt.ddx_charge_dlv1.value        = "";
            agt.ddx_charge_dlv1.style.backgroundColor     = "#C5DCFA";
            agt.ddx_charge_dlv2.style.backgroundColor     = "#FFFFFF";
            agt.ddx_dlv_bweight.style.backgroundColor     = "#FFFFFF";
            agt.ddx_over_dlv_charge.style.backgroundColor = "#FFFFFF";
        } // of if
    } else {
        alert("°è¾à´ë»óÇ°¸ñ¿¡¼­ DDX³ª ¸ðµÎ¸¦ ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿ä.");
        return false;
    }
}
