function pwd_del(path,id){
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	var wide = 310;
	var high = 150;

	if(confirm('삭제하시겠습니까?')){
		if(id==""){
			var theURL="/pwd.html?flag=del";
			window.open(theURL,"pwd_D",'width='+wide+',height='+high+',scrollbars=no,resizable=yes,top=' + window_top + ',left=' + window_left + '');
		}else{
			location.href=path;
		}
	}
}


function pwd_mod(path,id){
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	var wide = 310;
	var high = 150;

	if(id==""){
		var theURL="/pwd.html?flag=mod";
		window.open(theURL,"pwd_D",'width='+wide+',height='+high+',scrollbars=no,resizable=yes,top=' + window_top + ',left=' + window_left + '');
	}else{
		location.href=path;
	}

}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
 
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

//----------------------  메뉴바 --------------------------
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


//------------------ 로그인 CHECK FORM --------------
function LoginFrm(theForm) 
{
	if (theForm.id.value == "") {
		window.alert("아이디를 입력하십시요.");
		theForm.id.focus();
		return false;
	}
	if (theForm.pwd.value == "") {
		window.alert("비밀번호를 입력하십시요.");
		theForm.pwd.focus();
		return false;
	}
	if(typeof(theForm.boan) == 'object'){
		if(theForm.boan.checked){
			var url = "https://www.kscp.net:8145/member/login.php";
			 theForm.action = url;
		}
	}
}

//----------------------- 새창 띄우기(스크롤바 유) ----------------------------
function Win_scroll(theURL,wide,high) {
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	window.open(theURL,"Newwin",'width='+wide+',height='+high+',scrollbars=yes,resizable=no,top=' + window_top + ',left=' + window_left + '');
}

//----------------------- 새창 띄우기(스크롤바 무) ----------------------------
function Win_mu(theURL,wide,high) {
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	window.open(theURL,"Newwin",'width='+wide+',height='+high+',scrollbars=no,resizable=no,top=' + window_top + ',left=' + window_left + '');
}

//----------------------- 검색 ----------------------------
function Search_send(theForm)
{
	if(theForm.keyword.value == "")
	{
		alert("검색어를 입력하세요.");
		theForm.keyword.focus();
		return false;
	}
}

//------------------ 라디오버튼 CHECK --------------
function radioCheck(oN){
	for(i=0;i<oN.length;i++){
		if(oN[i].checked){ return true; }
	}
	return false;
}

//-----------------------E-mail 주소확인----------------------------
function isEmail(str) {
  
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) 
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
  return (!r1.test(str) && r2.test(str));
}

//----------------------- 숫자 확인 ----------------------------
function Check_Num(theForm) {
	t = theForm.value ;
	for(i=0;i<t.length;i++) {
		if (t.charAt(i)<'0' || t.charAt(i)>'9') {
			alert("숫자만 입력해주세요.") ;
			theForm.value="";
			theForm.focus();
			return false ;
		}
	}
	return true; 
}

//----------------------- 숫자 확인(자리수 포함) ----------------------------
function Check_Tel(theForm,mm) {
	t = theForm.value;
	for(i=0;i<t.length;i++) {
		if (t.charAt(i)<'0' || t.charAt(i)>'9') {
			alert("숫자만 입력해주세요.") ;
			theForm.value="";
			theForm.focus() ;
			return false ;
		}
	}
	if (t.length < mm)
	{
		alert("숫자의 길이를 확인하십시요.");
		theForm.focus();
		return false;
	}
	return true;
}	

//------------------------ 우편번호검색 ----------------------------
function OpenZipcode(z,is_https){    //open zip code check win
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	zName = "/zip_check.html?zip_gubun="+z
	if( is_https ) zName += "&amp;is_https=" + is_https;
	window.open(zName,"ZipWin",'width=466,height=340,scrollbars=yes,top=' + window_top + ',left=' + window_left + '');
}

function OpenZipcode2(z){    //open zip code check win
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	zName = "/zip_check.html?zip_gubun="+z
	window.open(zName,"ZipWin2",'width=466,height=340,scrollbars=yes,top=' + window_top + ',left=' + window_left + '');
}

