function userLogin() {
	$fn('unc-cash','userId').value = $('unc-login-user').value;
	$fn('unc-cash','userPw').value = $('unc-login-pw').value;
	Web.submit('unc-cash', {method:'post',action:'login-process.do'});
}

function login_focus() {
	Web.Form.setStyle('unc-unit');
	Web.Element.setClass('span','unc-fnt-out', 'unc-fnt-over');
	$('unc-login-user').focus();
}

function member_list_init() {
	Web.Form.setStyle('unc-unit');
	if ($('unc-member-category-list')) {
		Unc.tag.select.apply('unc-member-category-list',80,22);
	}	
}

function member_init() {
	Web.Form.setStyle('unc-unit');
	Web.Form.loadForm('unc-cash');
	
	/*
	if (Web.Form.hash['userReg_no'] == 'Y') {
		$('unc-member-regno').style.display = 'inline';	
	}
	*/
	if (Web.Form.hash['userName'] == 'Y') {
		$('unc-member-name').style.display = 'inline';	
	}
	if (Web.Form.hash['userIcon'] == 'Y') {
		$('unc-member-icon').style.display = 'inline';	
	}
	if (Web.Form.hash['userPhoto'] == 'Y') {
		$('unc-member-photo').style.display = 'inline';	
	}
	if (Web.Form.hash['userZip_cd'] == 'Y') {
		$('unc-member-zipcd').style.display = 'inline';	
	}
	if (Web.Form.hash['userAddress'] == 'Y') {
		$('unc-member-address').style.display = 'inline';	
	}
	if (Web.Form.hash['userBirth_dt'] == 'Y') {
		$('unc-member-birth').style.display = 'inline';	
	}
	if (Web.Form.hash['userWedding_dt'] == 'Y') {
		$('unc-member-wedding').style.display = 'inline';	
	}
	if (Web.Form.hash['userTel'] == 'Y') {
		$('unc-member-tel').style.display = 'inline';	
	}
	if (Web.Form.hash['userHp'] == 'Y') {
		$('unc-member-hp').style.display = 'inline';	
	}
	if (Web.Form.hash['userComment'] == 'Y') {
		$('unc-member-comment').style.display = 'inline';	
	}
	if (Web.Form.hash['userHomepage'] == 'Y') {
		$('unc-member-home').style.display = 'inline';	
	}
	if (Web.Form.hash['userHobby'] == 'Y') {
		$('unc-member-hobby').style.display = 'inline';	
	}
	if (Web.Form.hash['userSex'] == 'Y') {
		$('unc-member-sex').style.display = 'inline';	
	}
	//if (Web.Form.hash['userCafe'] == 'Y') {
		if (Web.Form.hash['userGubun_cd'] == 'B') {
			$('unc-member-cafe').style.display = 'inline';	
		}
	//}
	if (!eval(Web.Form.hash['login'])) {
		if (Web.Form.hash['userGubun'] == 'Y') {
			$('unc-member-gubun').style.display = 'inline';	
		}		
	}
	else {
		if (Web.Form.hash['userGubun_cd'] == 'A') {
			var gb = $fh('unc-unit','userGubun_cd');
			for (var i = 0; i < gb.length; i++) {
				if ('AB'.indexOf(gb[i].value) == -1) {
					$('spn_userGubun_'+gb[i].value).style.display = 'none';	
				}
			}
		}
	}

	if (Web.Form.hash['userSex'] != 'N') {
		if (Web.Form.hash['userSex_cd'] == 'M') {
			$fh('unc-unit','userSex_cd')[0].checked = true;
		}
		else if (Web.Form.hash['userSex_cd'] == 'F') {
			$fh('unc-unit','userSex_cd')[1].checked = true;
		}
	}
	
	if (eval(Web.Form.hash['login'])) {
		if (Web.Form.hash['userGubun'] != 'N' && $fh('unc-unit','userGubun_cd').length > 1) {		
			if (Web.Form.hash['userGubun_cd'] == 'A') {
				$fh('unc-unit','userGubun_cd')[0].checked = true;
			}
			else if (Web.Form.hash['userGubun_cd'] == 'B') {
				$fh('unc-unit','userGubun_cd')[1].checked = true;
			}
			else if (Web.Form.hash['userGubun_cd'] == 'C') {
				$fh('unc-unit','userGubun_cd')[2].checked = true;
			}
			else if (Web.Form.hash['userGubun_cd'] == 'D') {
				$fh('unc-unit','userGubun_cd')[3].checked = true;
			}
			else if (Web.Form.hash['userGubun_cd'] == 'E') {
				$fh('unc-unit','userGubun_cd')[4].checked = true;
			}
			else if (Web.Form.hash['userGubun_cd'] == 'Z') {
				$fh('unc-unit','userGubun_cd')[5].checked = true;
			}
		}
	}

	if (!eval(Web.Form.hash['login'])) {
		if (Web.Form.hash['userCertify'] != 'N') {
			var entr = $fn('unc-unit','userEnter');
	
			for (var i = 0; i < entr.options.length; i++) {			
				if (entr.options[i].value == Web.Form.hash['userEnter']) {				
					entr.options[i].selected = true;	
				}
			}
			
			var grdr = $fn('unc-unit','userGrader');
			for (var i = 0; i < grdr.options.length; i++) {
				if (grdr.options[i].value == Web.Form.hash['userGrader']) {
					grdr.options[i].selected = true;	
				}
			}
			
			var clsn = $fn('unc-unit','userClassNo');
			for (var i = 0; i < clsn.options.length; i++) {
				if (clsn.options[i].value == Web.Form.hash['userClassNo']) {
					clsn.options[i].selected = true;	
				}
			}
			/*
			var stdn = $fn('unc-unit','userStudentNo');
			for (var i = 0; i < stdn.options.length; i++) {
				if (stdn.options[i].value == Web.Form.hash['userStudentNo']) {
					stdn.options[i].selected = true;	
				}
			}
			*/
		}
	}
	
	if (Web.Form.hash['userCafe'] != 'N') {
		if (eval(Web.Form.hash['login']) && Web.Form.hash['userGubun_cd'] == 'B') {
			$('unc-member-cafe2').style.display = 'inline';
		}
		
		if ($fn('unc-unit','userCafe_cd')) {
			var cafe = $fn('unc-unit','userCafe_cd');
			for (var i = 0; i < cafe.options.length; i++) {
				if (cafe.options[i].value == Web.Form.hash['userCafe_cd']) {
					cafe.options[i].selected = true;	
				}
			}
		}
	}
	
	
	if (Web.Form.hash['userHobby'] != 'N') {
		var val = $fn('unc-cash','serialUserHobby').value.split(",");
		var obj = $fn('unc-unit','hobby');
		for (var i = 0; i < obj.length; i++) {
			for (var k = 0; k < val.length; k++) {
				if (obj[i].value == val[k])
					obj[i].checked = true;
			}
		}
	}

	if ($('unc-alice')) {
		Unc.alice.hash['alice'] = Web.EditorManager.instance("unc-alice",{width:565,height:350,type:'normal'});
	}
}

