<!--
function WinOpen(url, width, height, x, y) {
    window.open(url, "winz","width=" + width + ",height=" + height + ",left=" + x + ", top=" + y + ", menubar=no,scrollbars=no,toolbars=no,status=no");
}

function load(URL) {		
	window.open(URL,"","width=1010,height=660,top=10,left=10,scrollbars=yes,status=no,toolbar=no,resizable=yes");
}
/*
var newWin = null;
function load (URL) {
	if(newWin == null || newWin.closed) {
		newWin = window.open(URL,"newWinName","width=300,height=150,top=10,left=10,scrollbars=no,status=no,toolbar=no,resizable=yes");
	} else {
		newWin.location = URL;
	}
}
*/
//숫자
function onlyNumber() {
	if ((event.keyCode < 48) || (57 < event.keyCode))
		event.returnValue = false;
}

//숫자-
function onlyPhone() {
	if (((event.keyCode < 48) || (57 < event.keyCode)) && (45 != event.keyCode))
		event.returnValue = false;
}

//숫자.
function onlyDate() {
	if (((event.keyCode < 48) || (57 < event.keyCode)) && (46 != event.keyCode))
		event.returnValue = false;
}

//숫자랑 영문만인지
function isAlnum( inText ) {
	var deny_pattern = /[^(a-zA-Z0-9)]/;

	if (deny_pattern.test(inText)) {
		return false;
	}
	return true;
}

//한글만 입력받기 onKeyPress="onlyKr();"
function onlyKr() {
	if((event.keyCode < 12592) || (event.keyCode > 12687))
		event.returnValue = false;
}

//최대길이
function chkLen(obj) {
	var str = byteLeft(obj.value, obj.maxLength);
	obj.value = str;
}

//최대길이 & alert
function chkLenA(obj) {
	var i = byteLen(obj.value);
	if (i > obj.maxLength) {
		alert('영문' + obj.maxLength + '자/한글'+ Math.floor(obj.maxLength/2) + '자 이내로 작성하세요.');
		obj.focus();
		return false;
	}
}

//문자열의 바이트 길이
function byteLen(str) {
    var result = 0;
    for (var i = 0; i < str.length; i++) {
        var c = str.charAt(i);
        var enc = encodeURIComponent(c);
        result++;
        if (enc.length > 3) result++;
    }
    return result;
}

//문자열을 바이트 길이만큼 자름
function byteLeft( str , limit ) {
    var result = "";
    for (var i = 0; i < str.length; i++) {
        var c = str.charAt(i);
		if (byteLen(result+c) <= limit) {
			result = result + c;
		}
		else {
			return result;
		}
    }
    return result;
}

//이메일형식
function chkEmail(obj) { 
	if (obj.value == "") {
		return;
	}
	//re=/^[a-z]+([0-9\.\-]*_?\w+)*@([0-9_\.\-a-z]+)*(\w{1,3}|[0-9]{1,3})$/i;
	re = /[0-9a-zA-Z-_]{2,}@[0-9a-zA-Z-_]{2,}(\.[0-9a-zA-Z-_]{2,}){1,3}$/;

	if (!re.test(obj.value)) {
		alert("메일형식이 맞지 않습니다.\n 다시 입력해주세요.\n");
		obj.focus();
		obj.select();
		return false;
	}
}

//사업자번호 체크
function chkBizNo( str ) {
	var returnValue = false;
	var BCK = 0;
	if (str.length != 10) {
		return false;
	}
	else {
		BCK += parseInt(str.charAt(0)) * 1;
		BCK += parseInt(str.charAt(1)) * 3;
		BCK += parseInt(str.charAt(2)) * 7;
		BCK += parseInt(str.charAt(3)) * 1;
		BCK += parseInt(str.charAt(4)) * 3;
		BCK += parseInt(str.charAt(5)) * 7;
		BCK += parseInt(str.charAt(6)) * 1;
		BCK += parseInt(str.charAt(7)) * 3;
		BCK += parseInt(str.charAt(8)) * 5;
		BCK += Math.floor( (parseInt(str.charAt(8)) * 5) / 10 );
	}
	if (((BCK % 10) + parseInt(str.charAt(9))) % 10 == 0) {
		returnValue = true;
	}
	return returnValue;
}

