<?php

	include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
	include $_SERVER['DOCUMENT_ROOT'].ADMIN_PATH.'common/auth_chk.php';

	$mp = "21";	//set top nav

?>
<? include("../inc/inc_top.php") ?>
<? include("../inc/inc_header.php") ?>

<?
	$cd_dealer = $_REQUEST["cd_dealer"];
	$cd_dealer_p = $_REQUEST["cd_dealer_p"];

	$sql ="SELECT
				*
				FROM dealer_master
				WHERE cd_dealer='$cd_dealer' AND ds_delind='N'";

	$mode = "Add";

	$col=mysql_fetch_array(mysql_query($sql));
	if (!empty($col['cd_dealer'])){
		$cd_dealer = $col['cd_dealer'];
		$cd_dealerid = $col['cd_dealerid'];
		$cd_dealer_p = $col['cd_dealer_p'];
		$nm_pass = $col['nm_pass'];
		$ds_type = $col['ds_type'];
		$ds_level = $col['ds_level'];
		$nm_company = $col['nm_company'];
		$nm_name = $col['nm_name'];
		$nm_birth = $col['nm_birth'];
		$nm_tel_01 = $col['nm_tel_01'];
		$nm_tel_02 = $col['nm_tel_02'];
		$nm_tel_03 = $col['nm_tel_03'];
		$nm_hp_01 = $col['nm_hp_01'];
		$nm_hp_02 = $col['nm_hp_02'];
		$nm_hp_03 = $col['nm_hp_03'];
		$nm_fax_01 = $col['nm_fax_01'];
		$nm_fax_02 = $col['nm_fax_02'];
		$nm_fax_03 = $col['nm_fax_03'];
		$nm_email = $col['nm_email'];
		$nm_zip = $col['nm_zip'];
		$nm_addr = $col['nm_addr'];
		$nm_addr_sub = $col['nm_addr_sub'];
		$nm_etc_01 = $col['nm_etc_01'];
		$nm_etc_02 = $col['nm_etc_02'];
		$nm_etc_03 = $col['nm_etc_03'];
		$ds_status = $col['ds_status'];
		$nm_company_biz = $col['nm_company_biz'];
		$nm_name_biz = $col['nm_name_biz'];
		$nm_no_biz = $col['nm_no_biz'];
		$nm_date_biz = $col['nm_date_biz'];
		$nm_type_biz = $col['nm_type_biz'];
		$nm_condition_biz = $col['nm_condition_biz'];
		$nm_tel_biz_01 = $col['nm_tel_biz_01'];
		$nm_tel_biz_02 = $col['nm_tel_biz_02'];
		$nm_tel_biz_03 = $col['nm_tel_biz_03'];
		$nm_hp_biz_01 = $col['nm_hp_biz_01'];
		$nm_hp_biz_02 = $col['nm_hp_biz_02'];
		$nm_hp_biz_03 = $col['nm_hp_biz_03'];
		$nm_fax_biz_01 = $col['nm_fax_biz_01'];
		$nm_fax_biz_02 = $col['nm_fax_biz_02'];
		$nm_fax_biz_03 = $col['nm_fax_biz_03'];
		$nm_email_biz = $col['nm_email_biz'];
		$nm_zip_biz = $col['nm_zip_biz'];
		$nm_addr_biz = $col['nm_addr_biz'];
		$nm_addr_sub_biz = $col['nm_addr_sub_biz'];
		$nm_area = $col['nm_area'];
		$nm_title = $col['nm_title'];
		$nm_file = $col['nm_file'];
		$nm_etc = $col['nm_etc'];
		$nm_deposit = $col['nm_deposit'];
		$dt_insert = $col['dt_insert'];
		$nm_insert = $col['nm_insert'];
		$dt_update = $col['dt_update'];
		$nm_update = $col['nm_update'];
		$ds_delind = $col['ds_delind'];
/*
		$arr_nm_info1 = explode("-",$nm_info1);
		if(count($arr_nm_info1) == 3){
			$nm_info11 = $arr_nm_info1[0];
			$nm_info12 = $arr_nm_info1[1];
			$nm_info13 = $arr_nm_info1[2];
		}else{
			$nm_info11 = "";
			$nm_info12 = "";
			$nm_info13 = "";
		}

		$arr_nm_info3 = explode("@",$nm_info3);
		if(count($arr_nm_info3) == 2){
			$nm_info31 = $arr_nm_info3[0];
			$nm_info32 = $arr_nm_info3[1];
		}else{
			$nm_info31 = "";
			$nm_info32 = "";
		}
		$nm_info3 = $col[nm_info3];
*/
		$mode = "Update";
	}else{
		$ds_level = "1";
	}

