  var ERRORMSG;
  var intCheckId  = 0;
  var intCheckAgent = 0;
  var strNum      = "0123456789";
  var strAlpabet  = "abcdefghijklmnopqrstuvwxyz";
  var strAlpabetB = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  var strSpecial = "!#$%&*+-./=?@^_`{|}"+strNum+strAlpabet+strAlpabetB;

// 로그인 버튼 관련 함수
function Keycode(e){
	var result;
	if(window.event)
	{
		result = window.event.keyCode;
	}else if(e)
	{
		result = e.which;
	}
	return result;
}

  function fnEnterchk()
  {
  	if(event.keyCode==13)
  	{
  		log_in();
  	}
  }

  function fnEnterchk2()
  {
  	if(event.keyCode==13)
  	{
  		log_in_guest();
  	}
  }

  function fnEnterchk3()
  {
  	if(event.keyCode==13)
  	{
  		search_Id();
  	}
  }

  function fnEnterchk4()
  {
  	if(event.keyCode==13)
  	{
  		search_Pw();
  	}
  }

function fnEnterchk5()
{
	if(event.keyCode==13)
	{
		fnAdminLogin();
	}
}

function fnEnterchk6()
{
	if(event.keyCode==13)
	{
		login_check_mem();
	}
}
// 새로운 함수
  function fnCheckString(tmpString, strTmp) {
    var i;
 		for(i=0; i<tmpString.length; i++) {
      if(strTmp.indexOf(tmpString.substring(i, i+1)) < 0) {
        return false;
      }
 		}
 		return true;
  }

  function fnCheckLength(tmpString, intMin, intMax) {
    var intLen = tmpString.length;
      if(intLen < intMin) return false;
      if(intLen > intMax) return false;
    return true;
  }

// 숫자만 입력하는 함수 시작
  function onlyNumber() {
    var objString;
        objString = window.event.keyCode;
    if(objString < 48 || objString > 57) {
        alert("숫자만 입력 하실 수 있습니다.");
        window.event.returnValue = false;
    }
  }

// 아이디 체크 함수 시작
//  function fnCheckId(tmpString) {
//    var oForm = eval("document.all.regiform");
//      if(fnCheckString(tmpString, strNum + strAlpabet + strAlpabetB) && fnCheckLength(tmpString, 4, 12)) {
//        if(!intCheckId) window.open('/memberht/id_check.asp?sId=' + tmpString ,'checkId','width=450,height=280,top=0,left=0');
//        return true;
//      }else {
//        alert("아이디는 영문과 숫자 조합 4~12 자리만 가능합니다.!");
//        oForm.sId.focus();
//        return false;
//      }
//  }

function fnCheckId(tmpString) {
    var oForm = eval("document.all.regiform");
	if(!regiform.uid.value) {
       alert("아이디(ID)를 입력하신 후에 확인하세요!");
  	   oForm.uid.focus();
     	 return false;
  	} else if((regiform.uid.value.length < 3) || (regiform.uid.value.length > 12)) {
  		alert("아이디는 4자이상 12자 이하로 입력해주세요!");
  		oForm.uid.focus();
  		return false;
  	} else if (!fnCheckString(tmpString, strNum + strAlpabet + strAlpabetB)) {
      alert("아이디는 영문과 숫자 조합 4~12 자리만 가능합니다.!");
  		oForm.uid.focus();
  		return false;
  	} else {
  		var ref = "/memberht/pop_idChk.asp?uid=" + regiform.uid.value;
  		var window_left = (screen.width-640)/2;
        var window_top = (screen.height-480)/2;
        if(!intCheckId) popLayer.launcher({src:ref,width:352,height:167});
        return true;
	}
}

function fnCheckAgentNo(tmpString) {
    var oForm = eval("document.all.regiform");
	if(!regiform.agentNO.value) {
       alert("사업자 등록번호를 입력하신 후에 확인하세요!");
  	   oForm.agentNO.focus();
     	 return;
  	} else if(regiform.agentNO.value.length > 10) {
  		alert("사업자 번호는 (-)를 제회한 10자리 입니다. 다시 확인 후 입력바랍니다.!");
  		oForm.agentNO.focus();
  		return;
    } 
    if(fnCheckAgentNumberSub()==false) {
  		oForm.agentNO.focus();
 			return;
  	} else {
      return true;
  	}
}
// 아이디 및 사업자 등록번호 체크 함수 끝
// 아이디와 비밀번호 조합검사 부분 시작
  function fnCheckPwd(tmpString, tmpString_re) {
    var oForm = eval("document.all.regiform");
      if(!tmpString.length || !fnCheckString(tmpString, strNum + strAlpabet + strAlpabetB) || !fnCheckLength(tmpString, 4, 10)) {
        ERRORMSG = "비밀번호는 영문과 숫자 조합 4~10 자리만 가능합니다.!";
        return -1;
      }

      if(!tmpString_re.length || !fnCheckString(tmpString_re, strNum + strAlpabet + strAlpabetB) || !fnCheckLength(tmpString_re, 4, 10)) {
        ERRORMSG = "비밀번호는 영문과 숫자 조합 4~10 자리만 가능합니다.!";
        return 1;
      }

      if(tmpString == oForm.uid.value) {
        ERRORMSG = "아이디와 동일한 패스워드는 사용할 수 없습니다.!";
        oForm.passwd.value = "";
        oForm.passwd2.value = "";
        return -1;
      }

      if(tmpString != tmpString_re) {
        ERRORMSG = "비밀번호가 일치 하지 않습니다.";
        return 1;
      }
    return 0;
  }

  function fnCheckPwd_sub(tmpString, tmpString_re) {
    var oForm = eval("document.all.regiform_sub");
      if(!tmpString.length || !fnCheckString(tmpString, strNum + strAlpabet + strAlpabetB) || !fnCheckLength(tmpString, 4, 10)) {
        ERRORMSG = "비밀번호는 영문과 숫자 조합 4~10 자리만 가능합니다.!";
        return -1;
      }

      if(!tmpString_re.length || !fnCheckString(tmpString_re, strNum + strAlpabet + strAlpabetB) || !fnCheckLength(tmpString_re, 4, 10)) {
        ERRORMSG = "비밀번호는 영문과 숫자 조합 4~10 자리만 가능합니다.!";
        return 1;
      }

      if(tmpString == oForm.uid.value) {
        ERRORMSG = "아이디와 동일한 패스워드는 사용할 수 없습니다.!";
        oForm.passwd.value = "";
        oForm.passwd2.value = "";
        return -1;
      }

      if(tmpString != tmpString_re) {
        ERRORMSG = "비밀번호가 일치 하지 않습니다.";
        return 1;
      }
    return 0;
  }
