function num_plus(ths , danwee , jaego)
{
	var fnum = parseInt(ths.value);
	ths.value = fnum + parseInt(danwee);

	if (jaego != "No") {
		if (fnum > parseInt(jaego)-1)
		{
			alert('\n存在数量を超過しました。        \n');
			ths.value = jaego;
			return false;
		}
	}
}
function num_minus(ths , danwee , jaego)
{
	var fnum = parseInt(ths.value);
	ths.value = (fnum > parseInt(danwee)) ? fnum - parseInt(danwee) : parseInt(danwee);
}
function jaego_ment(jaego)
{
	alert('このオプションの現在存在数量は ['+jaego+']です。        ');
}
function cart_update(num,value,step)
{
	if (!confirm('\n本当に数量を変更しましすか？   \n'))
	{
		return false;
	}
	location.href = "./cart.php?action=cart_update&buy_num="+ num.value +"&step=" + step + "&value=" + value;
}
function cart_del(value,step)
{
	if (!confirm('\n本当に買い物かごから除去しますか？      \n'))
	{
		return false;
	}
	location.href = "./cart.php?action=cart_del&step=" + step + "&value=" + value;
}
function cart_op_del(value,step,op_num)
{
	if (!confirm('\n本当に選択したオプションを除去しますか？        \n'))
	{
		return false;
	}
	location.href = "./cart.php?action=cart_op_del&op_num="+ op_num +"&step=" + step + "&value=" + value;
}
function cart_wish(uid,id)
{
	if (!id)
	{
		if (!confirm('\n\n会員でログイン後、利用できます。          \n\n今、ログインしますか？'))
		{
			return false;
		}
		else {
			location.href = "./login.php?pwd=cart.php?pwd="+location.href;
			return false;
		}
	}
	if (!confirm('本当にウィッシュリストに入れますか？          '))
	{
		return false;
	}
	var url = "cart.php?action=wish&type=mall&uid=" + uid;
	window.open(url , 'wishwin' , 'top=3000,left=0,width=100,height=100');

}
function cart_empty(step)
{
	if (!confirm('\n本当にデータを空にしますか?        \n'))
	{
		return false;
	}
	location.href = "./cart.php?action=cart_empty&step=" + step;
}
function shop_continue()
{
	location.href = "./index.php";
}
function shop_buy(step)
{
	location.href = "./cart.php?query=" + step;
}
function cart_view()
{
	var ly = document.all.cart_layer;
	if (ly.style.display == "none")
	{
		ly.style.display = "block";
	}
	else {
		ly.style.display = "none";
	}
}
function info_same(ths)
{
	var f = document.order_form;
	if (ths.checked == true)
	{
		f.BY_TO_NAME.value = f.BY_BY_NAME.value;
		f.BY_TO_HOME_TEL_1.value = f.BY_BY_HOME_TEL_1.value;
		f.BY_TO_HOME_TEL_2.value = f.BY_BY_HOME_TEL_2.value;
		f.BY_TO_HOME_TEL_3.value = f.BY_BY_HOME_TEL_3.value;
		f.BY_TO_ZIP1.value = f.BY_BY_ZIP1.value;
		f.BY_TO_ZIP2.value = f.BY_BY_ZIP2.value;
		f.BY_TO_ADDR1.value = f.BY_BY_ADDR1.value;
		f.BY_TO_ADDR2.value = f.BY_BY_ADDR2.value;
	}
	else {
		f.BY_TO_NAME.value = '';
		f.BY_TO_HOME_TEL_1.value = '';
		f.BY_TO_HOME_TEL_2.value = '';
		f.BY_TO_HOME_TEL_3.value = '';
		f.BY_TO_ZIP1.value = '';
		f.BY_TO_ZIP2.value = '';
		f.BY_TO_ADDR1.value = '';
		f.BY_TO_ADDR2.value = '';
	}
	f.BY_TO_ADDR2.focus();
}
function pay_lay_hide()
{
	var ly = document.all;
	ly.pay_online_lay.style.display = "none";
	ly.pay_card_lay.style.display = "none";
	ly.pay_multi_lay.style.display = "none";
	ly.pay_multi_lay1.style.display = "none";
}
function pay_reset()
{
	var f  = document.order_form;
	var f1 = document.pay_select;
	for(var i = 0; i < f1.pay_type.length; i++)
	{
		if(f1.pay_type[i].value == f.BY_PAY_TYPE.value) {
			f1.pay_type[i].checked = true;
		}
	}
}
function pay_drop(ths,halin)
{
	var f  = document.order_form;
	var f1 = document.pay_select;
	var ly = document.all;

	if (ths.value == "적립금")
	{
		if (!f1.member_id.value)
		{
			alert('会員でログイン後に使用できます。   ');
			ths.checked = false;
			pay_reset();
			return false;
		}
		if (parseInt(f1.member_point.value) < parseInt(f1.enable_point.value))
		{
			alert('\nポイントは最小 '+commaSplit(f1.enable_point.value)+'円　以上から使用できます。          \n\n現在お客様の存在ポイントは　 '+commaSplit(f1.member_point.value)+'円です。');
			ths.checked = false;
			pay_reset();
			return false;
		}
		if (parseInt(filterNum(f1.price_total2.value.replace("円" , ""))) > parseInt(f1.member_point.value))
		{
			alert('\n商品購入金額('+f1.price_total2.value+')がお客様の存在ポイントより多いです。             \n\n現在お客様の存在ポイントは　'+commaSplit(f1.member_point.value)+'円です。');
			ths.checked = false;
			pay_reset();
			return false;
		}
	}

	var pr_total = (f1.pr_total.value) ? parseInt(f1.pr_total.value) : 0;
	var ha_total = (f1.ha_total.value) ? parseInt(f1.ha_total.value) : 0;

	
	var ta_total = parseInt(filterNum(f1.price_tack.value.replace("円" , "")));
	var jeolsa	 = parseInt(f1.jeolsa.value);

	ha_total  = ha_total + (pr_total*(halin/100));
	pr_total2 = pr_total - ha_total + ta_total;
	pr_total3 = getJeolsa(''+pr_total2+'' , jeolsa , false);

	if ( ths.value == "다중결제")
	{
		f1.halin_total.value  = commaSplit(parseInt(ha_total)) + "円";
		f1.price_total2.value = commaSplit(pr_total3) + "円";
		f1.price_jeolsa.value = commaSplit(pr_total2 - pr_total3) + "円";
		f.BY_ONLINE_PRICE.value = f1.price_total2.value;
		f.BY_CARD_PRICE.value   = "0円";
		f.BY_POINT_PRICE.value  = "0円";
	}
	else {
		f1.halin_total.value  = commaSplit(parseInt(ha_total)) + "円";
		f1.price_total2.value = commaSplit(pr_total3) + "円";
		f1.price_jeolsa.value = commaSplit(pr_total2 - pr_total3) + "円";
	}

	f.BY_PAY_TYPE.value = ths.value;
	pay_lay_hide();

	switch (ths.value)
	{
		case "온라인" :
		ly.pay_online_lay.style.display = "block";
		break;

		case "신용카드" :
		ly.pay_card_lay.style.display = "block";
		break;

		case "모바일" :
		ly.pay_mobile_lay.style.display = "block";
		break;

		case "계좌이체" :
		ly.pay_ziro_lay.style.display = "block";
		ly.pay_ziro_lay1.style.display = "block";
		break;

		case "적립금" :
		ly.pay_point_lay.style.display = "block";
		break;

		case "다중결제" :
		ly.pay_multi_lay.style.display = "block";
		ly.pay_multi_lay1.style.display = "block";
		break;
	}
}
function pay_dasong(ths,besong)
{ 

    var halin= 0;
	var f  = document.order_form;
	var f1 = document.pay_select;
	var ly = document.all;

	

	var pr_total = (f1.pr_total.value) ? parseInt(f1.pr_total.value) : 0;
	var ha_total = (f1.ha_total.value) ? parseInt(f1.ha_total.value) : 0;

	var ta_total = parseInt(besong);
	var jeolsa	 = parseInt(f1.jeolsa.value);

	ha_total  = ha_total + (pr_total*(halin/100));
	pr_total2 = pr_total - ha_total + ta_total;
	pr_total3 = getJeolsa(''+pr_total2+'' , jeolsa , false);

	if ( f.BY_PAY_TYPE.value == "다중결제")
	{
		f1.halin_total.value  = commaSplit(parseInt(ha_total)) + "円";
		f1.price_total2.value = commaSplit(pr_total3) + "円";
		f1.price_jeolsa.value = commaSplit(pr_total2 - pr_total3) + "円";
		f.BY_ONLINE_PRICE.value = f1.price_total2.value;
		f.BY_CARD_PRICE.value   = "0円";
		f.BY_POINT_PRICE.value  = "0円";
	}
	else {
		f1.halin_total.value  = commaSplit(parseInt(ha_total)) + "円";
		f1.price_total2.value = commaSplit(pr_total3) + "円";
		f1.price_jeolsa.value = commaSplit(pr_total2 - pr_total3) + "円";
	}

	f1.price_tack.value = commaSplit(besong) + "円";
	f.MBY_pay_basong.value = ths.value;
}
function multi_price(type, money)
{
	var f  = document.order_form;
	var f1 = document.pay_select;
	
	var halin_online = (f1.halin_online_percent.value)  ? f1.halin_online_percent.value : 0;
	var halin_card   = (f1.halin_card_percent.value)	? f1.halin_card_percent.value : 0;

	var pr_total = (f1.pr_total.value) ? parseInt(f1.pr_total.value) : 0;
	var ha_total = (f1.ha_total.value) ? parseInt(f1.ha_total.value) : 0;

	if (f1.price_tack.value != "- 무료 -" && f1.price_tack.value != "- 착불 -" && f1.price_tack.value != "- 별도 -")
	{
		var ta_total = parseInt(filterNum(f1.price_tack.value.replace("円" , "")));
	}
	else {
		var ta_total = parseInt(f1.ta_total.value);
	}

	var jeolsa	 = (f1.jeolsa.value) ? parseInt(f1.jeolsa.value) : 0;
	var member_point = (f1.member_point.value) ? parseInt(f1.member_point.value) : 0;

	var card_enable_money  = parseInt(f1.enable_card.value);
	var point_enable_money = parseInt(f1.enable_point.value);

	var element_money= parseInt(filterNum(f1.price_total2.value.replace("円", "")));
	var online_money = parseInt(filterNum(f.BY_ONLINE_PRICE.value.replace("円", "")));
	var card_money   = parseInt(filterNum(f.BY_CARD_PRICE.value.replace("円", "")));
	var point_money  = parseInt(filterNum(f.BY_POINT_PRICE.value.replace("円", "")));

	if (type == 'card')
	{
		if (money == 0)
		{

			var ha_online_money = ((pr_total - point_money) * (halin_online/100));				
			var ha_card_money   = 0;
			var ha_sum_money    = ha_online_money;
			var ha_total_money  = ha_total + ha_sum_money;
			var by_online_money = (pr_total + ta_total) - (ha_total_money + point_money);

			f.BY_CARD_PRICE.value   = "0円";
			f1.halin_total.value    = commaSplit(parseInt(ha_total_money)) + "円";
			f1.price_total2.value   = commaSplit(getJeolsa(''+(pr_total + ta_total - ha_total_money)+'',jeolsa,false)) + "円";
			f1.price_jeolsa.value   = commaSplit(parseInt((pr_total + ta_total - ha_total_money) - getJeolsa(''+(pr_total + ta_total - ha_total_money)+'',jeolsa,false))) + "円";
			f.BY_ONLINE_PRICE.value = commaSplit(getJeolsa(''+by_online_money+'',jeolsa,false)) + "円";
			
			return false;
		}
		if (money > online_money)
		{
			return false;
		}
		if (card_money + money < card_enable_money)
		{
			alert('クレジックカードは最小'+commaSplit(card_enable_money)+'円から決済可能です。            ');
			
			var ha_card_money   = (card_enable_money * (halin_card/100));
			var ha_online_money = ((pr_total - (card_enable_money + point_money)) * (halin_online/100));	
			var ha_sum_money    = ha_online_money + ha_card_money;
			var ha_total_money  = ha_total + ha_sum_money;
			var by_online_money = (pr_total + ta_total) - (card_enable_money + point_money + ha_total_money);

			f.BY_CARD_PRICE.value   = commaSplit(card_enable_money) + "円";
			f1.halin_total.value    = commaSplit(parseInt(ha_total_money)) + "円";
			f1.price_total2.value   = commaSplit(getJeolsa(''+(pr_total + ta_total - ha_total_money)+'',jeolsa,false)) + "円";
			f1.price_jeolsa.value   = commaSplit(parseInt((pr_total + ta_total - ha_total_money) - getJeolsa(''+(pr_total + ta_total - ha_total_money)+'',jeolsa,false))) + "円";
			f.BY_ONLINE_PRICE.value = commaSplit(getJeolsa(''+by_online_money+'',jeolsa,false)) + "円";

			return false;
		}

		var ha_card_money   = ((card_money + money) * (halin_card/100));
		var ha_online_money = ((pr_total - (card_money + point_money + money)) * (halin_online/100));	
		var ha_sum_money    = ha_online_money + ha_card_money;
		var ha_total_money  = ha_total + ha_sum_money;
		var by_online_money = (pr_total + ta_total) - (card_money + point_money + money + ha_total_money);

		f.BY_CARD_PRICE.value   = commaSplit(card_money + money) + "円";
		f1.halin_total.value    = commaSplit(parseInt(ha_total_money)) + "円";
		f1.price_total2.value   = commaSplit(getJeolsa(''+(pr_total + ta_total - ha_total_money)+'',jeolsa,false)) + "円";
		f1.price_jeolsa.value   = commaSplit(parseInt((pr_total + ta_total - ha_total_money) - getJeolsa(''+(pr_total + ta_total - ha_total_money)+'',jeolsa,false))) + "円";
		f.BY_ONLINE_PRICE.value = commaSplit(getJeolsa(''+by_online_money+'',jeolsa,false)) + "円";
	}

	if (type == 'point')
	{
		if (money == 0)
		{

			var ha_online_money = ((pr_total - card_money) * (halin_online/100));				
			var ha_card_money   = (card_money * (halin_card/100));
			var ha_sum_money    = ha_online_money + ha_card_money;
			var ha_total_money  = ha_total + ha_sum_money;
			var by_online_money = ((pr_total + ta_total) - card_money) - ha_total_money;

			f.BY_POINT_PRICE.value  = "0円";
			f1.halin_total.value    = commaSplit(parseInt(ha_total_money)) + "円";
			f1.price_total2.value   = commaSplit(getJeolsa(''+(pr_total + ta_total - ha_total_money)+'',jeolsa,false)) + "円";
			f1.price_jeolsa.value   = commaSplit(((pr_total + ta_total - ha_total_money) - getJeolsa(''+(pr_total + ta_total - ha_total_money)+'',jeolsa,false))) + "円";
			f.BY_ONLINE_PRICE.value = commaSplit(getJeolsa(''+by_online_money+'',jeolsa,false)) + "円";
			
			return false;
		}
		if (money > online_money)
		{
			return false;
		}
		if (point_money + money < point_enable_money)
		{
			alert('ポイントは最小 '+commaSplit(point_enable_money)+'円から決済可能です。          ');

			var ha_online_money = ((pr_total - (card_money + point_enable_money)) * (halin_online/100));				
			var ha_card_money   = (card_money * (halin_card/100));
			var ha_sum_money    = ha_online_money + ha_card_money;
			var ha_total_money  = ha_total + ha_sum_money;
			var by_online_money = (pr_total + ta_total) - (card_money + point_enable_money + ha_total_money);

			f.BY_POINT_PRICE.value  = commaSplit(point_enable_money) + "円";
			f1.halin_total.value    = commaSplit(parseInt(ha_total_money)) + "円";
			f1.price_total2.value   = commaSplit(getJeolsa(''+(pr_total + ta_total - ha_total_money)+'',jeolsa,false)) + "円";
			f1.price_jeolsa.value   = commaSplit(parseInt((pr_total + ta_total - ha_total_money) - getJeolsa(''+(pr_total + ta_total - ha_total_money)+'',jeolsa,false))) + "円";
			f.BY_ONLINE_PRICE.value = commaSplit(getJeolsa(''+by_online_money+'',jeolsa,false)) + "円";
		
			return false;
		}
		if (point_money + money > member_point)
		{
			alert('お客様の存在ポイントは '+commaSplit(member_point)+'円です。            ');
			var ha_online_money = ((pr_total - (card_money + member_point)) * (halin_online/100));				
			var ha_card_money   = (card_money * (halin_card/100));
			var ha_sum_money    = ha_online_money + ha_card_money;
			var ha_total_money  = ha_total + ha_sum_money;
			var by_online_money = (pr_total + ta_total) - (card_money + member_point + ha_total_money);

			f.BY_POINT_PRICE.value  = commaSplit(member_point) + "円";
			f1.halin_total.value    = commaSplit(parseInt(ha_total_money)) + "円";
			f1.price_total2.value   = commaSplit(getJeolsa(''+(pr_total + ta_total - ha_total_money)+'',jeolsa,false)) + "円";
			f1.price_jeolsa.value   = commaSplit(parseInt((pr_total + ta_total - ha_total_money) - getJeolsa(''+(pr_total + ta_total - ha_total_money)+'',jeolsa,false))) + "円";
			f.BY_ONLINE_PRICE.value = commaSplit(getJeolsa(''+by_online_money+'',jeolsa,false)) + "円";

			return false;
		}

		var ha_card_money   = (card_money * (halin_card/100));
		var ha_online_money = ((pr_total - (card_money + point_money + money)) * (halin_online/100));
		var ha_sum_money    = ha_online_money + ha_card_money;
		var ha_total_money  = ha_total + ha_sum_money;
		var by_online_money = (pr_total + ta_total) - (card_money + point_money + money + ha_total_money);

		f.BY_POINT_PRICE.value  = commaSplit(point_money + money) + "円";
		f1.halin_total.value    = commaSplit(parseInt(ha_total_money)) + "円";
		f1.price_total2.value   = commaSplit(getJeolsa(''+(pr_total + ta_total - ha_total_money)+'',jeolsa,false)) + "円";
		f1.price_jeolsa.value   = commaSplit(parseInt((pr_total + ta_total - ha_total_money) - getJeolsa(''+(pr_total + ta_total - ha_total_money)+'',jeolsa,false))) + "円";
		f.BY_ONLINE_PRICE.value = commaSplit(getJeolsa(''+by_online_money+'',jeolsa,false)) + "円";
	}
}

