function joinAgree(){
	f=document.joinAgreeFrm;
	if (use_biz_memebr=="Y")
	{
		if (!checkCB(document.member_type_frm.member_type,"È¸¿ø Á¾·ù¸¦"))
		{
			return;
		}
		if (document.member_type_frm.member_type[0].checked==true) mt=1;
		else mt=2;

		f.member_type.value=mt;
	}

	// º¯°æµÈ °³ÀÎÁ¤º¸º¸È£±ÔÁ¤¿¡ ÀÇÇÑ ¾÷µ¥ÀÌÆ®
	var agree = document.getElementById ("ck_agree");
	var privacy = document.getElementById ("ck_privacy");

	if (agree && privacy) { // ¼öÁ¤µÈ ÅÛÇÃ¸´¿¡¸¸ Àû¿ë
		if (agree) f.agree.value = ( agree.checked == true ) ? "Y" : "N";
		if (privacy) f.privacy.value = ( privacy.checked == true ) ? "Y" : "N";

		if (f.agree.value == "N") var msg = "¾à°ü¿¡ µ¿ÀÇÇØ ÁÖ½Ê½Ã¿À";
		if (f.privacy.value == "N") var msg = "°³ÀÎÁ¤º¸Ãë±Þ¹æÄ§¿¡ µ¿ÀÇÇØ ÁÖ½Ê½Ã¿À";
		if (msg)	{
			window.alert (msg);
			return;
		}
	}
	
	f.submit();
}


function checkID(id) {
	id.value=CheckSpace(id);
	id.value=id.value.toLowerCase();
	if (isEmpty(id.value) || !CheckType(id.value, NUM+SALPHA))
	{
		alert('¾ÆÀÌµð¸¦ °ø¹é¾øÀÌ ¿µ¹®, ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä');
		id.focus();
		return false;
	}
	if (id.value.length<4 || id.value.length>16)
	{
		alert('¾ÆÀÌµð´Â 4~16ÀÚÀÔ´Ï´Ù');
		id.focus();
		return false;
	}
	first_id=id.value.charAt(0);
	if (CheckType(first_id, NUM))
	{
		alert('¾ÆÀÌµðÀÇ Ã¹±ÛÀÚ´Â ¼ýÀÚ¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù');
		id.focus();
		return false;
	}

	return true;
}

function checkDupl(id){
	if (!id.value)
	{
		alert('¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä');
		id.focus();
		return;
	}
	if (!checkID(id)) return;
	document.frames[hid_frame].location.href=root_url+'/main/exec.php?exec_file=member/check_dupl.php&exec=1&member_id='+id.value;
}

function checkDuplNick(nick){
	if (!nick.value)
	{
		alert('´Ð³×ÀÓÀ» ÀÔ·ÂÇÏ¼¼¿ä');
		nick.focus();
		return;
	}

	document.frames[hid_frame].location.href=root_url+'/main/exec.php?exec_file=member/check_duplNick.php&exec=1&nick='+nick.value;
}

function CheckRID (sRIDFirst, sRIDLast) {
	var chk = 0;

	var nYear = sRIDFirst.substring(0,2);
	var nMondth = sRIDFirst.substring(2,4);
	var nDay = sRIDFirst.substring(4,6);

	var nSex = sRIDLast.charAt(0);

	if (!CheckType(sRIDFirst, NUM)) {
		ERRORMSG = "[ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕºÎºÐ]¿¡ Àß¸øµÈ ¹®ÀÚ°¡ ÀÖ½À´Ï´Ù.";
		return -1;
	}

	if ( sRIDFirst.length!=6 ||  nMondth<1 || nMondth>12 || nDay<1 || nDay>31) {
		ERRORMSG = "[ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕºÎºÐ]ÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.";
		return -1;
	}

	if (!CheckType(sRIDLast, NUM)) {
		ERRORMSG = "[ÁÖ¹Îµî·Ï¹øÈ£ µÞºÎºÐ]¿¡ Àß¸øµÈ ¹®ÀÚ°¡ ÀÖ½À´Ï´Ù.";
		return 1;
	}

	if ( sRIDLast.length!=7 || (nSex!=1 && nSex!=2 && nSex!=3  && nSex!=4 && nSex!=5 && nSex!=6) ) {
		ERRORMSG = "[ÁÖ¹Îµî·Ï¹øÈ£ µÞºÎºÐ]ÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.";
		return 1;
	}

	var i;

	for (i=0; i<6; i++) {
		chk += ( (i+2) * parseInt( sRIDFirst.charAt(i) ));
	}

	for (i=6; i<12; i++) {
		chk += ( (i%8+2) * parseInt( sRIDLast.charAt(i-6) ));
	}

	chk = 11 - (chk%11);
	chk %= 10;

	if (chk != parseInt( sRIDLast.charAt(6))) {
		ERRORMSG = "À¯È¿ÇÏÁö ¾ÊÀº [ÁÖ¹Îµî·Ï¹øÈ£]ÀÔ´Ï´Ù.";
		return -1;
	}

	return 0;
}