function changeUserGubun() {
	if ($fh('unc-unit','userGubun_cd')[1].checked) {		
		if (Web.Form.hash['userCertify'] == 'Y') {
			if ($('unc-member-certify')) $('unc-member-certify').style.display = 'inline';	
			if ($('unc-member-cafe')) $('unc-member-cafe').style.display = 'inline';
			if ($('unc-member-cafe2')) $('unc-member-cafe2').style.display = 'inline';
		}
		if ($('unc-member-std')) $('unc-member-std').style.display = 'inline';	
		if ($('unc-member-parent')) $('unc-member-parent').style.display = 'none';
	}
	else if ($fh('unc-unit','userGubun_cd')[4].checked) {
		if (Web.Form.hash['userCertify'] == 'Y') {
			if ($('unc-member-certify')) $('unc-member-certify').style.display = 'inline';	
		}
		if ($('unc-member-std')) $('unc-member-std').style.display = 'none';	
		if ($('unc-member-parent')) $('unc-member-parent').style.display = 'inline';
		if ($('unc-member-cafe')) $('unc-member-cafe').style.display = 'none';
		if ($('unc-member-cafe2')) $('unc-member-cafe2').style.display = 'none';
	}
	else {
		if ($('unc-member-std')) $('unc-member-std').style.display = 'none';	
		if ($('unc-member-parent')) $('unc-member-parent').style.display = 'none';
		if ($('unc-member-certify')) $('unc-member-certify').style.display = 'none';	
		if ($('unc-member-cafe')) $('unc-member-cafe').style.display = 'none';
		if ($('unc-member-cafe2')) $('unc-member-cafe2').style.display = 'none';
	}
}

function ableToId() {
	if (!Web.Form.validateValue($fn('unc-unit','userId'))) return;
	if (!Web.Form.validateAlphaNum($fn('unc-unit','userId'))) return;
	if (!Web.Form.validateMaxByte($fn('unc-unit','userId'))) return;
	if (!Web.Form.validateMinByte($fn('unc-unit','userId'))) return;	
	Web.Ajax.invoke({action:'ajax-member-id.do',params:'userId='+$fn('unc-unit','userId').value+'&command=ABLETOID',handler:'messageParsing'});
	$fn('unc-unit','bfUserId').value = $fn('unc-unit','userId').value;

}

function ableToNick() {
	if (Web.Form.validateValue($fn('unc-unit','userNick'))) {
		Web.Ajax.invoke({action:'ajax-member-nick.do',params:'userNick='+encodeURIComponent($fn('unc-unit','userNick').value)+'&command=ABLETONICK',handler:'messageParsing'});
	}
}

function ableToEmail() {
	if (Web.Form.validateEmail($fn('unc-unit','userEmail'))) {
		Web.Ajax.invoke({action:'ajax-member-email.do',params:'userEmail='+$fn('unc-unit','userEmail').value+'&command=ABLETOEMAIL',handler:'messageParsing'});
		$fn('unc-unit','bfUserEmail').value = $fn('unc-unit','userEmail').value;
	}
}

