// isCanNotFocus ¹ÌÀÔ·Â½Ã Æ÷Ä¿½ºÇÔ
function EB_checkBlank(obj, msg, isFocus) {
	if (obj.value != null && obj.value != "") {
		return true;
	} else {
		if (msg != "") alert(msg);
		if (isFocus == null) isFocus = true;
		if (isFocus) obj.focus();
	}
	return false;    
}
    
function NAMO_checkBlank(wecObj, msg) {
	var text = wecObj.TextValue;
	text = text.replace(/[\r\n\ ]+/g , ""); 
	
	if (text != "") {
		return true;
	} else {
		alert(msg);
		wecObj.focus();
	}
	return false;
}

	  
function Digit_Check(objF, digit, obj){
	if(objF.value.length==digit){
		if(objF){
			number = objF.value;
			for (i=0;i<=number.length;i++){
				digit=number.substr(i,1);
				if(digit==1 || digit==2 || digit==3 || digit==4 || digit==5 || digit==6 || digit==7 || digit==8 || digit==9 || digit==0){
				}else{
					alert('¼ýÀÚ¸¸ ÀÔ·ÂÀÌ °¡´ÉÇÕ´Ï´Ù.');
					objF.value="";
					objF.focus();
					return;
				}
			}
		}
	obj.focus();
	return;
	}
}

function Digit_Check_temp(objF, digit, obj){
	if(objF.value.length==digit){
		if(objF==document.form1.a1){
			number = document.form1.a1.value;
			for (i=0;i<=number.length;i++){
				digit=number.substr(i,1);
				if(digit==1 || digit==2 || digit==3 || digit==4 || digit==5 || digit==6 || digit==7 || digit==8 || digit==9 || digit==0){
				}else{
					alert('¼ýÀÚ¸¸ ÀÔ·ÂÀÌ °¡´ÉÇÕ´Ï´Ù.');
					document.form1.a1.value="";
					document.form1.a1.focus();
					return;
				}
			}
		}
		obj.focus();
		return;
	}
}


function Digit_Check2(obj){
	if (!containsCharsOnly(obj,"0123456789")) {
		alert("¼ýÀÚ¸¸ ÀÔ·ÂÀÌ °¡´ÉÇÕ´Ï´Ù."); 
		obj.value="";
		obj.focus();
		return;
	}
}


/** 
* ÀÔ·Â°ªÀÌ Æ¯Á¤ ¹®ÀÚ(chars)¸¸À¸·Î µÇ¾îÀÖ´ÂÁö Ã¼Å© 

* Æ¯Á¤ ¹®ÀÚ¸¸ Çã¿ëÇÏ·Á ÇÒ ¶§ »ç¿ë 
* ex) if (!containsCharsOnly(form.blood,"ABO")) { 
* alert("Ç÷¾×Çü ÇÊµå¿¡´Â A,B,O ¹®ÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù."); 
* } 
*/ 
function containsCharsOnly(input,chars) { 
	for (var inx = 0; inx < input.value.length; inx++) { 
		if (chars.indexOf(input.value.charAt(inx)) == -1) return false; 
	} 
	return true; 
} 

function alertFocus(s,o){ o.focus(); alert(s); }
function alertFocusFalse(s,o){ alertFocus(s,o); return false; }
function showMsg(o,s){ return alertFocus(s, o); }

function chkAlphaNumeric(s){ return !(/[^0-9A-Za-z]/g).test(s); }
function getAlphaNumeric(s){ return s.replace(/[^0-9A-Za-z]/g,''); }

function chkNumeric(s){ return !(/[^(0-9)]/g).test(s); }
function getNumeric(s){ return s.replace(/[^0-9]/g,''); }

function chkEmail(s){ return !(/^[\\w\\-]([\\.\\w\\-])+[\\w]+@([\\w\\-]+\\.)+[a-zA-Z]{2,4}$/).test(s); }
function getEmail(s){ return s.replace(/^[\\w\\-]([\\.\\w\\-])+[\\w]+@([\\w\\-]+\\.)+[a-zA-Z]{2,4}$/,''); }

function chkSelect(o,s){ if(o.selectedIndex==0) return showMsg(o,s+'À»(¸¦) ¼±ÅÃÇÏ¼¼¿ä. '); return true; }
function chkRadio(o,s){ for(var i=0,l=o.length;i<l;i++) if(o[i].checked) return true; return showMsg(o[0],s+'À»(¸¦) ¼±ÅÃÇÏ¼¼¿ä. '); }
function chkNull(o,s){ if(o.value=='') return showMsg(o,s+'À»(¸¦) ÀÔ·ÂÇÏ¼¼¿ä. '); return true; }