//주민등록번호 체크
function chkSSN(str) {
	var sum = 0, rem = 0;

	// 문자열을 정수로 바꿔주는 내장함수 : parseInt()
	sum += parseInt(str.charAt(0)) * 2;
	sum += parseInt(str.charAt(1)) * 3;
	sum += parseInt(str.charAt(2)) * 4;
	sum += parseInt(str.charAt(3)) * 5;
	sum += parseInt(str.charAt(4)) * 6;
	sum += parseInt(str.charAt(5)) * 7;
	sum += parseInt(str.charAt(6)) * 8;
	sum += parseInt(str.charAt(7)) * 9;
	sum += parseInt(str.charAt(8)) * 2;
	sum += parseInt(str.charAt(9)) * 3;
	sum += parseInt(str.charAt(10)) * 4;
	sum += parseInt(str.charAt(11)) * 5;

	rem = sum % 11;
	rem = (11 - rem) % 10;

	if (rem == parseInt(str.charAt(12)))
		return true;
	else
		return false;
}

//왼쪽 로그인
function login() {
	if (logl.cid.value == "") {
		alert("회사 아이디를 입력하세요.");
		logl.cid.focus();
		return;
	}
	if (logl.id.value == "") {
		alert("사용자 아이디를 입력하세요.");
		logl.id.focus();
		return;
	}
	if (logl.password.value == "") {
		alert("비밀번호를 입력하세요.");
		logl.password.focus();
		return;
	}
	logl.gotoUrl.value = location.href;
	logl.action = "/home1/mypage/login_ok.jsp";
	logl.submit();
}

function ViewCalendar(num){
	switch (num) {
	case 1:
		obj = document.all.calendar1;	break;
	case 2:
		obj = document.all.calendar2;	break;
	case 3:
		obj = document.all.calendar3;	break;
	}

	if (obj.style.display == "block") {
		obj.style.display = "none";
	} else {
		obj.style.display = "block";
	}
}

function SetDateP(num, dd) {
	switch (num) {
	case 1:
		document.all.trmDpart.value=dd.replace(/-/g,"");
		break;
	case 2:
		document.all.trmChkin.value=dd.replace(/-/g,"");
		break;
	case 3:
		document.all.gtrmDpart.value=dd.replace(/-/g,"");
		break;
	}
}

function flt_search() {
	sform.searchType[0].checked = true;
	if (sform.dest.value == "") {
		alert("목적지(도시)를 입력하세요.");
		sform.dest.focus();
		return;
	}
	if (sform.trmDpart.value == "") {
		alert("출발일을 선택하세요.");
		return;
	}
	sform.submit();
}

function htl_search() {
	sform.searchType[1].checked = true;
	if (sform.city.value == "") {
		alert("투숙지(도시)를 입력하세요.");
		sform.city.focus();
		return;
	}
	if (sform.trmChkin.value == "") {
		alert("투숙일을 선택하세요.");
		return;
	}
	sform.submit();
}

function gds_search() {
	sform.searchType[2].checked = true;
	if (sform.gplace.value == "") {
		alert("대표여행지(도시)를 입력하세요.");
		sform.gplace.focus();
		return;
	}/*
	if (sform.trmDpart.value == "") {
		alert("출발일을 선택하세요.");
		return;
	}*/
	sform.submit();
}