//------------------------ 병원검색 ----------------------------
function OpenHosp(z){
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	murl = "/hosp_search.html?field="+z
	window.open(murl,"HosWin",'width=466,height=175,scrollbars=yes,top=' + window_top + ',left=' + window_left + '');
}

//------------------------ 사진 입력 ----------------------------
function OpenPhoto(str){
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	murl = "/photo_up.html?num="+str;
	window.open(murl,"PhoWin",'width=441,height=256,top=' + window_top + ',left=' + window_left + '');
}

//------------------------ 공지사항 PopUp ----------------------------
function OpenNotify(murl){
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	window.open(murl,"NoticeWin",'width=529,height=410,scrollbars=yes,top=' + window_top + ',left=' + window_left + '');
}

//------------------------ 의료계뉴스 PopUp ----------------------------
function OpenNews(murl){
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	window.open(murl,"NewsWin",'width=529,height=410,scrollbars=yes,top=' + window_top + ',left=' + window_left + '');
}

//------------------------ 행사일정 PopUp ----------------------------
function OpenEvent(murl){
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	window.open(murl,"NewsWin",'width=529,height=410,scrollbars=yes,top=' + window_top + ',left=' + window_left + '');
}

//------------------------ 삭제 ----------------------------
function delconf(murl) 
{
	if(confirm("정말 삭제하시겠습니까?"))
	window.location = murl;
}

//---------------------- 쪽지 popup -------------
function Memo_open(myurl){
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	window.open (myurl, "memo", 'width=414, height=268,scrollbars=yes,top=' + window_top + ',left=' + window_left + '')
}

//---------------------- 쪽지 -------------
function Memo_wasteconf(murl){
	if(confirm("정말 삭제하시겠습니까?\n\n휴지통로 이동됩니다."))
	window.location = murl;
}

//---------------------- 쪽지 -------------
function Memo_delconf(murl){
	if(confirm("정말 삭제하시겠습니까?\n\n선택한 쪽지가 완전히 삭제됩니다."))
	window.location = murl;
}

//---------------------- 쪽지 -------------
function Sender_delconf(murl){
	if(confirm("쪽지를 삭제하시겠습니까?"))
	window.location = murl;
}

//----------------------- 아이디 / 패스워드 찾기 ----------------------------
function Find_Send(theForm) 
{
	if (!theForm.name.value) {
		window.alert("성명을 입력하십시요.");
		theForm.name.focus();
		return false;
	}
	if (!theForm.jumin.value) {
		window.alert("주민등록번호를 입력하십시요.");
		theForm.jumin.focus();
		return false;
	}
}


//--------------------- 파일 포맷 CHECK -------------------------
function formatChk(theForm)
{	
    var fname = theForm.value;
    sp_arry = fname.split(".");
    sp_einx = sp_arry.length - 1;
    sp_arry[sp_einx] = sp_arry[sp_einx].toLowerCase();

	return sp_arry[sp_einx];
}
//----------------------- 회원검색 ----------------------------
function User_send(theForm) 
{
	var cnt = 0;
	for( var i=0; i< theForm.elements.length; i++)
	{
		var temp = theForm.elements[i];
		if(temp.value != "")
		cnt += 1;
	}
	if (cnt == 0)
	{
		window.alert("한가지 이상의 검색조건과 검색어를 선택,입력하십시요.");
		theForm.key.focus();
		return false;
	}else{
		if(theForm.key.value != "" && !theForm.keyword.value){
			window.alert("검색어를 입력하십시요.");
			theForm.keyword.focus();
			return false;
		}
		if(theForm.keyword.value != "" && !theForm.key.value){
			window.alert("검색조건을 선택하십시요.");
			theForm.key.focus();
			return false;
		}
	}
}

function goQuiz()
{
	document.times_form.submit();
}

//------------------ 약관에 동의 --------------
function Chk_poll(theForm)
{
	if(!radioCheck(theForm.item))
	{
		alert("항목을 선택해 주십시오.");
		theForm.item[0].focus();
		return false;
	}
}

//----------------- 팝업 -------------------------
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//----------------- 퀴즈 팝업 -------------------------
function openWin(murl,msize){
	window.open(murl,"popup",msize)
}

