function amortSubmit() {
    var isLoanMonthsSet = document.getElementById('amortLoanMonths').value == "" ? false : true;
    var isLoanAmountSet = document.getElementById('amortLoanAmount').value == "" ? false : true;
    
    if (!isLoanMonthsSet) {
        var temp = prompt("The required field \"Number of months of loan\" was not set.\nPlease assign it a value now.",'');
        document.getElementById('amortLoanMonths').value = temp;
        if (temp != "" && temp != null)
        isLoanMonthsSet = true;
    }
    if (!isLoanAmountSet) {
        var temp = prompt("The required field \"Total amount of loan\" was not set.\nPlease assign it a value now.",'');
        document.getElementById('amortLoanAmount').value = temp;
        if (temp != "" && temp != null)
        isLoanAmountSet = true;
    }
    
    if (isLoanMonthsSet && isLoanAmountSet) {
        document.getElementById('ammortizationForm').submit();
    } 
}
function amortClear() {
    document.getElementById('amortLoanMonths').value = "";
    document.getElementById('amortLoanAmount').value = "";
    document.getElementById('amortBody').innerHTML = "";
}
function ammortEmail() {
    document.getElementById('ammortAction').value = 'email';
    document.getElementById('ammortizationForm').submit();
}

function ammortPrint() {
    document.getElementById('ammortAction').value='print';
    document.getElementById('ammortizationForm').submit();
}