// 아이디와 비밀번호 조합검사 부분 끝
// 이메일 검사부분 시작
  function fnCheckEmail(tmpEmail) {
  	if (!fnCheckString(tmpEmail, strSpecial)) {
  		ERRORMSG = "에 잘못된 문자가 있습니다.";
  		return false;
  	}

  	var a  = tmpEmail.indexOf('@');
  	var d1 = tmpEmail.indexOf('.@');
  	var d2 = tmpEmail.indexOf('@.');
  	if ( a <=0 || a == tmpEmail.length -1 || d1 >= 0 || d2 >= 0) {
  		ERRORMSG = "는 aaa@bbb.ccc.ddd 와 같은 형태로 입력하셔야 합니다.";
  		return false;
  	}
  	return true;
  }

function email_chk()
{
  var t = document.login_guest.gEmail.value
	var ValidFlag = false
	var atCount = 0
	var SpecialFlag
	var atLoop
	var atChr
	var BadFlag
	var tAry1
	var UserName
	var DomainName

	if ( t.length > 0 && t.indexOf("@") > 0 && t.indexOf(".") > 0 ) {
		atCount = 0
		SpecialFlag = false

		for( atLoop=1; atLoop<=t.length; atLoop++ ) {
			atChr = t.substring( atLoop, atLoop+1 )
			if ( atChr == "@" ) atCount = atCount + 1

			if ( (atChr >= 32) && (atChr <= 44) ) SpecialFlag = true 
			if ( (atChr == 47) || (atChr == 96) || (atChr >= 123) ) SpecialFlag = true 
			if ( (atChr >= 58) && (atChr <= 63) ) SpecialFlag = true 
			if ( (atChr >= 91) && (atChr <= 94) ) SpecialFlag = true 
		}

		if ( ( atCount == 1 ) && (SpecialFlag == false ) ) {
			BadFlag = false
			tAry1 = t.split("@")
			UserName = tAry1[0]
			DomainName = tAry1[1]
			if ( (UserName.length <= 0 ) || (DomainName.length <= 0 ) ) BadFlag = true
			if ( DomainName.substring( 1, 2 ) == "." ) BadFlag = true
			if ( DomainName.substring( DomainName.length-1, DomainName.length) == "." ) BadFlag = true
			ValidFlag = true
		}
	}
	if ( BadFlag == true ) ValidFlag = false
	return ValidFlag
}
// 이메일 검사부분 끝
// 주민번호 앞자리로 생년월일 넣기 시작
	function f_birth()
	{
	 var s_Day = document.regiform.sCitizen1.value
		if (s_Day != ''){
			document.regiform.year.value = '19' + s_Day.substring(0,2);
			document.regiform.month.value = s_Day.substring(2,4);
			document.regiform.day.value = s_Day.substring(4,6);
		 }
	}
// 주민번호 앞자리로 생년월일 넣기 끝

// 주민등록 확인 부분 시작
  function fnCheckCitizenId(tmpCitizenId1, tmpCitizenId2) {
  	var chk     = 0;
  	var nYear   = tmpCitizenId1.substring(0,2);
  	var nMondth = tmpCitizenId1.substring(2,4);
  	var nDay    = tmpCitizenId1.substring(4,6);

    	if (!fnCheckString(tmpCitizenId1, strNum) || tmpCitizenId1.length!=6 ||  nMondth<1 || nMondth>12 || nDay<1 || nDay>31) {
    		ERRORMSG = "[주민등록번호 앞부분]이 잘못되었습니다.";
    		return -1;
    	}

    	if (!fnCheckString(tmpCitizenId2, strNum) || tmpCitizenId2.length!=7) {
    		ERRORMSG = "[주민등록번호 뒷부분]이 잘못되었습니다.";
    		return 1;
    	}

    	var i;

      	for (i=0; i<6; i++) chk += ( (i+2) * parseInt( tmpCitizenId1.charAt(i) ));
      	for (i=6; i<12; i++) chk += ( (i%8+2) * parseInt( tmpCitizenId2.charAt(i-6) ));

      	chk = 11 - (chk%11);
      	chk %= 10;

      	if (chk != parseInt( tmpCitizenId2.charAt(6))) {
      		ERRORMSG = "유효하지 않은 [주민등록번호]입니다.";
      		return -1;
      	}
  	return 0;
  }
