var qna_edit=1;
function addCart(f,next) {
	var astr = '';
	if (f.stat.value!=2)
	{
		ems='\n ÁË¼ÛÇÕ´Ï´Ù\n\n '+soldout_name+'µÈ »óÇ°Àº ÁÖ¹®ÇÒ ¼ö ¾ø½À´Ï´Ù        \n';
		if (typeof f.sold_reserve!='undefined' && f.sold_reserve.value=='Y')
		{
			ems+='\n ¿¹¾àÁÖ¹®ÇÏ±â¸¦ ÀÌ¿ëÇÏ½Ã¸é ÀÔ°íÈÄ ¿¬¶ôµå¸®°Ú½À´Ï´Ù        ';
		}
		alert(ems);
		return;
	}
	var min_ord=eval(f.min_ord.value);
	var max_ord=eval(f.max_ord.value);
	var buy_ea=eval(f.buy_ea.value);


	if (buy_ea<min_ord)
	{
		if(min_ord>1) astr='ÀÌ »óÇ°Àº ';
		alert(astr+'ÃÖ¼Ò '+min_ord+'°³ ÀÌ»ó ±¸¸ÅÇÏ¼Å¾ßÇÕ´Ï´Ù');
		f.buy_ea.value=min_ord;
		return;
	}
	if (max_ord && buy_ea>max_ord)
	{
		alert('ÀÌ »óÇ°Àº ÃÖ´ë '+max_ord+'°³±îÁö ±¸¸ÅÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù');
		f.buy_ea.value=max_ord;
		return;
	}

	opt_no=eval(f.opt_no.value);
	if (opt_no>0)
	{
		for (j=1; j<=eval(opt_no); j++)
		{
			if (f.elements['option_necessary'+j].value=="Y") // necessary
			{
				if (f.elements['option_type'+j].value==2) // select
				{
					if (!checkSel(f.elements['option'+j],f.elements['option_name'+j].value+'À»(¸¦)')) return;
				}
				else // radio, checkbox
				{
					if (!checkCB(f.elements['option'+j],f.elements['option_name'+j].value+'À»(¸¦)')) return;
				}

			}
			// <2006-12-01 : ¿É¼ÇÀç°íÃ¼Å© - Han
			if(f.elements['option_ea_ck'+j].value == "Y"){
				if(f.elements['option_ea_num'+j].value < 1){ alert("ÇØ´ç ¿É¼ÇÀº Ç°ÀýµÇ¾ú½À´Ï´Ù. - "+f.elements['option_name'+j].value+"   "); return; }
				if(buy_ea > f.elements['option_ea_num'+j].value){ 
					alert("ÇØ´ç ¿É¼ÇÀº "+f.elements['option_ea_num'+j].value+"±îÁö¸¸ ±¸¸Å°¡ °¡´ÉÇÕ´Ï´Ù. - "+f.elements['option_name'+j].value+"   ");
					f.buy_ea.value=f.elements['option_ea_num'+j].value;
					return;
				}
			}
			// >
		}
	}


	//cwith=confirm('\n Ã¥¹Ù±¸´Ï¿¡ ÀÖ´Â »óÇ°°ú ÇÔ²² ÁÖ¹®ÇÏ½Ã°Ú½À´Ï±î?\n\n \'Ãë¼Ò\'À» Å¬¸¯ÇÏ½Ã¸é ¼±ÅÃÇÏ½Å »óÇ°¸¸ ÁÖ¹®ÇÕ´Ï´Ù                  ');
	cwith=1;
	if (next==1 || (next==2 && cwith))
	{
		tg=hid_frame;
		ac=root_url+'/main/exec.php?exec_file=cart/cart.exe.php';
		f.next.value=next;
	}
	else
	{
		tg='';
		ac=root_url+'/shop/order.php';
	}
	
	f.exec.value='add';
	f.target=tg;
	f.action=ac;
	f.submit();

}

