
	function frmcyber(form){
	
		// nome, nascimento, email, cidade, estado, pais
		if(EhVazio(form.nome.value)){
			alert('O seu nome é obrigatório.');
			form.nome.focus();
			return false;
		}
		if(EhVazio(form.email.value)){
			alert('O campo e-mail é obrigatório.');
			form.email.focus();
			return false;
		}
		else{
			if(!EhEmail(form.email.value)){
				alert('Verifique se se e-mail está correto.');
				form.email.focus();
				return false;
			}
		}
		if(EhVazio(form.cidade.value)){
			alert('O campo cidade é obrigatório.');
			form.cidade.focus();
			return false;
		}
		if(EhVazio(form.estado.value)){
			alert('O campo estado é obrigatório.');
			form.estado.focus();
			return false;
		}
		
		return true;
	}
	
	function Trim(str){
	
		var regexp = /[ ]+$/; 		
		str = str.replace(regexp, "");
		
		regexp = /^[ ]+/; 		
		str = str.replace(regexp, "");
		
		return str;
	
	}
	
	
	function EhVazio(valor){
		
		valor = Trim(valor)
		
		if(valor == ''){
			return true;
		}
		else{
			return false;
		}
	
	}
	
	function EhData(Valor){
	
		var re = /[0-9]{1,2}[\-\/][0-9]{1,2}[\-\/][0-9]{2,4}/;
		if(Valor.search(re) != -1){
			return true;
		}else{
			return false;
		}
	
	}
	
	function EhEmail(Valor){
	
		var re = /[a-zA-Z._0-9-]+@[a-zA-Z._0-9-]+\.[a-zA-Z]+[.]?[a-zA-Z]{0,3}/;
		if(Valor.search(re) != -1){
			return true;
		}else{
			return false;
		}
		
	}