function ableToStudent() {
	if (Web.Form.hash['userCertify'] == 'Y') {
		if (Web.Form.hash['userGubun'] == 'Y') {
			if (!$fh('unc-unit','userGubun_cd')[0].checked &&
				!$fh('unc-unit','userGubun_cd')[1].checked &&
				!$fh('unc-unit','userGubun_cd')[2].checked &&
				!$fh('unc-unit','userGubun_cd')[3].checked &&
				!$fh('unc-unit','userGubun_cd')[4].checked &&
				!$fh('unc-unit','userGubun_cd')[5].checked) {
				Web.alert({title:'°æ°í',msg:'ÇÐ»ý±¸ºÐÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
				return;
			}
		}
		
		if ($fh('unc-unit','userGubun_cd')[1].checked) {
			if (!Web.Form.validateValue($fn('unc-unit','userName'))) return;
			if (!Web.Form.validateSelect($fn('unc-unit','userEnter'),1)) {
				Web.alert({title:'°æ°í',msg:'ÀÔÇÐ³âµµ¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
				return;
			}
			if (!Web.Form.validateSelect($fn('unc-unit','userGrader'),1)) {
				Web.alert({title:'°æ°í',msg:'ÇÐ³â ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
				return;
			}
			if (!Web.Form.validateSelect($fn('unc-unit','userClassNo'),1)) {
				Web.alert({title:'°æ°í',msg:'¹ÝÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
				return;
			}
			if (!Web.Form.validateValue($fn('unc-unit','userStudentNo'))) return;

			$fn('unc-unit','bfUserEnter').value = $fn('unc-unit','userEnter').value;
			$fn('unc-unit','bfUserGrader').value = $fn('unc-unit','userGrader').value;
			$fn('unc-unit','bfUserClassNo').value = $fn('unc-unit','userClassNo').value;
			$fn('unc-unit','bfUserStudentNo').value = $fn('unc-unit','userStudentNo').value;
			$fn('unc-unit','bfUserName').value = $fn('unc-unit','userName').value;
			Web.Ajax.invoke({action:'ajax-member-student.do',params:'userName='+encodeURIComponent($fn('unc-unit','userName').value)+'&userEnter='+$fn('unc-unit','userEnter').value+'&userGrader='+$fn('unc-unit','userGrader').value+'&userClassNo='+$fn('unc-unit','userClassNo').value+'&userStudentNo='+$fn('unc-unit','userStudentNo').value+'&command=ABLETOSTUDENT',handler:'messageParsing'});
		}
		else {
			Web.alert({title:'¾Ë¸²',msg:'ÇÐ»ý°ú ÇÐºÎ¸ð¸¸ ÀÎÁõÀýÂ÷°¡ ÇÊ¿äÇÕ´Ï´Ù'});
			return;
		}
	}	
}

function ableToStudent2() {
	
	if (Web.Form.hash['userCertify'] == 'Y') {
		if (Web.Form.hash['userGubun'] == 'Y') {
			if (!$fh('unc-unit','userGubun_cd')[0].checked &&
				!$fh('unc-unit','userGubun_cd')[1].checked) {
				Web.alert({title:'°æ°í',msg:'ÇÐ»ý±¸ºÐÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
				return;
			}
		}
		
		if ($fh('unc-unit','userGubun_cd')[1].checked) {
			if (!Web.Form.validateSelect($fn('unc-unit','userEnter'),1)) {
				Web.alert({title:'°æ°í',msg:'ÀÔÇÐ³âµµ¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
				return;
			}
			if (!Web.Form.validateSelect($fn('unc-unit','userGrader'),1)) {
				Web.alert({title:'°æ°í',msg:'ÇÐ³â ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
				return;
			}
			
			if (!Web.Form.validateSelect($fn('unc-unit','userClassNo'),1)) {
				Web.alert({title:'°æ°í',msg:'¹ÝÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
				return;
			}
			if (!Web.Form.validateValue($fn('unc-unit','userStudentNo'))) return;
			$fn('unc-unit','bfUserEnter').value = $fn('unc-unit','userEnter').value;
			$fn('unc-unit','bfUserGrader').value = $fn('unc-unit','userGrader').value;
			$fn('unc-unit','bfUserClassNo').value = $fn('unc-unit','userClassNo').value;
			$fn('unc-unit','bfUserStudentNo').value = $fn('unc-unit','userStudentNo').value;
			$fn('unc-unit','bfUserName').value = $fn('unc-unit','userName').value;
			Web.Ajax.invoke({action:'ajax-member-student.do',params:'userName='+encodeURIComponent($fn('unc-unit','userName').value)+'&userEnter='+$fn('unc-unit','userEnter').value+'&userGrader='+$fn('unc-unit','userGrader').value+'&userClassNo='+$fn('unc-unit','userClassNo').value+'&userStudentNo='+$fn('unc-unit','userStudentNo').value+'&command=ABLETOSTUDENT',handler:'messageParsing'});
		}
		else {
			Web.alert({title:'¾Ë¸²',msg:'ÇÐ»ý°ú ÇÐºÎ¸ð¸¸ ÀÎÁõÀýÂ÷°¡ ÇÊ¿äÇÕ´Ï´Ù'});
			return;
		}
	}	
}

function ableToParent() {
	if (Web.Form.hash['userCertify'] == 'Y') {
		if (Web.Form.hash['userGubun'] == 'Y') {
			if (!$fh('unc-unit','userGubun_cd')[0].checked &&
				!$fh('unc-unit','userGubun_cd')[1].checked &&
				!$fh('unc-unit','userGubun_cd')[2].checked &&
				!$fh('unc-unit','userGubun_cd')[3].checked &&
				!$fh('unc-unit','userGubun_cd')[4].checked &&
				!$fh('unc-unit','userGubun_cd')[5].checked) {
				Web.alert({title:'°æ°í',msg:'ÇÐ»ý±¸ºÐÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
				return;
			}
		}
		
		if ($fh('unc-unit','userGubun_cd')[4].checked) {
			if (!Web.Form.validateValue($fn('unc-unit','childUserId'))) return;

			$fn('unc-unit','bfChildUserId').value = $fn('unc-unit','childUserId').value;
			Web.Ajax.invoke({action:'ajax-member-parent.do',params:'childUserId='+$fn('unc-unit','childUserId').value+'&command=ABLETOPARENT',handler:'messageParsing'});
		}
		else {
			Web.alert({title:'¾Ë¸²',msg:'ÇÐ»ý°ú ÇÐºÎ¸ð¸¸ ÀÎÁõÀýÂ÷°¡ ÇÊ¿äÇÕ´Ï´Ù'});
			return;
		}
	}	
}

function setPostcd(zip,addr) {
	$fn('unc-unit','userZip1_cd').value = zip.substring(0,3);
	$fn('unc-unit','userZip2_cd').value = zip.substring(4,7);
	$fn('unc-unit','userAddress').value = addr;	
}

function fileSend(id, mode, subid){
	if (Web.Form.validateValue(id) &&
		Web.Form.validateFile(id, "gif","jpg","jpeg","pnp")) {
		$fn('unc-unit','mode').value = mode;
		$fn('unc-unit','subId').value = subid;
		Web.submit('unc-unit',{method:'post',target:'_hidden',action:'uploadManager',encoding:'multipart/form-data',resubmit:'Y'});
	}
}

function pasteImage(icon) {	
	$fn('unc-unit','userIcon').value = icon;
	$('unc-member-icon-view').style.display = 'inline';
	$('unc-user-icon').src = './'+Web.Form.hash['htmlImage']+'/icon/'+icon.substring(0,8)+'/'+icon;
}

function pastePhoto(photo) {
	$fn('unc-unit','userPhoto').value = photo;
	$('unc-member-photo-view').style.display = 'block';
	$('unc-user-photo').src = './'+Web.Form.hash['htmlImage']+'/photo/'+photo.substring(0,8)+'/'+photo;
}

function showMemberType(id) {
	$('unc-information').style.display = 'none';
	$('unc-password').style.display = 'none';
	$('unc-drop').style.display = 'none';
	$(id).style.display = 'inline';
	if (id == 'unc-information') {
		$fn('unc-unit','userPw').focus();
	}
	else if (id == 'unc-password') {
		$fn('unc-unit','currentPw').focus();
	}
	else if (id == 'unc-drop') {
		$fn('unc-unit','yourPw').focus();
	}
}

function memberPassword() {
	if (!Web.Form.validateValue($fn('unc-unit','currentPw'))) return;
	if (!Web.Form.validateValue($fn('unc-unit','newPw'))) return;
	if (!Web.Form.validateAlphaNum($fn('unc-unit','newPw'))) return;
	if (!Web.Form.validateMaxByte($fn('unc-unit','newPw'))) return;
	if (!Web.Form.validateMinByte($fn('unc-unit','newPw'))) return;
	
	if ($fn('unc-unit','newPw').value != $fn('unc-unit','newPw_confirm').value) {
		Web.alert({title:'°æ°í',msg:'ÀÔ·ÂÇÑ »õºñ¹Ð¹øÈ£¿Í ºñ¹Ð¹øÈ£ È®ÀÎ°ªÀÌ Æ²¸³³ª´Ù',focus:$fn('unc-unit','newPw')});
		return;
	}
	$fn('unc-unit','command').value = "PASSWORD";
	Web.confirm({title:'È®ÀÎ',msg:'Á¤¸» ºñ¹Ð¹øÈ£¸¦ º¯°æ ÇÏ½Ã°Ú½À´Ï±î?',fnok:function() {
		Web.submit('unc-unit',{method:'post',action:'member-join-process.do',target:'_self'});
	}});
}

function memberDrop() {
	if (!Web.Form.validateValue($fn('unc-unit','yourPw'))) return;
	$fn('unc-unit','command').value = "DELETE";
	Web.confirm({title:'È®ÀÎ',msg:'Á¤¸» Å»È¸ ÇÏ½Ã°Ú½À´Ï±î?',fnok:function() {
		Web.submit('unc-unit',{method:'post',action:'member-join-process.do',target:'_self'});
	}});
}

function memberSave() {		
	if (!eval(Web.Form.hash['login'])) {
		if (!Web.Form.validateValue($fn('unc-unit','userId'))) return;
		if (!Web.Form.validateAlphaNum($fn('unc-unit','userId'))) return;
		if (!Web.Form.validateMaxByte($fn('unc-unit','userId'))) return;
		if (!Web.Form.validateMinByte($fn('unc-unit','userId'))) return;
		if ($fn('unc-unit','userPw').value != $fn('unc-unit','userPw_confirm').value) {
			Web.alert({title:'°æ°í',msg:'ºñ¹Ð¹øÈ£¿Í ºñ¹Ð¹øÈ£È®ÀÎ °ªÀÌ Æ²¸³´Ï´Ù'});
			return;	
		}
		$fn('unc-unit','command').value = "NEW";
	} 
	else {
		$fn('unc-unit','command').value = "UPDATE";
	}
	
	$fn('unc-unit','userReg_no').value = '';
	$fn('unc-unit','userZip_cd').value = '';
	$fn('unc-unit','userBirth_dt').value = '';
	$fn('unc-unit','userWedding_dt').value = '';
	$fn('unc-unit','userHobby').value = '';
	
	if (!Web.Form.validateValue($fn('unc-unit','userPw'))) return;
	if (!Web.Form.validateAlphaNum($fn('unc-unit','userPw'))) return;
	if (!Web.Form.validateMaxByte($fn('unc-unit','userPw'))) return;
	if (!Web.Form.validateMinByte($fn('unc-unit','userPw'))) return;

	//if (!Web.Form.validateValue($fn('unc-unit','userNick'))) return;
	//if (!Web.Form.validateValue($fn('unc-unit','userPw_question'))) return;
	//if (!Web.Form.validateValue($fn('unc-unit','userPw_answer'))) return;
	if (!Web.Form.validateValue($fn('unc-unit','userEmail'))) return;

	if (!eval(Web.Form.hash['login'])) {
		if (Web.Form.hash['userReg_no'] == 'Y') {
			/*
			if (!Web.Form.validateValue($fn('unc-unit','userReg1_no'))) return;
			if (!Web.Form.validateValue($fn('unc-unit','userReg2_no'))) return;
			*/
		}

		if (Web.Form.hash['userName'] == 'Y') {
			if (!Web.Form.validateValue($fn('unc-unit','userName'))) return;
			$fn('unc-unit','userNick').value = $fn('unc-unit','userId').value;
		}
	}
	if (Web.Form.hash['userIcon'] == 'Y') {
		if (!Web.Form.validateValue($fn('unc-unit','userIcon'),'¾ÆÀÌÄÜ¿¡')) return;
	}
	if (Web.Form.hash['userPhoto'] == 'Y') {
		if (!Web.Form.validateValue($fn('unc-unit','userPhoto'),'»çÁø¿¡')) return;
	}
	if (Web.Form.hash['userZip_cd'] == 'Y') {
		if (!Web.Form.validateValue($fn('unc-unit','userZip1_cd'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userZip2_cd'))) return;
	}
	if (Web.Form.hash['userAddress'] == 'Y') {
		if (!Web.Form.validateValue($fn('unc-unit','userAddress'))) return;
	}
	if (Web.Form.hash['userBirth_dt'] == 'Y') {
		if (!Web.Form.validateValue($fn('unc-unit','userBirth1_dt'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userBirth2_dt'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userBirth3_dt'))) return;
	}
	if (Web.Form.hash['userWedding_dt'] == 'Y') {
		if (!Web.Form.validateValue($fn('unc-unit','userWedding1_dt'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userWedding2_dt'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userWedding3_dt'))) return;
	}
	if (Web.Form.hash['userTel'] == 'Y') {
		if (!Web.Form.validateValue($fn('unc-unit','userTel1'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userTel2'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userTel3'))) return;
	}
	if (Web.Form.hash['userHp'] == 'Y') {
		if (!Web.Form.validateValue($fn('unc-unit','userHp1'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userHp2'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userHp3'))) return;
	}
	if (Web.Form.hash['userHomepage'] == 'Y') {
		if (!Web.Form.validateValue($fn('unc-unit','userHomepage'))) return;
	}	
	
	if (Web.Form.hash['userComment'] != 'N') {
		var ct = Unc.alice.hash['alice'].getContent(true);
		if (Unc.alice.hash['alice'].isLimit()) {
			Web.alert({title:'°æ°í', msg:'Àâ´ãÀ» ³Ê¹« ¸¹ÀÌ ÀÛ¼ºÇÏ¼Ì½À´Ï´Ù<br>ÃÖ´ë Àâ´ã ÀÛ¼º°¡´É ±ÛÀÚ¼ö´Â <b>'+Unc.alice.hash['alice'].limit+'</b>¹ÙÀÌÆ® ÀÔ´Ï´Ù<br>ÇöÀç ÀÛ¼º ±ÛÀÚ¼ö´Â <b>'+ct.getByte()+'</b>¹ÙÀÌÆ® ÀÔ´Ï´Ù',width:400});
			return;
		}
		
		if (Web.Form.hash['userComment'] == 'Y' && (ct.empty() || ct == '<br>')) {
			Web.alert({title:'ÁÖÀÇ',msg:'Àâ´ãÀ» ÀÔ·ÂÇÏ¼¼¿ä'});			
			return;
		}
		$fn('unc-unit','userComment').value = ct;
	}
	
	if (Web.Form.hash['userSex'] == 'Y') {
		if (!$fh('unc-unit','userSex_cd')[0].checked && !$fh('unc-unit','userSex_cd')[1].checked) {
			Web.alert({title:'°æ°í',msg:'¼ºº°À» ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
			return;
		}
	}
	
	if (!eval(Web.Form.hash['login'])) {
		if ($fn('unc-unit','bfUserId').value != $fn('unc-unit','userId').value) {
			Web.alert({title:'°æ°í',msg:'<b>¾ÆÀÌµð Áßº¹Ã¼Å©ÇÏÁö ¾Ê¾Ò°Å³ª ÇöÀç ¾ÆÀÌµð°¡ Áßº¹Ã¼Å©	½Ã Çß´ø ¾ÆÀÌµð¿Í Æ²¸³´Ï´Ù<br>´Ù½Ã ¾ÆÀÌµð Áßº¹Ã¼Å©¸¦ ÇØÁÖ¼¼¿ä</b>'});
			return;
		}		
		
		if ($fn('unc-unit','bfUserEmail').value != $fn('unc-unit','userEmail').value) {
			Web.alert({title:'°æ°í',msg:'<b>ÀÌ¸ÞÀÏ Áßº¹Ã¼Å©ÇÏÁö ¾Ê¾Ò°Å³ª ÇöÀç ÀÌ¸ÞÀÏÀÌ Áßº¹Ã¼Å©	½Ã Çß´ø ÀÌ¸ÞÀÏ°ú Æ²¸³´Ï´Ù<br>´Ù½Ã ÀÌ¸ÞÀÏ Áßº¹Ã¼Å©¸¦ ÇØÁÖ¼¼¿ä</b>'});
			return;
		}
		
		if (Web.Form.hash['userGubun'] == 'Y') {
			if (!$fh('unc-unit','userGubun_cd')[0].checked &&
				!$fh('unc-unit','userGubun_cd')[1].checked &&
				!$fh('unc-unit','userGubun_cd')[2].checked &&
				!$fh('unc-unit','userGubun_cd')[3].checked &&
				!$fh('unc-unit','userGubun_cd')[4].checked &&
				!$fh('unc-unit','userGubun_cd')[5].checked) {
				Web.alert({title:'°æ°í',msg:'ÇÐ»ý±¸ºÐÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
				return;
			}
		}
		
		if (Web.Form.hash['userCertify'] == 'Y') {
			if ($fh('unc-unit','userGubun_cd')[1].checked) {
				if (!Web.Form.validateSelect($fn('unc-unit','userEnter'),1)) {
					Web.alert({title:'°æ°í',msg:'ÀÔÇÐ³âµµ¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
					return;
				}
				if (!Web.Form.validateSelect($fn('unc-unit','userGrader'),1)) {
					Web.alert({title:'°æ°í',msg:'ÇÐ³â ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
					return;
				}
				if (!Web.Form.validateSelect($fn('unc-unit','userClassNo'),1)) {
					Web.alert({title:'°æ°í',msg:'¹ÝÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
					return;
				}
				if (!Web.Form.validateValue($fn('unc-unit','userStudentNo'))) return;
				
				if (($fn('unc-unit','userName').value != $fn('unc-unit','bfUserName').value) ||
					($fn('unc-unit','userEnter').value != $fn('unc-unit','bfUserEnter').value) ||
					($fn('unc-unit','userGrader').value != $fn('unc-unit','bfUserGrader').value) ||
					($fn('unc-unit','userClassNo').value != $fn('unc-unit','bfUserClassNo').value) ||
					($fn('unc-unit','userStudentNo').value != $fn('unc-unit','bfUserStudentNo').value)) {
					Web.alert({title:'°æ°í',msg:'<b>ÇÐ»ýÀÎÁõÀ» ÇÏÁö ¾Ê¾Ò°Å³ª ÇÐ»ýÀÎÁõ Á¤º¸°¡ º¯°æµÇ¾ú½À´Ï´Ù<br>´Ù½Ã ÇÐ»ýÀÎÁõÀ» ÇØÁÖ¼¼¿ä</b>'});
					return;
				}
			}
			else if ($fh('unc-unit','userGubun_cd')[4].checked) {
				if (!Web.Form.validateValue($fn('unc-unit','childUserId'))) return;	
				if ($fn('unc-unit','bfChildUserId').value != $fn('unc-unit','childUserId').value) {
					Web.alert({title:'°æ°í',msg:'<b>ÇÐ»ý¾ÆÀÌµðÀÎÁõÀ» ÇÏÁö ¾Ê¾Ò°Å³ª ÇÐ»ý¾ÆÀÌµðÀÎÁõ Á¤º¸°¡ º¯°æµÇ¾ú½À´Ï´Ù<br>´Ù½Ã ÇÐ»ýÀÎÁõÀ» ÇØÁÖ¼¼¿ä</b>'});
					return;
				}
			}
		}
	}
	else {
		// ·Î±×ÀÎÈÄ ½ÅÀÔ»ýÀÎ°æ¿ì 
		if (Web.Form.hash['userGubun_cd'] == 'A') {
			if (Web.Form.hash['userGubun'] == 'Y') {
				if (!$fh('unc-unit','userGubun_cd')[0].checked &&
					!$fh('unc-unit','userGubun_cd')[1].checked) {
					Web.alert({title:'°æ°í',msg:'ÇÐ»ý±¸ºÐÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
					return;
				}
			}
		
			if (Web.Form.hash['userCertify'] == 'Y') {
				if ($fh('unc-unit','userGubun_cd')[1].checked) {
					if (!Web.Form.validateSelect($fn('unc-unit','userEnter'),1)) {
						Web.alert({title:'°æ°í',msg:'ÀÔÇÐ³âµµ¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
						return;
					}
					if (!Web.Form.validateSelect($fn('unc-unit','userGrader'),1)) {
						Web.alert({title:'°æ°í',msg:'ÇÐ³â ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
						return;
					}
					if (!Web.Form.validateSelect($fn('unc-unit','userClassNo'),1)) {
						Web.alert({title:'°æ°í',msg:'¹ÝÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
						return;
					}
					if (!Web.Form.validateValue($fn('unc-unit','userStudentNo'))) return;
					
					if (($fn('unc-unit','userName').value != $fn('unc-unit','bfUserName').value) ||
						($fn('unc-unit','userEnter').value != $fn('unc-unit','bfUserEnter').value) ||
						($fn('unc-unit','userGrader').value != $fn('unc-unit','bfUserGrader').value) ||
						($fn('unc-unit','userClassNo').value != $fn('unc-unit','bfUserClassNo').value) ||
						($fn('unc-unit','userStudentNo').value != $fn('unc-unit','bfUserStudentNo').value)) {
						Web.alert({title:'°æ°í',msg:'<b>ÇÐ»ýÀÎÁõÀ» ÇÏÁö ¾Ê¾Ò°Å³ª ÇÐ»ýÀÎÁõ Á¤º¸°¡ º¯°æµÇ¾ú½À´Ï´Ù<br>´Ù½Ã ÇÐ»ýÀÎÁõÀ» ÇØÁÖ¼¼¿ä</b>'});
						return;
					}
				}
			}
		}
	}
		
	//if (Web.Form.hash['userCafe'] == 'Y') {
	if (($fh('unc-unit','userGubun_cd').length > 1 &&
		$fh('unc-unit','userGubun_cd')[1].checked &&
		!Web.Form.validateSelect($fn('unc-unit','userCafe_cd'),1)) || 
		($fh('unc-unit','userGubun_cd').length == 1 && $fn('unc-unit','userGubun_cd').value == 'B') && !Web.Form.validateSelect($fn('unc-unit','userCafe_cd'),1)) 
		{
		Web.alert({title:'°æ°í',msg:'ÀçÇÐ»ýÀÎ °æ¿ì µ¿È£È¸¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
		return;
	}
	
	/*
	if (!$n('userPublic_cd')[0].checked && !$n('userPublic_cd')[1].checked && !$n('userPublic_cd')[2].checked && !$n('userPublic_cd')[3].checked) {
		Web.alert({title:'°æ°í',msg:'Á¤º¸°ø°³Áß ÃÖ¼ÒÇÑ ÇÏ³ª¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
		return;
	}
	*/
	
	if (!eval(Web.Form.hash['login'])) {
		/*
		if (Web.Form.hash['userReg_no'] != 'N' && (!$fn('unc-unit','userReg1_no').value.empty() || !$fn('unc-unit','userReg2_no').value.empty())) {
			if (!Web.Form.validateRegno($fn('unc-unit','userReg1_no'), $fn('unc-unit','userReg2_no'))) return;
		}
		*/
	}
	if (Web.Form.hash['userZip_cd'] != 'N' && (!$fn('unc-unit','userZip1_cd').value.empty() || !$fn('unc-unit','userZip2_cd').value.empty())) {
		if (!Web.Form.validateValue($fn('unc-unit','userZip1_cd'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userZip2_cd'))) return;
		if (!Web.Form.validateNum($fn('unc-unit','userZip1_cd'))) return;
		if (!Web.Form.validateNum($fn('unc-unit','userZip2_cd'))) return;
	}
	if (Web.Form.hash['userBirth_dt'] != 'N' && 
		(!$fn('unc-unit','userBirth1_dt').value.empty() || !$fn('unc-unit','userBirth2_dt').value.empty() || !$fn('unc-unit','userBirth3_dt').value.empty())) {
		if (!Web.Form.validateValue($fn('unc-unit','userBirth1_dt'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userBirth2_dt'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userBirth3_dt'))) return;
		if (!Web.Form.validateNum($fn('unc-unit','userBirth1_dt'))) return;
		if (!Web.Form.validateNum($fn('unc-unit','userBirth2_dt'))) return;
		if (!Web.Form.validateNum($fn('unc-unit','userBirth3_dt'))) return;
	}
	if (Web.Form.hash['userWedding_dt'] != 'N' && 
		(!$fn('unc-unit','userWedding1_dt').value.empty() || !$fn('unc-unit','userWedding2_dt').value.empty() || !$fn('unc-unit','userWedding3_dt').value.empty())) {
		if (!Web.Form.validateValue($fn('unc-unit','userWedding1_dt'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userWedding2_dt'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userWedding3_dt'))) return;
		if (!Web.Form.validateNum($fn('unc-unit','userWedding1_dt'))) return;
		if (!Web.Form.validateNum($fn('unc-unit','userWedding2_dt'))) return;
		if (!Web.Form.validateNum($fn('unc-unit','userWedding3_dt'))) return;
	}
	if (Web.Form.hash['userTel'] != 'N' &&
		(!$fn('unc-unit','userTel1').value.empty() || !$fn('unc-unit','userTel2').value.empty() || !$fn('unc-unit','userTel3').value.empty())) {
		if (!Web.Form.validateValue($fn('unc-unit','userTel1'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userTel2'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userTel3'))) return;
		if (!Web.Form.validateNum($fn('unc-unit','userTel1'))) return;
		if (!Web.Form.validateNum($fn('unc-unit','userTel2'))) return;
		if (!Web.Form.validateNum($fn('unc-unit','userTel3'))) return;
	}
	if (Web.Form.hash['userHp'] != 'N' &&
		(!$fn('unc-unit','userHp1').value.empty() || !$fn('unc-unit','userHp2').value.empty() || !$fn('unc-unit','userHp3').value.empty())) {
		if (!Web.Form.validateValue($fn('unc-unit','userHp1'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userHp2'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userHp3'))) return;
		if (!Web.Form.validateNum($fn('unc-unit','userHp1'))) return;
		if (!Web.Form.validateNum($fn('unc-unit','userHp2'))) return;
		if (!Web.Form.validateNum($fn('unc-unit','userHp3'))) return;
	}
	
	if (Web.Form.hash['userEmail'] != 'N' && $fn('unc-unit','userEmail').value.empty()) {
		if (!Web.Form.validateEmail($fn('unc-unit','userEmail'))) return;	
	}
	/*
	if (!eval(Web.Form.hash['login'])) {
		if (Web.Form.hash['userReg_no'] != 'N' && !$fn('unc-unit','userReg1_no').value.empty() && !$fn('unc-unit','userReg1_no').value.empty()) {
			$fn('unc-unit','userReg_no').value = $fn('unc-unit','userReg1_no').value.toString()+$fn('unc-unit','userReg2_no').value.toString();
		}
	}
	*/
	if (Web.Form.hash['userZip_cd'] != 'N' && !$fn('unc-unit','userZip1_cd').value.empty() && !$fn('unc-unit','userZip2_cd').value.empty()) {
		$fn('unc-unit','userZip_cd').value = $fn('unc-unit','userZip1_cd').value.toString()+$fn('unc-unit','userZip2_cd').value.toString();
	}
	if (Web.Form.hash['userBirth_dt'] != 'N' && !$fn('unc-unit','userBirth1_dt').value.empty() && !$fn('unc-unit','userBirth2_dt').value.empty() && !$fn('unc-unit','userBirth3_dt').value.empty()) {
		$fn('unc-unit','userBirth_dt').value = $fn('unc-unit','userBirth1_dt').value.toString()+$fn('unc-unit','userBirth2_dt').value.toString()+$fn('unc-unit','userBirth3_dt').value.toString();
	}
	if (Web.Form.hash['userWedding_dt'] != 'N' && !$fn('unc-unit','userWedding1_dt').value.empty() && !$fn('unc-unit','userWedding2_dt').value.empty() && !$fn('unc-unit','userWedding3_dt').value.empty()) {
		$fn('unc-unit','userWedding_dt').value = $fn('unc-unit','userWedding1_dt').value.toString()+$fn('unc-unit','userWedding2_dt').value.toString()+$fn('unc-unit','userWedding3_dt').value.toString();
	}
	
	if (Web.Form.hash['userHobby'] != 'N') {
		var hobbySelected = '';
		var objs = $('unc-unit');
		for (var i = 0; i < objs.elements.length; i++) {
			if (objs.elements[i].name == 'hobby' &&
				objs.elements[i].checked) {
				hobbySelected += objs.elements[i].value+',';
			}
		}
		if (Web.Form.hash['userHobby'] == 'Y' && hobbySelected == '') {
			Web.alert({title:'°æ°í',msg:'Ãë¹Ì¸¦ ÃÖ¼Ò ÇÏ³ªÀÌ»ó ¼±ÅÃÇØ ÁÖ¼¼¿ä'});
			return;
		}
		$fn('unc-unit','userHobby').value = hobbySelected;
	}

	Web.submit('unc-unit',{method:'post',action:'member-join-process.do',target:'_self',encoding:'application/x-www-form-urlencoded'});
}

function userFound_init() {
	Web.Form.setStyle('unc-unit');
	Web.Element.setClass('span','unc-fnt-out', 'unc-fnt-over');
	$fn('unc-unit','userNick').focus();	
}

function userInfoFound_init() {
	Web.Form.setStyle('unc-unit');
	Web.Element.setClass('span','unc-fnt-out', 'unc-fnt-over');
	$fn('unc-unit','userName').focus();	
}

function userPasswordFound_init() {
	Web.Form.setStyle('unc-unit');
	Web.Element.setClass('span','unc-fnt-out', 'unc-fnt-over');
	if ($('unc-login-id')) {
		$('unc-login-id').focus();
	}
	if ($('unc-login-answer')) {
		$('unc-login-answer').focus();
	}
}

function userFound() {
	userStep('step3');
}

function userPasswordFound() {
	userStep('step1');
}

function userPasswordHintFound() {
	userStep('step2');
}

function userInfoFound() {
	if($n('unc-found')[0].checked){
		// ¾ÆÀÌµðÃ£±â
		userStep('step4');
	}else if($n('unc-found')[1].checked){
		// ºñ¹Ð¹øÈ£ Ã£±â
		userStep('step1');
	}else{
		alert("¾ÆÀÌµðÃ£±â ¶Ç´Â ºñ¹Ð¹øÈ£ Ã£±â¸¦ ¼±ÅÃÇØ ÁÖ½Ê½Ã¿À.");
	}
}

function userStep(fg) {
	if (fg == 'step1') {
		if (!Web.Form.validateValue($fn('unc-unit','userId'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userEmail'))) return;
		Web.submit('unc-unit',{method:'post',action:'member-password.do?menuId=108'});
	} 
	else if (fg == 'step2') {
		if (!Web.Form.validateValue($fn('unc-unit','userPw_answer'))) return;
		Web.submit('unc-unit',{method:'post',action:'member-password.do?menuId=108'});
	} 
	else if (fg == 'step3') {
		if (!Web.Form.validateValue($fn('unc-unit','userNick'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userEmail'))) return;
		Web.submit('unc-unit',{method:'post'});
	} 
	else if (fg == 'step4') {
		if (!Web.Form.validateValue($fn('unc-unit','userName'))) return;
		if (!Web.Form.validateValue($fn('unc-unit','userEmail'))) return;
		Web.submit('unc-unit',{method:'post',action:'member-found.do?menuId=108'});
	} 
	else if (fg == 'back') {
		back();
		return;
	}
}

function memberSearch() {
	if (Web.Form.validateValue($fn('unc-unit','searchKey'))) {
		Web.submit('unc-unit',{method:'post'});	
	}
}

function viewMyMessage(addr) {
	Web.Window.popup(addr,{width:450,height:500});
}

function viewCharacter(uid, e) {
	Unc.user.loading(uid, e);
}

function writeMessage(uid) {
	Web.Window.popup('message-edit.do?receiveUserId='+uid, {width:450,height:500});
}

function viewUserArticle(uid) {
	var div = null;
	if ($("unc-user-search")) {
		div = $("unc-user-search");
	}
	else {
		div = document.createElement("div");
		div.setAttribute("id", "unc-user-search");
		document.body.appendChild(div);	
	}
		
	div.innerHTML = ""+
			"<form name=unc-temp-form>"+
				"<input type=hidden name=command value='SUMMARY'>"+
				"<input type=hidden name=searchType value='I MI'>"+
				"<input type=hidden name=thumbnailSize value=50>"+
				"<input type=hidden name=pageScale value=50>"+
				"<input type=hidden name=page value=1>"+
				"<input type=hidden name=searchOrKey value='"+uid+"'>"+
			"</form>";
		
	Web.submit('unc-temp-form',{method:'post',action:'search.do'});
}
function fncChange(obj) {
	var fnm	= obj.value;
	if(fnm == 'id'){
		schName.innerText		= "ÀÌ¸§";
		nameField.style.display	= "";
		idField.style.display	= "none";
	}else if(fnm == 'pw'){
		schName.innerText		= "ID";
		nameField.style.display	= "none";
		idField.style.display	= "";
	}
}
