// 自動計算タイプ２

function keisan(){


	
	// CUBE＋CUBE　追加個数の合計
	
	// 追加商品1（追加 キューブGIANT）
	var price_a = document.mail_form.goods_other1.options[document.mail_form.goods_other1.selectedIndex].value;	
	
	// 追加商品2（追加 スーツケース）
	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）
	var price1 = document.mail_form.goods1.options[document.mail_form.goods1.selectedIndex].value;

	// 商品2（１個目　キューブGINAT／スーツケース／ゴルフバッグ）
	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;    


	
	// 追加個数を計算
	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 = 140 + 150;
	if(total_box == 2)
	    document.mail_form.added_box_total.value = 270 + 150;
	if(total_box == 3)
	    document.mail_form.added_box_total.value = 400 + 150;
	if(total_box == 4)
	    document.mail_form.added_box_total.value = 530 + 150;
	if(total_box == 5)
	    document.mail_form.added_box_total.value = 660 + 150;
	if(total_box == 6)
	    document.mail_form.added_box_total.value = 790 + 150;	
	if(total_box == 7)
	    document.mail_form.added_box_total.value = 920 + 150;
	if(total_box == 8)
	    document.mail_form.added_box_total.value = 1050 + 150;
	if(total_box == 9)
	    document.mail_form.added_box_total.value = 1180 + 150;
	if(total_box == 10)
	    document.mail_form.added_box_total.value = 1310 + 150;
	if(total_box == 11)
	    document.mail_form.added_box_total.value = 1440 + 150;
	if(total_box == 12)
	    document.mail_form.added_box_total.value = 1570 + 150;	
	if(total_box == 13)
	    document.mail_form.added_box_total.value = 1700 + 150;
	if(total_box == 14)
	    document.mail_form.added_box_total.value = 1830 + 150;
	if(total_box == 15)
	    document.mail_form.added_box_total.value = 1960 + 150;
	    
	    
	// 商品5（CUBE＋CUBE SALE 小計）
	var price5 = document.mail_form.added_box_total.value;

        //if(no_cube == 0)
	//    document.mail_form.added_box_total.value = 0;
	//if(no_cube == 0)
	//    document.mail_form.goods6.value = 0;   
	//if(no_cube == 0)
	//    document.mail_form.goods_other1.options[document.mail_form.goods_other1.selectedIndex].value = 0; 
	//if(no_cube == 0)
	//    document.mail_form.goods_other2.options[document.mail_form.goods_other2.selectedIndex].value = 0; 
	//if(no_cube == 0)
	//    document.mail_form.goods_other3.options[document.mail_form.goods_other3.selectedIndex].value = 0; 
 

	// 合計を計算
	var total = parseInt(price1) + 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.goods2.options[document.mail_form.goods2.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(price1) + parseInt(price2) + parseInt(price3) + parseInt(price4);
            document.mail_form.added_box_total.value = 0;
	}


	// 設定終了

}