﻿function ValidateSectionC(Errors)
{
    var isValid = true;
    if (!IsOptionSelected('PreviousBankruptcy', true))
    {
        isValid = false;
        Errors[Errors.length] = 'Please check if you have filed bankruptcy in the past 10 years';
    }
    if (!IsOptionSelected('PreviousRepossession', true))
    {
        isValid = false;
        Errors[Errors.length] = 'Please check if you have you had any vehicles repossessed in the past 10 years';
    }
    if (!IsOptionSelected('UsbankCreditor', true))
    {
        isValid = false;
        Errors[Errors.length] = 'Please check if U.S. Bank is listed in this bankruptcy as a creditor';
    }
    if (!IsOptionSelected('HasSecondLien', true))
    {
        isValid = false;
        Errors[Errors.length] = 'Please check if there is a second lien on this vehicle';
    }
    if (!IsOptionSelected('HasCoSigner', true))
    {
        isValid = false;
        Errors[Errors.length] = 'Please check if there a Co-Signer on this Vehicle loan';
    }
    if (IsOptionSelected('HasCoSigner', false) && $(':input[name=HasCoSigner]:checked').val() == 'true')
    {
        if (!HasValue('#CoSignerName', true))
        {
            isValid = false;
            Errors[Errors.length] = 'Please Enter the Co-Signer name';
        }
    }
    if (!IsOptionSelected('OtherOnTitle', true))
    {
        isValid = false;
        Errors[Errors.length] = 'Please check if there is anyone else on the title of this vehicle';
    }
    if (IsOptionSelected('OtherOnTitle', false) && $(':input[name=OtherOnTitle]:checked').val() == 'true')
    {
        if (!HasValue('#OtherNameOnTitle', true))
        {
            isValid = false;
            Errors[Errors.length] = 'Please Enter the Other Title Holder name';
        }
    }
    return isValid;
}
