function CheckFrm(){



	if(IsEmpty(frm.company.value)==true){
		alert("È¸»ç¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		frm.company.focus();
		return;
	}



	if(IsEmpty(frm.manager.value) == true){
		alert("´ã´çÀÚ ÇÑ±Û¼º¸íÀ» ÀÔ·ÂÇØ ÁÖ¼Å¿ä!");
		frm.manager.focus();
		return;
	}


	if(IsEmpty(frm.tel.value) == true){
		alert("¿¬¶ôÃ³ ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À.");
		frm.tel.focus();
		return;
	}else if(!checkDigit(frm.tel.value)){
		alert(" ¿¬¶ôÃ³ ÀüÈ­¹øÈ£´Â ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä.");
		frm.tel.focus();
		return;
	}


	if(IsEmpty(frm.fax.value) == true){
		alert("fax¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À.");
		frm.fax.focus();
		return;
	}else if(!checkDigit(frm.fax.value)){
		alert("fax¹øÈ£´Â ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä.");
		frm.fax.focus();
		return;
	}



	if(IsEmpty(frm.email.value) == true){
		alert("ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		frm.email.focus();
		return;
	}

	if(IsEmpty(frm.email.value) == false){
		var i;
		var strEmail = frm.email.value;
		var strCheck1 = false;
		var strCheck2 = false;

		for(i=0; i<strEmail.length; i++) {
			if ((strEmail.substring(i,i+1) == "~") || (strEmail.substring(i,i+1) == ".") || (strEmail.substring(i,i+1) == "_") || (strEmail.substring(i,i+1) == "-") || ((strEmail.substring(i,i+1) >= "0") && (strEmail.substring(i,i+1) <= "9")) || ((strEmail.substring(i,i+1) >= "@") && (strEmail.substring(i,i+1) <= "Z")) || ((strEmail.substring(i,i+1) >= "a") && (strEmail.substring(i,i+1) <= "z"))){
				if (strEmail.substring(i,i+1) == ".")
					strCheck1 = true;
				if (strEmail.substring(i,i+1) == "@")
				strCheck2 = true;
			}else{
				alert("\nÀÌ¸ÞÀÏÀ» Á¤È®ÇÏ°Ô ÀÔ·Â ÇÏ½Ê½Ã¿À.");
				frm.email.focus();
				return;
			}
		}

		if((strCheck1 == false) || (strCheck2 == false)){
			alert("\nÀÌ¸ÞÀÏÀ» Á¤È®ÇÏ°Ô ÀÔ·Â ÇÏ½Ê½Ã¿À.");
			frm.email.focus();
			return;
		}
	}



	if(IsEmpty(frm.post1.value) == true){
		alert("¿ìÆí¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À.");
		frm.post1.focus();
		return;
	}

	if(IsEmpty(frm.post2.value) == true){
		alert("¿ìÆí¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À.");
		frm.post2.focus();
		return;
	}

	if(IsEmpty(frm.addr1.value) == true){
		alert("ÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À.");
		frm.addr1.focus();
		return;
	}

	if(IsEmpty(frm.addr2.value) == true){
		alert("³ª¸ÓÁöÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À.");
		frm.addr2.focus();
		return;
	}







	frm.action="insert_request.asp";
	frm.submit();
}





function post(){
	var NWin = window.open('post.asp', '', ('scrollbars=yes, resizable=no, width=439, height=460, left=100, top=100'));
	self.name = "AddrWin"
	NWin.location = "post.asp";
	NWin.opener = self;
	NWin.focus();
}






function IsEmpty(data){
	for(var i=0; i<data.length; i++){
		if (data.substring(i,i+1) != " ")
		return false;
	}   
	return true;
}

function IsAlphaNumeric(checkStr){
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_0123456789";
	for(i = 0; i < checkStr.length; i++ ){
		ch = checkStr.charAt(i);
		for(j = 0; j < checkOK.length; j++)
			if(ch == checkOK.charAt(j))
				break;
			if(j == checkOK.length){
				return false;
				break;
			}
	}
		return (true);
}

function checkDigit(tocheck){
	var isnum = true;
	if(( tocheck ==null ) || ( tocheck == "" )){
		isnum = false;
		return isnum;
	}

	for(var j= 0 ; j< tocheck.length; j++ ){
		if( ( tocheck.substring(j,j+1) != "0" ) && ( tocheck.substring(j,j+1) != "1" ) && ( tocheck.substring(j,j+1) != "2" ) && ( tocheck.substring(j,j+1) != "3" ) && ( tocheck.substring(j,j+1) != "4" ) && ( tocheck.substring(j,j+1) != "5" ) && ( tocheck.substring(j,j+1) != "6" ) && ( tocheck.substring(j,j+1) != "7" ) && ( tocheck.substring(j,j+1) != "8" ) && ( tocheck.substring(j,j+1) != "9" ) ){
			isnum = false;
		}
	}
	return isnum;
}