?>

<section id="contents">
	<h2>딜러 회원관리</h2>
	<h3><em>▶</em> 딜러 회원등록</h3>
	<div class="tbl_wrap">
	<form id="frmMember" name="frmMember" method="post" action="dealer_proc.php" enctype="multipart/form-data">
	<input type="hidden" name="validate" id="validate" value=""/>
	<input type="hidden" name="ds_type" id="ds_type" value="D0"/>
	<input type="hidden" name="ds_level" id="ds_level" value="<?=$ds_level?>"/>
	<input type="hidden" name="cd_dealer" id="cd_dealer" value="<?=$cd_dealer?>"/>
	<input type="hidden" name="cd_dealer_p" id="cd_dealer_p" value="<?=$cd_dealer_p?>"/>
	<input type="hidden" name="mode" id="mode" value="<?=$mode?>"/>
	<!--input type="hidden" name="PageNo" id="PageNo" value="<?=$PageNo?>"/-->
	<input type="hidden" name="nm_email" id="nm_email" value="<?=$nm_email?>"/>
	<input type="hidden" name="nm_hp_01" id="nm_hp_01" value="<?=$nm_hp_01?>"/>
	<input type="hidden" name="nm_tel_01" id="nm_tel_01" value="<?=$nm_tel_01?>"/>
	<input type="hidden" name="nm_fax_01" id="nm_fax_01" value="<?=$nm_fax_01?>"/>
		<table class="tbl_list2">
			<colgroup>
				<col width="12%">
				<col width="32%">
				<col width="12%">
				<col width="*">
			</colgroup>
			<tr>
				<th>아이디</th>
				<td>
