function openScrollWindow(url, name, width, height)   {
    var top     =       screen.height / 2 - height / 2 - 50;
    var left    =       screen.width / 2 - width / 2 ;
    var win = open(url, name, 'width='+width+',height='+height+',top='+top+',left='+left+',resizable=no,status=no,toolbar=no,menubar=no,scrollbars=yes');
    if ( win == Object)
    {
		win.focus();
    }
    return win;
}

function addrSearch(){
	openScrollWindow('/common/findPostNo.asp?rtn1=q_zipcode&rtn2=q_addr1&rtn3=q_addr2', 'addrSerch', 430, 255);
}

function checkform(mode){
	var fr = document.Frm;
		
	if (fr.q_name.value == ""){
		alert("¼º¸íÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		fr.q_name.focus();
		return;
	}
	
	if (containsChars(fr.q_name,"!,*&^%$#@~;")) {
		alert("¼º¸í¿¡´Â Æ¯¼ö¹®ÀÚ¸¦ ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
		fr.q_name.focus();
		return;
	}
	
	if (mode=="0"){
		if (fr.q_year.value == ""){
		alert("¿¬·ÉÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		fr.q_year.focus();
		return;
		}
		if (fr.q_year.value != ""){
			if (!isNumber(fr.q_year)){
				alert("¿¬·ÉÀº ¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
				fr.q_year.focus();
				return;
			}
		}
	}

	if (fr.tel1.value == "" || fr.tel2.value == "" || fr.tel3.value == ""){
		alert("ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		return;
	}

	if (!isNumber(fr.tel1)){
		alert("ÀüÈ­¹øÈ£¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		fr.tel1.focus();
		return;
	}
	
	if (!isNumber(fr.tel2)){
		alert("ÀüÈ­¹øÈ£¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		fr.tel2.focus();
		return;
	}

	if (!isNumber(fr.tel3)){
		alert("ÀüÈ­¹øÈ£¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		fr.tel3.focus();
		return;
	}
	
	fr.q_email.value = fr.q_email1.value + "@" + fr.q_email2.value;
	if (!isValidEmail(fr.q_email)){
		alert("ÀÌ¸ÞÀÏÀ» Á¤È®È÷ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		fr.q_email1.focus();
		return;
	}
	

	if (fr.zipcode.value == ""){
		alert("ÁÖ¼Ò¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		return;
	}
	
	if(fr.content.value ==""){
		alert("³»¿ëÀ» ÀÔ·ÂÇØÁÖ½Ê½Ã¿À.")
		fr.content.focus();
		return;
	}
	
	if(fr.mailInfo) {
		if(fr.mailInfo[0].checked == false) {	
			alert("Á¤º¸¼öÁý¿¡ µ¿ÀÇ ÇÏ¼Å¾ß º¸³»±â¸¦ ÇÒ¼ö ÀÖ½À´Ï´Ù. ")
			return;
		}
	}
	

	fr.q_zipcode.value = fr.zipcode.value;
	fr.q_addr1.value = fr.addr1.value;
	fr.q_addr2.value = fr.addr2.value;
	fr.q_tel.value = fr.tel1.value + "-" + fr.tel2.value + "-" + fr.tel3.value;
	fr.submit();
}
