/******************************************************************************
*  ¼³ ¸í  : ÄÚµåÁ¶È¸
*  »ç¿ë¿¹ : 
//   ParambyName     : 1. codeFieldName   - ÄÚµåÇÊµå¸í
//                   : 2. edi_gubun       - ±¸ºÐÄÚµå
//                   : 3. codeValue       - ÄÚµå°ª
//                   : 4. length          - ÀÔ·Â°ª ±æÀÌÁ¦ÇÑ
*******************************************************************************/
function CheckCodeOne(Doctype, company_code, gubun1, gubun2, length, CodeValue, field1) {
  if(eval("document.frm") != undefined){
	CheckForm = "document.frm.";
  }else{
	CheckForm = "document.frmSearch.";
  }

    if(eval(CheckForm+CodeValue).value == '') {
		// ³×ÀÓ ÇÊµå ÃÊ±âÈ­
	    if(field1 != '' ) {
			eval(CheckForm+field1).value = '';
		}
		return;
	}else{
		CodeField = CodeValue
		CodeValue = eval(CheckForm+CodeValue);
	    len       = CodeValue.value.length
    if (len > length)
	  {
		  alert("ÄÚµåºÎºÐ¿¡´Â " + length + "ÀÌ»óÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇÒ¼ö ¾ø½À´Ï´Ù");
		  CodeValue.value = "";
		  CodeField.focus();	
		  return;
	  }	
	  for (t=0;t< len; t++)
	  {
		  if (escape((CodeValue.value).substr(t,1)).length > 4)
		  {
			  alert("ÄÚµåºÎºÐ¿¡ ÇÑ±ÛÀ» ÀÔ·ÂÇÏ½Ç¼ö¾ø½À´Ï´Ù.");
			  CodeValue.value = "";
			  CodeField.focus();	
			  return;
		  }
	  }
	  CodeValue.value = CodeValue.value.toUpperCase()

	var Params = "?Doctype=" + Doctype + "&company_code=" + company_code
		       + "&gubun1=" + gubun1 + "&gubun2=" + gubun2 + "&CodeField=" + CodeField + "&CodeValue=" + CodeValue.value
		       + "&field1=" + field1;

  	document.CheckFrm.location.href="/CheckCode/CheckCodeOne.asp"+ Params;
	}
}


/******************************************************************************
*  ¼³ ¸í  : ÄÚµåÁ¶È¸
*  »ç¿ë¿¹ : 
//   ParambyName     : 1. codeFieldName   - ÄÚµåÇÊµå¸í
//                   : 2. edi_gubun       - ±¸ºÐÄÚµå
//                   : 3. codeValue       - ÄÚµå°ª
//                   : 4. length          - ÀÔ·Â°ª ±æÀÌÁ¦ÇÑ
*******************************************************************************/
function CheckCodeOneHan(Doctype, company_code, gubun1, gubun2, length, CodeValue, field1) {
  if(eval("document.frm") != undefined){
	CheckForm = "document.frm.";
  }else{
	CheckForm = "document.frmSearch.";
  }

  if(eval(CheckForm+CodeValue).value == '') {
		// ³×ÀÓ ÇÊµå ÃÊ±âÈ­
	    if(field1 != '' ) {
			eval(CheckForm+field1).value = '';
		}
		return;
	}else{
		CodeField = CodeValue
		CodeValue = eval(CheckForm+CodeValue);
	    len       = CodeValue.value.length
    if (len > length)
	  {
		  alert("ÄÚµåºÎºÐ¿¡´Â " + length + "ÀÌ»óÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇÒ¼ö ¾ø½À´Ï´Ù");
		  CodeValue.value = "";
		  CodeField.focus();	
		  return;
	  }	
	  CodeValue.value = CodeValue.value.toUpperCase()

	var Params = "?Doctype=" + Doctype + "&company_code=" + company_code
		       + "&gubun1=" + gubun1 + "&gubun2=" + gubun2 + "&CodeField=" + CodeField + "&CodeValue=" + CodeValue.value
		       + "&field1=" + field1;

  	document.CheckFrm.location.href="/CheckCode/CheckCodeOne.asp"+ Params;
	}
}

