﻿	function check(strPass){

		var tempVal = strPass.value;
		var mikExp = /[$\\@\\\#%\^\&\*\(\)\[\]\+\<\>\_\{\}\'\`\"\-\=\|\;]/;

		var strLength = tempVal.length;
		var lchar = tempVal.charAt((strLength) - 1);
		if(lchar.search(mikExp) != -1) {
			window.alert("@ $ % ^ < > _ & * # ( ) [ ] \\ { + }  ` \" - =  | ; \n\n 과 같은 특수문자는 입력하실 수 없습니다.");
			strPass.value="";
			strPass.focus();
			return true;
		}else{
			return false;
		}
	}
	/*권장..*/
	function numCheck(inputValue){
		var numPattern = /([^0-9])/;
		numPattern = inputValue.value.match(numPattern);
		if(numPattern != null){
			alert("숫자만 입력해 주십시오.");
			inputValue.value='';
			inputValue.focus();
			return false;
		}
	}

	function checkNum(){
		var objEv = event.srcElement;
		var numPattern = /([^0-9])/;
		numPattern = objEv.value.match(numPattern);
		if(numPattern != null){
			alert("숫자만 입력해 주십시오.");
			objEv.value='';
			objEv.focus();
			return false;
		}
	}function emailCheck(s){
		var arrMatch = s.match(/^(".*"|[A-Za-z0-9_]([A-Za-z0-9_-]|[\+\.])*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z0-9][A-Za-z0-9_-]*(\.[A-Za-z0-9][A-Za-z0-9_-]*)+)$/);
		if (arrMatch == null){
			return false;
		}
		var arrIP = arrMatch[2].match(/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/);
		if (arrIP != null){
			for (var i = 1; i <= 4; i++){
				if (arrIP[i] > 255){
					return false;
				}
		   }
		}
		return true;
   }function isNullValue(inputValue, title){
		inputValue.value = chk_Space(inputValue.value);
	    if (inputValue.value == null || inputValue.length == 0 || inputValue.value == ""){
			alert(title + ' 입력해 주십시오.');
			inputValue.focus();
            return true;
        }else{
            return false;
        }
    }function isNullCheck(inputValue){

        if (inputValue == null || inputValue.length == 0 || inputValue == ""){
            return true;
        }else{
            return false;
        }
    }function lengthCheckKor(inputElement, maxLength, title){
        var c;
        var byteLength = 0;
        var strLength = 0;
        var halfMaxLength = parseInt(maxLength/2);

		for(i=0; i<inputElement.value.length; i++)
        {
            c = inputElement.value.charAt(i);
            if (escape(c).length > 4){ // 한글이면
                byteLength += 2;
            }
            else
            {
                byteLength++;
            }
            strLength++;
            if (byteLength > maxLength)
            {
                if(isNullCheck(title)){
                     alert("한글은 " + halfMaxLength + "자 이내로, 영문은 " + maxLength + "자 이내로 입력해 주십시오.");
                }else{
                     alert(""+title+" 한글은 " + halfMaxLength + "자 이내로, 영문은 " + maxLength + "자 이내로 입력해 주십시오.");
                }
                inputElement.value = inputElement.value.substring(0, strLength-1);
                if(inputElement.type != "hidden"){
                    inputElement.focus();
                }
                return false;
            }
        }
        return true;
    }function chk_Space(tmp){
        var str = tmp;
        while(str.charAt(0)==' ')
        {
           str = str.substring(1,str.length)
        }
           return str;
    }function chk_select(inputElement, title){
       if(inputElement.value == '' || inputElement.value == '-1'){
		   inputElement.focus();
		   alert(title + " 선택해 주십시오.");
		   return true;
	   }else{
		   return false;
	   }
    }