// lost_idpw.jsp
function changeQue(str) {
	if (str == 'id'){
		//document.lostForm.userid.value='';
		//document.lostForm.email.value='';
		document.all.tre1.style.display='none';
		//document.all.tre2.style.display='block';
		document.all.tre3.style.display='block';
		document.all.tre4.style.display='none';
		document.all.tre5.style.display='block';
		document.all.tre6.style.display='none';
	} 
	if (str == 'pw') {
		//document.lostForm.userid.value='';
		//document.lostForm.email.value='';
		document.all.tre1.style.display='block';
		//document.all.tre2.style.display='none';
		document.all.tre3.style.display='none';
		document.all.tre4.style.display='block';
		document.all.tre5.style.display='block';
		document.all.tre6.style.display='none';
	}
	if (str == '00') {
		document.all.tre3.style.display='none';
		document.all.tre4.style.display='none';
		document.all.tre5.style.display='none';
		document.all.tre6.style.display='block';
	}
}

// 주소검색 팝업창
function zip() {
	var width = 602;
	var height = 400;
    var x = screen.availWidth / 2 - width / 2;
    var y = screen.availHeight / 2 - height / 2;
    window.open('/home1/mypage/zipsearch.jsp','zip','width='+width+',height='+height+',left='+x+',top='+y+',menubar=no,scrollbars=yes,status=no');
}

// 사업자 ID 팝업창
function cid() {
	var width = 420;
	var height = 200;
    var x = screen.availWidth / 2 - width / 2;
    var y = screen.availHeight / 2 - height / 2;
	if (!isAlnum(apply.t_c_id.value)) {
		alert("사업자 ID는 영문과 숫자의 조합으로 입력하세요.");
		apply.t_c_id.focus();
		return;
	}
	if (apply.t_c_id.value.length < 4) {
		alert("사업자 ID를 4~12자로 입력하세요.");
		apply.t_c_id.focus();
		return;
	}
	var textid = apply.t_c_id.value;
    window.open('/home1/mypage/cidsearch.jsp?textid='+textid,'cid','width='+width+',height='+height+',left='+x+',top='+y+',menubar=no,scrollbars=yes,status=no');
}

// 사업자등록번호 검색 팝업창
function cno() {
	var width = 420;
	var height = 200;
    var x = screen.availWidth / 2 - width / 2;
    var y = screen.availHeight / 2 - height / 2;
	if (apply.t_c_no[0].value.length < 3) {
		alert("사업자등록번호를 입력하세요.");
		apply.t_c_no[0].focus();
		return;
	}
	if (apply.t_c_no[1].value.length < 2) {
		alert("사업자등록번호를 입력하세요.");
		apply.t_c_no[1].focus();
		return;
	}
	if (apply.t_c_no[2].value.length < 5) {
		alert("사업자등록번호를 입력하세요.");
		apply.t_c_no[2].focus();
		return;
	}
	if (!chkBizNo(apply.t_c_no[0].value+apply.t_c_no[1].value+apply.t_c_no[2].value)) {
		alert("사업자등록번호가 유효하지 않습니다.");
		apply.t_c_no[0].focus();
		return;
	}
	var textno = apply.t_c_no[0].value+'-'+apply.t_c_no[1].value+'-'+apply.t_c_no[2].value;
    window.open('/home1/mypage/cnosearch.jsp?textno='+textno,'cno','width='+width+',height='+height+',left='+x+',top='+y+',menubar=no,scrollbars=yes,status=no');
}

function same() {
	apply.name.value = apply.c_president.value;
	apply.phone[0].value = apply.c_phone[0].value;
	apply.phone[1].value = apply.c_phone[1].value;
	apply.phone[2].value = apply.c_phone[2].value;
	apply.email.value = apply.c_email.value;
}

function getFileSize(path) {
	var img = new Image();
	if (path == "")	{
		return 0;
	}
	img.dynsrc = path;
	return img.fileSize;
}

function isImgFile(path){
	var arr = path.split(".");
	var idx = arr.length - 1;
	var ext = arr[idx].toLowerCase();
	if (ext == "jpg" || ext == "jpeg" || ext == "gif"){
		return true;
	}
	return false;
}