function checkBizNo(vencod) {
	var sum = 0;
	var getlist =new Array(10);
	var chkvalue =new Array("1","3","7","1","3","7","1","3","5");

	for(var i=0; i<10; i++) { getlist[i] = vencod.substring(i, i+1); }
	for(var i=0; i<9; i++) { sum += getlist[i]*chkvalue[i]; }

	sum = sum + parseInt((getlist[8]*5)/10);
	sidliy = sum % 10;
	sidchk = 0;

	if(sidliy != 0) { sidchk = 10 - sidliy; }
	else { sidchk = 0; }

	if(sidchk != getlist[9]) { return false; }

	return true;
}

function checkRegMember(f){

	if (mlv==10) {

		// ±â¾÷È¸¿ø
		if (use_biz_memebr=="Y" && member_type==2)
		{

			if(!checkBlank(f.dam,"´ã´çÀÚ ÀÌ¸§À»")) return false;
			if(!checkBlank(f.owner,"´ëÇ¥ÀÚ ÀÌ¸§À»")) return false;

			if(!checkBlank(f.name,"È¸»ç¸íÀ»")) return false;
			for (i=0; i<3; i++)
			{
				if(!checkBlank(f.biz_num[i],'»ç¾÷ÀÚ µî·Ï ¹øÈ£¸¦')) return false;
				if(!CheckType(f.biz_num[i].value, NUM)) {
					alert('»ç¾÷ÀÚ µî·Ï ¹øÈ£¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä');
					f.biz_num[i].focus();
					return false;
				}
			}
			biz_num_sum=f.biz_num[0].value+f.biz_num[1].value+f.biz_num[2].value;
			if(!checkBizNo(biz_num_sum)){
				alert('»ç¾÷ÀÚ µî·Ï ¹øÈ£°¡ Àß¸øµÇ¾ú½À´Ï´Ù');
				f.biz_num[0].focus();
				return false;
			}

			if(!checkBlank(f.biz_type1,"¾÷ÅÂ¸¦")) return false;
			if(!checkBlank(f.biz_type2,"¾÷Á¾¸¦")) return false;
		}
		else 
		{
			if(!checkBlank(f.name,"ÀÌ¸§À»")) return false;
		}

		if (!checkID(f.member_id)) return false;
		if (f.member_id_checked.value==0) {
			alert('¾ÆÀÌµð Áßº¹ Ã¼Å©¸¦ ÇÏ¼¼¿ä');
			return false;
		}

		if(!checkBlank(f.pwd[0],'ºñ¹Ð¹øÈ£¸¦')) return false;
	}

	if(typeof f.jumin1 != 'undefined' && typeof f.jumin2 != 'undefined'){ // 2007-01-04 : ÁÖ¹Î¹øÈ£ ¹ÞÁö ¾ÊÀ» °æ¿ìÀÇ´ëºñ - Han
		if(!checkBlank(f.jumin1,"ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦")) return false;
		if(!checkBlank(f.jumin2,"ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦")) return false;

		var ret = CheckRID (f.jumin1.value, f.jumin2.value);

		if ( ret != 0 ) {
			alert(ERRORMSG);
			if ( ret < 0) {
				f.jumin1.select();
			} else {
				f.jumin2.select();
			}
			return false;
		}
	}else{
		if(typeof f.sex != 'undefined'){
			if(!checkCB(f.sex,'¼ºº°À»')) return false;
		}
		if(typeof f.birth1 != 'undefined' && typeof f.birth2 != 'undefined' && typeof f.birth3 != 'undefined'){
			if(!checkBlank(f.birth1,'»ý³â¿ùÀÏ(³â)À»')) return false;
			if(!checkBlank(f.birth2,'»ý³â¿ùÀÏ(¿ù)À»')) return false;
			if(!checkBlank(f.birth3,'»ý³â¿ùÀÏ(ÀÏ)À»')) return false;
		}
	}

	if (f.pwd[0].value)
	{
		if (f.pwd[0].value.length<4)
		{
			alert('ºñ¹Ð¹øÈ£¸¦ 4ÀÚÀÌ»ó ÀÔ·ÂÇÏ¼¼¿ä');
			f.pwd[1].value='';
			f.pwd[0].focus();
			return false;
		}
		if (!CheckType(f.pwd[0].value,PASSWORD))
		{
			alert('ºñ¹Ð¹øÈ£´Â ¿µ¹®,¼ýÀÚ,Æ¯¼ö±âÈ£¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù');
			f.pwd[1].value='';
			f.pwd[0].focus();
			return false;
		}
		if(!checkBlank(f.pwd[1],'È®ÀÎ ºñ¹Ð¹øÈ£¸¦')) return false;
		if (f.pwd[0].value!=f.pwd[1].value)
		{
			alert('ºñ¹Ð¹øÈ£¿Í È®ÀÎ ºñ¹Ð¹øÈ£°¡ ´Ù¸¨´Ï´Ù');
			f.pwd[0].value=f.pwd[1].value='';
			f.pwd[0].focus();
			return false;
		}
	}

	p1=checkPhone(f.phone);
	p2=checkPhone(f.cell);
	if (nec_member_phone=='S')
	{
		if (p1!=9 && p2!=9)
		{
			alert('ÀüÈ­¹øÈ£³ª ÈÞ´ëÀüÈ­ ¹øÈ£¸¦ °ø¹é¾øÀÌ ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä');
			f.phone[p1].focus();
			f.phone[p1].select();
			return false;
		}
	}
	else
	{
		if (p1!=9)
		{
			alert('ÀüÈ­¹øÈ£¸¦ °ø¹é¾øÀÌ ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä');
			f.phone[p1].focus();
			f.phone[p1].select();
			return false;
		}
		if (p2!=9)
		{
			alert('ÈÞ´ëÀüÈ­ ¹øÈ£¸¦ °ø¹é¾øÀÌ ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä');
			f.cell[p2].focus();
			f.cell[p2].select();
			return false;
		}
	}
/*
	if(!checkBlank(f.phone[0],'ÀüÈ­¹øÈ£¸¦')) return false;
	if(!checkBlank(f.phone[1],'ÀüÈ­¹øÈ£¸¦')) return false;
	if(!checkBlank(f.phone[2],'ÀüÈ­¹øÈ£¸¦')) return false;

	if(!checkBlank(f.cell[0],'ÈÞ´ëÀüÈ­¹øÈ£¸¦')) return false;
	if(!checkBlank(f.cell[1],'ÈÞ´ëÀüÈ­¹øÈ£¸¦')) return false;
	if(!checkBlank(f.cell[2],'ÈÞ´ëÀüÈ­¹øÈ£¸¦')) return false;
*/

	if(!checkBlank(f.zip,'¿ìÆí¹øÈ£°Ë»öÀ» ´­·¯ ¿ìÆí¹øÈ£¸¦')) return false;
	if(!checkBlank(f.addr1,'¿ìÆí¹øÈ£°Ë»öÀ» ´­·¯ ÁÖ¼Ò¸¦')) return false;
	if(!checkBlank(f.addr2,'³ª¸ÓÁö ÁÖ¼Ò¸¦')) return false;

	if(!checkBlank(f.email1,'ÀÌ¸ÞÀÏ ÁÖ¼Ò¸¦')) return false;
	if (typeof f.email3!='undefined')
	{
		if(!checkSel(f.email3,"ÀÌ¸ÞÀÏ ÁÖ¼Ò¸¦")) return false;
	}	
	emails=f.email1.value+'@'+f.email2.value;
	if(CheckType(emails,EMAIL)==false || CheckMail(emails)==false) {
		alert('ÀÌ¸ÞÀÏ Çü½ÄÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù');
		f.email1.focus();
		return false;
	}


	if (total_add_info>0)
	{
		for (i=0; i<total_add_info; i++)
		{
			if (skip_add_info[i]=="Y")
			{
				continue;
			}
			tmp_obj=document.getElementById('add_info_style'+i);
			tmp=tmp_obj.value.split('::');
			if (tmp[0]=="Y")
			{
				if (tmp[1]=="radio" && !checkCB(f.elements['add_info'+i],'Ãß°¡Á¤º¸('+tmp[2]+')¸¦'))
				{
					return false;
				}
				else if (tmp[1]=="select" && !checkSel(f.elements['add_info_style'+i],'Ãß°¡Á¤º¸('+tmp[2]+')¸¦'))
				{
					return false;
				}
			}
		}
	}

	return true;
}

