//オーダーフォーム　js

//---------------------ハンコ名、価格初期設定-----------------------------------------------------------
Seal = new Array();						//変数宣言

//↓「ハンコ名」「価格」の設定　　※価格は数値のみ　（例→　'ハンコ名１':価格１, 'ハンコ名２':価格２
Seal = { 
'スピード日付印　15mm丸':3800,
'スピード日付印　18mm丸':4200
};
//--------------------iSecret、価格初期設定----------------------------------------------------------
Isecret = new Array();						//変数宣言
//↓「ケース名」「価格」の設定　　　  ※価格は数値のみ
Isecret = { 
'0個':0,
'1個':1365,
'2個':2730,
'3個':4095,
'4個':5460,
'5個':6825,
'6個':8190,
'7個':9555,
'8個':10920,
'9個':12285,
'10個':13650
};
//--------------------印章の友、価格初期設定----------------------------------------------------------
Intomo = new Array();						//変数宣言
//↓「ケース名」「価格」の設定　　　  ※価格は数値のみ
Intomo = { 
'0個':0,
'1個':577,
'2個':1154,
'3個':1731,
'4個':2308,
'5個':2885,
'6個':3462,
'7個':4039,
'8個':4616,
'9個':5193,
'10個':5770
};
//----------------------------------------------------------------------------------------------------

var Isecret_price = 0;					//←選択した「iSecret」保存用変数（0804追加）
var Intomo_price = 0;					//←選択した「印章の友」保存用変数（0804追加）
var Seal_name;							//←選択した「ハンコ名」保存用変数
var Seal_size;							//←選択した「サイズ径」保存用変数


//↓項目「ハンコ名」
function Seal_NameAdd(n){
document.getElementById("item").value = n;			//←選択した「商品名」の表示
Seal_name = n;							//←選択した「商品名」のvalueを一時保存
Calc();
}


//↓項目「iSecret」（0804追加）
function Isecret_PriceAdd(n){
Isecret_price = Isecret[n];						//←選択した「iSecret」のvalueを一時保存
Calc();
}
//↓項目「印章の友」（0804追加）
function Intomo_PriceAdd(n){
Intomo_price = Intomo[n];						//←選択した「印章の友」のvalueを一時保存
Calc();
}

//↓代金、送料、合計金額算出＆表示
function Calc(){
var Price;
var Carriage = 1050;
var Total;


//↓項目「ハンコ名」、項目「サイズ径」が選択されていた場合
if (Seal_name){
Price = Seal[Seal_name] + Isecret_price + Intomo_price;
}else{
Price = Isecret_price + Intomo_price;
}


//↓代金、送料、合計金額算出
if (Price >= 1 && Price < 1000000){			//←商品代金が10,000円未満の場合
Total    = Price + Carriage;
	}else{							//←商品代金が0円の場合
//↓iSecretのみ選択時（0804追加）
if (Isecret_price >= 1){
Price    =  Isecret_price + Intomo_price;
Total    = Price + Carriage;
}
//↓印章の友のみ選択時（0804追加）
if (Intomo_price >= 1){
Price    = Isecret_price + Intomo_price;
Total    = Price + Carriage;
//↓未選択時
	}else{
	Price    = 0;
	Carriage = 0;
	Total    = 0;
	}
}
document.getElementById("price").value = Price;			//←「商品代金」の表示
document.getElementById("souryou").value = Carriage;			//←「送料」の表示
document.getElementById("total").value = Total;			//←「合計金額」の表示
}

function Clear(){
document.getElementById("price").value = "";			//←「商品代金」のクリア
document.getElementById("souryou").value = "";			//←「送料」のクリア
document.getElementById("total").value = "";			//←「合計金額」のクリア
}

function Clear(){
document.getElementById("price").value = "";			//←「商品代金」のクリア
document.getElementById("souryou").value = "";			//←「送料」のクリア
document.getElementById("total").value = "";			//←「合計金額」のクリア
}