function sendit() {
	//프로그램 사용 정보
	if (!isAlnum(apply.t_c_id.value)) {
		alert("ID는 영문과 숫자의 조합으로 입력하세요.");//사업자 
		apply.t_c_id.focus();
		return;
	}
	if (apply.t_c_id.value.length < 4) {
		alert("ID를 4~12자로 입력하세요.");//사업자 
		apply.t_c_id.focus();
		return;
	}
	if (apply.t_c_id.value.charAt(0) >= "0" && apply.t_c_id.value.charAt(0) <= "9") {
		alert("ID의 첫글자는 영문으로 입력하세요.");//사업자 
		apply.t_c_id.focus();
		return;
	}
	if (apply.c_id.value != apply.t_c_id.value) {
		alert("ID 중복을 확인하세요.");//사업자 
		apply.t_c_id.focus();
		return;
	}
	if (apply.usernum.value == "") {
		alert("사용자 수를 입력하세요.");
		apply.usernum.focus();
		return;
	}
	if (parseInt(apply.usernum.value) < 1) {
		alert("사용자 수는 한 명 이상이어야 합니다.");
		apply.usernum.focus();
		return;
	}
	//사업자 정보
	if (apply.t_c_no[0].value.length < 3) {
		alert("사업자등록번호를 입력하세요.");
		apply.t_c_no[0].focus();
		return;
	}
	if (apply.t_c_no[1].value.length < 2) {
		alert("사업자등록번호를 입력하세요.");
		apply.t_c_no[1].focus();
		return;
	}
	if (apply.t_c_no[2].value.length < 5) {
		alert("사업자등록번호를 입력하세요.");
		apply.t_c_no[2].focus();
		return;
	}
	if (!chkBizNo(apply.t_c_no[0].value+apply.t_c_no[1].value+apply.t_c_no[2].value)) {
		alert("사업자등록번호가 유효하지 않습니다.");
		apply.t_c_no[0].focus();
		return;
	}
	if (apply.c_no[0].value != apply.t_c_no[0].value || apply.c_no[1].value != apply.t_c_no[1].value || apply.c_no[2].value != apply.t_c_no[2].value) {
		alert("사업자등록번호 중복을 확인하세요.");
		apply.t_c_no[0].focus();
		return;
	}
	if (apply.c_name.value == "") {
		alert("상호(법인명)를 입력하세요.");
		apply.c_name.focus();
		return;
	}
	if (apply.c_president.value == "") {
		alert("대표자를 입력하세요.");
		apply.c_president.focus();
		return;
	}
	if (apply.c_phone[0].value == "") {
		alert("대표전화번호를 입력하세요.");
		apply.c_phone[0].focus();
		return;
	}
	if (apply.c_phone[1].value == "") {
		alert("대표전화번호를 입력하세요.");
		apply.c_phone[1].focus();
		return;
	}
	if (apply.c_phone[2].value == "") {
		alert("대표전화번호를 입력하세요.");
		apply.c_phone[2].focus();
		return;
	}
	if (apply.c_email.value == "") {
		alert("E-mail을 입력하세요.");
		apply.c_email.focus();
		return;
	}
	if (apply.saler[0].checked == false && apply.saler[1].checked == false) {
		alert("사업자 구분을 선택하세요.");
		apply.saler[0].focus();
		return;
	}
	var fileSize = 0;
	if (apply.logofile.value != "") {
		if (!isImgFile(apply.logofile.value)) {
			alert("gif/jpg 화일만 업로드할 수 있습니다.");
			apply.logofile.focus();
			return;
		}
		fileSize = getFileSize(apply.logofile.value);
		if (fileSize > 524288) {
			alert('화일 크기가 500KByte 이하여야 합니다.');
			apply.logofile.focus();
			return;
		}
	}
	if (apply.sealfile.value != "") {
		if (!isImgFile(apply.sealfile.value)) {
			alert("gif/jpg 화일만 업로드할 수 있습니다.");
			apply.sealfile.focus();
			return;
		}
		fileSize = getFileSize(apply.sealfile.value);
		if (fileSize > 524288) {
			alert('화일 크기가 500KByte 이하여야 합니다.');
			apply.sealfile.focus();
			return;
		}
	}
	//사용자 정보
/*	if (!isAlnum(apply.u_id.value)) {
		alert("사용자 ID는 영문과 숫자의 조합으로 입력하세요.");
		apply.u_id.focus();
		return;
	}
	if (apply.u_id.value.length < 4) {
		alert("사용자 ID를 4~12자로 입력하세요.");
		apply.u_id.focus();
		return;
	}*/
	if (apply.u_pw.value.length < 4) {
		alert("비밀번호를 4~8자로 입력하세요.");
		apply.u_pw.focus();
		return;
	}
	if (apply.u_pw.value != apply.u_pw2.value) {
		alert("비밀번호를 확인하세요.");
		apply.u_pw2.focus();
		apply.u_pw2.select();
		return;
	}
/*	if (apply.u_pwq.value == "") {
		alert("비밀번호 분실시 힌트가 될 질문을 입력하세요.");
		apply.u_pwq.focus();
		return;
	}
	if (apply.u_pwa.value == "") {
		alert("비밀번호 분실시 힌트가 될 답변을 입력하세요.");
		apply.u_pwa.focus();
		return;
	}
	if (apply.name.value == "") {
		alert("사용자 이름을 입력하세요.");
		apply.name.focus();
		return;
	}
	if (apply.idno[0].value == "") {
		alert("주민등록번호를 입력하세요.");
		apply.idno[0].focus();
		return;
	}
	if (apply.idno[1].value == "") {
		alert("주민등록번호를 입력하세요.");
		apply.idno[1].focus();
		return;
	}
	if (!chkSSN(apply.idno[0].value+apply.idno[1].value)) {
		alert("주민등록번호가 유효하지 않습니다.");
		apply.idno[0].focus();
		return;
	}
	if (apply.phone[0].value == "") {
		alert("전화번호를 입력하세요.");
		apply.phone[0].focus();
		return;
	}
	if (apply.phone[1].value == "") {
		alert("전화번호를 입력하세요.");
		apply.phone[1].focus();
		return;
	}
	if (apply.phone[2].value == "") {
		alert("전화번호를 입력하세요.");
		apply.phone[2].focus();
		return;
	}
	if (apply.email.value == "") {
		alert("사용자의 E-mail을 입력하세요.");
		apply.email.focus();
		return;
	}
*/	if (confirm("가입 신청하시겠습니까?")) {
		apply.action = "join_ok.jsp";
		apply.submit();
	}
	else {
		return;
	}
}