//----------------- 검색 조건중 소속일때 selectbox로 나타내기---------
function type_list(){


}

//주민번호 유효성을 체크 -- 2003.12.23 신호정
function JuminCheck(no1,no2)
	{
		if (no1.length != 6)
		{
		   return false;
		}
		else if (no2.length != 7)
		{
		   return false;
		}
		else
		{
		   var str_serial1 = no1;
		   var str_serial2 = no2;
		   var digit=0
		   for (var i=0;i<str_serial1.length;i++){
		   	var str_dig=str_serial1.substring(i,i+1);
		   	if (str_dig<'0' || str_dig>'9'){
		   	digit=digit+1
		   }
		}
		 if ((str_serial1 == '') || ( digit != 0 ))
		 {
			return false;
		  }
		 var digit1=0
			for (var i=0;i<str_serial2.length;i++){
				var str_dig1=str_serial2.substring(i,i+1);
				 if (str_dig1<'0' || str_dig1>'9'){
					 digit1=digit1+1
					}
		 }
		 if ((str_serial2 == '') || ( digit1 != 0 ))
		 {
			return false;
		  }
		 if (str_serial1.substring(2,3) > 1)
		 {
			return false;
		  }
		 if (str_serial1.substring(4,5) > 3)
		 {
			return false;
		  }
		 if (str_serial2.substring(0,1) > 4 || str_serial2.substring(0,1) == 0)
		 {
			return false;
		  }
			var a1=str_serial1.substring(0,1)
			var a2=str_serial1.substring(1,2)
			var a3=str_serial1.substring(2,3)
			var a4=str_serial1.substring(3,4)
			var a5=str_serial1.substring(4,5)
			var a6=str_serial1.substring(5,6)
			var check_digit=a1*2+a2*3+a3*4+a4*5+a5*6+a6*7

			var b1=str_serial2.substring(0,1)
			var b2=str_serial2.substring(1,2)
			var b3=str_serial2.substring(2,3)
			var b4=str_serial2.substring(3,4)
			var b5=str_serial2.substring(4,5)
			var b6=str_serial2.substring(5,6)
			var b7=str_serial2.substring(6,7)
			var check_digit=check_digit+b1*8+b2*9+b3*2+b4*3+b5*4+b6*5

			check_digit = check_digit%11
			check_digit = 11 - check_digit
			check_digit = check_digit%10

		 if (check_digit != b7)
		 {
			return false;
		 }
		 else
		 {
			return true;
		 }
 		}
	}

