How can I do to read the first character entered in the input and the part of the condition to be called a specific mask.
if(Se o primeiro caractere no input for letra){
}else{
$('#login_username').mask('(99) 9999-9999?9').focusout(function() {
var phone, element;
element = $(this);
element.unmask();
phone = element.val().replace(/\D/g, '');
if( phone.substring(0, 1) === '0' ) {
element.mask("9999-999-9999");
} else if (phone.length > 10) {
element.mask("(99) 99999-999?9");
} else {
element.mask("(99) 9999-9999?9");
}
}).trigger('focusout');
}