<? if ($mode == "Add"){ ?>
				<input type="text" class="inp_txt" style="width:80%;" name="cd_dealerid" id="cd_dealerid">
<? }else{ ?>
				<?=$cd_dealerid?>
<? } ?>
				</td>
				<th>비밀번호</th>
				<td><input type="password" class="inp_txt" style="width:60%;" name="nm_pass" id="nm_pass"></td>
			</tr>
			<tr>
				<th>이름</th>
				<td><input type="text" class="inp_txt" style="width:80%;" name="nm_name" id="nm_name" value="<?=$nm_name?>"></td>
				<th>핸드폰</th>
				<td>
					<span class="select2" style="margin-right:5px;width:22%;" id="sel_nm_hp_01">
						<select>
							<option value="" >선택</option>
							<option value="010" <?if($nm_hp_01=="010"){?>selected="selected"<?}?> >010</option>
							<option value="011" <?if($nm_hp_01=="011"){?>selected="selected"<?}?> >011</option>
							<option value="016" <?if($nm_hp_01=="016"){?>selected="selected"<?}?> >016</option>
							<option value="017" <?if($nm_hp_01=="017"){?>selected="selected"<?}?> >017</option>
							<option value="018" <?if($nm_hp_01=="018"){?>selected="selected"<?}?> >018</option>
							<option value="019" <?if($nm_hp_01=="019"){?>selected="selected"<?}?> >019</option>
							<option value="070" <?if($nm_hp_01=="070"){?>selected="selected"<?}?> >070</option>
						</select>
					</span>
					<input type="text" class="inp_txt" style="width:22%;" name="nm_hp_02" id="nm_hp_02" value="<?=$nm_hp_02?>"> - <input type="text" class="inp_txt" style="width:22%;" name="nm_hp_03" id="nm_hp_03" value="<?=$nm_hp_03?>">
				</td>
			</tr>
			<tr>
				<th>상호</th>
				<td><input type="text" class="inp_txt" style="width:80%;" name="nm_company" id="nm_company" value="<?=$nm_company?>"></td>
				<th>연락처</th>
				<td>
					<span class="select2" style="margin-right:5px;width:22%;" id="sel_nm_tel_01">
						<select>
							<option>선택</option>
							<option value="02"<?if($nm_tel_01=="02"){?> selected="selected"<?}?>>02</option>
							<option value="031"<?if($nm_tel_01=="031"){?> selected="selected"<?}?>>031</option>
							<option value="032"<?if($nm_tel_01=="032"){?> selected="selected"<?}?>>032</option>
							<option value="033"<?if($nm_tel_01=="033"){?> selected="selected"<?}?>>033</option>
							<option value="041"<?if($nm_tel_01=="041"){?> selected="selected"<?}?>>041</option>
							<option value="042"<?if($nm_tel_01=="042"){?> selected="selected"<?}?>>042</option>
							<option value="043"<?if($nm_tel_01=="043"){?> selected="selected"<?}?>>043</option>
							<option value="044"<?if($nm_tel_01=="044"){?> selected="selected"<?}?>>044</option>
							<option value="051"<?if($nm_tel_01=="051"){?> selected="selected"<?}?>>051</option>
							<option value="052"<?if($nm_tel_01=="052"){?> selected="selected"<?}?>>052</option>
							<option value="053"<?if($nm_tel_01=="053"){?> selected="selected"<?}?>>053</option>
							<option value="054"<?if($nm_tel_01=="054"){?> selected="selected"<?}?>>054</option>
							<option value="055"<?if($nm_tel_01=="055"){?> selected="selected"<?}?>>055</option>
							<option value="061"<?if($nm_tel_01=="061"){?> selected="selected"<?}?>>061</option>
							<option value="062"<?if($nm_tel_01=="062"){?> selected="selected"<?}?>>062</option>
							<option value="063"<?if($nm_tel_01=="063"){?> selected="selected"<?}?>>063</option>
							<option value="064"<?if($nm_tel_01=="064"){?> selected="selected"<?}?>>064</option>
						</select>
					</span>
					<input type="text" class="inp_txt" style="width:22%;" name="nm_tel_02" id="nm_tel_02" value="<?=$nm_tel_02?>"> - <input type="text" class="inp_txt" style="width:22%;" name="nm_tel_03" id="nm_tel_03" value="<?=$nm_tel_03?>">
				</td>
			</tr>
			<tr>
				<th>팩스번호</th>
				<td colspan="3">
					<span class="select2" style="margin-right:5px;width:12%;" id="sel_nm_fax_01">
						<select>
							<option value="" >선택</option>
							<option value="02"<?if($nm_fax_01=="02"){?> selected="selected"<?}?>>02</option>
							<option value="031"<?if($nm_fax_01=="031"){?> selected="selected"<?}?>>031</option>
							<option value="032"<?if($nm_fax_01=="032"){?> selected="selected"<?}?>>032</option>
							<option value="033"<?if($nm_fax_01=="033"){?> selected="selected"<?}?>>033</option>
							<option value="041"<?if($nm_fax_01=="041"){?> selected="selected"<?}?>>041</option>
							<option value="042"<?if($nm_fax_01=="042"){?> selected="selected"<?}?>>042</option>
							<option value="043"<?if($nm_fax_01=="043"){?> selected="selected"<?}?>>043</option>
							<option value="044"<?if($nm_fax_01=="044"){?> selected="selected"<?}?>>044</option>
							<option value="051"<?if($nm_fax_01=="051"){?> selected="selected"<?}?>>051</option>
							<option value="052"<?if($nm_fax_01=="052"){?> selected="selected"<?}?>>052</option>
							<option value="053"<?if($nm_fax_01=="053"){?> selected="selected"<?}?>>053</option>
							<option value="054"<?if($nm_fax_01=="054"){?> selected="selected"<?}?>>054</option>
							<option value="055"<?if($nm_fax_01=="055"){?> selected="selected"<?}?>>055</option>
							<option value="061"<?if($nm_fax_01=="061"){?> selected="selected"<?}?>>061</option>
							<option value="062"<?if($nm_fax_01=="062"){?> selected="selected"<?}?>>062</option>
							<option value="063"<?if($nm_fax_01=="063"){?> selected="selected"<?}?>>063</option>
							<option value="064"<?if($nm_fax_01=="064"){?> selected="selected"<?}?>>064</option>
						</select>
					</span>
					<input type="text" class="inp_txt" style="width:12%;" name="nm_fax_02" id="nm_fax_02" value="<?=$nm_fax_02?>"> - <input type="text" class="inp_txt" style="width:12%;" name="nm_fax_02" id="nm_fax_02" value="<?=$nm_fax_02?>">
				</td>
			</tr>
			<tr>
				<th>주소</th>
				<td colspan="3">
					<input type="text" class="inp_txt" style="margin-right:5px;width:15%;" name="nm_zip" id="nm_zip" value="<?=$nm_zip?>" readonly="readonly">
					<a href="#" class="rnd_btn ty3 gray" style="width:80px;" onClick="execDaumPostcode('');">우편번호</a>
					<p><input type="text" class="inp_txt" style="width:85%;" name="nm_addr" id="nm_addr" value="<?=$nm_addr?>" readonly="readonly"></p>
					<p><input type="text" class="inp_txt" style="width:85%;" name="nm_addr_sub" id="nm_addr_sub" value="<?=$nm_addr_sub?>"></p>
				</td>
			</tr>
			<tr>
				<th>승인상태</th>
				<td colspan="3">
					<div class="radio_chk">
						<span class="check_wrap"><input type="radio" name="ds_status" id="radio1" value="Z0"<?if($ds_status=="Z0"){?> checked="checked"<?}?>><i></i><label for="radio1">승인</label></span>
						<span class="check_wrap"><input type="radio" name="ds_status" id="radio2" value="A0"<?if($ds_status!="Z0"){?> checked="checked"<?}?>><i></i><label for="radio2">미승인</label></span>
					</div>
				</td>
			</tr>
		</table>
	</div>

	<h3><em>▶</em> 사업자 정보</h3>
	<div class="tbl_wrap">
		<table class="tbl_list2">
			<colgroup>
				<col width="12%">
				<col width="32%">
				<col width="12%">
				<col width="*">
			</colgroup>
			<tr>
				<th>상호</th>
				<td><input type="text" class="inp_txt" style="width:80%;" name="nm_company_biz" id="nm_company_biz" value="<?=$nm_company_biz?>"></td>
				<th>사업자번호</th>
				<td><input type="text" class="inp_txt" style="width:60%;" name="nm_no_biz" id="nm_no_biz" value="<?=$nm_no_biz?>"></td>
			</tr>
			<tr>
				<th>대표자명</th>
				<td><input type="text" class="inp_txt" style="width:80%;" name="nm_name_biz" id="nm_name_biz" value="<?=$nm_name_biz?>"></td>
				<th>종목</th>
				<td><input type="text" class="inp_txt" style="width:60%;" name="nm_type_biz" id="nm_type_biz" value="<?=$nm_type_biz?>"></td>
			</tr>
			<tr>
				<th>업태</th>
				<td colspan="3"><input type="text" class="inp_txt" style="width:28%;" name="nm_condition_biz" id="nm_condition_biz" value="<?=$nm_condition_biz?>"></td>
			</tr>
			<tr>
				<th>주소</th>
				<td colspan="3">
					<input type="text" class="inp_txt" style="margin-right:5px;width:15%;" name="nm_zip_biz" id="nm_zip_biz" value="<?=$nm_zip_biz?>" readonly="readonly">
					<a href="#" class="rnd_btn ty3 gray" style="width:80px;" onClick="execDaumPostcode('_biz');">우편번호</a>
					<p><input type="text" class="inp_txt" style="width:85%;" name="nm_addr_biz" id="nm_addr_biz" value="<?=$nm_addr_biz?>" readonly="readonly"></p>
					<p><input type="text" class="inp_txt" style="width:85%;" name="nm_addr_sub_biz" id="nm_addr_sub_biz" value="<?=$nm_addr_sub_biz?>"></p>
				</td>
			</tr>
		</table>
	</div>

	<div class="btn_right">
		<a href="#" class="rnd_btn ty2 gray" onclick="location.replace('<?=ADMIN_PATH?>member/dealer.php?PageNo=<?=$PageNo?>');">목록</a>
		<a href="#" class="rnd_btn ty2 black" id="btn_write">저장</a>
	</div>