// 주민등록 확인 부분 끝
// 사업자등록 유효성 확인 시작
  function fnCheckAgentNumber()
  {
//    var frm1=document.forms[0]
    var ValidFlagYN = false
    var Company1 = document.login_check_mem.sCompany1.value;
    var Company2 = document.login_check_mem.sCompany2.value;
    var Company3 = document.login_check_mem.sCompany3.value;
    var num=(Company1+Company2+Company3)  //사업자등록번호를 붙입니다... 
    var w_c,w_e,w_f,w_tot
    w_c=num.charAt(8)*5       // 9번째자리의 숫자에 5를 곱한다.
    w_e=parseInt((w_c/10),10) // 10으로 나누고 10진수 형태의 숫자형으로 만든당..나눈몫
    w_f=w_c % 10              // 10으로 나눈 나머지....        
    w_tot=num.charAt(0)*1
    w_tot+=num.charAt(1)*3 
    w_tot+=num.charAt(2)*7
    w_tot+=num.charAt(3)*1 
    w_tot+=num.charAt(4)*3 
    w_tot+=num.charAt(5)*7 
    w_tot+=num.charAt(6)*1 
    w_tot+=num.charAt(7)*3 
    w_tot+=num.charAt(9)*1 
    w_tot+=(w_e+w_f)       
      if (!(w_tot % 10))         // 10으로 나누어 지면 true를 그렇지 않으면 false를 반환합니당.. 
      {   
  			ValidFlag = true
        document.login_check_mem.submit()  //이건 다른 포거스 를 주면 되죠,,,다음 입력라인  
      }else{  
        alert("사업자 등록 번호가 규격에 맞지 않습니다.\n\n사업자 등록증을 확인하신 후 정확히 입력하여 주세요")  
        document.login_check_mem.sCompany1.value=""  
        document.login_check_mem.sCompany2.value=""  
        document.login_check_mem.sCompany3.value=""  
        document.login_check_mem.sCompany1.focus()  
  			ValidFlag = false
      }
    return ValidFlagYN
  }

  function fnCheckAgentNumberSub()
  {
    var ValidFlagYN = false
    var num=document.regiform.agentNO.value  //사업자등록번호를 붙입니다... 
    var w_c,w_e,w_f,w_tot
    w_c=num.charAt(8)*5       // 9번째자리의 숫자에 5를 곱한다.
    w_e=parseInt((w_c/10),10) // 10으로 나누고 10진수 형태의 숫자형으로 만든당..나눈몫
    w_f=w_c % 10              // 10으로 나눈 나머지....        
    w_tot=num.charAt(0)*1
    w_tot+=num.charAt(1)*3 
    w_tot+=num.charAt(2)*7
    w_tot+=num.charAt(3)*1 
    w_tot+=num.charAt(4)*3 
    w_tot+=num.charAt(5)*7 
    w_tot+=num.charAt(6)*1 
    w_tot+=num.charAt(7)*3 
    w_tot+=num.charAt(9)*1 
    w_tot+=(w_e+w_f)       
      if (!(w_tot % 10))         // 10으로 나누어 지면 true를 그렇지 않으면 false를 반환합니당.. 
      {   
  			ValidFlag = true
    		var ref = "/memberht/pop_bnChk.asp?agentNO=" + regiform.agentNO.value;
    		var window_left = (screen.width-640)/2;
          var window_top = (screen.height-480)/2;
          if(!intCheckAgent) popLayer.launcher({src:ref,width:352,height:167});//window.open(ref,"agentNOWin",'width=500,height=260,status=no,top=' + window_top + ',left=' + window_left + '');
          return;
      }else{  
        alert("사업자 등록 번호가 규격에 맞지 않습니다.\n\n사업자 등록증을 확인하신 후 정확히 입력하여 주세요")  
        document.all.regiform.agentNO.value=""
  			ValidFlag = false
      }
    return ValidFlagYN
  }
// 사업자등록 유효성 확인 끝
// 우편번호 찾기 부분 시작
 function fnSearchAddress(frm) {
   var ref_1 = "/memberht/pop_addrFind.asp?frms="+ frm;
   popLayer.launcher({src:ref_1,width:352,height:167});
 }

// 우편번호 찾기 부분 끝
// 자동 넘어가기 함수 시작
	function check()
	{
	    var str = document.login_check_mem.sCitizen1.value.length;
	    if(str == 6)
	       document.login_check_mem.sCitizen2.focus();
	}

	function check1()
	{
	    var str = document.login_check_mem.sCompany1.value.length;
	    if(str == 3)
	       document.login_check_mem.sCompany2.focus();
	}
	function check2()
	{
	    var str = document.login_check_mem.sCompany2.value.length;
	    if(str == 2)
	       document.login_check_mem.sCompany3.focus();
	}

	function check11()
	{
	    var str = document.regiform.tel2.value.length;
	    if(str == 4)
	       document.regiform.tel3.focus();
	}

	function check22()
	{
	    var str = document.regiform.handphone2.value.length;
  	    if(str == 4)
	         document.regiform.handphone3.focus();
	}

	function check23()
	{
	    var str = document.regiform.phone2.value.length;
  	    if(str == 4)
	         document.regiform.phone3.focus();
	}

	function check24()
	{
	    var str = document.regiform.fax2.value.length;
  	    if(str == 4)
	         document.regiform.fax3.focus();
	}

	function check25()
	{
	    var str = document.login_find.sCitizen1.value.length;
	    if(str == 6)
	       document.login_find.sCitizen2.focus();
	}

	function check26()
	{
	    var str = document.login_pw_find.sCitizen1.value.length;
	    if(str == 6)
	       document.login_pw_find.sCitizen2.focus();
	}

	function check27()
	{
	    var str = document.frmreserv.handphone2.value.length;
  	    if(str == 4)
	         document.frmreserv.handphone3.focus();
	}

	function check28()
	{
	    var str = document.frmreserv.phone2.value.length;
  	    if(str == 4)
	         document.frmreserv.phone3.focus();
	}

	function check29()
	{
	    var str = document.frmreserv.fax2.value.length;
  	    if(str == 4)
	         document.frmreserv.fax3.focus();
	}

	function check30()
	{
	    var str = document.login_check_mem.sCompany1.value.length;
  	    if(str == 3)
	         document.login_check_mem.sCompany2.focus();
	}

	function check31()
	{
	    var str = document.login_check_mem.sCompany2.value.length;
  	    if(str == 2)
	         document.login_check_mem.sCompany3.focus();
	}

  function chkPatten(field)
  {
    var regNum =/^[0-9]+$/;    
    if(!regNum.test(field.value)){      
      alert("숫자만 입력가능합니다.\n\n숫자만 입력해주세요");      
      field.value='';
      //field.focus();       
      return false;    
    }
	else
	  {
		return true;
	  }
  }
// 자동 넘어가기 함수 끝
//메일선택 부분시작
function fnCancelReason()
{
	if(document.getElementById("mail2").value=="user")
	{
		document.all["mail3"].value="";
		document.all["mail3"].style.display="";
	}else{
		document.all["mail3"].value="";
		document.all["mail3"].style.display="none";
	}
}
//메일 선택부분 끝