function checkEditStep1(f){
	if (!checkBlank(f.pwd,"ºñ¹Ð¹øÈ£¸¦")) return false;
	return true;
}


function checkFind(f,t){
	if(t>1 && !checkBlank(f.member_id,"¾ÆÀÌµð¸¦")) return false;
	if(!checkBlank(f.name,"ÀÌ¸§À»")) return false;

	if(t==1){ // 2007-01-04 : ÁÖ¹Î¹øÈ£¸¦ ¹ÞÁö ¾ÊÀ» °æ¿ì - Han
		if(typeof f.jumin1 != 'undefined' && typeof f.jumin2 != 'undefined'){
			if(!checkBlank(f.jumin1,"ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦")) return false;
			if(!checkBlank(f.jumin2,"ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦")) return false;
			var ret = CheckRID (f.jumin1.value, f.jumin2.value);

			if ( ret != 0 ) {
				alert(ERRORMSG);
				if ( ret < 0) {
					f.jumin1.select();
				} else {
					f.jumin2.select();
				}
				return false;
			}
		}else{
			if(!checkBlank(f.email,'ÀÌ¸ÞÀÏ ÁÖ¼Ò¸¦')) return false;
		}
	}
	
	if (t==2)
	{
		if(!checkBlank(f.email,'ÀÌ¸ÞÀÏ ÁÖ¼Ò¸¦')) return false;
		if(!CheckType(f.email.value,EMAIL) || !CheckMail(f.email.value)) {
			alert('ÀÌ¸ÞÀÏ Çü½ÄÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù');
			f.email.focus();
			return false;
		}
	}
	else if (t==3)
	{
		if(!checkBlank(f.cell[0],'ÈÞ´ëÀüÈ­¹øÈ£¸¦')) return false;
		if(!checkBlank(f.cell[1],'ÈÞ´ëÀüÈ­¹øÈ£¸¦')) return false;
		if(!checkBlank(f.cell[2],'ÈÞ´ëÀüÈ­¹øÈ£¸¦')) return false;
	}
}

function checkDraw(f){

	/*
	if(!checkBlank(f.jumin1,"ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦")) return false;
	if(!checkBlank(f.jumin2,"ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦")) return false;

	var ret = CheckRID (f.jumin1.value, f.jumin2.value);

	if ( ret != 0 ) {
		alert(ERRORMSG);
		if ( ret < 0) {
			f.jumin1.select();
		} else {
			f.jumin2.select();
		}
		return false;
	}
	*/

	if(!checkBlank(f.pwd,"ºñ¹Ð¹øÈ£¸¦")) return false;

	if(!checkBlank(f.content,"Å»Åð»çÀ¯¸¦")) return false;
}