//사업자 수정
function sendit2() {
	//기본 정보
/*	if (apply.db_pw.value.length < 4) {
		alert("기존 DB 비밀번호를 입력하세요.");
		apply.db_pw.focus();
		return;
	}
	if (apply.new_db_pw.value.length != "" && apply.new_db_pw.value.length < 4) {
		alert("새 비밀번호를 4~8자로 입력하세요.");
		apply.new_db_pw.focus();
		return;
	}
	if (apply.new_db_pw.value != apply.new_db_pw2.value) {
		alert("새 비밀번호를 확인하세요.");
		apply.new_db_pw2.focus();
		apply.new_db_pw2.select();
		return;
	}
*/	//사업자 정보
	if (apply.c_name.value == "") {
		alert("상호(법인명)를 입력하세요.");
		apply.c_name.focus();
		return;
	}
	if (apply.c_president.value == "") {
		alert("대표자를 입력하세요.");
		apply.c_president.focus();
		return;
	}
	if (apply.c_phone[0].value == "") {
		alert("대표전화번호를 입력하세요.");
		apply.c_phone[0].focus();
		return;
	}
	if (apply.c_phone[1].value == "") {
		alert("대표전화번호를 입력하세요.");
		apply.c_phone[1].focus();
		return;
	}
	if (apply.c_phone[2].value == "") {
		alert("대표전화번호를 입력하세요.");
		apply.c_phone[2].focus();
		return;
	}
	if (apply.c_email.value == "") {
		alert("E-mail을 입력하세요.");
		apply.c_email.focus();
		return;
	}
	if (apply.saler[0].checked == false && apply.saler[1].checked == false) {
		alert("사업자 구분을 선택하세요.");
		apply.saler[0].focus();
		return;
	}
	var fileSize = 0;
	if (apply.logofile.value != "") {
		if (!isImgFile(apply.logofile.value)) {
			alert("gif/jpg 화일만 업로드할 수 있습니다.");
			apply.logofile.focus();
			return;
		}
		fileSize = getFileSize(apply.logofile.value);
		if (fileSize > 524288) {
			alert('화일 크기가 500KByte 이하여야 합니다.');
			apply.logofile.focus();
			return;
		}
	}
	if (apply.sealfile.value != "") {
		if (!isImgFile(apply.sealfile.value)) {
			alert("gif/jpg 화일만 업로드할 수 있습니다.");
			apply.sealfile.focus();
			return;
		}
		fileSize = getFileSize(apply.sealfile.value);
		if (fileSize > 524288) {
			alert('화일 크기가 500KByte 이하여야 합니다.');
			apply.sealfile.focus();
			return;
		}
	}
	if (confirm("저장하시겠습니까?")) {
		apply.action = "c_update_ok.jsp";
		apply.submit();
	}
	else {
		return;
	}
}