// 경고창 부분 시작
  function fnPersonGO() {
    var oForm = eval("document.all.regiform");
    var tmpId, tmpPwd1, tmpPwd2;
    var tmpPhone1, tmpPhone2, tmpPhone3;
    var tmpEmail, tmpEmail2, tmpPwdCheck;

        tmpId              = oForm.uid;
        tmpPwd1            = oForm.passwd;
        tmpPwd2            = oForm.passwd2;
        tmpEmail           = oForm.mail1;
        tmpEmail2          = oForm.mail2;
        tmpPhone1          = oForm.handphone1;
        tmpPhone2          = oForm.handphone2;
        tmpPhone3          = oForm.handphone3;

        /** 아이디 중복 확인 체크 **/
        if(!fnCheckId(tmpId.value) || !intCheckId)  return;

        /** 비밀번호 확인 체크 **/
        tmpPwdCheck = fnCheckPwd(tmpPwd1.value, tmpPwd2.value);
        if(tmpPwdCheck != 0) {
          alert(ERRORMSG);
          if(tmpPwdCheck < 0) {
            tmpPwd1.focus();
          }else {
            tmpPwd2.focus();
          }
          return;
        }

      	/** 이메일 유효성 확인 **/
      	if(!tmpEmail.value.length) {
      	  alert("E-mail을 입력해 주십시요.!");
      	  tmpEmail.focus();
      	  return;
      	}

      	if(!tmpEmail2.value.length) {
      	  alert("E-mail 뒷 자리를 선택해 주십시요.!");
      	  tmpEmail2.focus();
      	  return;
      	}

      	/** 핸드폰번호 입력 확인 **/
      	if(!tmpPhone1.value.length) {
      	  alert("핸드폰 번호를 입력해 주십시요.!");
      	  tmpPhone1.focus();
      	  return;
      	}

      	if(!tmpPhone2.value.length) {
      	  alert("핸드폰 가운데 번호를 입력해 주십시요.!");
      	  tmpPhone2.focus();
      	  return;
      	}

      	if(!tmpPhone3.value.length) {
      	  alert("핸드폰 뒷 자리를 입력해 주십시요.!");
      	  tmpPhone3.focus();
      	  return;
      	}
     document.regiform.submit()
  }


