var penny;	// 投資金額
var years;	// 継続年数
var boost;	// 予想平均上昇率

var temp;

var total;	// 数年後の合計金額

function investmentFunc() {
	// エラーチェック
	if(document.investment.penny.value == ""){
		alert("投資金額は必須項目です。");
		document.investment.penny.focus();
		return(false);
	}
	else{
		penny = parseInt(document.investment.penny.value);
		years = document.investment.years.value;
		boost = document.investment.boost.value;
	}
	
	boost = (boost / 100);
	
	temp = penny * Math.pow(boost,years);
	temp = Math.round(temp * 1) / 1;
	
	if(temp > 0){
		total = temp;
	}

	document.investment.total.value = total;
}