$(document).ready(function() {
if(cadastro==true){
msg("Cadastro efetuado com sucesso!","#0000FF","");
}else if(remover==true){
msg("E-mail removido com sucesso!","#0000FF","");
}else if(cadastro=="existe"){
msg("Esse e-mail ja existe em nosso sistema!","#FF0000","");
}
		
$("#formn").submit( function() {		
	var ok_="";
	var regmail = /^[\w!#$%&amp;'*+\/=?^`{|}~-]+(\.[\w!#$%&amp;'*+\/=?^`{|}~-]+)*@(([\w-]+\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;
	
	if (!regmail.test($("#email").val())) {
		$('#email').focus();
		ok_="email";
	}
	
	if($("#nomee").val()=="" || $("#nomee").val()==" "){
		$('#nomee').focus();
		ok_="nome";
	}
	
	if(ok_==""){
		loading(); 
		$("#formn").submit();
	}
	
	return false;
	
});

$("#form_c").submit( function() {		
	var ok_="";
	var regmail = /^[\w!#$%&amp;'*+\/=?^`{|}~-]+(\.[\w!#$%&amp;'*+\/=?^`{|}~-]+)*@(([\w-]+\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;
	
	if (!regmail.test($("#emaill").val())) {
		$('#emaill').focus();
		ok_="email";
	}
	
	if(ok_==""){
		loading(); 
		$("#form_c").submit();
	}
	
	return false;
	
});

});