//
function onCheck(theForm){

	if(theForm.id.value=="")
	{
		alert("아이디를 입력하세요!");
		theForm.id.focus();
		return false;
	}
	if(theForm.id.length<4 || theForm.id.length>8){
		alert("ID는 4자리이상 8자리이하 영문숫자조합으로 사용가능합니다.");
		theForm.id.focus();
		return false;
	}
	if(theForm.pwd.value=="")
	{
		alert("비밀번호를 입력하세요!");
		theForm.pwd.focus();
		return false;
	}
	if(theForm.pwd_re.value=="")
	{
		alert("비밀번호 확인을 입력하세요!");
		theForm.pwd_re.focus();
		return false;
	}
	if(theForm.pwd.value != theForm.pwd_re.value){
		alert("비밀번호와 확인이 일치하지 않습니다!");
		theForm.pwd_re.focus();
		return false;
	}
	if(theForm.name.value=="")
	{
		alert("이름을 입력하세요!");
		theForm.name.focus();
		return false;
	}
	if(theForm.jumin1.value=="")
	{
		alert("주민번호를 입력하세요!");
		theForm.jumin1.focus();
		return false;
	}
	if(theForm.jumin2.value=="")
	{
		alert("주민번호를 입력하세요!");
		theForm.jumin2.focus();
		return false;
	}
	//테스트를 위해 막아 놓음
	/*if(!JuminCheck(theForm.jumin1.value,theForm.jumin2.value)){
		alert("주민번호가 유효하지 않습니다!");
		theForm.jumin1.focus();
		return false;
	}
	
	//040707 요청에 의해 막아 놓음
	if (theForm.email.value=="") 
	{
		alert("E-mail을 입력하세요!");
		theForm.email.focus();
		return false;
	}
	if (!isEmail(theForm.email.value)) 
	{
		alert("E-mail이 형식에 맞지 않습니다.");
		theForm.email.value="";
		theForm.email.focus();
		return false;
	}
	*/

	if(theForm.zip1.value=="")
	{
		alert("자택 우편번호를 입력하세요!");
		return false;
	}
	if(theForm.addr.value=="")
	{
		alert("자택주소를 입력하세요!");
		theForm.addr.focus();
		return false;
	}
	/*if(theForm.of_zip1.value=="")
	{
		alert("직장 우편번호를 입력하세요!");
		return false;
	}
	if(theForm.of_addr.value=="")
	{ 
		alert("직장주소를 입력하세요!");
		theForm.of_addr.focus();
		return false;
	}*/
	if(theForm.tel.value=="")
	{
		alert("자택전화를 입력하세요!");
		theForm.tel.focus();
		return false;
	}
	
	/*
	// 040707 요청(복지관) 에 의해 막아 놓음
	if(theForm.pcs1.value=="" || theForm.pcs2.value=="" || theForm.pcs3.value=="" )
	{
		alert("휴대폰 번호를 입력하세요!");
		theForm.pcs1.focus();
		return false;
	}
	*/

	if(theForm.serve_check.checked==true){ 
		if(theForm.hope_serve.value=="")
		{
			alert("희망봉사 분류를 입력하세요!");  
			theForm.hope_serve.focus();
			return false; 
		} 
		if(theForm.serve_time.value=="")
		{
			alert("봉사가능기간을 입력하세요!");  
			theForm.serve_time.focus();
			return false; 
		} 
		if(!radioCheck(theForm.before_serve))
		{
			alert("이전 봉사여부 유무를 체크하세요!");
			theForm.before_serve[0].focus();
			return false;
		}
		if(!radioCheck(theForm.marry))
		{
			alert("결혼유무를 체크하세요!");
			theForm.marry[0].focus();
			return false;
		}
		if(theForm.religion.value=="")
		{
			alert("종교를 입력하세요!");
			theForm.religion.focus();
			return false;
		}
		if(theForm.of_tel1.value=="" || theForm.of_tel2.value=="" || theForm.of_tel3.value=="" )
		{
			alert("직장전화를 입력하세요!");
			theForm.of_tel1.focus();
			return false;
		}


	}

	//theForm.action="register_detail_ok.html";
	return true;
}

//가입중 봉사관련 입력부분 사라지고 나타나는 function
function bongsa(rform){
	if(rform.serve_check.checked==true){
		document.all.hs.style.display = "block";
		document.all.st.style.display = "block";
		document.all.ar.style.display = "block";
		document.all.bs.style.display = "block";
		document.all.etc1.style.display = "block";
		document.all.etc2.style.display = "block";
		document.all.etc3.style.display = "block";
		document.all.etc4.style.display = "block";
		document.all.etc5.style.display = "block";
		document.all.etc6.style.display = "block";
		rform.serve_check.value="Y";
	}else{
		document.all.hs.style.display = "none";
		document.all.st.style.display = "none";
		document.all.ar.style.display = "none";
		document.all.bs.style.display = "none";
		document.all.etc1.style.display = "none";
		document.all.etc2.style.display = "none";
		document.all.etc3.style.display = "none";
		document.all.etc4.style.display = "none";
		document.all.etc5.style.display = "none";
		document.all.etc6.style.display = "none";
		rform.serve_check.value="N";
	}
}

//
function idCheck(rform){
	if(rform.id.value==""){
		alert("ID를 입력하세요~!");
		rform.id.focus();
		return ;
	}else{
		if(rform.id.value.length<4 || rform.id.value.length>8){
			alert("ID는 4자리이상 8자리이하 영문숫자조합으로 사용가능합니다.");
			rform.id.focus();
			return;
		}else{
			Win_scroll('/id_check.php?id='+rform.id.value,380,300);
		}
	}
}