function addMultiCart(f,next){
	if (f.stat.value!=2)
	{
		ems='\n ÁË¼ÛÇÕ´Ï´Ù\n\n '+soldout_name+'µÈ »óÇ°Àº ÁÖ¹®ÇÒ ¼ö ¾ø½À´Ï´Ù        \n';
		if (typeof f.sold_reserve!='undefined' && f.sold_reserve.value=='Y')
		{
			ems+='\n ¿¹¾àÁÖ¹®ÇÏ±â¸¦ ÀÌ¿ëÇÏ½Ã¸é ÀÔ°íÈÄ ¿¬¶ôµå¸®°Ú½À´Ï´Ù        ';
		}
		alert(ems);
		return;
	}
	var opt_no=eval(f.opt_no.value);
	var min_ord=eval(f.min_ord.value);
	var max_ord=eval(f.max_ord.value);
	var buy_ea=0;
	var ea_num=f["buy_ea[]"].length;
	if(!ea_num) ea_num=1;
	if(ea_num == 1){
		buy_ea += eval(f["buy_ea[]"].value);
		if(opt_no>0){
			for(ii=1; ii<=opt_no; ii++){
				if(f['option_necessary'+ii].value=="Y"){
					if(f['option_type'+ii].value==2){ if(!checkSel(f['option'+ii+'[]'],f['option_name'+ii].value+'À»(¸¦)')) return; }
					else{ if(!checkCB(f['option'+ii+'[]'],f['option_name'+ii].value+'À»(¸¦)')) return; }
				}
			}
		}
	}else{
		for(jj=0; jj<ea_num; jj++){
			buy_ea += eval(f["buy_ea[]"][jj].value);
			if(opt_no>0){
				for(ii=1; ii<=opt_no; ii++){
					if(f['option_necessary'+ii].value=="Y"){
						if(f['option_type'+ii].value==2){ if(!checkSel(f['option'+ii+"[]"][jj],f['option_name'+ii].value+'À»(¸¦)')) return; }
						else{ if(!checkCB(f['option'+ii][jj],f['option_name'+ii].value+'À»(¸¦)')) return; }
					}
				}
			}
		}
	}
	if(buy_ea<min_ord){ 
		if(min_ord>1) astr='ÀÌ »óÇ°Àº '; else astr='';
		alert(astr+'ÃÖ¼Ò '+min_ord+'°³ ÀÌ»ó ±¸¸ÅÇÏ¼Å¾ßÇÕ´Ï´Ù'); return;
	}
	if(max_ord && buy_ea>max_ord){ alert('ÀÌ »óÇ°Àº ÃÖ´ë '+max_ord+'°³±îÁö ±¸¸ÅÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù'); return; }

	tg=hid_frame;
	ac=root_url+'/main/exec.php?exec_file=cart/cart.exe.php';
	f.next.value=next;
	
	f.exec.value='multi_option';
	f.target=hid_frame;
	f.action=root_url+'/main/exec.php?exec_file=cart/cart.exe.php';
	f.submit();
}

function reservePrd(f,url){
	if (f.stat.value!=3)
	{
		alert('\n ÇöÀç »óÇ°Àº Á¤»ó ÆÇ¸ÅÁßÀÔ´Ï´Ù\n\n ±¸¸ÅÇÏ±â ¶Ç´Â Ã¥¹Ù±¸´Ï´ã±â¸¦ Å¬¸¯ÇÏ¼¼¿ä         \n');
		return;
	}
	else if (typeof f.sold_reserve=='undefined' || f.sold_reserve.value!='Y')
	{
		alert('\n ÁË¼ÛÇÕ´Ï´Ù \n\n ÇöÀç »óÇ°Àº ¿¹¾à ÁÖ¹®ÀÌ ºÒ°¡´ÉÇÕ´Ï´Ù         \n');
		return;
	}
	if (url=='')
	{
		location.href=root_url+'/shop/reserve.php?pno='+f.pno.value;
	}
	else 
	{
		location.href=url;
	}
}

