function Chk_Email(obj_email) {
	var ln = obj_email.value.length;
	var chSpecial = false;
	var noMail = false;
	var chDotCnt = 0;
	var chAltCnt = 0;
	var preCh = "";

	for (var i=0; i<ln; ++i) {
		var ch = obj_email.value.charAt(i);
		if (ch == '-' ||ch == '_') continue;
		if (ch == '@') chAltCnt ++;
		if (ch == '.') chDotCnt ++;
		//if (ch == '.' && chAltCnt == 0) noMail = true;
		if (ch == '.' && preCh == '@') noMail = true;
		if (ch == '.' && preCh == '.') noMail = true;
		if (ch == '.' || ch == '@') {
			preCh = ch;
			continue;
		}
		if (ch > 'z' || ch < '0' || ch == '^' || ch == ';' || ch == ':') chSpecial = true;
		if (ch == '\\' || ch == '`' || ch == '<' || ch == '>' || ch == '=' ) chSpecial = true;
		preCh = ch;
	}

	if(chSpecial) {
		alert("ÇÑ±Û, °ø¶õ, Æ¯¼ö¹®ÀÚ´Â EMail ÁÖ¼Ò·Î ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
		obj_email.focus();
		return false;
	}

	if(chAltCnt>1 || ch=='.' || noMail) {
		alert("EMailÀ» Á¤È®È÷ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		obj_email.focus();
		return false;
	}

	if(chDotCnt<1 || chDotCnt>3) {
		alert("EMailÀ» Á¤È®È÷ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		obj_email.focus();
		return false;
	}
	return true;
}

	//==================================
	// ±ÛÀÚ ¹ÙÀÌÆ® Ã¼Å©
	//==================================
	function cal_byte(field, minbyte, maxbyte, info) {
		var tmpStr;
		var temp=0;
		var onechar;
		var tcount;
		tcount = 0;

		tmpStr = new String(field.value);
		temp = tmpStr.length;

		for (k=0;k<temp;k++){
			onechar = tmpStr.charAt(k);
			if (escape(onechar).length > 4) {
				tcount += 2;
			}
			else if (onechar!='\r') {
				tcount++;
			}
		}

		if(tcount<minbyte || tcount>maxbyte) {
			if (tcount < minbyte){
				alert(info + "´Â(Àº) " + minbyte + "¹ÙÀÌÆ® ÀÌ»ó ±âÀçÇØ¾ß ÇÕ´Ï´Ù.\n\nÇÑ±ÛÀº 1ÀÚ¿¡ 2byteÀÌ¸ç, ¿µ¹®Àº 1ÀÚ¿¡ 1byteÀÔ´Ï´Ù.");
			}
			else{
				reserve = tcount-maxbyte;
				alert(info + "´Â(Àº) " + maxbyte + "¹ÙÀÌÆ® ÀÌ»óÀº »ç¿ë ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n±âÀçÇÏ½Å ³»¿ëÀº "+reserve+"¹ÙÀÌÆ®°¡ ÃÊ°úµÇ¾ú½À´Ï´Ù."); 
			}
			field.focus();
			return false;
		}
		else
			return true;
	}		
			
			
			
	//==================================
	// Null Ã¼Å©
	//==================================
	function CheckNullValue ( field , info ){ 
		if ( field.value == "" ) {
			alert ( info + "À» ÀÔ·ÂÇÏ¼¼¿ä.");
	    	field.focus();
	    	return false; 
		}
		return true;
	}
				
			
	function CheckValue() {
		  if (CheckNullValue(document.frm.custName, "¼º¸í"))
		 if (CheckNullValue(document.frm.compName, "°í°´»ç ¸í"))
         if (CheckNullValue(document.frm.funcs, "Á÷±Þ/Á÷Ã¥"))
		 if (CheckNullValue(document.frm.phoNumber, "¿¬¶ôÃ³")) 
		 if (CheckNullValue(document.frm.Email, "Email"))
		 if (Chk_Email(document.frm.Email))	  
		{
			document.frm.submit();
		}
	}
	
	function CheckValue_eDM() {
		 if (CheckNullValue(document.frm.custName, "¼º¸í"))
		 if (CheckNullValue(document.frm.compName, "°í°´»ç ¸í"))
		 if (CheckNullValue(document.frm.phoNumber, "¿¬¶ôÃ³")) 
		 if (CheckNullValue(document.frm.Email, "Email"))
		 if (Chk_Email(document.frm.Email)){
			document.frm.submit();
		}
	}	
