// 自動計算タイプ２

function keisan(){


	
	// CUBE＋CUBE　追加個数の合計
	
	// 追加商品1（追加　キューブGIANT）
	var price_a = document.mail_form.goods_other1.options[document.mail_form.goods_other1.selectedIndex].value;	
	
	// 追加商品2（追加　キューブGIANT）
	var price_b = document.mail_form.goods_other2.options[document.mail_form.goods_other2.selectedIndex].value;	
	
	// 追加商品3（追加　スーツケース）
	var price_c = document.mail_form.goods_other3.options[document.mail_form.goods_other3.selectedIndex].value;	
   

	    
	// 商品1（１個目　キューブBOX／キューブGINAT／スーツケース １個）
	var price1 = document.mail_form.goods1.options[document.mail_form.goods1.selectedIndex].value;	

	// 商品2（ゴルフバッグ）
	var price2 = document.mail_form.goods2.options[document.mail_form.goods2.selectedIndex].value;

	// 商品3（サーフボード ）
	var price3 = document.mail_form.goods3.options[document.mail_form.goods3.selectedIndex].value;
	
	// 商品4（自転車）
	var price4 = document.mail_form.goods4.options[document.mail_form.goods4.selectedIndex].value; 
	
        // 商品6（追加　ゴルフバッグ／ゴルフバッグ）
	var price6 = document.mail_form.goods6.options[document.mail_form.goods6.selectedIndex].value;
	
	

	// CUBE＋CUBE＆パッケージスペシャル　追加個数を計算
	var total_box = parseInt(price_a) + parseInt(price_b) + parseInt(price_c);
	
	
	
	// 追加個数の合計を計算
	if(total_box == 0)
	    document.mail_form.added_box_total.value = 0;
	if(total_box == 1)
	    document.mail_form.added_box_total.value = 170 + 160;
	if(total_box == 2)
	    document.mail_form.added_box_total.value = 170 + 310;
	if(total_box == 3)
	    document.mail_form.added_box_total.value = 170 + 460;
	if(total_box == 4)
	    document.mail_form.added_box_total.value = 170 + 610;
	if(total_box == 5)
	    document.mail_form.added_box_total.value = 170 + 760;
	if(total_box == 6)
	    document.mail_form.added_box_total.value = 170 + 910;	
	if(total_box == 7)
	    document.mail_form.added_box_total.value = 170 + 1060;
	if(total_box == 8)
	    document.mail_form.added_box_total.value = 170 + 1210;
	if(total_box == 9)
	    document.mail_form.added_box_total.value = 170 + 1360;
	if(total_box == 10)
	    document.mail_form.added_box_total.value = 170 + 1510;
	if(total_box == 11)
	    document.mail_form.added_box_total.value = 170 + 1660;
	if(total_box == 12)
	    document.mail_form.added_box_total.value = 170 + 1810;	
	if(total_box == 13)
	    document.mail_form.added_box_total.value = 170 + 1960;
	if(total_box == 14)
	    document.mail_form.added_box_total.value = 170 + 2110;
	if(total_box == 15)
	    document.mail_form.added_box_total.value = 170 + 2260;
	    

	// 商品5（CUBE＋CUBE 追加料金を合計）
	var price5 = document.mail_form.added_box_total.value;


	// 合計を計算
	var total = parseInt(price2) + parseInt(price3) + parseInt(price4) + parseInt(price5) + parseInt(price6);
	var total_no_cube = parseInt(price1) + parseInt(price2) + parseInt(price3) + parseInt(price4) + parseInt(price6);
	    
	    
	// 合計を表示
	if(total_box >= 1)
	    document.mail_form.field_total.value = total; // CUBE＋CUBE 有り 合計を表示
	else
	    document.mail_form.field_total.value = total_no_cube; // CUBE＋CUBE 無し 合計を表示


	// CUBE＋CUBE　0個の場合
	var no_cube = document.mail_form.goods1.options[document.mail_form.goods1.selectedIndex].value;	

        if(no_cube == 0) {
	    document.mail_form.added_box_total.value = parseInt(price1);
	    document.mail_form.goods6.options[document.mail_form.goods6.selectedIndex].value = 0;   
	    document.mail_form.goods_other1.options[document.mail_form.goods_other1.selectedIndex].value = 0; 
	    document.mail_form.goods_other2.options[document.mail_form.goods_other2.selectedIndex].value = 0; 
	    document.mail_form.goods_other3.options[document.mail_form.goods_other3.selectedIndex].value = 0;
	    document.mail_form.field_total.value = parseInt(price2) + parseInt(price3) + parseInt(price4);
	}


	// 設定終了
}