function priceCal(f){
	var mpc;
	if (typeof f.multi_price=='undefined') mpc=0;
	else mpc=eval(f.multi_price.value);

	if (mpc==0) return;
	if (mpc>1)
	{
		for (m=0; m<mpc; m++)
		{
			if (f.price[m].checked==true)
			{
				tmp=f.price[m].value.split("::");
				price=eval(tmp[1]);
				break;
			}
		}
	}
	else
	{
		tmp=f.price.value.split("::");
		price=eval(tmp[1]);
	}

	f.new_total_prc.value=eval(f.total_prc.value)+price;
}

function optionCal(f,opt_no,sval){
	tmp=sval.split("::");
	f.elements['option_sel_item'+opt_no].value=tmp[0];
	f.elements['option_prc'+opt_no].value=tmp[1];
	f.elements['option_ea_num'+opt_no].value=tmp[2];
	totalCal(f);
}

function totalCal(f){
	priceCal(f);
	new_total_prc=eval(f.total_prc.value); // 2006-05-12
	total_option=eval(f.opt_no.value);
	if (total_option) {
		for (i=1; i<=total_option; i++)
		{
			oprc=eval(f.elements['option_prc'+i].value);
			if (!oprc)
			{
				oprc=0;
			}
			//if (oprc)
			//{
				how_cal=f.elements['option_how_cal'+i].value;
				if (how_cal==1)
				{
					new_total_prc+=oprc;
				}
				else if (how_cal==3)
				{
					oprc_ea=eval(f.elements['opt_ea'+i].value);
					if (!oprc_ea || oprc_ea<1) oprc_ea=1;
					new_total_prc+=oprc*oprc_ea;
				}
				else 
				{
					new_total_prc*=oprc;
				}
			//}
		}
	}
	var tmp1=document.getElementById('sell_prc_str');
	f.new_total_prc.value=new_total_prc;
	tmp1.innerHTML=setComma(new_total_prc);
}

function addWish(f){
	f.exec.value='add';
	f.rURL.value=this_url;
	f.target=hid_frame;
	f.action=root_url+'/main/exec.php?exec_file=mypage/wish.exe.php';
	f.submit();
}

function checkWish(f){
	if (eval(f.total_wish.value)<1)
	{
		alert('À§½Ã¸®½ºÆ®°¡ ºñ¾ú½À´Ï´Ù');
		return false;
	}
	return true;
}

function deleteWish(f){
	if(!checkWish(f)) return;
	if(!checkCB(f.wno,"»èÁ¦ÇÒ »óÇ°À» ÇÏ³ª ÀÌ»ó")) return;
	f.exec.value='delete';
	f.submit();
}

function cartWish(f){ // 2007-12-13 : wishlist > cart - Han
	if(!checkWish(f)) return;
	if(!checkCB(f.wno,"Ã¥¹Ù±¸´Ï¿¡ ´ãÀ» »óÇ°À» ÇÏ³ª ÀÌ»ó")) return;
	f.exec_file.value = "cart/cart.exe.php";
	f.exec.value='from_wish';
	f.submit();
}

function cartList(f){ 
	if(!checkCB(f.prdno,"Ã¥¹Ù±¸´Ï¿¡ ´ãÀ» »óÇ°À» ÇÏ³ª ÀÌ»ó")) return;
	f.exec_file.value = "cart/cart.exe.php";
	f.exec.value='from_prdList';
	f.submit();
}

function wishList(f){ 
	if(!checkCB(f.prdno,"³»º¸°üÇÔ¿¡ ´ãÀ» »óÇ°À» ÇÏ³ª ÀÌ»ó")) return;
	f.exec_file.value = "mypage/wish.exe.php";
	f.exec.value='from_prdList';
	f.submit();
}

function checkCart(f){
	if (f.cart_rows.value=="0")
	{
		alert('Ã¥¹Ù±¸´Ï°¡ ºñ¾ú½À´Ï´Ù');
		return false;
	}
	return true;
}