function fnPersonModGO() {
    var oForm = eval("document.all.regiform");
    var tmpId, tmpPwd1, tmpPwd2;
    var tmpPhone1, tmpPhone2, tmpPhone3;
    var tmpEmail, tmpEmail2, tmpPwdCheck;

        tmpId              = oForm.uid;
        tmpPwd             = oForm.passwd;
        tmpEmail           = oForm.mail1;
        tmpEmail2          = oForm.mail2;
        tmpPhone1          = oForm.handphone1;
        tmpPhone2          = oForm.handphone2;
        tmpPhone3          = oForm.handphone3;

        /** 비밀번호 확인 체크 **/
      	if(!tmpPwd.value.length) {
      	  alert("비밀번호를 입력해 주십시요.");
      	  tmpPwd.focus();
      	  return;
      	}

      	if(!tmpEmail.value.length) {
      	  alert("E-mail을 입력해 주십시요.!");
      	  tmpEmail.focus();
      	  return;
      	}

      	if(!tmpEmail2.value.length) {
      	  alert("E-mail 뒷 자리를 선택해 주십시요.!");
      	  tmpEmail2.focus();
      	  return;
      	}

      	/** 핸드폰번호 입력 확인 **/
      	if(!tmpPhone1.value.length) {
      	  alert("핸드폰 번호를 입력해 주십시요.!");
      	  tmpPhone1.focus();
      	  return;
      	}

      	if(!tmpPhone2.value.length) {
      	  alert("가운데 번호를 입력해 주십시요.!");
      	  tmpPhone2.focus();
      	  return;
      	}

      	if(!tmpPhone3.value.length) {
      	  alert("핸드폰 뒷 자리를 입력해 주십시요.!");
      	  tmpPhone3.focus();
      	  return;
      	}
     document.regiform.submit()
  }

  function fnAgentPersonGO() {
    var oForm = eval("document.all.regiform");
    var tmpId, tmpPwd1, tmpPwd2, tmpAgentNo;
    var tmpPhone1, tmpPhone2, tmpPhone3;
    var tmpEmail, tmpEmail2, tmpPwdCheck;

        tmpId              = oForm.uid;
        tmpPwd1            = oForm.passwd;
        tmpPwd2            = oForm.passwd2;
        tmpAgentNo         = oForm.agentNO;
        tmpEmail           = oForm.mail1;
        tmpEmail2          = oForm.mail2;
        tmpPhone1          = oForm.phone1;
        tmpPhone2          = oForm.phone2;
        tmpPhone3          = oForm.phone3;

        /** 아이디 중복 확인 체크 **/
        if(!fnCheckId(tmpId.value) || !intCheckId)  return;

        /** 비밀번호 확인 체크 **/
        tmpPwdCheck = fnCheckPwd(tmpPwd1.value, tmpPwd2.value);
        if(tmpPwdCheck != 0) {
          alert(ERRORMSG);
          if(tmpPwdCheck < 0) {
            tmpPwd1.focus();
          }else {
            tmpPwd2.focus();
          }
          return;
        }

		//사업자 번호 체크
		if(oForm.gubun.value=="Z")
	    {
			if(!fnCheckAgentNo(tmpAgentNo.value) || !intCheckAgent)  return;
		}

      	/** 이메일 유효성 확인 **/
      	if(!tmpEmail.value.length) {
      	  alert("E-mail을 입력해 주십시요.!");
      	  tmpEmail.focus();
      	  return;
      	}

      	if(!tmpEmail2.value.length) {
      	  alert("E-mail 뒷 자리를 선택해 주십시요.!");
      	  tmpEmail2.focus();
      	  return;
      	}

      	/** 핸드폰번호 입력 확인 **/
      	if(!tmpPhone1.value.length) {
      	  alert("핸드폰 번호를 입력해 주십시요.!");
      	  tmpPhone1.focus();
      	  return;
      	}

      	if(!tmpPhone2.value.length) {
      	  alert("핸드폰 가운데 번호를 입력해 주십시요.!");
      	  tmpPhone2.focus();
      	  return;
      	}

      	if(!tmpPhone3.value.length) {
      	  alert("핸드폰 뒷 자리를 입력해 주십시요.!");
      	  tmpPhone3.focus();
      	  return;
      	}
     document.regiform.submit()
  }

  function fnAgentGO() {
    var oForm = eval("document.all.regiform");
    var tmpName, tmpId, tmpPwd1, tmpPwd2;
    var tmpPhone1, tmpPhone2, tmpPhone3;
    var tmpEmail, tmpEmail2, tmpPwdCheck;
    var tmpAgentBank, tmpAgentBankNm;

        tmpName            = oForm.agentCEO;
        tmpId              = oForm.uid;
        tmpPwd1            = oForm.passwd;
        tmpPwd2            = oForm.passwd2;
        tmpAgentNo         = oForm.agentNO;
        tmpEmail           = oForm.mail1;
        tmpEmail2          = oForm.mail2;
        tmpPhone1          = oForm.phone1;
        tmpPhone2          = oForm.phone2;
        tmpPhone3          = oForm.phone3;
        tmpFax1            = oForm.fax1;
        tmpFax2            = oForm.fax2;
        tmpFax3            = oForm.fax3;
        tmpAddress         = oForm.addr1;
        tmpAddress2        = oForm.addr2;
        tmpAgentBank       = oForm.agentBank1;
        tmpAgentBankNm     = oForm.agentBankNm1;

        /** 여행사 대표 명 입력확인 **/
        if(!fnCheckLength(tmpName.value, 3, 14)) {
          alert("대표자명을 정확히 입력하여 주십시요.");
          tmpName.focus();
          return;
        }

        /** 아이디 중복 확인 체크 **/
        if(!fnCheckId(tmpId.value) || !intCheckId)  return;

        /** 비밀번호 확인 체크 **/
        tmpPwdCheck = fnCheckPwd(tmpPwd1.value, tmpPwd2.value);
        if(tmpPwdCheck != 0) {
          alert(ERRORMSG);
          if(tmpPwdCheck < 0) {
            tmpPwd1.focus();
          }else {
            tmpPwd2.focus();
          }
          return;
        }

      	/** 이메일 유효성 확인 **/
      	if(!tmpEmail.value.length) {
      	  alert("E-mail을 입력해 주십시요.!");
      	  tmpEmail.focus();
      	  return;
      	}

      	if(!tmpEmail2.value.length) {
      	  alert("E-mail 뒷 자리를 선택해 주십시요.!");
      	  tmpEmail2.focus();
      	  return;
      	}

      	/** 전화번호 입력 확인 **/
      	if(!tmpPhone1.value.length) {
      	  alert("전화번호를 입력해 주십시요.!");
      	  tmpPhone1.focus();
      	  return;
      	}

      	if(!tmpPhone2.value.length) {
      	  alert("전화번호 가운데 자리를 입력해 주십시요.!");
      	  tmpPhone2.focus();
      	  return;
      	}

      	if(!tmpPhone3.value.length) {
      	  alert("전화번호 뒷 자리를 입력해 주십시요.!");
      	  tmpPhone3.focus();
      	  return;
      	}

      	/** 팩스 입력 확인 **/
      	if(!tmpFax1.value.length) {
      	  alert("팩스 번호를 입력해 주십시요.!");
      	  tmpFax1.focus();
      	  return;
      	}

      	if(!tmpFax2.value.length) {
      	  alert("팩스 가운데 번호를 입력해 주십시요.!");
      	  tmpFax2.focus();
      	  return;
      	}

      	if(!tmpFax3.value.length) {
      	  alert("팩스번호 뒷 자리를 입력해 주십시요.!");
      	  tmpFax3.focus();
      	  return;
      	}

      	/** 주소 입력 확인 **/
      	if(!tmpAddress.value.length) {
      	  fnSearchAddress('regiform');
      	  return;
      	}

      	if(!tmpAddress.value.length) {
      	  alert("주소를 입력해 주십시요.!");
      	  tmpAddress.focus();
      	  return;
      	}

       /**계좌정보 입력 확인**/
      	if(!tmpAgentBank.value.length) {
      	  alert("대표 계좌정보를 입력해 주십시요.!");
      	  tmpAgentBank.focus();
      	  return;
      	}

      	if(!tmpAgentBankNm.value.length) {
      	  alert("대표 예금주를 입력해 주십시요.!");
      	  tmpAgentBankNm.focus();
      	  return;
      	}

     document.regiform.submit()
  }

  function fnAgentModGO() {
    var oForm = eval("document.regiform");
    var tmpPwd, tmpPhone1, tmpPhone2, tmpPhone3;
    var tmpEmail, tmpEmail2;
    var tmpAgentBank, tmpAgentBankNm;

        tmpPwd             = oForm.passwd;
        tmpEmail           = oForm.mail1;
        tmpEmail2          = oForm.mail2;
        tmpPhone1          = oForm.phone1;
        tmpPhone2          = oForm.phone2;
        tmpPhone3          = oForm.phone3;
        tmpFax1            = oForm.fax1;
        tmpFax2            = oForm.fax2;
        tmpFax3            = oForm.fax3;
        tmpAgentBank       = oForm.agentBank1;
        tmpAgentBankNm     = oForm.agentBankNm1;

      	/** 이메일 유효성 확인 **/
      	if(!tmpPwd.value.length) {
      	  alert("비밀번호를 입력해 주십시요.");
      	  tmpPwd.focus();
      	  return;
      	}

      	/** 이메일 유효성 확인 **/
      	if(!tmpEmail.value.length) {
      	  alert("E-mail을 입력해 주십시요.");
      	  tmpEmail.focus();
      	  return;
      	}

      	if(!tmpEmail2.value.length) {
      	  alert("E-mail 뒷 자리를 선택해 주십시요.");
      	  tmpEmail2.focus();
      	  return;
      	}

      	/** 전화번호 입력 확인 **/
      	if(!tmpPhone1.value.length) {
      	  alert("전화번호를 입력해 주십시요.");
      	  tmpPhone1.focus();
      	  return;
      	}

      	if(!tmpPhone2.value.length) {
      	  alert("전화번호 가운데 자리를 입력해 주십시요.");
      	  tmpPhone2.focus();
      	  return;
      	}

      	if(!tmpPhone3.value.length) {
      	  alert("전화번호 뒷 자리를 입력해 주십시요.");
      	  tmpPhone3.focus();
      	  return;
      	}

      	/** 팩스 입력 확인 **/
      	if(!tmpFax1.value.length) {
      	  alert("팩스 번호를 입력해 주십시요.");
      	  tmpFax1.focus();
      	  return;
      	}

      	if(!tmpFax2.value.length) {
      	  alert("팩스 가운데 번호를 입력해 주십시요.");
      	  tmpFax2.focus();
      	  return;
      	}

      	if(!tmpFax3.value.length) {
      	  alert("팩스번호 뒷 자리를 입력해 주십시요.");
      	  tmpFax3.focus();
      	  return;
      	}

       /**계좌정보 입력 확인**/
      	if(!tmpAgentBank.value.length) {
      	  alert("대표 계좌정보를 입력해 주십시요.");
      	  tmpAgentBank.focus();
      	  return;
      	}

      	if(!tmpAgentBankNm.value.length) {
      	  alert("대표 예금주를 입력해 주십시요.");
      	  tmpAgentBankNm.focus();
      	  return;
      	}

     document.regiform.submit()
  }

