function round(number,X) {
// rounds number to X decimal places, defaults to 2
X = (!X ? 2 : X);
return Math.round(number*Math.pow(10,X))/Math.pow(10,X);
}


function jumpBox(list) {
   location.href = list.options[list.selectedIndex].value
   }

function computeForm(form)  {

//By Daniel C. Peterson, 1997  All Rights Reserved.
//For commercial use rates send email to:
//webmaster@webwinder.com

    var i = form.interest.value;

    if (i > 1.0) {i = form.interest.value / 100} else {i = form.interest.value};

    i /= 12;

   var ma = eval(form.moAdd.value);

   var prin = eval(form.principal.value);

   var pmts = eval(form.payments.value * 12);

   var count = 0;
    
   while(count < pmts) {

        newprin = prin + ma;

        prin = (newprin * i) + eval(prin + ma);

        count = count + 1;

      }

   form.fv.value = round(prin,2);
		
		var totinv = eval(count * ma) + eval(form.principal.value);

    form.totalint.value = round(eval(prin - totinv),2);

}





function clearForm(form)

{

    form.payments.value = "";

    form.interest.value = "";

    form.principal.value = "";

    form.moAdd.value = "";

}