function deleteCart(f){
	if(!checkCart(f)) return;
	if(!checkCB(f.cno,"»èÁ¦ÇÒ »óÇ°À» ÇÏ³ª ÀÌ»ó")) return;
	f.exec.value='delete';
	f.submit();
}

function truncateCart(f){
	if(!checkCart(f)) return;
	if (!confirm('Ã¥¹Ù±¸´Ï¸¦ ¸ðµÎ ºñ¿ì½Ã°Ú½À´Ï±î?')) return;
	f.exec.value='truncate';
	f.submit();
}

function updateCart(f){
	if(!checkCart(f)) return;
	checkAll(f.cno,true);
	f.exec.value='update';
	f.submit();
}

function orderCart(f){
	if(!checkCart(f)) return;
	u=root_url+'/shop/order.php';
	if (typeof f.cart_where!='undefined' && f.cart_where.value)
	{
		u+='?cart_where='+f.cart_where.value;
	}
	location.href=u;
}

function orderCartAll(){
	c1=eval(document.cartFrm1.cart_rows.value);
	c2=eval(document.cartFrm2.cart_rows.value);

	total_cart=c1+c2;
	if (total_cart==0)
	{
		alert('Ã¥¹Ù±¸´Ï°¡ ºñ¾ú½À´Ï´Ù  ');
		return;
	}
	if (c2>0 && !confirm('\n ÀÏ¹Ý »óÇ°°ú ¹«ÀÌÀÚ ÇÒºÎ »óÇ°À» ÇÔ²² ±¸¸ÅÇÏ½Ç °æ¿ì     \n\n ¹«ÀÌÀÚ ÇÒºÎ°¡ ºÒ°¡´ÉÇÕ´Ï´Ù\n\n °è¼ÓÇÏ½Ã°Ú½À´Ï±î?\n'))
	{
		return;
	}
	location.href=root_url+'/shop/order.php';
}

function checkRevFrm(f){

	if (ra==2)
	{
		if(!memberOnly(this_url,1,1)) return false;

	}
	if (ra==1 && mlv==10)
	{
		if (f.name.value=='ÀÌ¸§') f.name.value='';
		if (f.pwd.value=='ºñ¹Ð¹øÈ£') f.pwd.value='';
		if(!checkBlank(f.name,'ÀÌ¸§À»')) return false;
		if(!checkBlank(f.pwd,'ºñ¹Ð¹øÈ£¸¦')) return false;
	}
	if (typeof f.rev_pt!='undefined')
	{
		if (f.pno.value) pmsg="»óÇ°ÀÇ Á¡¼ö¸¦";
		else pmsg="Á¡¼ö¸¦";

		if (!checkCB(f.rev_pt,pmsg)) return false;
	}
	
	if(!checkBlank(f.title,'Á¦¸ñÀ»')) return false;
	if(review_strlen){
		if(review_strlen > f.title.value.length){ alert("Á¦¸ñÀº "+review_strlen+"ÀÚ ÀÌ»ó ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù"); return false; }
	}
	if(!checkBlank(f.content,'»óÇ°ÆòÀ»')) return false;

	return true;
}

function checkQnaFrm(f){

	if (qa==2)
	{
		if(!memberOnly(this_url,1,1)) return false;

	}
	if (qa=='' && mlv==10)
	{
		if (f.name.value=='ÀÌ¸§') f.name.value='';		
		if(!checkBlank(f.name,'ÀÌ¸§À»')) return false;

		if (f.pwd.value=='ºñ¹Ð¹øÈ£' || f.pwd.value=='pass') f.pwd.value='';
		if(!checkBlank(f.pwd,'ºñ¹Ð¹øÈ£¸¦')) return false;
	}

	if (typeof f.cate!='undefined')
	{
		if (!checkSel(f.cate,'ºÐ·ù¸¦')) return false;
	}
	if(!checkBlank(f.title,'Á¦¸ñÀ»')) return false;
	if(qna_strlen){
		if(qna_strlen > f.title.value.length){ alert("Á¦¸ñÀº "+qna_strlen+"ÀÚ ÀÌ»ó ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù"); return false; }
	}
	if(!checkBlank(f.content,'³»¿ëÀ»')) return false;
	return true;
}

