/*	
	'################################################################
	' project : Aveda Korea
	' file_nm : check_aveda.js
	' creator : in beom, Seo
	' tm      : 2005.06.07
	' cont	  : ¾Æº£´ÙÄÚ¸®¾Æ Ã¼Å© ½ºÅ©¸³Æ® ¸ðÀ½

	' editor  : ko kae woon
	' date	  : 2009.06.01
	
	' co      : copyright (c) 2004 by adnstyle corp. all right reserved
	'################################################################
*/

var urlstring = "http://www.avedakorea.com";

/*********************************************************************
 Á¦Ç° ÆäÀÌÁö(¸Þ´º Å¬¸¯½Ã) - Ä«Å×°í¸® ÄÚµå ¹× Á¦Ç° ÄÚµå
*********************************************************************/
function menucode(CateCode,MenuCode) {
	var	form		=	document.productForm;	
	var CateCode	=	CateCode;				//	Ä«Å×ÄÚ¸® ÄÚµå
	var MenuCode	=	MenuCode;				//	Á¦Ç° ÄÚµå

	form.CateCode.value	=	CateCode;
	form.MenuCode.value	=	MenuCode;

	form.target	=	"_self";
	form.action =	"/products/nodepage.asp"
	form.submit();
}


/*********************************************************************
Á¦Ç° ÆäÀÌÁö - ³ª¸¸ÀÇ Á¦Ç° ¸®½ºÆ® Ãß°¡
*********************************************************************/
function wishList(MenuCode) {
	var form		=	document.productForm;
	
	form.inCd.value	=	MenuCode;
	form.key.value	=	"wishList";	
	form.target		=	"FrameCKP";
	form.action		=	urlstring + "/mod/inc/message.asp";
	form.submit();
}

/*********************************************************************
Á¦Ç° ÆäÀÌÁö - ³ª¸¸ÀÇ Á¦Ç° ¸®½ºÆ® Ãß°¡(·Î±×ÀÎ Ã³¸®)
*********************************************************************/
function proLogin() {
	var form		=	document.productForm;
	
	form.key.value	=	"wishList";	
	form.target		=	"_self";
	form.action		=	"/member/login.asp";
	form.submit();
}

/*********************************************************************
 Login Ã¼Å©
*********************************************************************/