// 로그인 submit 부분 시작
  function join_in()
   {
		if (!document.join.click.value) {
			alert("약관에 동의하여 주세요!");
			join.click.focus();
			return;
      }
	join.submit();
	}

  function log_in()
   {
     document.login.action = "/memberht/login_post.asp"

     	if (document.login.uid.value=="")
       	{
       		alert("아이디를 입력해 주세요")
       		document.login.uid.focus()
       		return
       	}

    	if (document.login.passwd.value=="")
       	{
       		alert("패스워드를 입력해 주세요")
       		document.login.passwd.focus()
       		return
       	}

     document.login.submit()
    }

  function fnAdminLogin()
   {
     document.AdminLogin.action = "/memberht/login_post.asp"

     	if (document.AdminLogin.uid.value=="")
       	{
       		alert("아이디를 입력해 주세요")
       		document.AdminLogin.uid.focus()
       		return
       	}

    	if (document.login.passwd.value=="")
       	{
       		alert("패스워드를 입력해 주세요")
       		document.AdminLogin.passwd.focus()
       		return
       	}

     document.AdminLogin.submit()
    }

  function log_find()
   {
    var oForm = eval("document.login_find");
    var tmpCitizenId1, tmpCitizenId2;
    var tmpKnm, tmpCitizenId, gubun;
	oForm.action = "/memberht/pop_lossid.asp";

        tmpKnm             = oForm.knm;
        tmpCitizenId1      = oForm.sCitizen1;
        tmpCitizenId2      = oForm.sCitizen2;
		gubun			   = oForm.gubun;

        /** 이름 입력 확인**/
      	if(!tmpKnm.value.length) {
      	  alert("이름을 입력해 주십시요.!");
      	  tmpKnm.focus();
      	  return;
      	}

        /** 주민등록 번호 유효성 확인 **/
      	tmpCitizenId = fnCheckCitizenId(tmpCitizenId1.value, tmpCitizenId2.value);
      	if(tmpCitizenId != 0) {
      		alert(ERRORMSG);
      		if(tmpCitizenId < 0) {
      			tmpCitizenId1.focus();
      		}else {
      			tmpCitizenId2.focus();
      		}
      		return;
      	}
	tmpKnm = encodeURIComponent(tmpKnm.value);
    var ref = "/memberht/pop_lossid.asp?gubun="+gubun.value+"&knm="+tmpKnm+"&sCitizen1="+tmpCitizenId1.value+"&sCitizen2="+tmpCitizenId2.value;

	popLayer.launcher({src:ref,width:352,height:167,name:tmpKnm.value});
	//window.open(ref);
    }

  function log_findcom()
   {
    var oForm = eval("document.login_check_mem");
    var tmpCompany1, tmpCompany2;
    var tmpKnm, tmpCompany3;
    oForm.action = "/popupht/popup_findidcom.asp"

        tmpKnm           = oForm.agentNm;
        tmpCompany1      = oForm.sCompany1;
        tmpCompany2      = oForm.sCompany2;
        tmpCompany3      = oForm.sCompany3;

        /** 이름 입력 확인**/
      	if(!tmpKnm.value.length) {
      	  alert("상호명을 입력해 주십시요.!");
      	  tmpKnm.focus();
      	  return;
      	}

        /** 사업자 번호 입력 확인**/
      	if(!tmpCompany1.value.length) {
      	  alert("사업자 번호 앞자리를 입력해 주십시요.");
      	  tmpCompany1.focus();
      	  return;
      	}

		if(!tmpCompany2.value.length) {
      	  alert("사업자번호를 입력해 주십시요.!");
      	  tmpCompany2.focus();
      	  return;
      	}

		if(!tmpCompany3.value.length) {
      	  alert("사업자번호를 입력해 주십시요.!");
      	  tmpCompany3.focus();
      	  return;
      	}	

		if(fnCheckAgentNumber()==false)
        {
  			tmpCompany1.focus()
  			return
  		}
	 
	 document.login_check_mem.submit()
    }

  function log_pwcom()
   {
    var oForm = eval("document.login_check_mem");
    var tmpCompany1, tmpCompany2;
    var tmpKnm, tmpCompany3, tmpUid;
    oForm.action = "/memberht/login_post.asp"

        tmpUid           = oForm.uid;
        tmpKnm           = oForm.agentNm;
        tmpCompany1      = oForm.sCompany1;
        tmpCompany2      = oForm.sCompany2;
        tmpCompany3      = oForm.sCompany3;

        /** 이름 입력 확인**/
      	if(!tmpUid.value.length) {
      	  alert("아이디를 입력해 주십시요.!");
      	  tmpUid.focus();
      	  return;
      	}

        /** 이름 입력 확인**/
      	if(!tmpKnm.value.length) {
      	  alert("상호명을 입력해 주십시요.!");
      	  tmpKnm.focus();
      	  return;
      	}

        /** 사업자 번호 입력 확인**/
      	if(!tmpCompany1.value.length) {
      	  alert("사업자 번호 앞자리를 입력해 주십시요.");
      	  tmpCompany1.focus();
      	  return;
      	}

		if(!tmpCompany2.value.length) {
      	  alert("사업자번호를 입력해 주십시요.!");
      	  tmpCompany2.focus();
      	  return;
      	}

		if(!tmpCompany3.value.length) {
      	  alert("사업자번호를 입력해 주십시요.!");
      	  tmpCompany3.focus();
      	  return;
      	}	

     	if(fnCheckAgentNumber()==false)
        {
  			tmpCompany1.focus()
  			return
  		}

	 document.login_check_mem.submit()
    }

  function log_pw()
   {
    var oForm = eval("document.login_pw_find");
    var tmpCitizenId1, tmpCitizenId2;
    var tmpUid, tmpKnm, tmpCitizenId;
    
        tmpUid             = oForm.uid;
        tmpKnm             = oForm.knm;
        tmpCitizenId1      = oForm.sCitizen1;
        tmpCitizenId2      = oForm.sCitizen2;

        /** 이름 입력 확인**/
      	if(!tmpUid.value.length) {
      	  alert("아이디를 입력해 주십시요.!");
      	  tmpUid.focus();
      	  return;
      	}

        /** 이름 입력 확인**/
      	if(!tmpKnm.value.length) {
      	  alert("이름을 입력해 주십시요.!");
      	  tmpKnm.focus();
      	  return;
      	}

        /** 주민등록 번호 유효성 확인 **/
      	tmpCitizenId = fnCheckCitizenId(tmpCitizenId1.value, tmpCitizenId2.value);
      	if(tmpCitizenId != 0) {
      		alert(ERRORMSG);
      		if(tmpCitizenId < 0) {
      			tmpCitizenId1.focus();
      		}else {
      			tmpCitizenId2.focus();
      		}
      		return;
      	}

 	 var ref = "/memberht/login_post.asp?mode=searchPWD&uid="+tmpUid.value+"&knm="+tmpKnm.value+"&sCitizen1="+tmpCitizenId1.value+"&sCitizen2="+tmpCitizenId2.value;
     document.location.href = ref;
    }

  function log_in_guest()
   {
     document.login_guest.action = "/memberht/login_post.asp"

        if(!document.login_guest.gEmail.value) 
          {
       			alert("메일 주소를 입력해 주세요!")
       			document.login_guest.gEmail.focus()
       			return
       		}
       	if(email_chk()==false)
          {
      			alert("이메일주소가 올바르지 않습니다.\n\n정확히 입력해주십시오!")
       			document.login_guest.gEmail.value = ''
       			document.login_guest.gEmail.focus()
       			return
       		}

    	if (document.login_guest.gHp.value=="")
       	{
       		alert("휴대폰 번호를 입력해 주세요")
       		document.login_guest.gHp.focus()
       		return
       	}

     document.login_guest.submit()
    }

  function passwd()
   {
    var oForm = eval("document.all.regiform_sub");
    var tmpPwd1, tmpPwd2, tmpOldPwd, fnCheckPwd;
    oForm.action = "/memberht/login_post.asp"

        tmpOldPwd          = oForm.old_passwd;
        tmpPwd1            = oForm.passwd;
        tmpPwd2            = oForm.passwd2;

        /** 이전 비밀번호 입력 확인**/
      	if(!tmpOldPwd.value.length) {
      	  alert("이전 비밀번호를 입력해 주십시요.!");
      	  tmpOldPwd.focus();
      	  return;
      	}

        /** 비밀번호 확인 체크 **/
        tmpPwdCheck = fnCheckPwd_sub(tmpPwd1.value, tmpPwd2.value);
        if(tmpPwdCheck != 0) {
          alert(ERRORMSG);
          if(tmpPwdCheck < 0) {
            tmpPwd1.focus();
          }else {
            tmpPwd2.focus();
          }
          return;
        }

     document.regiform_sub.submit()
    }

  function member_del()
   {
		if(confirm("정말 탈퇴하시겠습니까?\n\n회원 탈퇴를 하시면, 지금까지 예약하신 모든 호텔예약정보가 삭제됩니다."))
		{
     document.member_out.action = "/memberht/login_post.asp"

    	if (document.member_out.passwd.value=="")
       	{
       		alert("패스워드를 입력해 주세요")
       		document.member_out.passwd.focus()
       		return
       	}

     document.member_out.submit()
		}else{
    }
  }
    

  function login_check_mem()
   {
     document.login_check_mem.action = "/memberht/login_post.asp"
     if(document.login_check_mem.gubun.value=="C" || document.login_check_mem.gubun.value=="A")
     {
     	if (document.login_check_mem.knm.value=="")
       	{
       		alert("이름를 입력해 주세요")
       		document.login_check_mem.knm.focus()
       		return
       	}

    	if (document.login_check_mem.sCitizen1.value=="")
       	{
       		alert("주민등록번호를 입력해 주세요")
       		document.login_check_mem.sCitizen1.focus()
       		return
       	}

    	if (document.login_check_mem.sCitizen2.value=="")
       	{
       		alert("주민등록번호를 입력해 주세요")
       		document.login_check_mem.sCitizen2.focus()
       		return
       	}
     }else{
     	if (document.login_check_mem.agentNm.value=="")
       	{
       		alert("상호를 입력해 주세요")
       		document.login_check_mem.agentNm.focus()
       		return
       	}

    	if (document.login_check_mem.sCompany1.value=="")
       	{
       		alert("사업자번호를 입력해 주세요")
       		document.login_check_mem.sCompany1.focus()
       		return
       	}

    	if (document.login_check_mem.sCompany2.value=="")
       	{
       		alert("사업자번호를 입력해 주세요")
       		document.login_check_mem.sCompany2.focus()
       		return
       	}
    	if (document.login_check_mem.sCompany3.value=="")
       	{
       		alert("사업자번호를 입력해 주세요")
       		document.login_check_mem.sCompany3.focus()
       		return
       	}
     	if(fnCheckAgentNumber()==false)
        {
//    			alert("정확히 입력해주십시오!")
     			document.login_check_mem.sCompany1.focus()
     			return
     		}
     }
     document.login_check_mem.submit()
    }