// »óÇª ÈÄ±â ¾²±â ·¹ÀÌ¾î ¿­±â
function writeReview(){
	var tmp=document.getElementById('revWriteDiv');
	if (ra=='2')
	{
		if(memberOnly(this_url,1,1)) layTgl(tmp);		
	}
	else if (ra=='3')
	{
		alert('º» »óÇ°À» ±¸¸ÅÇÑ °í°´¸¸ »óÇ°ÆòÀ» ÀÛ¼ºÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù');
		return;
	}
	else layTgl(tmp);		
}

// »óÇª Áú´ä ¾²±â ·¹ÀÌ¾î ¿­±â
function writeQna(){
	if (qna_edit==2)
	{
		f=document.qnaFrm;
		if (typeof f.name!='undefined') {
			f.name.readOnly=false;
			f.name.style.backgroundColor='';
			f.name.value='';
		}
		if (typeof f.pwd!='undefined') {
			f.pwd.readOnly=false;
			f.pwd.style.backgroundColor='';
			f.pwd.value='';
		}
		f.title.value="";
		f.content.value="";
		qna_edit=1;
	}
	var tmp=document.getElementById('qnaWriteDiv');
	if (qa=='2' || qa=='3')
	{
		if(memberOnly(this_url,1,1)) layTgl(tmp);		
	}
	else layTgl(tmp);		
}
// ÃßÃµ¸ÞÀÏº¸³»±â ÆË¾÷Ã¢¿­±â 2006-11-17 - Han
function recomMail(pno,w,h){
	if(mlv == 10){
	    c=confirm("\n ·Î±×ÀÎÀÌ ÇÊ¿äÇÑ ¼­ºñ½ºÀÔ´Ï´Ù          \n\n ·Î±×ÀÎÇÏ½Ã°Ú½À´Ï±î? \n");
		if(c){
			window.location=root_url+'/member/login.php?rURL='+escape(this_url);
		}
		return;
	}
	if (!w) w=600
	if (!h) h=500
	url=root_url+'/shop/product_request.php?pno='+pno;
	window.open(url,'proRequest','top=10,left=10,height='+h+',width='+w+',status=no,scrollbars=no,toolbar=no,menubar=no');
}
// ÃßÃµ¸ÞÀÏº¸³»±â ÆûÃ¼Å© 2006-11-20 - Han
function checkProRequest(frm){
	if (!checkBlank(frm.from_name,"º¸³»´Â »ç¶÷ÀÇ ÀÌ¸§À»")) return false;
	if (!checkBlank(frm.from_email,"º¸³»´Â »ç¶÷ÀÇ ÀÌ¸ÞÀÏÀ»")) return false;
	if(CheckMail(frm.from_email.value) == false){
		alert("º¸³»´Â »ç¶÷ÀÇ Á¤È®ÇÑ ¸ÞÀÏÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ¼¼¿ä."); return false;
	}
	if (!checkBlank(frm.to_name,"¹Þ´Â »ç¶÷ÀÇ ÀÌ¸§À»")) return false;
	if (!checkBlank(frm.to_email,"¹Þ´Â »ç¶÷ÀÇ ÀÌ¸ÞÀÏÀ»")) return false;
	if(CheckMail(frm.to_email.value) == false){
		alert("¹Þ´Â »ç¶÷ÀÇ Á¤È®ÇÑ ¸ÞÀÏÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ¼¼¿ä."); return false;
	}
	if (!checkBlank(frm.sub,"Á¦¸ñÀ»")) return false;
	if (!checkBlank(frm.content,"³»¿ëÀ»")) return false;
}
function checkRevCmt(f){
	if (!checkBlank(f.content,'³»¿ëÀ»')) return false;
}

