//<script language="JavaScript">
//<!--

/**
 * JavaScript functions for flight training cost calculations
 *
 * @author      Richard Farrar
 * @version     1.0.0
 */


// Cost calculation
function CalcCost()
{
    // Get key variables from HTML form
    intTotalCost  = document.getElementById("totalcost").value; // in pounds
    intDeposit  = document.getElementById("deposit").value;     // variable deposit in pounds
    intMonths = document.getElementById("months").value;        // months spent training

    // Calculate amount remaining after deposit
    intRemain = intTotalCost - intDeposit;

    // Calculate cost per month
    intCost = intRemain / intMonths;

    // Show results on web page in allocated field
    document.getElementById("cost").value  = intCost.toFixed(2);
}


//-->
//</script>