function mas_Frm(theForm){

	if(theForm.donot_enter.value=="N"){
		alert("업로드 중입니다.한번만 누르세요!");
		return false;
	}

	if(theForm.name.value=="")
	{
		alert("후원자의 성함을 입력하세요!");
		theForm.name.focus();
		return false;
	}
	if(theForm.jumin_num1.value=="")
	{
		alert("주민등록번호를 입력하세요!");
		return false;
	}
	if(theForm.jumin_num2.value=="")
	{
		alert("주민등록번호를 입력하세요!");
		return false;
	}
	/*
	if(theForm.zip1.value=="")
	{
		alert("우편번호를 입력하세요!");
		return false;
	}
	if(theForm.addr.value=="")
	{
		alert("주소를 입력하세요!");
		theForm.addr.focus();
		return false;
	}
	*/
	if(theForm.hp.value=="")
	{
		alert("핸드폰 번호를 입력하세요!");
		theForm.hp.focus();
		return false;
	}
	if (theForm.email.value=="") 
	{
		alert("E-mail을 입력하세요!");
		theForm.email.focus();
		return false;
	}
	if(theForm.tel.value=="")
	{
		alert("전화번호를 입력하세요!");
		theForm.tel.focus();
		return false;
	}
	if (!isEmail(theForm.email.value+"@"+theForm.input_user_email2.value)) 
	{
		alert("E-mail이 형식에 맞지 않습니다.");
		theForm.email.value="";
		theForm.email.focus();
		return false;
	}
	if(theForm.gift.value=="")
	{
		alert("후원물품을 기입해 주세요.!");
		theForm.gift.focus();
		return false;
	}
	if(theForm.body.value=="")
	{
		alert("하고싶은 말씀을 입력해 주세요!");
		theForm.body.focus();
		return false;
	}

	theForm.donot_enter.value="N";
	return true;	
}


function chkType()
{
	if(document.rform.spon_type[0].checked==true)
	{
		indiv_num.style.display="";
		company_num.style.display="none";
	}
	else
	{
		indiv_num.style.display="none";
		company_num.style.display="";
	}
}
function aid_Frm(theForm){
	if(theForm.donot_enter.value=="N"){
		alert("업로드 중입니다.한번만 누르세요!");
		return false;
	}
	
	var flag=0;
	for ( var i =0 ; i< theForm.spon_type.length ;i++ )
	{
		if(theForm.spon_type[i].checked==true)flag++;
	}
	if (flag==0)
	{	
		alert("후원구분을 선택하세요!");
		theForm.spon_type[0].focus(); 
		return false;
	}

	if(theForm.name.value=="")
	{
		alert("후원자의 성함을 입력하세요!");
		theForm.name.focus();
		return false;
	}
	if(theForm.spon_type[0].checked==true)
	{
		if((theForm.jumin_num1.value=="")||(theForm.jumin_num2.value==""))
		{
			alert("주민등록번호를 입력하세요!");
			theForm.jumin_num1.focus();
			return false;
		}	
	}
	if(theForm.spon_type[1].checked==true)
	{
		if(theForm.compay_num.value=="")
		{
			alert("사업자등록번호를 입력하세요!");
			theForm.compay_num.focus();
			return false;
		}	
	}
	if(theForm.hp.value=="")
	{
		alert("핸드폰 번호를 입력하세요!");
		theForm.hp.focus();
		return false;
	}
	if(theForm.tel.value=="")
	{
		alert("전화번호를 입력하세요!");
		theForm.tel.focus();
		return false;
	}
	if (theForm.email.value=="") 
	{
		alert("E-mail을 입력하세요!");
		theForm.email.focus();
		return false;
	}
	if (!isEmail(theForm.email.value+"@"+theForm.input_user_email2.value)) 
	{
		alert("E-mail이 형식에 맞지 않습니다.");
		theForm.email.value="";
		theForm.email.focus();
		return false;
	}

	if(theForm.zip1.value=="")
	{
		alert("우편번호를 입력하세요!");
		return false;
	}
	
	if(theForm.addr.value=="")
	{
		alert("주소를 입력하세요!");
		theForm.addr.focus();
		return false;
	}

	if(theForm.supp_pay.value=="")
	{
		alert("후원금액을 입력하세요!");
		theForm.supp_pay.focus();
		return false;
	}

//	if(!(theForm.giro.checked==true || theForm.auto_e.checked==true || theForm.tong_e.checked==true) )
/*
	if(!(theForm.giro.checked==true || theForm.auto_e.checked==true ) )
	{
		alert("납입방법을 선택해 주십시요!");
		theForm.giro.focus();
		return false;
	}
*/
var flag=0;
	for ( var i =0 ; i< theForm.bankgiro.length ;i++ )
	{
		if(theForm.bankgiro[i].checked==true)flag++;
	}
	if (flag==0)
	{	
		alert("결제방법을 선택하세요!");
		theForm.bankgiro[0].focus(); 
		return false;
	}

	if(theForm.bankgiro[0].checked==true){
		if(theForm.bank.value=="")
		{
			alert("은행명을 입력하세요!");
			theForm.bank.focus(); 
			return false;
		}
		if(theForm.tong_num.value=="")
		{
			alert("게좌번호를 입력하세요!");
			theForm.tong_num.focus();
			return false;
		}
		if(theForm.tong_name.value=="")
		{
			alert("예금주명을 입력하세요!");
			theForm.tong_name.focus();
			return false;
		}
		if(theForm.jumin1.value=="")
		{
			alert("예금주의 주민번호를 입력하세요!");
			theForm.jumin1.focus();
			return false;
		}
		if(theForm.jumin2.value=="")
		{
			alert("예금주의 주민번호를 입력하세요!");
			theForm.jumin2.focus();
			return false;
		}
		if(!radioCheck(theForm.trans_data))
		{
			alert("이체일을 체크하세요!");
			theForm.trans_data[0].focus();
			return false;
		}
	}

	if(theForm.body.value=="")
	{
		alert("하고싶은 말씀을 입력해 주세요!");
		theForm.body.focus();
		return false;
	}
	theForm.donot_enter.value="N";
	return true;	
}


