function validarBranco(texto){
    if(texto==""){
        return false;
    }else{
        return true;
    }
}

function validarEmail(texto){
    //indexOf é um método do objeto string
    //essa função retorna a posição de um caractere
    //caso não seja encontrado, ele retorna "-1"
    if(texto.indexOf("@")>1 && texto.indexOf(".")>3){
        return true;
    }else{
        return false;
    }
}

function validarTelefone(texto){
    //charAt - pega um caracter de acordo com o indice passado
    //sustring - pega uma string dentro da string => "casa"substring(0,2) = "cas"
    //(99)9999-9999
    if((texto.charAt(0)!="(" || texto.charAt(3)!=")" || texto.charAt(8)!="-") ||
    (isNaN(texto.substring(1,3))||isNaN(texto.substring(4,8)) ||
    isNaN(texto.substring(9,13)))){
        return false;
    }else{
        return true;
    }
}
function validarRadio(texto){
    //var okFormaContato= false;

    for(i=0;i<texto.getElementsByTagName("input").length;i++)
        if(texto.getElementsByTagName("input")[i].checked == true){
            return true;
        }
}
