function compound() {
  var doc = document.Compounding;
  var points = 0;
  var totalprofit=0;
  var startamount = doc.startamount.value;
  var periods = doc.periods.value;
  var percent = doc.percent.value;
  points = Math.pow(1+(percent/100),periods)*startamount;
  doc.result.value = Math.round(points);
    totalprofit=(points-startamount);
	doc.resultprofit.value = Math.round(totalprofit);
  totalprofitpercent=100*(points-startamount)/startamount;
  doc.resultprofitpercent.value = Math.round(totalprofitpercent)+"%";
}