//사용자 수정
function sendit3() {
	//사용자 정보
	if (apply.u_pw.value.length < 4) {
		alert("비밀번호를 입력하세요.");
		apply.u_pw.focus();
		return;
	}
	if (apply.new_u_pw.value != "" && apply.new_u_pw.value.length < 4) {
		alert("새 비밀번호를 4~8자로 입력하세요.");
		apply.new_u_pw.focus();
		return;
	}
	if (apply.new_u_pw.value != apply.new_u_pw2.value) {
		alert("새 비밀번호를 확인하세요.");
		apply.new_u_pw2.focus();
		apply.new_u_pw2.select();
		return;
	}
	if (apply.u_pwq.value == "") {
		alert("비밀번호 분실시 힌트가 될 질문을 입력하세요.");
		apply.u_pwq.focus();
		return;
	}
	if (apply.u_pwa.value == "") {
		alert("비밀번호 분실시 힌트가 될 답변을 입력하세요.");
		apply.u_pwa.focus();
		return;
	}
	if (apply.name.value == "") {
		alert("사용자 이름을 입력하세요.");
		apply.name.focus();
		return;
	}
/*	if (apply.idno[0].value == "") {
		alert("주민등록번호를 입력하세요.");
		apply.idno[0].focus();
		return;
	}
	if (apply.idno[1].value == "") {
		alert("주민등록번호를 입력하세요.");
		apply.idno[1].focus();
		return;
	}
	if (!chkSSN(apply.idno[0].value+apply.idno[1].value)) {
		alert("주민등록번호가 유효하지 않습니다.");
		apply.idno[0].focus();
		return;
	}
	if (apply.phone[0].value == "") {
		alert("전화번호를 입력하세요.");
		apply.phone[0].focus();
		return;
	}
	if (apply.phone[1].value == "") {
		alert("전화번호를 입력하세요.");
		apply.phone[1].focus();
		return;
	}
	if (apply.phone[2].value == "") {
		alert("전화번호를 입력하세요.");
		apply.phone[2].focus();
		return;
	}
	if (apply.email.value == "") {
		alert("사용자의 E-mail을 입력하세요.");
		apply.email.focus();
		return;
	}
*/	if (confirm("저장하시겠습니까?")) {
		apply.action = "u_update_ok.jsp";
		apply.submit();
	}
	else {
		return;
	}
}

