<!--単価表
var prices = new Array();	//スクリプト単価
prices[1] =20000;	// 北海道
prices[2] =18000;	// 青森
prices[3] =10000;	// エアコンクリーニング（壁掛けタイプ）
prices[4] =15000;	// キッチンクリーニング
prices[5] =20000;	// 浴室クリーニング
prices[6] =25000;	// ガラス・サッシ・網戸クリーニング


function goodsCheck(n) {
	if(document.calc.goods[n-1].checked == true) {
		document.calc['num'+n].disabled = false;
		document.calc['num'+n].style.backgroundColor='#FFFFFF';
	} else {
		document.calc['num'+n].disabled = true;
		document.calc['num'+n].style.backgroundColor='#D4D0C8';
	}
}
function init() {
	var i;
	for(i in prices) {
		goodsCheck(i);
	}
}
function calcSum() {
	var i;
	var total = 0;
	var subtotal = 0;
	var tax = 0;
	for(i in prices) {
		if(document.calc.goods[i-1].checked == true) {
			var num = document.calc['num'+i].value;
			if(isNaN(num)) {
				alert("数量は、半角数字で指定して下さい。");
			}
			if(num < 1) {
				num = 1;
			}
			var price = prices[i] * num;
			subtotal += price;
		}
	}

	total = subtotal;
	total1 = subtotal;

	subtotal = String( subtotal );
	while( subtotal != ( subtotal = subtotal.replace( /^(\d+)(\d{3})/ , "$1,$2" ) ) ){}

	total = String( total );
	while( total != ( total = total.replace( /^(\d+)(\d{3})/ , "$1,$2" ) ) ){}


	total1 = String( total );
	while( total != ( total = total.replace( /^(\d+)(\d{3})/ , "$1,$2" ) ) ){}

	document.calc.total.value = total;
	document.calc.total1.value = total1;
	document.calc.subtotal.value = subtotal;

}
//-->