</section>

<script src="http://dmaps.daum.net/map_js_init/postcode.v2.js"></script>
<script>
    function execDaumPostcode(arg) {
        new daum.Postcode({
            oncomplete: function(data) {
                // 팝업에서 검색결과 항목을 클릭했을때 실행할 코드를 작성하는 부분.

                // 각 주소의 노출 규칙에 따라 주소를 조합한다.
                // 내려오는 변수가 값이 없는 경우엔 공백('')값을 가지므로, 이를 참고하여 분기 한다.
                var fullAddr = ''; // 최종 주소 변수
                var extraAddr = ''; // 조합형 주소 변수

                // 사용자가 선택한 주소 타입에 따라 해당 주소 값을 가져온다.
                if (data.userSelectedType === 'R') { // 사용자가 도로명 주소를 선택했을 경우
                    fullAddr = data.roadAddress;

                } else {  m
                    fullAddr += (extraAddr !== '' ? ' ('+ extraAddr +')' : '');
                }

                // 우편번호와 주소 정보를 해당 필드에 넣는다.
                document.getElementById('nm_zip'+arg).value = data.zonecode; //5자리 새우편번호 사용
                document.getElementById('nm_addr'+arg).value = fullAddr;

                // 커서를 상세주소 필드로 이동한다.
                document.getElementById('nm_addr_sub'+arg).focus();
            }
        }).open();
    }