function delRevCmt(no){
	if (!confirm('»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?')) return;
	f=document.reviewDelFrm;
	f.no.value=no;
	f.exec_file.value='shop/review_comment.exe.php';
	f.submit();
}

function delRev(no){
	ams='';
	if (alv!='')
	{
		ams='\n\n (ÇöÀç ¼îÇÎ¸ô °ü¸®ÀÚ·Î ·Î±×ÀÎÁßÀÌ¹Ç·Î ¹Ù·Î »èÁ¦µË´Ï´Ù)';
	}
	if (!confirm('\n »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?  '+ams+'\n')) return;
	f=document.reviewDelFrm;
	f.no.value=no;
	f.exec_file.value='shop/review_reg.exe.php';
	f.submit();
}

function editRev(no){
	f=document.reviewDelFrm;
	f.no.value=no;
	f.exec_file.value='shop/review_edit.php';
	f.submit();
}
// <2006-11-22 Qna¼öÁ¤, »èÁ¦±â´ÉÃß°¡ - Han
function delQna(no){
	ams='';
	if (alv!='')
	{
		ams='\n\n (ÇöÀç ¼îÇÎ¸ô °ü¸®ÀÚ·Î ·Î±×ÀÎÁßÀÌ¹Ç·Î ¹Ù·Î »èÁ¦µË´Ï´Ù)';
	}
	if (!confirm('\n »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?  '+ams+'\n')) return;
	f=document.qnaFrm;
	f.no.value=no;
	f.exec_file.value='shop/qna_reg.exe.php';
	f.exec.value='delete';
	f.submit();
}
function conDelQna(no){ // 2007-03-07 : Qna»èÁ¦±â´É º¸¿Ï - Han
	f=document.forms["qna_pfrm"+no];
	f.exec_file.value="shop/qna_reg.exe.php";
	f.exec.value='delete';
	parent.document.getElementById('qna_pwd'+no).style.display='block';
	parent.document.getElementById('qna_modi'+no).style.display='none';
}
function conDelRev(no){ // 2007-03-07 : Review»èÁ¦±â´É º¸¿Ï - Han
	f=document.forms["review_pfrm"+no];
	f.exec_file.value="shop/review_reg.exe.php";
	f.exec.value='delete';
	parent.document.getElementById('review_pwd'+no).style.display='block';
	parent.document.getElementById('review_modi'+no).style.display='none';
}
function editQna(no){
	qna_edit=2;
	f=document.qnaFrm;
	f.no.value=no;
	f.exec_file.value='shop/qna_edit.php';
	f.exec.value='';
	f.submit();
}
function checkQnapwdFrm(f){
	if(!checkBlank(f.pwd,'ºñ¹Ð¹øÈ£¸¦')) return false;
}
function checkQnaModiFrm(f){
	if (typeof f.cate!='undefined')
	{
		if (!checkSel(f.cate,'ºÐ·ù¸¦')) return false;
	}
	if(!checkBlank(f.title,'Á¦¸ñÀ»')) return false;
	if(!checkBlank(f.content,'³»¿ëÀ»')) return false;
}
// >
// <2006-11-24 Review¼öÁ¤, »èÁ¦±â´ÉÃß°¡ - Han
function checkReviewpwdFrm(f){
	if(!checkBlank(f.pwd,'ºñ¹Ð¹øÈ£¸¦')) return false;
}
function checkReviewModiFrm(f){
	if(!checkBlank(f.title,'Á¦¸ñÀ»')) return false;
	if(!checkBlank(f.content,'³»¿ëÀ»')) return false;
}
// >

function zoomView(pno,w,h){
	if (!w) w=735;
	if (!h) h=630;

	url=root_url+'/shop/zoom.php?pno='+pno;
	window.open(url,'wmZoomView','top=10,left=10,height='+h+',width='+w+',status=no,scrollbars=no,toolbar=no,menubar=no');
}