function winOpen(url,w,h,wname,opt) {

	var newWin;

	LP=(screen.width)?(screen.width-w)/2:100;
      TP=(screen.height)?(screen.height-h)/3:100;

	if (opt=='') {
		setting = "height="+h+",width="+w+",top="+TP+",left="+LP;
	} else {
		setting = opt + ",height="+h+",width="+w+",top="+TP+",left="+LP;
	}

	newWin = window.open(url,wname,setting);
	newWin.focus();
}
function juminnum_check(obj1, obj2){
	str1 = obj1.value ;
	str2 = obj2.value ;
	li_value = new Array(13);
	var li_lastid,li_mod,li_minus,li_last;
	var return_value;
	if(str1.length != 6 ){
		return_value = "주민번호 앞자리를 6자리로 입력해 주십시오.";
		return return_value;
	}
	if(str2.length != 7 ){
		return_value = "주민번호 뒷자리를 7자리로 입력해 주십시오.";
		return return_value;
	}
	if (!( (str2.substring(0,1) == "1") || (str2.substring(0,1) == "2") || (str2.substring(0,1) == "3")) ) {
		return_value = "주민번호 뒷자리는 [1]이나 [2]로 시작합니다.";
		return return_value;
	}
	if (jf_isInteger(str1) && jf_isInteger(str2)) {
		li_lastid   = parseFloat(str2.substring(6,7));
		li_value[0] = parseFloat(str1.substring(0,1)) * 2;
		li_value[1] = parseFloat(str1.substring(1,2)) * 3;
		li_value[2] = parseFloat(str1.substring(2,3)) * 4;
		li_value[3] = parseFloat(str1.substring(3,4)) * 5;
		li_value[4] = parseFloat(str1.substring(4,5)) * 6;
		li_value[5] = parseFloat(str1.substring(5,6)) * 7;
		li_value[6] = parseFloat(str2.substring(0,1)) * 8;
		li_value[7] = parseFloat(str2.substring(1,2)) * 9;
		li_value[8] = parseFloat(str2.substring(2,3)) * 2;
		li_value[9] = parseFloat(str2.substring(3,4)) * 3;
		li_value[10] = parseFloat(str2.substring(4,5)) * 4;
		li_value[11] = parseFloat(str2.substring(5,6)) * 5;
		li_value[12] = 0;
		for (var i = 0; i<12;i++) {
			li_value[12] = li_value[12] + li_value[i] ;
		}
		li_mod = li_value[12] %11;
		li_minus = 11 - li_mod;
		li_last = li_minus % 10;
		if (li_last != li_lastid){
			return_value = "주민번호가 잘못입력되었습니다.";
			return return_value;
		}else
		{
			return_value = true;
			return return_value;
		}
	}else   {
		return_value = "주민번호가 잘못 입력되었습니다.";
		return return_value;
	}
}
function jf_isInteger(st)
{
	if (!jf_isEmpty(st)){
	   for (j=0; j<st.length; j++){
		 if (((st.substring(j, j+1) < "0") || (st.substring(j, j+1) > "9")))
		 return;
	   }
	}else{
	   return ;
	}
	return true ;
}
/*--------------------------------------------------
  기능   : Check NULL OR Space RETURN T/F
----------------------------------------------------*/
function jf_isEmpty(toCheck)
{
	 var chkstr = toCheck + "";
	 var is_Space = true ;
	 if ( ( chkstr == "") || ( chkstr == null ) )
	   return( false );
	 for ( j = 0 ; is_Space && ( j < chkstr.length ) ; j++){
		 if( chkstr.substring( j , j+1 ) != " " )
			   is_Space = false ;
	 }
	 return ( is_Space );
}
function registrynum_check(obj1, obj2)
		{
		 	var fgn_reg_no = obj1.value + obj2.value;
			if (fgn_reg_no.length != 13) {
				alert('입력하신 번호의 자리수가 맞지 않습니다.');
				return false;
			}
			if ((fgn_reg_no.charAt(6) == "5") || (fgn_reg_no.charAt(6) == "6"))
			{
				birthYear = "19";
			}
			else if ((fgn_reg_no.charAt(6) == "7") || (fgn_reg_no.charAt(6) == "8"))
			{
				birthYear = "20";
			}
			else if ((fgn_reg_no.charAt(6) == "9") || (fgn_reg_no.charAt(6) == "0"))
			{
				birthYear = "18";
			}
			else
			{
 				alert("입력하신 법호에 오류가 있습니다. 다시 확인하십시오.");
				return false;
			}
			birthYear += fgn_reg_no.substr(0, 2);
			birthMonth = fgn_reg_no.substr(2, 2) - 1;
			birthDate = fgn_reg_no.substr(4, 2);
			birth = new Date(birthYear, birthMonth, birthDate);

		        if ( birth.getYear() % 100 != fgn_reg_no.substr(0, 2) ||
				birth.getMonth() != birthMonth ||
				birth.getDate() != birthDate) {
				alert('생년월일에 오류가 있습니다. 다시 확인하십시오.');
				return false;
			}
		        if (fgn_no_chksum(fgn_reg_no) == false){
				alert('입력하신 번호에 오류가 있습니다. 다시 확인하십시오.');
				return false;
			}
			else {
				alert ('정상입니다.');
				return true;
			}
		}
function getFlashMenu(arg0,arg1,path,wid,hei){
	 document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='" + window.location.protocol + "//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+wid+"' height='"+hei+"'>  <param name='allowScriptAccess' value='sameDomain'>        <param name='movie' value='" + path + "'>          <param name='quality' value='high'>          <param name=flashvars value='"+arg0+"'>          <embed src='" + path + "' quality='high' flashvars='"+arg1+"' pluginspage='" + window.location.protocol + "//www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+wid+"' height='"+hei+"'></embed></object>"); 
}
