function validate_form(emailRequired)
{
    valid = true;
    msg = "";
    if (document.wg_form.amt.value == "")
    {
        msg += "Please fill in the loan amount.\n"
        valid = false;
    }
    if (document.wg_form.email && document.wg_form.email.value == "" && emailRequired){
		msg += "Please enter an email address.\n"
        valid = false;
    }
    if (!valid){
		alert(msg);
    }
    return valid;
}