function tack_price(ths)
{
	var f  = document.order_form;
	var f1 = document.pay_select;	

	if (f.BY_PAY_TYPE.value)
	{
		alert('\n특별 배송옵션은 결제수단 선택전에 선택하셔야 합니다.               \n');
		var doseo_tack_tmp1 = f1.doseo_tack_tmp.value;
		f1.reset();
		f1.doseo_tack_tmp.value = doseo_tack_tmp1;

		if (f1.price_tack.value != "- 무료 -" && f1.price_tack.value != "- 착불 -" && f1.price_tack.value != "- 별도 -")
		{
			var ta_total = parseInt(filterNum(f1.price_tack.value.replace("円" , "")));
		}
		else {
			var ta_total = parseInt(f1.ta_total.value);
		}
		var element_money = parseInt(filterNum(f1.price_total2.value.replace("円", "")));
		var element_tack  = ta_total;

		f1.price_total2.value = commaSplit(element_money + parseInt(doseo_tack_tmp1)) + "円";
		if (element_tack + parseInt(doseo_tack_tmp1) == 0)
		{
			f1.price_tack.value  = "- 무료 -";
		}
		else {
			f1.price_tack.value = commaSplit(element_tack + parseInt(doseo_tack_tmp1)) + "円";
		}
		f.BY_PAY_TYPE.value   = "";

		pay_lay_hide();
		return false;
	}

	var ta_total   = parseInt(f1.ta_total.value);
	if (ths.value)
	{
		var ggval = ths.value;
		var doseo_tack_tmp1 = f1.doseo_tack_tmp.value;
		f1.reset();
		f1.BY_SPECIAL_TACK_1.value = ggval;
		var spe_tack  = ggval.split('|');
		var spe_name  = spe_tack[0];
		var spe_price = parseInt(spe_tack[1]);
		var doseo_tack= parseInt(doseo_tack_tmp1);
		var element_money = parseInt(filterNum(f1.price_total2.value.replace("円", "")));
		
		f1.price_total2.value = commaSplit(element_money + spe_price + doseo_tack) + "円";
		if (ta_total + spe_price + doseo_tack == 0)
		{
			f1.price_tack.value  = "- 무료 -";
		}
		else {
			f1.price_tack.value = commaSplit(ta_total + spe_price + doseo_tack) + "円";
		}
		f1.doseo_tack_tmp.value = doseo_tack_tmp1;
	}
	else {
		var doseo_tack_tmp1 = f1.doseo_tack_tmp.value;
		f1.reset();

		var doseo_tack= parseInt(doseo_tack_tmp1);
		var element_money = parseInt(filterNum(f1.price_total2.value.replace("円", "")));
		
		f1.price_total2.value = commaSplit(element_money + doseo_tack) + "円";
		if (ta_total + doseo_tack == 0)
		{
			f1.price_tack.value  = "- 무료 -";
		}
		else {
			f1.price_tack.value = commaSplit(ta_total + doseo_tack) + "円";
		}
		f1.doseo_tack_tmp.value = doseo_tack_tmp1;
	}
}
function doseo_check()
{
	var f  = document.order_form;
	var f1 = document.pay_select;
	var i;
	if (f1.tack_type.value != "3")
	{
		return false;
	}

	var str = f.BY_TO_ADDR1.value;
	if (!str)
	{
		if (f1.price_tack.value != "- 무료 -" && f1.price_tack.value != "- 착불 -" && f1.price_tack.value != "- 별도 -")
		{
			var ta_total = parseInt(filterNum(f1.price_tack.value.replace("円" , "")));
		}
		else {
			var ta_total = parseInt(f1.ta_total.value);
		}

		var element_money = parseInt(filterNum(f1.price_total2.value.replace("円", "")));
		var element_tack  = ta_total;
		
		if (parseInt(f1.doseo_tack_tmp.value) != 0)
		{
			alert('\n특수지역(도서,산간) 배송이  취소되어         \n\n배송비 '+commaSplit(f1.doseo_tack_tmp.value)+'円이 제외되었습니다.\n');
		}

		f1.price_total2.value = commaSplit(element_money - parseInt(f1.doseo_tack_tmp.value)) + "円";
		if (element_tack - parseInt(f1.doseo_tack_tmp.value) == 0)
		{
			f1.price_tack.value  = "- 무료 -";
		}
		else {
			f1.price_tack.value  = commaSplit(element_tack - parseInt(f1.doseo_tack_tmp.value)) + "円";
		}
		
		if (f.BY_PAY_TYPE.value == "다중결제")
		{
			f.BY_ONLINE_PRICE.value = commaSplit(parseInt(filterNum(f.BY_ONLINE_PRICE.value.replace("円", ""))) - parseInt(f1.doseo_tack_tmp.value)) + "円";
		}
		f1.doseo_tack_tmp.value = 0;

		return false;
	}

	if (f1.doseo_tack_tmp.value != "0" && f1.doseo_tack_tmp.value != "")
	{
		return false;
	}

	var doseo_array1 = f1.doseo_tack_1.value.split('|');
	var doseo_array2 = f1.doseo_tack_2.value.split('|');
	var doseo_array3 = f1.doseo_tack_3.value.split('|');

	var doseo_1 = doseo_array1[0].split(',');
	var doseo_2 = doseo_array2[0].split(',');
	var doseo_3 = doseo_array3[0].split(',');

	if (f1.price_tack.value != "- 무료 -" && f1.price_tack.value != "- 착불 -" && f1.price_tack.value != "- 별도 -")
	{
		var ta_total = parseInt(filterNum(f1.price_tack.value.replace("円" , "")));
	}
	else {
		var ta_total = parseInt(f1.ta_total.value);
	}

	var element_money = parseInt(filterNum(f1.price_total2.value.replace("円", "")));
	var element_tack  = ta_total;


	for(i = 0; i < doseo_1.length; i++)
	{
		var match = str.replace(doseo_1[i] , '');
		if (str != match)
		{
			alert('\n배송지역이 특수지역(도서,산간)에 포함되어             \n\n배송비 '+commaSplit(doseo_array1[1])+'円이 추가되었습니다.\n');
			f1.price_total2.value = commaSplit(element_money + parseInt(doseo_array1[1])) + "円";
			f1.price_tack.value   = commaSplit(element_tack + parseInt(doseo_array1[1])) + "円";
			if (f.BY_PAY_TYPE.value == "다중결제")
			{
				f.BY_ONLINE_PRICE.value = commaSplit(parseInt(filterNum(f.BY_ONLINE_PRICE.value.replace("円", ""))) + parseInt(doseo_array1[1])) + "円";
			}
			f1.doseo_tack_tmp.value = doseo_array1[1];
			break;
		}
	}

	for(i = 0; i < doseo_2.length; i++)
	{
		var match1 = str.replace(doseo_2[i] , '');
		if (str != match1)
		{
			alert('\n배송지역이 특수지역(도서,산간)에 포함되어             \n\n배송비 '+commaSplit(doseo_array2[1])+'円이 추가되었습니다.\n');
			f1.price_total2.value = commaSplit(element_money + parseInt(doseo_array2[1])) + "円";
			f1.price_tack.value   = commaSplit(element_tack + parseInt(doseo_array2[1])) + "円";
			if (f.BY_PAY_TYPE.value == "다중결제")
			{
				f.BY_ONLINE_PRICE.value = commaSplit(parseInt(filterNum(f.BY_ONLINE_PRICE.value.replace("円", ""))) + parseInt(doseo_array2[1])) + "円";
			}
			f1.doseo_tack_tmp.value = doseo_array2[1];
			break;
		}
	}

	for(i = 0; i < doseo_3.length; i++)
	{
		var match2 = str.replace(doseo_3[i] , '');
		if (str != match2)
		{
			alert('\n배송지역이 특수지역(도서,산간)에 포함되어             \n\n배송비 '+commaSplit(doseo_array2[1])+'円이 추가되었습니다.\n');
			f1.price_total2.value = commaSplit(element_money + parseInt(doseo_array2[1])) + "円";
			f1.price_tack.value   = commaSplit(element_tack + parseInt(doseo_array2[1])) + "円";
			if (f.BY_PAY_TYPE.value == "다중결제")
			{
				f.BY_ONLINE_PRICE.value = commaSplit(parseInt(filterNum(f.BY_ONLINE_PRICE.value.replace("円", ""))) + parseInt(doseo_array2[1])) + "円";
			}
			f1.doseo_tack_tmp.value = doseo_array2[1];
			break;
		}
	}
	
	if (f.BY_PAY_TYPE.value == "적립금")
	{
		if (parseInt(filterNum(f1.price_total2.value.replace("円" , ""))) > parseInt(f1.member_point.value))
		{
			alert('\n특수 배송비추가로 인해 제품구매액('+f1.price_total2.value+')이 고객님의 보유적립금보다 많습니다.             \n\n현재 고객님의 보유적립금은 '+commaSplit(f1.member_point.value)+'円입니다.');
			
			var doseo_tack_tmp1 = f1.doseo_tack_tmp.value;
			f1.reset();
			f1.doseo_tack_tmp.value = doseo_tack_tmp1;

			if (f1.price_tack.value != "- 무료 -" && f1.price_tack.value != "- 착불 -" && f1.price_tack.value != "- 별도 -")
			{
				var ta_total = parseInt(filterNum(f1.price_tack.value.replace("円" , "")));
			}
			else {
				var ta_total = parseInt(f1.ta_total.value);
			}
			var element_money = parseInt(filterNum(f1.price_total2.value.replace("円", "")));
			var element_tack  = ta_total;

			f1.price_total2.value = commaSplit(element_money + parseInt(doseo_tack_tmp1)) + "円";
			if (element_tack + parseInt(doseo_tack_tmp1) == 0)
			{
				f1.price_tack.value  = "- 무료 -";
			}
			else {
				f1.price_tack.value = commaSplit(element_tack + parseInt(doseo_tack_tmp1)) + "円";
			}
			f.BY_PAY_TYPE.value   = "";
			return false;
		}
	}
}
function order_check()
{
	var f  = document.order_form;
	var f1 = document.pay_select;

	if (!f.BY_PAY_TYPE.value)
	{
		alert('\n결제수단을 선택해 주세요.             \n');
		location.href = "#pay_top";
		return false;
	}
	if (!f.BY_BY_NAME.value)
	{
		alert('\n주문인의 성함을 입력해 주세요.             \n');
		f.BY_BY_NAME.focus();
		return false;
	}
	if (!f.BY_BY_EMAIL.value)
	{
		alert('\n주문인의 이메일을 입력해 주세요.             \n');
		f.BY_BY_EMAIL.focus();
		return false;
	}
	if (!f.BY_BY_HOME_TEL_1.value || !f.BY_BY_HOME_TEL_2.value || !f.BY_BY_HOME_TEL_3.value)
	{
		alert('\n주문인의 전화번호를 정확히 입력해 주세요.             \n');
		f.BY_BY_HOME_TEL_1.focus();
		return false;
	}
	if (!f.BY_BY_ZIP1.value || !f.BY_BY_ZIP2.value || !f.BY_BY_ADDR1.value)
	{
		alert('\n주문인의 주소를 정확히 입력해 주세요.             \n');
		f.BY_BY_ADDR2.focus();
		return false;
	}

	if (!f.BY_TO_NAME.value)
	{
		alert('\n배송받으실 고객님의 성함을 입력해 주세요.             \n');
		f.BY_TO_NAME.focus();
		return false;
	}
	if (!f.BY_TO_HOME_TEL_1.value || !f.BY_TO_HOME_TEL_2.value || !f.BY_TO_HOME_TEL_3.value)
	{
		alert('\n배송받으실 고객님의 전화번호를 정확히 입력해 주세요.             \n');
		f.BY_TO_HOME_TEL_1.focus();
		return false;
	}
	if (!f.BY_TO_ZIP1.value || !f.BY_TO_ZIP2.value || !f.BY_TO_ADDR1.value)
	{
		alert('\n배송받으실 고객님의 주소를 정확히 입력해 주세요.             \n');
		f.BY_TO_ADDR2.focus();
		return false;
	}

	if (!confirm('\n입력하신 주문정보가 정확합니까?           \n'))
	{
		return false;
	}
	
	if (f.BY_PAY_TYPE.value != "별도협의")
	{
		f.g_mby_stack.value = f1.BY_SPECIAL_TACK_1.value;
		f.g_mby_price_order.value = filterNum(f1.price_total.value.replace("円", ""));

		if (f.BY_PAY_TYPE.value == "온라인")
		{
			f.g_mby_price_online.value = filterNum(f1.price_total2.value.replace("円", ""));
		}
		else {
			f.g_mby_price_online.value = (f.BY_PAY_TYPE.value == "다중결제") ? filterNum(f.BY_ONLINE_PRICE.value.replace("円", "")) : 0;
		}

		if (f.BY_PAY_TYPE.value == "신용카드")
		{
			f.g_mby_price_card.value = filterNum(f1.price_total2.value.replace("円", ""));
		}
		else {
			f.g_mby_price_card.value = (f.BY_PAY_TYPE.value == "다중결제") ? filterNum(f.BY_CARD_PRICE.value.replace("円", "")) : 0;
		}
		if (f.BY_PAY_TYPE.value == "적립금")
		{
			f.g_mby_price_point.value = filterNum(f1.price_total2.value.replace("円", ""));
		}
		else {	
			f.g_mby_price_point.value = (f.BY_PAY_TYPE.value == "다중결제") ? filterNum(f.BY_POINT_PRICE.value.replace("円", "")) : 0;
		}
		f.g_mby_price_hand.value = (f.BY_PAY_TYPE.value == "모바일") ? filterNum(f1.price_total2.value.replace("円", "")) : 0;
		f.g_mby_price_ziro.value = (f.BY_PAY_TYPE.value == "계좌이체") ? filterNum(f1.price_total2.value.replace("円", "")) : 0;
		f.g_mby_price_jeolsa.value = filterNum(f1.price_jeolsa.value.replace("円", ""));
		f.g_mby_price_halin.value = filterNum(f1.halin_total.value.replace("円", ""));
		
		if (f1.price_tack.value == "- 무료 -" || f1.price_tack.value == "- 별도 -")
		{
			f.g_mby_price_tack.value = 0;	
		}
		else if(f1.price_tack.value == "- 착불 -")
		{
			f.g_mby_price_tack.value = -1;			
		}
		else {
			f.g_mby_price_tack.value = filterNum(f1.price_tack.value.replace("円", ""));
		}
	}

	if (f.BY_PAY_TYPE.value == "온라인")
	{
		f.BY_HOWBANK.value = f.BY_HOWBANK_1.value;
	}
	if (f.BY_PAY_TYPE.value == "계좌이체")
	{
		f.BY_HOWBANK.value = f.BY_HOWBANK_2.value;
	}
	if (f.BY_PAY_TYPE.value == "다중결제")
	{
		f.BY_HOWBANK.value = f.BY_HOWBANK_3.value;
	}
}