function login() {
	var form	=	document.regForm;
	var txt_email1		=	form.txt_email1.value;
	var txt_email2		=	form.txt_email2.value;
	var pw		=	form.txt_pass.value;
	var email	=	form.txt_email.checked;

	var txt_email		=	form.txt_email;		// ÀÌ¸ÞÀÏ

	if (txt_email1 == "" || txt_email1.length == 0) {
  	  	alert ("ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
  	  	form.txt_email1.focus();
  	  	return;
  	}

	if (txt_email2 == "" || txt_email2.length == 0) {
  	  	alert ("ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
  	  	form.txt_email2.focus();
  	  	return;
  	}
/*
	if(!checkEmail(txt_email.value)) {
		alert("EmailÀÌ ¿Ã¹Ù¸¥Áö È®ÀÎÇØ ÁÖ¼¼¿ä");
		 form.txt_email1.focus();
		 return;
	}
*/
/*
	if (id == "" || id.length == 0) {
  	  	alert ("ÀÌ¸ÞÀÏ ÁÖ¼Ò¸¦ ÀÔ·Â ÇØÁÖ¼¼¿ä");
  	  	form.txt_email.focus();
  	  	return;
  	  }
*/
  	if (pw == "" || pw.length == 0) {
  	  	alert ("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
  	  	form.txt_pass.focus();
  	  	return;
  	}

	if (email == true)
	{
		form.txt_email.value = "Y";
	}

	form.target = "FrameCKP";
	form.action = urlstring + "/mod/inc/message.asp";
	form.submit();
}

/*********************************************************************
 ÇÏ´ÜÀÇ ¼ººÐ ÇÃ·¹½Ã Å¬¸¯½Ã ¼ººÐ ÆäÀÌÁö·Î ÀÌµ¿
*********************************************************************/
function glossary(inCd) {
	var	form		=	document.productForm;	
	form.inCd.value	=	inCd;


	form.target	=	"_self";
	form.action =	"/products/glossary.asp"
	form.submit();
}

/*********************************************************************
¸¶ÀÌÆäÀÌÁö - ³»°¡¼±ÅÃÇÑ Á¦Ç° ¸®½ºÆ® ÇÁ¸°Æ® ÇÏ±â
*********************************************************************/
function wishPrint(printCd) {
	window.open('/member/wishlist_print.asp?printCd='+printCd, 'print',"top=100px,left=100px,status=no,resizable=no,menubar=no,scrollbars=no,width=500,height=510");
}

/*********************************************************************
³ªÀÇ¾Æº£´Ù - ¼³¹® °á°ú ÇÁ¸°Æ® ÇÏ±â
*********************************************************************/
function resultPrint(printCd) {
	window.open('/pfy/resultPrint.asp?printCd='+printCd, 'print',"top=100px,left=100px,status=no,resizable=no,menubar=no,scrollbars=yes,width=560,height=580");
}

/*********************************************************************
¸¶ÀÌÆäÀÌÁö - ³»°¡¼±ÅÃÇÑ Á¦Ç° ¸ÞÀÏ º¸³»±â ÆË¾÷
*********************************************************************/
function wishEmail(itemCd) {
	window.open('/member/recommand.asp?itemCd='+itemCd, 'recommand',"top=100px,left=100px,status=no,resizable=no,menubar=no,scrollbars=no,width=405,height=540");
}

/*********************************************************************
¸¶ÀÌÆäÀÌÁö - ³»°¡¼±ÅÃÇÑ Á¦Ç° ¸ÞÀÏ º¸³»±â ÀÔ·Â
*********************************************************************/
function sendEmail() {
		var form	=	document.emailForm;
		var	sender_nm	=	form.sender_nm;		//	º¸³»´Â»ç¶÷ ÀÌ¸§
		var	sender_em	=	form.sender_em;		//	º¸³»´Â »ç¶÷ ÀÌ¸ÞÀÏ
		var rec_nm		=	form.rec_nm;		//	¹Þ´Â »ç¶÷ ÀÌ¸§
		var rec_em		=	form.rec_em;		//	¹Þ´Â »ç¶÷ ÀÌ¸ÞÀÏ
		var contents	=	form.contents;		//	¸ÞÀÏ ³»¿ë

		if (sender_nm.value == "" ) {
			alert("º¸³»´Â »ç¶÷ ÀÌ¸§À» ÀÔ·Â ÇÏ¼¼¿ä");
			sender_nm.focus();
			return;
		}

		if (sender_em.value == "" ) {
			alert("º¸³»´Â »ç¶÷ ÀÌ¸ÞÀÏÀ» ÀÔ·Â ÇÏ¼¼¿ä");
			sender_em.focus();
			return;
		}

		if(!checkEmail(sender_em.value)) {
			alert("º¸³»´Â »ç¶÷ ÀÌ¸ÞÀÏÀÌ ¿Ã¹Ù¸¥Áö È®ÀÎÇØ ÁÖ¼¼¿ä");
			 form.sender_em.focus();
			 return;
		}

		if (rec_nm.value == "" ) {
			alert("¹Þ´Â »ç¶÷ ÀÌ¸§À» ÀÔ·Â ÇÏ¼¼¿ä");
			rec_nm.focus();
			return;
		}

		if (rec_em.value == "" ) {
			alert("¹Þ´Â »ç¶÷ ÀÌ¸ÞÀÏÀ» ÀÔ·Â ÇÏ¼¼¿ä");
			rec_em.focus();
			return;
		}

		if(!checkEmail(rec_em.value)) {
			alert("¹Þ´Â »ç¶÷ ÀÌ¸ÞÀÏÀÌ ¿Ã¹Ù¸¥Áö È®ÀÎÇØ ÁÖ¼¼¿ä");
			 form.rec_em.focus();
			 return;
		}

		if (contents.value == "" ) {
			alert("¸ÞÀÏ ³»¿ëÀ» ÀÔ·Â ÇÏ¼¼¿ä");
			contents.focus();
			return;
		}

		form.target = "FrameCKP";
		form.action = urlstring + "/mod/inc/message.asp";
		form.submit();
	}

/*********************************************************************
¸¶ÀÌÆäÀÌÁö - ³»°¡¼±ÅÃÇÑ Á¦Ç° ¸®½ºÆ® »èÁ¦ÇÏ±â
*********************************************************************/
function delFile(itemCd) {
	msg	=	confirm("¼±ÅÃÇÏ½Å Á¦Ç°À» »èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?");

	if (msg == true)
	{
		var form	=	document.pageForm;
		form.itemCd.value	=	itemCd;

		form.target = "FrameCKP";
		form.action = urlstring + "/mod/inc/message.asp";
		form.submit();
	}
}

/*********************************************************************
 ³ªÀÇ ¾Æº£´Ù - È¸¿ø Å»Åð
*********************************************************************/
function withdrawal() {
	var form	=	document.drawalForm;
	var	question	=	form.question;
	var contents	=	form.contents;

	if (form.txt_pass.value == "" )
	{
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.txt_pass.focus();
		return;
	}

	k	=	0;
	for (i=0;i<7 ; i++)
	{
		if (question[i].checked == true)
		{
			k	=	k	+	1;
		}
	}

	if (k == 0)
	{
		alert("¼³¹®À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		return;
	}
	
	msg	=	confirm("Á¤¸»·Î È¸¿ø Å»Åð ÇÏ½Ã°Ú½À´Ï±î?");

	if (msg	==	true)
	{
		form.target = "FrameCKP";
		form.action = urlstring + "/mod/inc/message.asp";
		form.submit();
	}
	
}

/*********************************************************************
Á¦Ç° ÆäÀÌÁö - ¸ÞÀÌÅ©¾÷ÀÏ°æ¿ì ¼ººÐ ¸ñ·Ï ´ë½Å COLOR ¸ñ·Ï º¸ÀÌ°Ô
*********************************************************************/
function makeup(key) {
	if (key == "off")
	{
		parent.document.all.tb_color.style.display = "none";
		parent.document.all.tb_ingredient.style.display = "";
	} else {
		document.all.tb_color.style.display = "";
		document.all.tb_ingredient.style.display = "none";
	}
	
}

/*********************************************************************
Á¦Ç° ÆäÀÌÁö - Á¦Ç° Å©°Ô º¸±â
*********************************************************************/
function BigPopup(CateCode, MenuCode) {
	window.open('/products/BigPopup.asp?CateCode='+CateCode+'&MenuCode='+MenuCode, 'details',"top=100px,left=100px,status=no,resizable=no,menubar=no,scrollbars=no,width=405,height=550");
}

/*********************************************************************
 Á¦Ç° »ó¼¼ ÆäÀÌÁö - È¿°ú | ¼ººÐ | »ç¿ë¹æ¹ý | Á¦Ç° ½ºÅ¸ÀÏ¸µ ÄÁÆ®·Ñ
*********************************************************************/
function detail_view(key,gubun,cnt) {
	
	var BeDesc	=	document.productForm.BeDesc.value;		//	È¿°ú µ¥ÀÌÅÍ ¾øÀ»°æ¿ì
	var InDesc	=	document.productForm.InDesc.value;		//	¼ººÐ µ¥ÀÌÅÍ ¾øÀ»°æ¿ì
	var UseDesc	=	document.productForm.UseDesc.value;		//	»ç¿ë¹æ¹ý µ¥ÀÌÅÍ ¾øÀ»°æ¿ì
	var TipDesc	=	document.productForm.TipDesc.value;		//	Á¦Ç° ½ºÅ¸ÀÏ¸µ µ¥ÀÌÅÍ ¾øÀ»°æ¿ì
	var daily	=	document.productForm.daily.value;		//	Á¦Ç° ½ºÅ¸ÀÏ¸µ µ¥ÀÌÅÍ ¾øÀ»°æ¿ì
	var TipDesc2	=	document.productForm.TipDesc2.value;		//	Á¦Ç° ½ºÅ¸ÀÏ¸µ µ¥ÀÌÅÍ ¾øÀ»°æ¿ì

	if (key == "1" || key == "2" || key == "3" || key == "4" || key == "6" || key == "7")	{
		if (key == "1")	{
			show_img1	=	"_over"; show_img2	=	"";		show_img3	=	""; show_img4	=	"";show_img5	=	"";show_img6	=	"";
			show_txt1	=	"";		show_txt2	=	"none";	show_txt3	=	"none"; show_txt4	=	"none";show_txt5	=	"none";show_txt6	=	"none";
		} else if (key == "2") {
			show_img1	=	"";		show_img2	=	"_over";show_img3	=	""; show_img4	=	"";show_img5	=	"";show_img6	=	"";
			show_txt1	=	"none";	show_txt2	=	"";		show_txt3	=	"none";	show_txt4	=	"none";show_txt5	=	"none";show_txt6	=	"none";
		} else if (key == "3") {
			show_img1	=	"";		show_img2	=	"";		show_img3	=	"_over"; show_img4	=	"";show_img5	=	"";show_img6	=	"";
			show_txt1	=	"none";	show_txt2	=	"none";	show_txt3	=	""; show_txt4	=	"none";show_txt5	=	"none";show_txt6	=	"none";
		} else if (key == "4") {
			show_img1	=	"";		show_img2	=	"";		show_img3	=	""; show_img4	=	"_over";show_img5	=	"";show_img6	=	"";
			show_txt1	=	"none";	show_txt2	=	"none";	show_txt3	=	"none"; show_txt4	=	"";show_txt5	=	"none";show_txt6	=	"none";
		} else if (key == "6") {
			show_img1	=	"";		show_img2	=	"";		show_img3	=	""; show_img4	=	"";show_img5	=	"_over";show_img6	=	"";
			show_txt1	=	"none";	show_txt2	=	"none";	show_txt3	=	"none"; show_txt4	=	"none";show_txt5	=	"";show_txt6	=	"none";
		} else if (key == "7") {
			show_img1	=	"";		show_img2	=	"";		show_img3	=	""; show_img4	=	"";show_img5	=	"";show_img6	=	"_over";
			show_txt1	=	"none";	show_txt2	=	"none";	show_txt3	=	"none"; show_txt4	=	"none";show_txt5	=	"none";show_txt6	=	"";
		} 
		
		if (BeDesc != "off") {
			document.all.itemBeDesc.style.display = show_txt1;
			document.a_img.src="/products/images/sub_detail_01"+show_img1+".gif";
		}
		if (InDesc != "off") {
			document.all.itemInDesc.style.display =  show_txt2;
			document.b_img.src="/products/images/sub_detail_02"+show_img2+".gif";
		}
		
		if (UseDesc != "off") {
			document.all.itemUseDesc.style.display =  show_txt3;
			document.c_img.src="/products/images/sub_detail_03"+show_img3+".gif";
		}

		if (TipDesc != "off") {
			document.all.itemTipDesc.style.display =  show_txt4;
			document.d_img.src="/products/images/sub_detail_04"+show_img4+".gif";
		}

		if (daily != "off") {
			document.all.itemDaily.style.display =  show_txt5;
			document.e_img.src="/products/images/sub_detail_05"+show_img5+".gif";
		}

		if (TipDesc2 != "off") {
			document.all.itemTipDesc2.style.display =  show_txt6;
			document.f_img.src="/products/images/sub_detail_07"+show_img6+".gif";
		}
	
	} else if (key == "5"){
		imgId	=	eval("document.all."+gubun);
		
		if (gubun == "iden_img2") {
			imgId.style.borderColor	=	"#137DA4";
			document.all.inDesc2.style.display	=	"";
			document.all.inDesc1.style.display	=	"none";
			document.all.iden_img1.style.borderColor	=	"#C7C7C7";
			document.all.txt_style1.style.color			=	"#666666";
			document.all.txt_style2.style.color			=	"#137DA4";
		} else if (gubun == "iden_img1") {
			imgId.style.borderColor	=	"#137DA4";			
			document.all.txt_style1.style.color			=	"#137DA4";			
			document.all.inDesc1.style.display			=	"";
			if (cnt == 2)
			{
				document.all.inDesc2.style.display			=	"none";
				document.all.txt_style2.style.color			=	"#666666";
				document.all.iden_img2.style.borderColor	=	"#C7C7C7";
			}
			
		}
	}
	
	
}

/*********************************************************************
 Á¦Ç° »ó¼¼ ÆäÀÌÁö - ¼ººÐ ¸ñ·Ï Å¬¸¯½Ã
*********************************************************************/
function ingredient(inCd) {
	productForm.inCd.value	=	inCd;
	productForm.target	=	"_self";
	productForm.action	=	"/products/glossary.asp";
	productForm.submit();
}

/*********************************************************************
 È¸¿ø°¡ÀÔ - ÀÌ¿ë¾à°ü/°³ÀÎº¸È£Á¤Ã¥ Ã¼Å©
*********************************************************************/
function nextPage() {
	if(document.agree_form.agree.checked == false) {
		alert("ÀÌ¿ë¾à°ü¿¡ µ¿ÀÇÇØ ÁÖ¼¼¿ä");
		document.agree_form.agree.focus();
		return;
	}

	if(document.agree_form.agree2.checked == false) {
		alert("°³ÀÎº¸È£Á¤Ã¥¿¡ µ¿ÀÇÇØ ÁÖ¼¼¿ä");
		document.agree_form.agree2.focus();
		return;
	}

	agree_form.chkMethod.value = "ok"
	agree_form.action = "/member/mem2.asp";
	agree_form.submit();
}

/*********************************************************************
 ÀÌ¸ÞÀÏ Ã¼Å©
*********************************************************************/
function check_email(chkForm)
{  
	//form	=	eval(chkForm);
	var form = document.regForm;

	var str_id		=	form.txt_email1.value;
	var str_addr	=	document.regForm.txt_email2.value;	
	
	if(str_id == "" && !form.txt_email2.options[0].selected){
		alert("ºóÄ­À» Ã¤¿öÁÖ¼¼¿ä.");
		form.txt_email1.focus();
		form.txt_email2.options[0].selected = true;
		return;
	}else if(str_id != "" && str_id.indexOf("@") > -1){			
		alert("@ÀÇ ¾ÕºÎºÐ¸¸ ÀÔ·ÂÇØ ÁÖ½Ã°í,\nµÞºÎºÐÀº ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
		form.txt_email1.focus();
		form.txt_email2.options[0].selected = true; 
		return;		
	}	
	
	if (str_addr == "etc" ){
		 email_popup(form,chkForm);	
	}else {
		var mailsum = form.txt_email1.value + "@" + form.txt_email2.value;
		form.txt_email.value = mailsum;
	}	 
	//alert(write_form.txt_email.value) ;
}

/*********************************************************************
 Á÷Á¢ ÀÔ·ÂÇÏ´Â ÆË¾÷À» open
*********************************************************************/
function email_popup(evalform,chkForm) {
	//form	=	eval(evalform);
  	var urlname = "/member/mail.asp?eml_id="+document.regForm.txt_email1.value+"&chkForm="+chkForm;
		addr_etc = window.open(urlname, '',"top=100px,left=100px,status=no,resizable=no,menubar=no,scrollbars=no,width=405,height=258");
}

/*********************************************************************
 E-mail À¯È¿¼º °Ë»ç
*********************************************************************/

function checkEmail(str){
	var boolSuccess=false;
	var countAT=0,countDOT=0;
	
	for (var i= 0; i < str.length; i++){
		var chInput = str.substring(i,i+1);
		if (chInput == "@") {		
			countAT++;		
		}
		if (countAT == 1) {
			if (chInput == "."){
				countDOT++;
			}
		} else {
		countDOT=0;
	}
}
if ((countAT == 1) && (countDOT > 0)) {boolSuccess = true;}
return boolSuccess;	
}


/*********************************************************************
 E-mail Áßº¹ °Ë»ç
*********************************************************************/

function duplicate(chkForm) {
	var form	=	eval(chkForm);
	txt_email	=	form.txt_email.value;

	if (txt_email == "")
	{
		alert("ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.txt_email1.focus();
		return;
	}

	form.target = "FrameCKP";
	form.action = "/mod/inc/message.asp";
	form.submit();
}

/*********************************************************************
 ¼ýÀÚ Ã¼Å©
*********************************************************************/
function onlynum(objform,txtChk){
	
	var form	=	eval(objform);
	var	txt_reg	=	eval(objform+"."+txtChk+".value");
	var txt_focus	=	eval(objform+"."+txtChk+".focus()");

	var auto	=	txt_reg.length;
	var ret;

	for (var i = 0; i < txt_reg.length; i++) {
		ret = txt_reg.charCodeAt(i);
		if (!((ret > 47) && (ret < 58)))  {
			alert("¼ýÀÚ¸¸À» ÀÔ·ÂÇÏ¼¼¿ä");
			txt_reg = "";
			txt_focus;
			return false;
		}
	}
	
	if (txtChk == "txt_reg1")
	{
		if (auto == 6) {
		  form.txt_reg2.focus();
		  }
		return true;
	} 

	if (txtChk == "txt_reg2")
	{
		if (auto == 7) {
			if (form.txt_reg1.value == "")
			{
				alert("ÁÖ¹Î¹øÈ£ ¾ÕÀÚ¸®¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
				return false;
			} else {
				var reg1	=	form.txt_reg1.value;
				var reg2	=	form.txt_reg2.value;
				check_juminno(reg1,reg2);
				

			}
		 }
		return true;
	}
}


/*********************************************************************
 Àç¿Ü±¹ÀÎ ¹øÈ£ Ã¼Å©
*********************************************************************/
function check_fgnno(fgnno) {
 var sum=0;
 var odd=0;
 buf = new Array(13);
 for(i=0; i<13; i++) { buf[i]=parseInt(fgnno.charAt(i)); }
 odd = buf[7]*10 + buf[8];
 if(odd%2 != 0) { return false; }
 if( (buf[11]!=6) && (buf[11]!=7) && (buf[11]!=8) && (buf[11]!=9) ) {
  return false;
 }
 multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];
 for(i=0, sum=0; i<12; i++) { sum += (buf[i] *= multipliers[i]); }
 sum = 11 - (sum%11);
 if(sum >= 10) { sum -= 10; }
 sum += 2;
 if(sum >= 10) { sum -= 10; }
 if(sum != buf[12]) { return false }
 return true;
}

/*********************************************************************
 ÁÖ¹Î¹øÈ£ Ã¼Å©
*********************************************************************/
function check_juminno(jumin1,jumin2) {

 if((jumin1=="" || jumin1==null) || (jumin2=="" || jumin2==null)) {
  alert("ÁÖ¹Îµî·Ï¹øÈ£¸¦ Àû¾îÁÖ¼¼¿ä.");
  return false;
 }
 //var jumin1 = juminno.substr(0,6);
 //var jumin2 = juminno.substr(6,7);

 var yy     = jumin1.substr(0,2); // ³âµµ
 var mm     = jumin1.substr(2,2); // ¿ù
 var dd     = jumin1.substr(4,2); // ÀÏ
 var genda  = jumin2.substr(0,1); // ¼ºº°
 var msg, ss, cc;

 // ¼ýÀÚ°¡ ¾Æ´Ñ °ÍÀ» ÀÔ·ÂÇÑ °æ¿ì
 if (!isNumeric(jumin1)) {
  alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä.");
  return false;
 }
 // ±æÀÌ°¡ 6ÀÌ ¾Æ´Ñ °æ¿ì
 if (jumin1.length != 6) {
  alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
  return false;
 }
 // Ã¹¹øÂ° ÀÚ·á¿¡¼­ ¿¬¿ùÀÏ(YYMMDD) Çü½Ä Áß ±âº» ±¸¼º °Ë»ç
 if (yy < "00" || yy > "99" ||
  mm < "01" || mm > "12" ||
  dd < "01" || dd > "31") {
  alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
  return false;
 }
 // ¼ýÀÚ°¡ ¾Æ´Ñ °ÍÀ» ÀÔ·ÂÇÑ °æ¿ì
 if (!isNumeric(jumin2)) {
  alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä.");
  return false;
 }
 // ±æÀÌ°¡ 7ÀÌ ¾Æ´Ñ °æ¿ì
 if (jumin2.length != 7) {
  alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
  return false;
 }
 // ¼ºº°ºÎºÐÀÌ 1 ~ 4 °¡ ¾Æ´Ñ °æ¿ì
 if (genda < "1" || genda > "4") {
  alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
  return false;
 }
 // ¿¬µµ °è»ê - 1 ¶Ç´Â 2: 1900³â´ë, 3 ¶Ç´Â 4: 2000³â´ë
 cc = (genda == "1" || genda == "2") ? "19" : "20";
 // Ã¹¹øÂ° ÀÚ·á¿¡¼­ ¿¬¿ùÀÏ(YYMMDD) Çü½Ä Áß ³¯Â¥ Çü½Ä °Ë»ç
 if (isYYYYMMDD(parseInt(cc+yy), parseInt(mm), parseInt(dd)) == false) {
  alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
  return false;
 }
 // Check Digit °Ë»ç
 if (!isSSN(jumin1, jumin2)) {
  alert("ÀÔ·ÂÇÑ ÁÖ¹Îµî·Ï¹øÈ£¸¦ °ËÅäÇÑ ÈÄ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
  return false;
 }

 // ÁÖ¹Î¹øÈ£·Î »ý³â¿ùÀÏ ÀÔ·Â ÇÏ±â
 
 if (genda > "2")
 {
	txt_yy	=	"20"+yy;
 } else {
	txt_yy	=	"19"+yy;
 }

 regForm.txt_year.value		=	txt_yy;
 regForm.txt_month.value	=	mm;
 regForm.txt_day.value		=	dd;

 return true;
}

/*********************************************************************
 »ç¾÷ÀÚµî·Ï¹øÈ£ Ã¼Å©
*********************************************************************/
function check_busino(vencod) {
 var sum = 0;
 var getlist =new Array(10);
 var chkvalue =new Array("1","3","7","1","3","7","1","3","5");
 for(var i=0; i<10; i++) { getlist[i] = vencod.substring(i, i+1); }
 for(var i=0; i<9; i++) { sum += getlist[i]*chkvalue[i]; }
 sum = sum + parseInt((getlist[8]*5)/10);
 sidliy = sum % 10;
 sidchk = 0;
 if(sidliy != 0) { sidchk = 10 - sidliy; }
 else { sidchk = 0; }
 if(sidchk != getlist[9]) { return false; }
 return true;
}


function isYYYYMMDD(y, m, d) {
 switch (m) {
 case 2: // 2¿ùÀÇ °æ¿ì
  if (d > 29) return false;
  if (d == 29) {
   // 2¿ù 29ÀÇ °æ¿ì ´çÇØ°¡ À±³âÀÎÁö¸¦ È®ÀÎ
   if ((y % 4 != 0) || (y % 100 == 0) && (y % 400 != 0))
    return false;
  }
  break;
 case 4: // ÀÛÀº ´ÞÀÇ °æ¿ì
 case 6:
 case 9:
 case 11:
  if (d == 31) return false;
 }
 // Å« ´ÞÀÇ °æ¿ì
 return true;
}
function isNumeric(s) {
 for (i=0; i<s.length; i++) {
  c = s.substr(i, 1);
  if (c < "0" || c > "9") return false;
 }
 return true;
}
function isLeapYear(y) {
 if (y < 100)
 y = y + 1900;
 if ( (y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0) ) {
  return true;
 } else {
  return false;
 }
}
function getNumberOfDate(yy, mm) {
 month = new Array(29,31,28,31,30,31,30,31,31,30,31,30,31);
 if (mm == 2 && isLeapYear(yy)) mm = 0;
 return month[mm];
}
function isSSN(s1, s2) {
 n = 2;
 sum = 0;
 for (i=0; i<s1.length; i++)
  sum += parseInt(s1.substr(i, 1)) * n++;
 for (i=0; i<s2.length-1; i++) {
  sum += parseInt(s2.substr(i, 1)) * n++;
  if (n == 10) n = 2;
 }
 c = 11 - sum % 11;
 if (c == 11) c = 1;
 if (c == 10) c = 0;
 if (c != parseInt(s2.substr(6, 1))) return false;
 else return true;
}


/*********************************************************************
 ÀÌ¸ÞÀÏ Ã¼Å©
*********************************************************************/

function reception(chkForm) {
	var form	=	eval(chkForm);
	var txt_email2	=	form.txt_email2.value;
	var txt_rec		=	form.txt_mail_reception.checked;

	if (txt_email2 == "")
	{
		alert("ÀÌ¸ÞÀÏÁÖ¼Ò¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.txt_mail_reception.checked = false;
	} else {
		if (txt_rec == true)
		{
			if (txt_email2 == "hanmail.net" || txt_email2 == "daum.net")
			{
				alert("ÇÑ¸ÞÀÏ(hanmail.net, daum.net)¿ÜÀÇ ´Ù¸¥ ¸ÞÀÏÀ» ÀÔ·ÂÇÏ¿© ÁÖ¼¼¿ä");
				form.txt_mail_reception.checked = false;
			}
		}
	}
}

/*********************************************************************
 SMS Ã¼Å©
*********************************************************************/

function reception2(chkForm) {
	var form		=	eval(chkForm);
	var txt_tel1	=	form.txt_tel1.value;
	var txt_tel2	=	form.txt_tel2.value;
	var txt_tel3	=	form.txt_tel3.value;
	var txt_rec		=	form.txt_sms_reception.checked;

	if (txt_tel1 == "" || txt_tel2 == "" || txt_tel3 == "")
	{
		alert("¿¬¶ôÃ³¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.txt_sms_reception.checked = false;
	} 
}

/*********************************************************************
 ¾ÆÀÌµð ÀÔ·Â½Ã ÇÑ±Û,¿µ¹® Ã¼Å©
*********************************************************************/

function onlyEng(objform,txtChk) {
	var form   = eval(objform);
	
	var inText = eval(objform+"."+txtChk+".value");
	var ret;

	for (var i = 0; i < inText.length; i++) {
	    ret = inText.charCodeAt(i);
		if ((ret > 122) || (ret < 48) || (ret > 57 && ret < 65) || (ret > 90 && ret < 97)) {
			alert("¿µ¹®ÀÚ¿Í ¼ýÀÚ¸¸À» ÀÔ·ÂÇÏ¼¼¿ä");
			inText = "";
			return false;
		}
	}
	return true;
}

/*********************************************************************
 ¿ìÆí¹øÈ£ °Ë»ö
*********************************************************************/
function post() {
	window.open("/Member/search_zipcode.asp", "post", "menubar=no, toolbar=no, location=no, directories=no, scrollbars=no, status=no, resizable=no, width=405, height=440,left=300,top=70");
}

/*********************************************************************
 °ø¹éÃ¼Å©
*********************************************************************/
function checkMandatory(str)
{
	if (str.length == 0 || str == 0) 
		return false;
	else
		return true;
}

/*********************************************************************
 ¼ýÀÚÃ¼Å©
*********************************************************************/
function checkStringInteger(str)
{
	var boolSuccess=true;	
	if (str.length == 0)
	    boolSuccess=false;	
	for (var i = 0; i < str.length; i ++)
	{
		var chInput = str.substring(i,i+1);
		if (chInput == ".")
			boolSuccess = boolSuccess && false;
		else if ((chInput < "0" || chInput > "9" ) && (chInput != ","))
			boolSuccess = boolSuccess && false;
		else
		    boolSuccess = boolSuccess && true;
	}
	return boolSuccess;
} 

/*********************************************************************
 ¿¬¶ôÃ³ ÀÚ¸®¼ö Ã¼Å©
*********************************************************************/
function checkPhoneLength(str)
{
	if (str.length != 4) 
		return false;
	else
	return true;
}
/*********************************************************************
 ¿¬¶ôÃ³ ÀÚ¸®¼ö Ã¼Å©
*********************************************************************/
function checkPhoneLength2(str)
{
	if (str.length != 4 && str.length != 3 && str.length != 2) 
		return false;
	else
	return true;
}


/*********************************************************************
 È¸¿ø°¡ÀÔ- ¼±ÅÃÁ¤º¸ ÀÔ·Â½Ã °¹¼ö Á¦ÇÑ
 - ´ç½ÅÀÇ ¸ð¹ß Å¸ÀÔ - 3°³ ÀÌ»ó ¼±ÅÃ ºÒ°¡
 - Çì¾îÄÉ¾î Áß ÇöÀç °¡Àå °í¹Î - 2°³ÀÌ»ó ¼±ÅÃ ºÒ°¡
*********************************************************************/

function check_question(key,count) {
	var form	=	document.regForm;
	var chk		=	0;
	var last_no	=	0;
	if (key == "qst5")
	{
		for(i=0;i<count;i++) {
			if (form.txt_question5[i].checked == true)
			{  
				chk		=	chk + 1;
				if ((chk > 2 ))
				{
					form.txt_question5[i].checked = false;
					alert('"´ç½ÅÀÇ ¸ð¹ß Å¸ÀÔ" ¼³¹®Àº 2°³±îÁö ¼±ÅÃ °¡´É ÇÕ´Ï´Ù.');					
					return;
				}
			}
		}
		
	} else if (key == "qst7") {
		for(i=0;i<count;i++) {
			if (form.txt_question7[i].checked == true)
			{  
				chk		=	chk + 1;
				if ((chk > 2 ))
				{
					form.txt_question7[i].checked = false;
					alert('"Çì¾îÄÉ¾î Áß ÇöÀç °¡Àå °í¹Î ÁßÀÎ ¹®Á¦Á¡" ¼³¹®Àº 2°³±îÁö ¼±ÅÃ °¡´É ÇÕ´Ï´Ù.');					
					return;
				}
			}
		}
		

	}
}

/*********************************************************************
 È¸¿ø°¡ÀÔ- ¼±ÅÃÁ¤º¸ ±âÅ¸ ÀÔ·Â½Ã ÀÔ·Â ¹Ú½º (Show/Hide)
*********************************************************************/

function view_txt1(key,work) {
	var form	=	document.regForm;
	if (form.txt_question4[key-1].checked == true)
	{
		form.txt_question4_rec.readOnly = false;
		if (work == "modify")
		{
			form.txt_question4_rec.value = form.etc4.value;
		}	
		form.txt_question4_rec.focus();
	} else {
		form.txt_question4_rec.value = "";
		form.txt_question4_rec.readOnly = true;
	}
}

function view_txt2(key,work) {
	var form	=	document.regForm;
	if (form.txt_question7[key-1].checked == true)
	{
		form.txt_question7_rec.readOnly = false;
		if (work == "modify")
		{
			form.txt_question7_rec.value = form.etc7.value;
		}	
		form.txt_question7_rec.focus();
	} else {
		form.txt_question7_rec.value = "";
		form.txt_question7_rec.readOnly = true;
	}
}

function view_txt3(key,work) {
	var form	=	document.regForm;
	if (form.txt_question9[key-1].checked == true)
	{
		form.txt_question9_rec.readOnly = false;
		if (work == "modify")
		{
			form.txt_question9_rec.value = form.etc9.value;
		}	
		form.txt_question9_rec.focus();
	} else {
		form.txt_question9_rec.value = "";
		form.txt_question9_rec.readOnly = true;
	}
}

/*********************************************************************
 È¸¿ø°¡ÀÔ- ´Ù½Ã ÀÔ·Â Ã³¸®
*********************************************************************/

function txtReset() {
	regForm.reset();
	//regForm.action  = "register.asp";
	//regForm.submit();
}

/*********************************************************************
 Login Ã¼Å©
*********************************************************************/

function login1() {
	var form	=	document.loginForm;
	var id		=	form.txt_id.value;
	var pw		=	form.txt_pass.value;
	var email	=	form.txt_email.checked;
	if (id == "" || id.length == 0) {
  	  	alert ("ÀÌ¸ÞÀÏ ÁÖ¼Ò¸¦ ÀÔ·Â ÇØÁÖ¼¼¿ä");
  	  	form.txt_id.focus();
  	  	return;
  	  }

  	if (pw == "" || pw.length == 0) {
  	  	alert ("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
  	  	form.txt_pass.focus();
  	  	return;
  	}

	if (email == true)
	{
		form.txt_email.value = "Y";
	}

	form.target = "FrameCKP";
	form.action = urlstring + "/mod/inc/message.asp";
	form.submit();
}

/*********************************************************************
 ¾ÆÀÌµð/ºñ¹Ð¹øÈ£ Ã£±â
*********************************************************************/

function search_info(chkForm) {
	var form		=	eval(chkForm);
	var txt_reg1	=	form.txt_reg1;	//	ÁÖ¹Î¹øÈ£ ¾ÕÀÚ¸®
	var txt_reg2	=	form.txt_reg2;	//	ÁÖ¹Î¹øÈ£ µÞÀÚ¸®
	var txt_name	=	form.txt_name;	//	ÀÌ¸§
	var key			=	form.key.value;

	if(document.agree_form.agree.checked == false) {
		alert("°³ÀÎÁ¤º¸ ¼öÁý¿¡ µ¿ÀÇÇØ ÁÖ¼¼¿ä");
		document.agree_form.agree.focus();
		return;
	}

	if (key == "pw")
	{
		var txt_email	=	form.txt_email;
		if (txt_email.value == "")
		{
			alert("ÀÌ¸ÞÀÏ ÁÖ¼Ò¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
			txt_email.focus();
			return;
		}
	}
	if (txt_name.value == "")
	{
		alert("ÀÌ¸§À» ÀÔ·ÂÇØÁÖ¼¼¿ä");
		txt_name.focus();
		return;
	}

	if (txt_reg1.value == "")
	{
		alert("ÁÖ¹Î¹øÈ£ ¾ÕÀÚ¸®¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä");
		txt_reg1.focus();
		return;
	}

	if (txt_reg2.value == "")
	{
		alert("ÁÖ¹Î¹øÈ£ µÞÀÚ¸®¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä");
		txt_reg2.focus();
		return;
	}

	form.target = "FrameCKP";
	form.action = urlstring + "/mod/inc/message.asp";
	form.submit();
}

/*********************************************************************
 ÀÌ¸ÞÀÏ / ºñ¹Ð¹øÈ£ ¹®ÀÇ
*********************************************************************/

function send(chkForm) {
	var form		=	eval(chkForm);
	var txt_reg1	=	form.txt_reg1;	//	ÁÖ¹Î¹øÈ£ ¾ÕÀÚ¸®
	var txt_reg2	=	form.txt_reg2;	//	ÁÖ¹Î¹øÈ£ µÞÀÚ¸®
	var txt_name	=	form.txt_name;	//	ÀÌ¸§
	var txt_hp		=	form.txt_hp;	//	¿¬¶ôÃ³
	var txt_email	=	form.txt_email;	//	ÀÌ¸ÞÀÏ ÁÖ¼Ò

	if(document.conForm.agree.checked == false) {
		alert("°³ÀÎÁ¤º¸ ¼öÁý¿¡ µ¿ÀÇÇØ ÁÖ¼¼¿ä");
		document.conForm.agree.focus();
		return;
	}

	if (txt_name.value == "" )
	{
		alert("ÀÌ¸§À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		txt_name.focus();
		return;
	}

	if (txt_reg1.value == "" )
	{
		alert("ÁÖ¹Î¹ø·Î ¾ÕÀÚ¸®¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		txt_reg1.focus();
		return;
	}

	if (txt_reg2.value == "" )
	{
		alert("ÁÖ¹Î¹ø·Î µÞÀÚ¸®¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		txt_reg2.focus();
		return;
	}

	if (txt_hp.value == "" )
	{
		alert("¿¬¶ôÃ³¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		txt_hp.focus();
		return;
	}

	if (txt_email.value == "" )
	{
		alert("ÀÌ¸ÞÀÏ ÁÖ¼Ò¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		txt_email.focus();
		return;
	}

	form.target = "FrameCKP";
	form.action = urlstring + "/mod/inc/message.asp";
	form.submit();
}

/*********************************************************************
 ¿Â¶óÀÎ ±×¸° ¸¶ÀÏ¸®Áö - ÄíÆù ÆË¾÷ ÆäÀÌÁö STEP 1
*********************************************************************/
function coupon() {
//	alert("ÆË¾÷ÀÌ Â÷´Ü µÇ¾î ÀÖÀ¸¸é ÄíÆù Ãâ·ÂÀÌ Á¤»óÀûÀ¸·Î \n\nÁøÇàµÇÁö ¾ÊÀ» ¼ö ÀÖÀ¸´Ï ÆË¾÷ Â÷´ÜÀ» Ç®¾î ÁÖ¼¼¿ä");
	window.open("/member/coupon.asp", "coupon","top=100px,left=100px,status=no,resizable=no,menubar=no,scrollbars=no,width=500,height=485");
}

/*********************************************************************
 ¿Â¶óÀÎ ±×¸° ¸¶ÀÏ¸®Áö - ÄíÆù »ç¿ë¹æ¹ý ÆË¾÷
*********************************************************************/
function useCoupon() {
	window.open("/member/useCoupon.asp", "useinfo","top=100px,left=100px,status=no,resizable=no,menubar=no,scrollbars=yes,width=518,height=600");
}

/*********************************************************************
 ¿Â¶óÀÎ ±×¸° ¸¶ÀÏ¸®Áö - ³ª¿Í °¡±î¿î ¸ÅÀå Ã£±â
*********************************************************************/
function NearShop()	{
	var form	=	document.productForm;

	form.key.value	=	"nearShop";
	form.action		=	"/stores/locator.asp";
	form.submit();
}

/*********************************************************************
 ¿Â¶óÀÎ ±×¸° ¸¶ÀÏ¸®Áö - ÄíÆù ÆË¾÷ ÆäÀÌÁö STEP 2
*********************************************************************/

function point(chkForm, strPoint) {
	var form		=	eval(chkForm);
	var point		=	form.select_point;
	var online_pt	=	strPoint;

	if (point.value == "")
	{
		alert("»ç¿ëÇÏ½Ç Æ÷ÀÎÆ®¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä");
		return;
	}

	if (eval(point.value) < 100)
	{
		alert("100Á¡ ÀÌ»ó Àû¸³ÇÑ Æ÷ÀÎÆ®¸¸ Ãâ·Â °¡´ÉÇÕ´Ï´Ù");
		return;
	}

	if (point.value > online_pt)
	{
		alert("º¸À¯ÇÏ½Å Æ÷ÀÎÆ®¸¦ È®ÀÎ ÇÏ¿© ÁÖ¼¼¿ä");
		return;
	}
	
//	message	=	confirm('ÄíÆùÀ» ÇÁ¸°Æ® ÇÏ½Ã°Ú½À´Ï±î?\n\nÈ®ÀÎÀ» Å¬¸¯ÇÏ½Å ÈÄ ÇÁ¸°Æ® ¼³Á¤¿¡¼­ "Ãë¼Ò"¸¦ Å¬¸¯ÇØµµ Æ÷ÀÎÆ®´Â Â÷°¨µË´Ï´Ù.');

//	if (message == true)
//	{
//		window.open("/mod/inc/coupon.asp", "print","top=100px,left=100px,status=no,resizable=no,menubar=no,scrollbars=no,width=660,height=505");
//		form.target = "print";
		form.action = "/mod/inc/coupon.asp?print=ok";
		form.submit();

		form.target = "FrameCKP";
		form.action = urlstring + "/mod/inc/message.asp";
		form.submit();
//	}
}

/*********************************************************************
 ¸ÞÀÎ È­¸é - ÇÏ´Ü ÀÌº¥Æ® º¸ÀÌ±â/¼û±â±â
*********************************************************************/

function ShowHide() {
	var work = mainForm.work.value;
	if (work == "N")
	{
		banner.style.display = "";
		mainForm.work.value	=	"Y";
	} else {
		banner.style.display = "none";
		mainForm.work.value	=	"N";
	}
}

/*********************************************************************
 ¹®ÀÇ »çÇ×
*********************************************************************/

function contact() {
	var form		=	document.contactForm;
	var	txt_title	=	form.txt_title;		//	Á¦¸ñ
	var	txt_select	=	form.txt_select;	//	ºÐ·ù
	var	txt_name	=	form.txt_name;		//	ÀÛ¼ºÀÚ
	var	txt_email	=	form.txt_email;		//	ÀÌ¸ÞÀÏ
	var	txt_hp		=	form.txt_hp;		//	¿¬¶ôÃ³
	var	txt_content	=	form.txt_content;	//	³»¿ë

	if (txt_title.value == "" || txt_title.value.length == 0)
	{
		alert("Á¦¸ñÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		txt_title.focus();
		return;
	}

	if (txt_select.value == "" || txt_select.value.length == 0)
	{
		alert("ºÐ·ù¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä");
		txt_select.focus();
		return;
	}

	if (txt_name.value == "" || txt_name.value.length == 0)
	{
		alert("ÀÛ¼ºÀÚ¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		txt_name.focus();
		return;
	}

	if (txt_email.value == "" || txt_email.value.length == 0)
	{
		alert("¸ÞÀÏÁÖ¼Ò¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		txt_email.focus();
		return;
	}

	if (txt_hp.value == "" || txt_hp.value.length == 0)
	{
		alert("¿¬¶ôÃ³¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		txt_hp.focus();
		return;
	}

	if (txt_content.value == "" || txt_content.value.length == 0)
	{
		alert("¿¬¶ôÃ³¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		txt_content.focus();
		return;
	}

	form.target = "FrameCKP";
	form.action = urlstring + "/mod/inc/message.asp";
	form.submit();

}