//주민번호 체크
// modify : 2011.12.06
// author : 전태규
function login_check_mem_new()
{
   document.login_check_mem.action = "/memberht/login_post.asp"
   
   if(document.login_check_mem.gubun.value=="C" || document.login_check_mem.gubun.value=="A")
   {
      if (document.login_check_mem.knm.value=="")
      {
         alert("이름를 입력해 주세요")
         document.login_check_mem.knm.focus()
         return
      }

      if (document.login_check_mem.sCitizen1.value=="")
      {
         alert("주민등록번호를 입력해 주세요")
         document.login_check_mem.sCitizen1.focus()
         return
      }

      if (document.login_check_mem.sCitizen2.value=="")
      {
         alert("주민등록번호를 입력해 주세요")
         document.login_check_mem.sCitizen2.focus()
         return
      }

      //입력된 주민번호 로직 체크
      var jno1= document.login_check_mem.sCitizen1.value; //첫 번째 필드
      var jno2= document.login_check_mem.sCitizen2.value; //두번째 필드

      var chk = 0;
      
      //var yy  = jno1.substring(0, 2);
      //var mm  = jno1.substring(2, 4);
      //var dd  = jno2.substring(4, 6);
      //var sex = jno2.substring(0, 1);

      var yy  = parseInt(Number(jno1.substring(0, 2)));
      var mm  = parseInt(Number(jno1.substring(2, 4)));
      var dd  = parseInt(Number(jno2.substring(4, 6)));
      var sex = parseInt(Number(jno2.substring(0, 1)));      

      //if((jno1.length!=6) || (mm < 1 || mm > 12 || dd < 1 || dd > 31))
      //{
      //   alert('입력하신 주민번호의 생년월일이 유효하지 않습니다.');
      //   document.login_check_mem.sCitizen1.focus()
      //   return;
      //}
      //
      //if((jno2.length!=7) || (sex!=1 && sex!=2 && sex!=3 && sex!=4 ))
      //{
      //   alert('입력하신 주민번호의 내용이 유효하지 않습니다');
      //   document.login_check_mem.sCitizen2.focus()
      //   return;
      //}

      for(i=0; i<=5; i++) chk = chk+((i%8+2)*parseInt(jno1.substring(i, i+1)));

      for(i=6; i<=11; i++) chk = chk+((i%8+2)*parseInt(jno2.substring(i-6, i-5)));
      
      chk = (11-(chk%11))%10;
      
      if(chk!=jno2.substring(6, 7))
      {
         alert('입력하신 주민번호가 유효하지 않습니다.');
         document.login_check_mem.sCitizen1.focus()
         return;
      }      
   }
   else
   {
      if (document.login_check_mem.agentNm.value=="")
      {
         alert("상호를 입력해 주세요")
         document.login_check_mem.agentNm.focus()
         return
      }

      if (document.login_check_mem.sCompany1.value=="")
      {
         alert("사업자번호를 입력해 주세요")
         document.login_check_mem.sCompany1.focus()
         return
      }

      if (document.login_check_mem.sCompany2.value=="")
      {
         alert("사업자번호를 입력해 주세요")
         document.login_check_mem.sCompany2.focus()
         return
      }
      
      if (document.login_check_mem.sCompany3.value=="")
      {
         alert("사업자번호를 입력해 주세요")
         document.login_check_mem.sCompany3.focus()
         return
      }
    
    
      if(fnCheckAgentNumber()==false)
      {
         //alert("정확히 입력해주십시오!")
         document.login_check_mem.sCompany1.focus()
         return
     }
   }
   
   document.login_check_mem.submit()
}