// 사용자 ID 팝업창
function uid() {
	var width = 420;
	var height = 200;
    var x = screen.availWidth / 2 - width / 2;
    var y = screen.availHeight / 2 - height / 2;
	if (!isAlnum(apply.t_u_id.value)) {
		alert("사용자 ID는 영문과 숫자의 조합으로 입력하세요.");
		apply.t_u_id.focus();
		return;
	}
	if (apply.t_u_id.value.length < 4) {
		alert("사용자 ID를 4~12자로 입력하세요.");
		apply.t_u_id.focus();
		return;
	}
	if (apply.t_u_id.value.charAt(0) >= "0" && apply.t_u_id.value.charAt(0) <= "9") {
		alert("ID의 첫글자는 영문으로 입력하세요.");
		apply.t_u_id.focus();
		return;
	}
	var cid = apply.c_id.value;
	var textid = apply.t_u_id.value;
    window.open('/home1/mypage/uidsearch.jsp?cid='+cid+'&textid='+textid,'uid','width='+width+',height='+height+',left='+x+',top='+y+',menubar=no,scrollbars=yes,status=no');
}

//사용자 추가
function sendit4() {
	//사용자 정보
	if (!isAlnum(apply.t_u_id.value)) {
		alert("사용자 ID는 영문과 숫자의 조합으로 입력하세요.");
		apply.t_u_id.focus();
		return;
	}
	if (apply.t_u_id.value.length < 4) {
		alert("사용자 ID를 4~12자로 입력하세요.");
		apply.t_u_id.focus();
		return;
	}
	if (apply.t_u_id.value.charAt(0) >= "0" && apply.t_u_id.value.charAt(0) <= "9") {
		alert("ID의 첫글자는 영문으로 입력하세요.");
		apply.t_u_id.focus();
		return;
	}
	if (apply.u_id.value != apply.t_u_id.value) {
		alert("사용자 ID 중복을 확인하세요.");
		apply.t_u_id.focus();
		return;
	}
	if (apply.u_pw.value.length < 4) {
		alert("비밀번호를 입력하세요.");
		apply.u_pw.focus();
		return;
	}
	if (apply.u_pw.value != apply.u_pw2.value) {
		alert("비밀번호를 확인하세요.");
		apply.u_pw2.focus();
		apply.u_pw2.select();
		return;
	}
	if (apply.u_pwq.value == "") {
		alert("비밀번호 분실시 힌트가 될 질문을 입력하세요.");
		apply.u_pwq.focus();
		return;
	}
	if (apply.u_pwa.value == "") {
		alert("비밀번호 분실시 힌트가 될 답변을 입력하세요.");
		apply.u_pwa.focus();
		return;
	}
	if (apply.name.value == "") {
		alert("사용자 이름을 입력하세요.");
		apply.name.focus();
		return;
	}
/*	if (apply.idno[0].value == "") {
		alert("주민등록번호를 입력하세요.");
		apply.idno[0].focus();
		return;
	}
	if (apply.idno[1].value == "") {
		alert("주민등록번호를 입력하세요.");
		apply.idno[1].focus();
		return;
	}
	if (!chkSSN(apply.idno[0].value+apply.idno[1].value)) {
		alert("주민등록번호가 유효하지 않습니다.");
		apply.idno[0].focus();
		return;
	}
	if (apply.phone[0].value == "") {
		alert("전화번호를 입력하세요.");
		apply.phone[0].focus();
		return;
	}
	if (apply.phone[1].value == "") {
		alert("전화번호를 입력하세요.");
		apply.phone[1].focus();
		return;
	}
	if (apply.phone[2].value == "") {
		alert("전화번호를 입력하세요.");
		apply.phone[2].focus();
		return;
	}
	if (apply.email.value == "") {
		alert("사용자의 E-mail을 입력하세요.");
		apply.email.focus();
		return;
	}
*/	if (confirm("등록하시겠습니까?")) {
		apply.action = "u_insert_ok.jsp";
		apply.submit();
	}
	else {
		return;
	}
}

