

	function IsEmail(email) {
		var reg = new RegExp("^[0-9a-zA-Z-\-\.\_]+@[0-9a-zA-Z]+[\.]{1}[0-9a-zA-Z]+[\.]?[0-9a-zA-Z]+$");
		return reg.test(email);
	}


	function IsNumber(numero) {
		var reg = new RegExp("^[-]?[0-9]+[\.]?[0-9]+$");
		return reg.test(numero)
	}


	function ValidaForm() {
		verify = true;
		if (document.frmCadastro.txtNome.value == "") {
			alert("O campo nome é obrigatório.");
			document.getElementById("txtNome").focus();
			verify = false;
			return false;
		}

		if (!IsEmail(document.frmCadastro.txtEmail.value)) {
			alert("Informe um e-mail válido.");
			document.getElementById("txtEmail").focus();
			verify = false;
			return false;
		}

		if (!IsNumber(document.frmCadastro.txtDdd.value)) {
			alert("Informe um DDD válido. Você deve informar apenas números.");
			document.getElementById("txtDdd").focus();
			verify = false;
			return false;
		}

		if (!IsNumber(document.frmCadastro.txtTelefone.value)) {
			alert("Informe um telefone válido. Você deve informar apenas números.");
			document.getElementById("txtTelefone").focus();
			verify = false;
			return false;
		}

		if (verify) {
			document.frmCadastro.submit();
		}
	}


	function Voltar() {
		history.go(-1);
	}


	function Focus() {
		document.getElementById("txtNome").focus();
	}