function regist_Frm(theForm){
	theForm.action = "register.php";
	return true;
}

function back_Frm(theForm){
	theForm.action = "register_detail.html";
	theForm.submit();
}

function toggleMenu(currMenu) { 
                if (document.all) { 
                                thisMenu = eval("document.all." + currMenu + ".style") 
                                if (thisMenu.display == "block") { 
                                                thisMenu.display = "none" 
                                } 
                                else { 
                                                thisMenu.display = "block" 
                                } 
                                return false 
                } 
                else { 
                                return true 
                } 
}

function alreadyB(){
	alert('이미 봉사신청하셨습니다');
	location.href="/help/cat.html?left_flag=help&code=family_hope";
}

//textbox를 일정길이만큼 채우면 다음 칸으로 focus가 이동하는 함수 ---신호정   2004.1.27  시작
	var isNN = (navigator.appName.indexOf("Netscape")!=-1);

function autoTab(input,len, e) {
var keyCode = (isNN) ? e.which : e.keyCode; 
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46]; 
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].focus();
}
}

function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}

function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
return true;
}
//textbox를 일정길이만큼 채우면 다음 칸으로 focus가 이동하는 함수 ---신호정   2004.1.27  시작


function onCheckAdm(theForm){

	if(theForm.pwd.value ==""){
			alert("비밀번호를  반드시 입력해야 합니다.");
			theForm.pwd.focus();
			return false;
	}                                                     
	if(theForm.new_pwd.value !=""){
		if(theForm.new_repwd.value ==""){
			alert("새 비밀번호확인를  반드시 입력해야 합니다.");
			theForm.new_repwd.focus();
			return false;
		}
		if(theForm.new_pwd.value != theForm.new_repwd.value){
			alert("새 비밀번호가 일치하지 않습니다.");
			theForm.new_pwd.value="";
			theForm.new_repwd.value="";
			theForm.new_pwd.focus();
			return false;
		}
	}

	
	if(theForm.name.value=="")
	{
		alert("이름을 입력하세요!");
		theForm.name.focus();
		return false;
	}
	if(theForm.jumin1.value=="")
	{
		alert("주민번호를 입력하세요!");
		theForm.jumin1.focus();
		return false;
	}
	if(theForm.jumin2.value=="")
	{
		alert("주민번호를 입력하세요!");
		theForm.jumin2.focus();
		return false;
	}
	//테스트를 위해 막아 놓음
	/*if(!JuminCheck(theForm.jumin1.value,theForm.jumin2.value)){
		alert("주민번호가 유효하지 않습니다!");
		theForm.jumin1.focus();
		return false;
	}
	*/
	if (theForm.email.value=="") 
	{
		alert("E-mail을 입력하세요!");
		theForm.email.focus();
		return false;
	}
	if (!isEmail(theForm.email.value+"@"+theForm.input_user_email2.value)) 
	{
		alert("E-mail이 형식에 맞지 않습니다.");
		theForm.email.value="";
		theForm.email.focus();
		return false;
	}

	if(theForm.zip1.value=="")
	{
		alert("자택 우편번호를 입력하세요!");
		return false;
	}
	if(theForm.addr.value=="")
	{
		alert("자택주소를 입력하세요!");
		theForm.addr.focus();
		return false;
	}
	/*if(theForm.of_zip1.value=="")
	{
		alert("직장 우편번호를 입력하세요!");
		return false;
	}
	if(theForm.of_addr.value=="")
	{ 
		alert("직장주소를 입력하세요!");
		theForm.of_addr.focus();
		return false;
	}*/
	if(theForm.tel.value=="")
	{
		alert("자택전화를 입력하세요!");
		theForm.tel.focus();
		return false;
	}
	
	if(theForm.pcs.value=="")
	{
		alert("휴대폰 번호를 입력하세요!");
		theForm.pcs.focus();
		return false;
	}
	if(theForm.serve_check.checked==true){ 
		if(theForm.hope_serve.value=="")
		{
			alert("희망봉사 분류를 입력하세요!");  
			theForm.hope_serve.focus();
			return false; 
		} 
		if(theForm.serve_time.value=="")
		{
			alert("봉사가능기간을 입력하세요!");  
			theForm.serve_time.focus();
			return false; 
		} 
		if(!radioCheck(theForm.before_serve))
		{
			alert("이전 봉사여부 유무를 체크하세요!");
			theForm.before_serve[0].focus();
			return false;
		}
		if(!radioCheck(theForm.marry))
		{
			alert("결혼유무를 체크하세요!");
			theForm.marry[0].focus();
			return false;
		}
		if(theForm.religion.value=="")
		{
			alert("종교를 입력하세요!");
			theForm.religion.focus();
			return false;
		}
		if(theForm.of_tel1.value=="" || theForm.of_tel2.value=="" || theForm.of_tel3.value=="" )
		{
			alert("직장전화를 입력하세요!");
			theForm.of_tel1.focus();
			return false;
		}


	}

	//theForm.action="register_detail_ok.html";
	return true;
}