function order_view(id,oid,name)
{
	if (id)
	{
		location.href = "mypage.php?query=myorder";
	}
	else {
		window.open('./include/lib/order_mall.php?oid=' + oid + '&name='+name,'order_win','scrollbars=yes,width=650,height=600');
	}
}
function order_view_gr(id,oid,name)
{
	if (id)
	{
		location.href = "mypage.php?query=mygroupbuy";
	}
	else {
		window.open('./include/lib/order_groupbuy.php?oid=' + oid+ '&name='+name,'order_win','scrollbars=yes,width=650,height=600');
	}
}
function order_view_au(id,oid,name)
{
	if (id)
	{
		location.href = "mypage.php?query=myauction";
	}
	else {
		window.open('./include/lib/order_auction.php?oid=' + oid+ '&name='+name,'order_win','scrollbars=yes,width=650,height=600');
	}
}

function gr_order_check()
{
	var f  = document.order_form;

	if (!f.BY_BY_NAME.value)
	{
		alert('\n주문인의 성함을 입력해 주세요.             \n');
		f.BY_BY_NAME.focus();
		return false;
	}
	if (!f.BY_BY_EMAIL.value)
	{
		alert('\n주문인의 이메일을 입력해 주세요.             \n');
		f.BY_BY_EMAIL.focus();
		return false;
	}
	if (!f.BY_BY_HOME_TEL_1.value || !f.BY_BY_HOME_TEL_2.value || !f.BY_BY_HOME_TEL_3.value)
	{
		alert('\n주문인의 전화번호를 정확히 입력해 주세요.             \n');
		f.BY_BY_HOME_TEL_1.focus();
		return false;
	}
	if (!f.BY_BY_ZIP1.value || !f.BY_BY_ZIP2.value || !f.BY_BY_ADDR1.value)
	{
		alert('\n주문인의 주소를 정확히 입력해 주세요.             \n');
		f.BY_BY_ADDR2.focus();
		return false;
	}

	if (!f.BY_TO_NAME.value)
	{
		alert('\n배송받으실 고객님의 성함을 입력해 주세요.             \n');
		f.BY_TO_NAME.focus();
		return false;
	}
	if (!f.BY_TO_HOME_TEL_1.value || !f.BY_TO_HOME_TEL_2.value || !f.BY_TO_HOME_TEL_3.value)
	{
		alert('\n배송받으실 고객님의 전화번호를 정확히 입력해 주세요.             \n');
		f.BY_TO_HOME_TEL_1.focus();
		return false;
	}
	if (!f.BY_TO_ZIP1.value || !f.BY_TO_ZIP2.value || !f.BY_TO_ADDR1.value)
	{
		alert('\n배송받으실 고객님의 주소를 정확히 입력해 주세요.             \n');
		f.BY_TO_ADDR2.focus();
		return false;
	}

	if (!confirm('\n입력하신 신청정보가 정확합니까?           \n'))
	{
		return false;
	}
}
function gr_order_view(oid,name)
{
	window.open('./include/lib/order_groupbuy.php?oid=' + oid + '&name=' + name,'order_win','scrollbars=yes,width=700,height=650');
}
function au_order_view(oid,name)
{
	window.open('./include/lib/order_auction.php?oid=' + oid + '&name=' + name,'order_win','scrollbars=yes,width=700,height=650');
}

function ipchal_plus(ip,pp)
{
	var f = document.order_form;
	var price = parseInt(filterNum(f.IPCHAL_PRICE.value));

	f.IPCHAL_PRICE.value = commaSplit(price + parseInt(pp));
}
function ipchal_minus(ip,pp)
{
	var f = document.order_form;
	var price = parseInt(filterNum(f.IPCHAL_PRICE.value));
	
	if (parseInt(ip) > price - parseInt(pp))
	{
		alert('\n입찰금액은 최소 '+commaSplit(ip)+'円 이상이어야 합니다.           \n');
		return false;
	}

	f.IPCHAL_PRICE.value = commaSplit(price - parseInt(pp));
}