function noPrd(){
	alert('ÇöÀç ÆÇ¸ÅÁßÀÎ »óÇ°ÀÌ ¾Æ´Õ´Ï´Ù');
}

function orderCust(tp,newstat){
	var cf=document.orderCustFrm;
	var oldstat=eval(cf.stat.value);
	if (oldstat>10 && newstat>10)
	{
		alert('Ãë¼Ò/È¯ºÒ/¹ÝÇ° Á¢¼öÁßÀÔ´Ï´Ù');
		return;
	}
	if (newstat==12 && oldstat>3) // Ãë¼Ò
	{
		alert('\n ÁÖ¹® Ãë¼Ò´Â ¹è¼ÛÀü¿¡ °¡´ÉÇÕ´Ï´Ù\n\n ¹ÝÇ° ½ÅÃ»À» ÇÏ½Ê½Ã¿À\n');
		return;
	}
	if (newstat==16 && oldstat<4)
	{
		alert('\n ¹ÝÇ° ½ÅÃ»Àº ¹è¼ÛÈÄ¿¡ °¡´ÉÇÕ´Ï´Ù\n\n ÁÖ¹® Ãë¼Ò ½ÅÃ»À» ÇÏ½Ê½Ã¿À\n');
		return;
	}
	cf.cate1.value=tp;
	cf.cate2.value=newstat;

	if (mlv==10) cf.method='post';
	else cf.method='get';
	cf.submit();
}

function checkCounselFrm(f){
	if (mlv==10)
	{
		if(!checkBlank(f.name,'ÀÌ¸§À»')) return false;
		if (!f.email.value)
		{
			alert('1:1 Ä£Àý »ó´ãÀº ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇÏ¼Å¾ß ´äº¯À» ¹ÞÀ¸½Ç ¼ö ÀÖ½À´Ï´Ù');
			return false;
		}
	}

	if(!checkBlank(f.title,'¹®ÀÇ Á¦¸ñÀ»')) return false;
	if(!checkBlank(f.content,'¹®ÀÇ ³»¿ëÀ»')) return false;
}


function toggleAttatchImage(s,w,h){
	var mimg1=document.getElementById('mainImg');
	if (mimg1.src==s) return;
	var mimg=document.getElementById('mimg_div');
	str='<img id="mainImg" src="'+s+'" width="'+w+'" height="'+h+'">';
	mimg.innerHTML=str;
/*
	var mimg=document.getElementById('mainImg');
	mimg.src=root_url+'/_image/_default/etc/spacer.gif';
	mimg.width=w;
	mimg.height=h;
	mimg.src=s;
*/
}

function csView(no,stat){
	layTglList('rev','revQna',no);

	return;

	if (!stat)
	{
		layTglList('rev','revQna',no);
	}
	else
	{
		alert('\n ÇöÀç ´äº¯ ÁØºñÁßÀÔ´Ï´Ù \n\n È®ÀÎÈÄ ½Å¼ÓÈ÷ ´äº¯µå¸®°Ú½À´Ï´Ù           \n');
		return;
	}
}

function checkQnaSecret(f){
	if (!checkBlank(f.pwd,"ºñ¹Ð¹øÈ£¸¦")) return false;
}

function downLoadCoupon(n){
	if (confirm('ÄíÆùÀ» ´Ù¿î¹ÞÀ¸½Ã°Ú½À´Ï±î?'))
	{
		curl=root_url+'/main/exec.php?exec_file=mypage/coupon_download.php&no='+n+'&rURL='+escape(this_url);
		document.frames[hid_frame].location.href=curl;
		//location.href=curl;
	}
}

function multiCart(f){
	total_ea=0;
	for (i=0; i<f.buy_ea.length; i++)
	{
		total_ea+=eval(f.buy_ea[i].value);
	}
	if (total_ea<=0)
	{
		alert('±¸¸Å¼ö·®À» ÀÔ·ÂÇØÁÖ¼¼¿ä    ');
		return;
	}
	f.submit();
}