// 빈값 검사 (메세지 출력 / 공백을 제외하고 빈값이면 true 아니면 false)
function chkBlank_msg(box, msg) {
	var valid = box.value.replace(/\s/gi,"");
	if (valid=="") {
		if (!msg) msg = "빈 값입니다. 값을 입력하세요.";
		alert(msg); box.focus();
		return true;
	}
	return false;	
}

//------------------------ 검색후 쪽지 보내기 PopUp ----------------------------
function Memo_Win(murl,wth,ht){ 
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	window.open(murl,"NewsWin",'width=650,height=410,scrollbars=yes,top=' + window_top + ',left=' + window_left + '');
}

function SMS_open(myurl){
	window.open (myurl, "sms", "width=175,height=352,top=220,left=420,scrollbars=no, resizable=no")
} 

function SMS_open_new(myurl){
	window.open (myurl, "sms", "width=800,height=552,top=220,left=420,scrollbars=yes, resizable=no")
} 

function checkword(word)
{
	var charword;
	for(var i = 0; i < word.length; i++) 
	{
		charword = word.charAt(i); 
		if(charword.indexOf(" ") == -1) return true;
	} 
	return false;
}

//
function moveFocus(num,fromform,toform){
	var str = fromform.value.length;
	if(str == num)
	   toform.focus();
}
function chkMail(fromform,toform){
//	alert(fromform.value+","+toform.name);
	if(fromform.value=="직접입력")
	{
		toform.value = "";
		toform.focus();

	}
	else
	{
		toform.value = fromform.value;
	}
}
