// APN Setting
function ValidationAPNEntry() {

    var ProviderName = document.getElementById('txtProviderName');
    var APNName = document.getElementById('txtAPN');
    var DispName = document.getElementById('txtDispname');
    var APNDesc = document.getElementById('txtDesc');

    var isError = false;
    var controlToBeFocused;
    var alertMessage = '';

    if (RemoveSpaces(ProviderName).length == 0) {

        alertMessage += (alertMessage.length == 0 ? '' : '\n') + 'Please enter the Provider Name.';
        if (!isError) {
            isError = true;
            controlToBeFocused = ProviderName;
        }

        ProviderName.style.backgroundColor = 'lightyellow';
    }
    else {
        ProviderName.style.backgroundColor = 'white';
    }

    if (RemoveSpaces(DispName).length == 0) {

        alertMessage += (alertMessage.length == 0 ? '' : '\n') + 'Please enter the Display Name.';
        if (!isError) {
            isError = true;
            controlToBeFocused = DispName;
        }

        DispName.style.backgroundColor = 'lightyellow';
    }
    else {
        DispName.style.backgroundColor = 'white';
    }

    if (RemoveSpaces(APNDesc).length == 0) {

        alertMessage += (alertMessage.length == 0 ? '' : '\n') + 'Please enter the Description.';
        if (!isError) {
            isError = true;
            controlToBeFocused = APNDesc;
        }

        APNDesc.style.backgroundColor = 'lightyellow';
    }
    else {
        APNDesc.style.backgroundColor = 'white';
    }

    if (RemoveSpaces(APNName).length == 0) {

        alertMessage += (alertMessage.length == 0 ? '' : '\n') + 'Please enter the APN Name.';
        if (!isError) {
            isError = true;
            controlToBeFocused = APNName;
        }

        APNName.style.backgroundColor = 'lightyellow';
    }
    else {
        APNName.style.backgroundColor = 'white';
    }



    if (isError) {
        controlToBeFocused.focus();
        alert(alertMessage);
        return false;
    }
    else {
        return true;
    }
}