// <2006-11-28 ¼öÃëÈ®ÀÎ È®ÀÎ ÇÔ¼ö Ãß°¡ - Han
function receiveProduct(ono, escrow_type, escrow_id){
	if(!confirm("»óÇ°À» ¹ÞÀ¸¼Ì½À´Ï±î? \n\n»óÇ°À» ¹ÞÀ¸½ÅºÐÀº 'È®ÀÎ'¹öÆ°À» ´­·¯ÁÖ¼¼¿ä.")) return;

	if (escrow_type == "hana_escrow" && escrow_id ){
		var ef = document.getElementById("hana_escrow");
		if (ef)	{
			ef.tid.value = escrow_id;
			ef.ctype.value = "CFRM";
			ef.ono.value = ono;

			approve();
			if ( status_cd != "SUCCESS" ) return;
		}
	}

	gurl=root_url+"/main/exec.php?exec_file=mypage/receive.exe.php&ono="+ono;
	document.frames[hid_frame].location.href=gurl;
}

function UserDefine() { // ÇÏ³ª ¿¡½ºÅ©·Î ±¸¸Å¿Ï·á/°ÅÀý ¸Þ½ÃÁö Ã³¸®ÇÔ¼ö(ÇÏ³ªÀºÇà¿¡¼­ ÁöÁ¤µÈ ¸Þ¼Òµå, º¯¼ö ¸íÀÌ¹Ç·Î º¯°æ ºÒ°¡)
	var f = document.cporder;
	var ctype = ( document.cporder.ctype.value == "CFRM" ) ? "±¸¸Å¿Ï·á°¡" : "±¸¸Å°ÅÀýÀÌ";

	if(status_cd == "SUCCESS")	{
		alert("¿¡½ºÅ©·Î "+ctype+" ¼º°øÀûÀ¸·Î ¿Ï·áµÇ¾ú½À´Ï´Ù.");
	} else if (status_cd == "CANCEL") {
		alert("¿¡½ºÅ©·Î "+ctype+" Ãë¼ÒµÇ¾ú½À´Ï´Ù.");
	} else {
		alert("¿¡½ºÅ©·Î ¿¡·¯"+status_cd);
	}
}
// >

var mtopt_no=1;
function addMultiOpt(){ // 2007-03-20 : ¸ÖÆ¼ ¿É¼Ç Ãß°¡ - Han
    var obj=document.all.multiOpt;
	if(!obj) return;
	var ori=obj.innerHTML;
	def=defaultOpt;
	if(def == ""){ alert(" ÆäÀÌÁö·ÎµùÀÌ ³¡³­ ÈÄ ½ÃµµÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù"); return; }
	if(document.all.optDelImg){
		imgN="optDelImg";
		def=def.replace(imgN, imgN+mtopt_no);
		def=def.replace("visibility: hidden", "visibility: visible");
		def=def.replace("VISIBILITY: hidden", "VISIBILITY: visible");
		def=def.replace("deleteMultiOpt()", "deleteMultiOpt("+mtopt_no+")");
	}
	obj.innerHTML=ori+"<div id=\"multiOpt"+mtopt_no+"\">"+def+"</div>";
	mtopt_no++;
}

function deleteMultiOpt(objnum){ // 2007-03-20: ¸ÖÆ¼ ¿É¼Ç »èÁ¦ - Han
	if(!objnum) return;
	var obj=document.all["multiOpt"+objnum];
	if(!obj) return;
	obj.innerHTML="";
	optobj=document.all.multiOpt;
	if(!optobj) return;
	delobj="<DIV id="+obj.id+">&nbsp;</DIV>";
	var con=optobj.innerHTML.replace(delobj, "");
	optobj.innerHTML=con;
}

function rvQnaHit(type, no){ // 2007-12-04 : Review & Qna Á¶È¸¼ö Áõ°¡ - Han
	document.frames[hid_frame].location.href=root_url+'/main/exec.php?exec_file=shop/hit.exe.php&type='+type+'&no='+no;
}