</script>

<script laguage="javascript" type="text/javascript">
    $(document).ready(function() {

        setCodeSelect("listcode","ds_area", "dealer_master","ds_area","<?=$ds_area?>","선택하세요","");
//$('select').jqTransSelectRefresh();
//		$("#sel_ds_area div.jq_sel span").html($("#sel_ds_area option:selected").text());	//select box 대신 보이는 span 에 select value의 텍스트를 setting
/*
        $("#cd_dealerid").bind("keyup",function(){
            $("#idchkresult").val("N");
        });

        $("#nm_email3").on("change", function(){
            if($(this).val() == ""){
                $("#nm_email2").show();
            }else{
                $("#nm_email2").hide();
            }
        });

        $("#btn_idchk").bind("click",function(){

			if($("#nm_email1").val() == ""){
				alert("이메일을 입력하세요.");
				$("#nm_email1").focus();
				return false;
			}

			if($("#nm_email3").val() == ""){
				if($("#nm_email2").val() == ""){
					alert("이메일을 입력하세요.");
					$("#nm_email2").focus();
					return false;
				}
				$("#nm_email").val($("#nm_email1").val()+"@"+$("#nm_email2").val());
			}else{
				$("#nm_email").val($("#nm_email1").val()+"@"+$("#nm_email3").val());
			}

            $.post("dealer_proc.php", { mode: "IdChk", nm_email: $("#nm_email").val()},function(data) {
                 if(data=="Y"){
                     if(confirm("이용가능합니다. 아이디를 사용하시겠습니까?")){
                         $("#cd_dealerid").attr("readonly",true).css("background","#d2d3d5");
                         $("#idchkresult").val("Y");
                         return;
                     }
                 }else{
                     alert("사용불가능한 아이디 입니다.");
                     $("#idchkresult").val("N");
                     return;
                 }
            });
            return false;

        });

        $("#btn_delete").bind("click",function(){
            if(confirm("삭제하시겠습니까?")){
                $("#mode").val("Delete");
                $("#frmMember").submit();
            }
        });

        $("#agree_all").bind("click",function(){
            agreeChkAll();
        });

        $("#agree_all").bind("keyup",function(){
            agreeChkAll();
        });
*/

		$("#sel_nm_hp_01 div.jq_sel ul li a").bind("click",function(){
			$("#nm_hp_01").val($("#sel_nm_hp_01 option:selected").val());
		});

		$("#sel_nm_tel_01 div.jq_sel ul li a").bind("click",function(){
			$("#nm_tel_01").val($("#sel_nm_tel_01 option:selected").val());
		});

		$("#sel_nm_fax_01 div.jq_sel ul li a").bind("click",function(){
			$("#nm_fax_01").val($("#sel_nm_fax_01 option:selected").val());
		});

		$("#btn_write").bind("click",function(){

		<? if ($mode == "Add"){ ?>
            var fieldlist = [["cd_dealerid","아이디"],["nm_pass","비밀번호"],["nm_name","이름"],["nm_hp_01","핸드폰"],["nm_hp_02","핸드폰"],["nm_hp_03","핸드폰"]]
		<? }else{ ?>
            var fieldlist = [["nm_name","이름"],["nm_hp_01","핸드폰"],["nm_hp_02","핸드폰"],["nm_hp_03","핸드폰"]]
		<? } ?>

            if (!fnCheckForm(fieldlist)){
                return false;
            }else{

                /*아이디 관련 처리*/

				var idReg1 = /[a-z]/g;
				var idReg2 = /[0-9]/g;
/*
				if( !(idReg1.test( $("#cd_dealerid").val() )) || !(idReg2.test( $("#cd_dealerid").val() )) ) {
					alert("아이디는 영문/숫자 조합으로 이루어져야 합니다.");
					$("#cd_dealerid").focus();
					return false;
				}
				var idReg = /^[a-z]+[a-z0-9]{5,19}$/g;
				if( !idReg.test( $("#cd_dealerid").val() ) ) {
					alert("아이디는 영문자로 시작하는 6~20자 영문자 또는 숫자이어야 합니다.");
                    $("#cd_dealerid").focus();
                    return false;
				}

				if(!fnCheckAlphaNumber($("#cd_dealerid").val())){
                    alert('아이디는 영문/숫자 조합으로 이루어져야 합니다.');
                    return false;
                }
                if($("#cd_dealerid").val().length <6){
                    alert("6글자 이상 아이디를 입력하세요");
                    $("#cd_dealerid").focus();
                    return false;
                }

				if($("#idchkresult").val() != "Y"){
					alert("아이디 중복확인을 해 주세요.");
					$("#idchkresult").focus();
					return false;
				}
*/
		<? if ($mode == "Add"){ ?>
				/*패스워드 처리*/
//				if($("#nm_pass").val().length == 0 || $("#nm_pass2").val().length == 0){
//					alert("패스워드를 입력하세요");
//					$("#nm_pass").focus();
//					return false;
//				}

               if($("#nm_pass").val().length > 0){
                    if($("#cd_dealerid").val()==$("#nm_pass").val()){
                        alert("아이디와 변경할 패스워드를 다르게입력하세요");
                        $("#nm_pass").focus();
                        return false;
                    }
                    if($("#nm_pass").val().length <6){
                        alert("6글자 이상 변경할 패스워드를 입력하세요");
                        $("#nm_pass").focus();
                        return false;
                    }

                    if(!isStrongValidFormPassword($("#nm_pass").val())){
                        return false;
                    }

				}
		<? } ?>

/*
                if(!ChkNum($("#nm_hp").val())){
                    alert("휴대폰 번호는 숫자만 입력하세요.");
                    $("#nm_hp").focus();
                    return false;
                }

                if($("#nm_hp_01").val() == ""){
                    alert("휴대폰 번호를 입력하세요.");
                    $("#nm_hp_01").focus();
                    return false;
                }

                if($("#nm_hp_02").val() == ""){
                    alert("휴대폰 번호를 입력하세요.");
                    $("#nm_hp_02").focus();
                    return false;
                }

                if($("#nm_hp_03").val() == ""){
                    alert("휴대폰 번호를 입력하세요.");
                    $("#nm_hp_03").focus();
                    return false;
                }
*/

/*
                $("#nm_hp").val($("#nm_hp_01").val()+"-"+$("#nm_hp_02").val()+"-"+$("#nm_hp_03").val());

                if($("#nm_email1").val() == ""){
                    alert("이메일을 입력하세요.");
                    $("#nm_email1").focus();
                    return false;
                }

                if($("#nm_email3").val() == ""){
                    if($("#nm_email2").val() == ""){
                        alert("이메일을 입력하세요.");
                        $("#nm_email2").focus();
                        return false;
                    }
                    $("#nm_email").val($("#nm_email1").val()+"@"+$("#nm_email2").val());
                }else{
                    $("#nm_email").val($("#nm_email1").val()+"@"+$("#nm_email3").val());
                }
*/

		<? if ($mode == "Add"){ ?>
//                $("#nm_email").val($("#nm_email1").val()+"@"+$("#nm_email2").val());
		<? } ?>

/*
                if($("#nm_addr").val() == ""){
                    alert("주소를 입력하세요.");
                    $("#nm_addr").focus();
                    return false;
                }

                if($("#nm_addr_sub").val() == ""){
                    alert("주소를 입력하세요.");
                    $("#nm_addr_sub").focus();
                    return false;
                }

				if(!document.getElementById("ds_agree1").checked){
					alert('[필수] 회원 이용약관에 동의해 주세요.');
                    $("#ds_agree1").focus();
					return false;
				}

				if(!document.getElementById("ds_agree2").checked){
					alert('[필수] 개인정보 수집이용 에 동의해 주세요.');
                    $("#ds_agree2").focus();
					return false;
				}
 */

				var c=confirm("정보를 등록하시겠습니까?");
                if(c){
                    $("#btn_write").hide();
                    $("#frmMember").submit();
                }else{
                    $("#btn_write").show();
                    return false;
                }
            }
        });
    });
/*
    function agreeChkAll(){
        if(document.getElementById("agree_all").checked){
            document.getElementById("ds_agree1").checked = true;
            document.getElementById("ds_agree2").checked = true;
            document.getElementById("ds_agree3").checked = true;
            document.getElementById("ds_agree4").checked = true;
        }else{
            document.getElementById("ds_agree1").checked = false;
            document.getElementById("ds_agree2").checked = false;
            document.getElementById("ds_agree3").checked = false;
            document.getElementById("ds_agree4").checked = false;
        }
    }
*/
</script>
<script language="javascript">
<!--

function sel_1(sltObj)
{
    document.getElementById("nm_email2").value = sltObj;
	if (sltObj == "")
	{
		document.getElementById("nm_email2").readOnly = false;
	}else{
		document.getElementById("nm_email2").readOnly = true;
	}

}
//-->
</script>

<? include("../inc/inc_footer.php") ?>
<? include("../inc/inc_bottom.php") ?>
<?
mysql_close($connect);
?>
