   function trimAll_span(sString)
    {
      while( sString.substring(0,1) == ' ')
      {
        sString = sString.substring(1, sString.length);
      }
      
      while (sString.substring(sString.length-1, sString.length) == ' ')
      {
        sString = sString.substring(0,sString.length-1);
      }
      return sString;
    }
    function validate_form_span()
    {
        var field_count = 0;
        var error = '';
        obj = document.frm_loan_app;
        
        if( trimAll_span(obj.full_name.value) == '' )
        {
            error += 'Este "Nombre Completo" espacio se requiere.\n';
            field_count++;
        }
        if( trimAll_span(obj.day_tel_number.value) == '' )
        {
            error += 'Este "Numero (dia)" espacio se requiere.\n';
            field_count++;
        }
        if( trimAll_span(obj.evening_tel_number.value) == '' )
        {
            error += 'Este "Numero (Tarde)" espacio se requiere.\n';
            field_count++;
        }
        if( trimAll_span(obj.email.value) == '' )
        {
            error += 'Este "Email Address" espacio se requiere.\n';
            field_count++;
        }
        if( trimAll_span(obj.vehicle_paid.value) == '' )
        {
            error += 'Este "Esta el vehiculo todo pagado?" espacio se requiere.\n';
            field_count++;
        }
        if( trimAll_span(obj.ca_title.value) == '' )
        {
            error += 'Este "Es titulo de Calf" espacio se requiere.\n';
            field_count++;
        }
        if( trimAll_span(obj.name_title.value) == '' )
        {
            error += 'Este "Esta el titulo en su nombre?" espacio se requiere.\n';
            field_count++;
        }
        if( trimAll_span(obj.vehicle_year.value) == '' )
        {
            error += 'Este "Ano del vehiculo" espacio se requiere.\n';
            field_count++;
        }
        if( trimAll_span(obj.vehicle_make.value) == '' )
        {
            error += 'Este "Clase del vehiculo" espacio se requiere.\n';
            field_count++;
        }
        if( trimAll_span(obj.model_trim.value) == '' )
        {
            error += 'Este "Modelo y Corte" espacio se requiere.\n';
            field_count++;
        }if( trimAll_span(obj.mileage.value) == '' )
        {
            error += 'Este "Millas de odometro" espacio se requiere.\n';
            field_count++;
        }
        if( trimAll_span(obj.amount.value) == '' )
        {
            error += 'Este "Cantidad de prestamo que usted desea" espacio se requiere.\n';
            field_count++;
        }
        if( trimAll_span(obj.employment.value) == '' )
        {
            error += 'Este "Esta empleado?" espacio se requiere.\n';
            field_count++;
        }
        if( trimAll_span(obj.california_resident.value) == '' )
        {
            error += 'Este "Es un residente de California?" espacio se requiere.\n';
            field_count++;
        }
        if( trimAll_span(obj.hear_from.value) == '' )
        {
            error += 'Este "Como se dio cuenta de nosotros?" espacio se requiere.\n';
            field_count++;
        }
        if( trimAll_span(obj.captcha.value) == '' )
        {
            error += 'Este "Verificacion de codigo" espacio se requiere.\n';
            field_count++;
        }
        
        if( error != '')
        {
            if(field_count == 16)
            {
                alert('Favor de llenar el espacio requerido.');
            }
            else
            {
                alert(error);
            }
            return false;
        }
        else
        {
          return true;
        }
        
    }


