/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function checkMail(mail){
    var er = new RegExp(/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]{2,}\.[A-Za-z0-9]{2,}(\.[A-Za-z0-9])?/);
    if(typeof(mail) == "string"){
        if(er.test(mail)){ return true; }
    }else if(typeof(mail) == "object"){
        if(er.test(mail.value)){
            return true;
        }
    }else{
        return false;
    }
}
function signup(){
    mail = document.getElementById("email").value;
    if (!checkMail(mail)){
        alert('email inválido!');
        return false;
    }
    return true;

}