// 로고등록 관련 함수
function fnLogopop()
{
	var logoUrl = document.regiform.logoUrl.value;
	//window.open("pop_uploadlogo.asp?logoUrl="+logoUrl,"Logo","width=500,height=290,status=no,scrollbars=no");
	var ref = "/memberht/pop_uploadlogo.asp?logoUrl="+logoUrl
	popLayer.launcher({src:ref,width:500,height:281});
}

function show_Logo()
{
	var filename = "frmLogo.images.value";
	var ext = Right(eval(filename),3);
	if (ext != "gif" && ext != "GIF" && ext != "jpg" && ext != "JPG" && ext != "bmp" && ext != "BMP" && ext != "tif" && ext != "TIF" && ext != "png" && ext != "PNG")
	{
		alert("이미지 파일만 업로드 해주세요");
		return;
	}
	
	var img_value=eval("frmLogo.images");
	var imgzz=eval("frmLogo.img");
	imgzz.src=img_value.value;
}

function del_Logo()
{
	var img_value=eval("frmLogo.images");
	var imgzz=eval("frmLogo.img");
	imgzz.src="";
	frmLogo.delchk.value = "Y";
}

function fnLogoIMG()
{
	document.frmLogo.submit();
}

function Allcheckgo()
{
	var f = document.frmwish;
    var nCheckedCnt = 0 ;
	if (f.allcheck.checked)
	{
		if (f.chkcnt.value == 0)
		{
			alert("선택할 관심호텔이 없습니다.");
			f.allcheck.checked = false;
			return;
		}else if (f.chkcnt.value == 1)
		{
			f.seq.checked = true;
		}else{
			for (var nIdx=0 ; nIdx < f.seq.length ; nIdx++)
			{
				f.seq[nIdx].checked = true;
			}
		}
	}else{
		if (f.chkcnt.value == 0)
		{
			alert("선택할 관심호텔이 없습니다.");
			f.allcheck.checked = false;
			return;
		}else if (f.chkcnt.value == 1)
		{
			f.seq.checked = false;
		}else{
			for (var nIdx=0 ; nIdx < f.seq.length ; nIdx++)
			{
				f.seq[nIdx].checked = false;
			}
		}
	}
}

function Deletego()
{ 
	var f = document.frmwish;
    var nCheckedCnt = 0 ;
	var parm = "";

	if (f.chkcnt.value == 0)
	{
		alert("삭제할 관심호텔이 없습니다.");
		return;
	}else if (f.chkcnt.value == 1)
	{
		if (!f.seq.checked)
		{
			alert("선택된 관심호텔이 없습니다");
			return;
		}else{
			parm = f.seq.value;
		}
	}else{
		for (var nIdx=0 ; nIdx < f.seq.length ; nIdx++)
		{
			if(f.seq[nIdx].checked)
			{
				nCheckedCnt++;
				if(!parm)
				{
					parm = f.seq[nIdx].value;
				}else{
					parm = parm + "," + f.seq[nIdx].value;
				}
			}
		}
		
		if (nCheckedCnt == 0)
		{
			alert("선택된 관심호텔이 없습니다");
			return;
		}
	}
	var rUrl = '/mypageht/process/mypage_post.asp';
	var Parms  = '?seq=' + parm;
  		Parms += '&mode=wishdelete';
	var res = dynamic.loadText(rUrl + Parms);

	if(res=="OK")
	{
		alert("관심호텔이 삭제되었습니다.");
		location.reload();
	}

}

function PopupchoiceId()
{
		if(document.login["gubun"][1].checked)
		{
			window.open('/popupht/popup_findid.asp','findid','width=500,height=265,top=0,left=0,scrollbars=no')
		} else {
			window.open('/popupht/popup_findidcom.asp','findid','width=500,height=265,top=0,left=0,scrollbars=no')
		}
}

function PopupchoicePwd()
{
		if(document.login["gubun"][1].checked)
		{
			window.open('/popupht/popup_findpw.asp','findpwd','width=500,height=300,top=0,left=0,scrollbars=no')
		} else {
			window.open('/popupht/popup_findpwcom.asp','findpwd','width=500,height=300,top=0,left=0,scrollbars=no')
		}
}