//회원사 탈퇴
function sendit5() {
	//사용자 정보
	if (apply.u_pw.value.length < 4) {
		alert("비밀번호를 입력하세요.");
		apply.u_pw.focus();
		return;
	}
	if (apply.comment.value.length < 2) {
		alert("탈퇴사유를 입력하세요.");
		apply.comment.focus();
		return;
	}
	if (confirm("탈퇴하신 후에는 데이타가 삭제되며 복구할 수 없습니다.\n탈퇴하시겠습니까?")) {
		apply.action = "c_delete_ok.jsp";
		apply.submit();
	}
	else {
		return;
	}
}

var selF = 0;
function toggleSel() {
	selF += 1;
	selF %= 2;
	if (selF == 1) {
		for (var i=0; i < document.all.selItm.length; i++) {
			document.all.selItm[i].checked = true;
		}
	}
	else {
		for (var i=0; i < document.all.selItm.length; i++) {
			document.all.selItm[i].checked = false;
		}
	}
}

function checkSelItms() {
	var num = 0;
	for (var i=1; i < document.all.selItm.length; i++) {
		if (document.all.selItm[i].disabled == false && document.all.selItm[i].checked == true)
			num++;
	}
	return num;
}

function useid( max ) {
	//var selnum = checkSelItms();
	var selnum = 0, num = 0;

	for (var i=1; i < document.all.selItm.length; i++) {
		if (document.all.selItm[i].state == "O" && document.all.selItm[i].checked == false)
			num++;
	}
	for (var i=1; i < document.all.selItm.length; i++) {
		if (document.all.selItm[i].checked == true) {
			selnum++;
		}
	}
	if (max < selnum+num) {
		alert("최대 "+max+"개의 ID를 사용할 수 있습니다.");
		return;
	}

	if (selnum > 0) {
		if (confirm("선택한 ID를 사용하시겠습니까?")) {
			apply.mode.value = "useid";
			apply.action = "u_action.jsp";
			apply.submit();
		}
	}
	else {
		alert("선택된 ID가 없습니다.");
	}
}

function notuseid() {
	var selnum = checkSelItms();
	if (selnum > 0) {
		if (confirm("선택한 ID를 사용하지 않으시겠습니까?")) {
			apply.mode.value = "notuseid";
			apply.action = "u_action.jsp";
			apply.submit();
		}
	}
	else {
		alert("선택된 ID가 없습니다.");
	}
}

function delid() {
	var selnum = checkSelItms();
	if (selnum > 0) {
		if (confirm("선택한 ID를 삭제하시겠습니까?")) {
			apply.mode.value = "delid";
			apply.action = "u_action.jsp";
			apply.submit();
		}
	}
	else {
		alert("선택된 ID가 없습니다.");
	}
}

function changeid() {
	//var selnum = checkSelItms();
	var selnum = 0, num = 0;
	for (var i=1; i < document.all.selItm.length; i++) {
		if (document.all.selItm[i].disabled == false && document.all.selItm[i].checked == true) {
			selnum++;
			if (document.all.selItm[i].state == "O")
				num++;
		}
	}
	if (selnum == 1 && num == 1) {
		if (confirm("선택한 ID를 대표사용자로 지정하시겠습니까?\n확인을 누르면 저장과 동시에 로그아웃됩니다.")) {
			apply.mode.value = "changeid";
			apply.action = "u_action.jsp";
			apply.submit();
		}
	}
	else {
		alert("하나의 유효한 ID를 선택하셔야 합니다.");
	}
}
//-->
