// JavaScript Document
			var formOpenFlag = false;
			var totalPrice = 0;

			function addFigure(str) {
　				var num = new String(str).replace(/,/g, "");
　				while(num != (num = num.replace(/^(-?\d+)(\d{3})/, "$1,$2")));
　				return num;
			}

			$(document).ready(function() {
				if (formOpenFlag == true) {
					$("#openBt").next().toggle();
				}
				
				$("#openBt").click(function() {
			    	$(this).next().slideToggle("slow");
				});

				var Price = {};
				Price.Design = [
					//未選択
					0,
					//1提案
					120000,
					//2提案
					200000
				];

				Price.Cording = [
					//未選択
					0,
					//yes
					50000
				];

				Price.Page = [
					//未選択
					0,
					//1-5
					75000,
					//6-10
					150000,
					//11-15
					225000,
					//16-20
					300000
				];

				Price.Form = [
					//未選択
					0,
					//メーラー起動
					0,
					//1点
					25000,
					//2点
					50000
				];
				
				Price.Contents = [
					//未選択
					0,
					//不要
					0,
					//一部依頼
					50000,
					//全部依頼
					200000
				];
				
				Price.Illust = [
					//未選択
					0,
					//1
					10000,
					//2
					20000,
					//3
					30000,
					//4
					40000,
					//5
					50000,
					//0
					0
				];

				Price.Cara = [
					//未選択
					0,
					//1
					30000,
					//2
					60000,
					//3
					90000,
					//4
					0
				];

				Price.Flash = [
					//未選択
					0,
					//フラッシュ希望
					50000,
					//フラッシュ不要
					0
				];

				Price.Cms = [
					//未選択
					0,
					//希望
					100000,
					//希望しない
					0
				];

				$("#estimate select[name=designType]").change(calculation);
				$("#estimate select[name=flashType]").change(calculation);
				$("#estimate select[name=cordingType]").change(calculation);
				$("#estimate select[name=pageType]").change(calculation);
				$("#estimate select[name=formType]").change(calculation);
				$("#estimate select[name=contentsType]").change(calculation);
				$("#estimate select[name=illustType]").change(calculation);
				$("#estimate select[name=caraType]").change(calculation);
				$("#estimate select[name=cmsType]").change(calculation);
				

				function calculation() {
					var designType	= $("#estimate select[name=designType]").attr("value");
					var flashType	= $("#estimate select[name=flashType]").attr("value");
					var cordingType	= $("#estimate select[name=cordingType]").attr("value");
					var pageType	= $("#estimate select[name=pageType]").attr("value");
					var formType	= $("#estimate select[name=formType]").attr("value");
					var contentsType	= $("#estimate select[name=contentsType]").attr("value");
					var illustType	= $("#estimate select[name=illustType]").attr("value");
					var caraType	= $("#estimate select[name=caraType]").attr("value");
					var cmsType	= $("#estimate select[name=cmsType]").attr("value");

					var design	= Price.Design[designType];
					var flash	= Price.Flash[flashType];
					var cording	= Price.Cording[cordingType];
					var page	= Price.Page[pageType];
					var form	= Price.Form[formType];
					var contents	= Price.Contents[contentsType];
					var illust	= Price.Illust[illustType];
					var cara	= Price.Cara[caraType];
					var cms	= Price.Cms[cmsType];
					var small = design + flash + cording + page + form + contents + illust + cara + cms;
					var total	= small * 1.05;
					var credit = Math.floor(( total + ( total * 0.1308 )) / 36 / 100) * 100;

					$("#estimate input[name=designPrice]").attr("value", design);
					$("#estimate input[name=flashPrice]").attr("value", flash);
					$("#estimate input[name=cordingPrice]").attr("value", cording);
					$("#estimate input[name=pagePrice]").attr("value", page);
					$("#estimate input[name=formPrice]").attr("value", form);
					$("#estimate input[name=contentsPrice]").attr("value", contents);
					$("#estimate input[name=illustPrice]").attr("value", illust);
					$("#estimate input[name=caraPrice]").attr("value", cara);
					$("#estimate input[name=cmsPrice]").attr("value", cms);
					$("#estimate input[name=totalPrice]").attr("value",	total);


					$("#designPrice").html('￥' + addFigure(design));
					$("#flashPrice").html('￥' + addFigure(flash));
					$("#cordingPrice").html('￥' + addFigure(cording));
					$("#pagePrice").html('￥' + addFigure(page));
					$("#formPrice").html('￥' + addFigure(form));
					$("#contentsPrice").html('￥' + addFigure(contents));
					$("#illustPrice").html('￥' + addFigure(illust));
					$("#caraPrice").html('￥' + addFigure(cara));
					$("#cmsPrice").html('￥' + addFigure(cms));
					$("#small").html('￥' + addFigure(small));
					$("#price1").html('￥' + addFigure(total));
					$("#price2").html('または<strong>月々￥' + addFigure(credit) + '</strong>から　<a href="http://akinaihonpo.com/" target="_brank" rel="nofollow">分割決済システム「あきない本舗」</a>');
				}
			});