/******************************************************************************
*  ¼³ ¸í  : ÄÚµåÁ¶È¸
*  »ç¿ë¿¹ : 
//   ParambyName     : 1. codeFieldName   - ÄÚµåÇÊµå¸í
//                   : 2. edi_gubun       - ±¸ºÐÄÚµå
//                   : 3. codeValue       - ÄÚµå°ª
//                   : 4. length          - ÀÔ·Â°ª ±æÀÌÁ¦ÇÑ
*******************************************************************************/
function CheckCodeMulty(Doctype, company_code, gubun1, gubun2, length, CodeValue, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10) {
	  if(eval("document.frm") != undefined){
		  CheckForm = "document.frm.";
	  }else{
		  CheckForm = "document.frmSearch.";
	  }
	if(eval(CheckForm+CodeValue).value == '') {
		// ³×ÀÓ ÇÊµåµé ÃÊ±âÈ­
	    if(field1 != '' ) {
			eval(CheckForm+field1).value = '';
		}
	    if(field2 != '' ) {
			eval(CheckForm+field2).value = '';
		}
	    if(field3 != '' ) {
			eval(CheckForm+field3).value = '';
		}
	    if(field4 != '' ) {
			eval(CheckForm+field4).value = '';
		}
	    if(field5 != '' ) {
			eval(CheckForm+field5).value = '';
		}
	    if(field6 != '' ) {
			eval(CheckForm+field6).value = '';
		}
	    if(field7 != '' ) {
			eval(CheckForm+field7).value = '';
		}
	    if(field8 != '' ) {
			eval(CheckForm+field8).value = '';
		}
	    if(field9 != '' ) {
			eval(CheckForm+field9).value = '';
		}
	    if(field10 != '' ) {
			eval(CheckForm+field10).value = '';
		}
		return;
	}else{
		CodeField = CodeValue
	    CodeValue = eval(CheckForm+CodeValue);
	    len       = CodeValue.value.length

    if (len > length)
	  {
		  alert("ÄÚµåºÎºÐ¿¡´Â " + length + "ÀÌ»óÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇÒ¼ö ¾ø½À´Ï´Ù");
		  CodeValue.value = "";
		  //CodeField.focus();	
		  eval(CheckForm+CodeField).focus();	
		  return;
	  }

	  for (t=0;t< len; t++)
	  {
		  if (escape((CodeValue.value).substr(t,1)).length > 4)
		  {
			  alert("ÄÚµåºÎºÐ¿¡ ÇÑ±ÛÀ» ÀÔ·ÂÇÏ½Ç¼ö¾ø½À´Ï´Ù.");
			  CodeValue.value = "";
			  //CodeField.focus();	
			  eval(CheckForm+CodeField).focus();	
			  return;
		  }
	  }

	  CodeValue.value = CodeValue.value.toUpperCase()

	var Params = "?Doctype=" + Doctype + "&company_code=" + company_code
		       + "&gubun1=" + gubun1 + "&gubun2=" + gubun2 + "&CodeField=" + CodeField + "&CodeValue=" + CodeValue.value
		       + "&field1=" + field1 + "&field2=" + field2 + "&field3=" + field3 + "&field4=" + field4
		       + "&field5=" + field5 + "&field6=" + field6 + "&field7=" + field7 + "&field8=" + field8
		       + "&field9=" + field9 + "&field10=" + field10;
   
  	document.CheckFrm.location.href="/CheckCode/CheckCodeMulty.asp"+ Params;
	}
}

/******************************************************************************
*  ¼³ ¸í  : ÄÚµåÁ¶È¸
*  »ç¿ë¿¹ : 
//   ParambyName     : 1. codeFieldName   - ÄÚµåÇÊµå¸í
//                   : 2. edi_gubun       - ±¸ºÐÄÚµå
//                   : 3. codeValue       - ÄÚµå°ª
//                   : 4. length          - ÀÔ·Â°ª ±æÀÌÁ¦ÇÑ
*******************************************************************************/
function CheckCodeMultyHan(Doctype, company_code, gubun1, gubun2, length, CodeValue, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10) {
	  if(eval("document.frm") != undefined){
		CheckForm = "document.frm.";
	  }else{
		CheckForm = "document.frmSearch.";
	  }

    if(eval(CheckForm+CodeValue).value == '') {
		// ³×ÀÓ ÇÊµåµé ÃÊ±âÈ­
	    if(field1 != '' ) {
			eval(CheckForm+field1).value = '';
		}
	    if(field2 != '' ) {
			eval(CheckForm+field2).value = '';
		}
	    if(field3 != '' ) {
			eval(CheckForm+field3).value = '';
		}
	    if(field4 != '' ) {
			eval(CheckForm+field4).value = '';
		}
	    if(field5 != '' ) {
			eval(CheckForm+field5).value = '';
		}
	    if(field6 != '' ) {
			eval(CheckForm+field6).value = '';
		}
	    if(field7 != '' ) {
			eval(CheckForm+field7).value = '';
		}
	    if(field8 != '' ) {
			eval(CheckForm+field8).value = '';
		}
	    if(field9 != '' ) {
			eval(CheckForm+field9).value = '';
		}
	    if(field10 != '' ) {
			eval(CheckForm+field10).value = '';
		}
		return;
	}else{
		CodeField = CodeValue
	    CodeValue = eval(CheckForm+CodeValue);
	    len       = CodeValue.value.length

    if (len > length)
	  {
		  alert("ÄÚµåºÎºÐ¿¡´Â " + length + "ÀÌ»óÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇÒ¼ö ¾ø½À´Ï´Ù");
		  CodeValue.value = "";
		  eval(CheckForm+CodeField).focus();	
		  return;
	  }

	  CodeValue.value = CodeValue.value.toUpperCase()
	var Params = "?Doctype=" + Doctype + "&company_code=" + company_code
		       + "&gubun1=" + gubun1 + "&gubun2=" + gubun2 + "&CodeField=" + CodeField + "&CodeValue=" + CodeValue.value
		       + "&field1=" + field1 + "&field2=" + field2 + "&field3=" + field3 + "&field4=" + field4
		       + "&field5=" + field5 + "&field6=" + field6 + "&field7=" + field7 + "&field8=" + field8
		       + "&field9=" + field9 + "&field10=" + field10;

  	document.CheckFrm.location.href="/CheckCode/CheckCodeMulty.asp"+ Params;
	}
}
