function Form_Validator(theForm){

//**********************************
//* Função que chama as validações *
//**********************************

//ADICIONAR AS FUNÇÕES DAS VALIDAÇÕES NESTE ESPAÇO

	//****** CAMPO NOME ******
	// verifica se o campo está vazio
	if (theForm.nome.value == false){
		var idioma = theForm.idioma.value
		if (theForm.idioma.value == "1")
			{
				alert("Preencha o campo nome.");
			}
		if (theForm.idioma.value == "2")
			{
				alert("Enter your name.");
			}
		if (theForm.idioma.value == "3")
			{
				alert("Rellene el campo nombre");
			}			
		theForm.nome.focus();
		theForm.nome.select();
		return (false);
	  }else{
	// verifica se o campo contêm números
		var contnome = theForm.nome.value;
		for (var i = 0; i < 10; i = i + 1){
			contnome.indexOf(i);
			if (contnome.indexOf(i) != -1){
				if (theForm.idioma.value == "1")
					{
						alert("O campo nome não aceita números.");
					}
				if (theForm.idioma.value == "2")
					{
						alert("The name Box does not accept numbers.");
					}	
				if (theForm.idioma.value == "3")
					{
						alert("El campo nombre no admite números.");
					}					
				theForm.nome.focus();
				theForm.nome.select();
				return (false);
			}
		}
	}

//-------------------------------------------------------------------------------------------
	
//****** CAMPO EMAIL ******
var texto = theForm.email.value
// verifica se o campo está vazio.
if (texto == false) {
	if (theForm.idioma.value == "1")
		{
			alert("Preencha o campo e-mail.");
		}
	if (theForm.idioma.value == "2")
		{
			alert("Enter your e-mail address.");
		}
	if (theForm.idioma.value == "3")
		{
			alert("Rellene el campo e-mail.");
		}
	theForm.email.focus();
	theForm.email.select();
	return(false);
} else {

//VERIFICA SE EXISTE "@" NO E-MAIL
pos = texto.indexOf("@")
if (pos == -1 || pos < 2){
	if (theForm.idioma.value == "1")
		{
			alert("Preencha o campo e-mail corretamente.");
		}
	if (theForm.idioma.value == "2")
		{
			alert("Please type your complete e-mail address.");
		}
	if (theForm.idioma.value == "3")
		{
			alert("Rellene el campo e-mail adecuadamente.");
		}
		theForm.email.focus();
		theForm.email.select();
		return(false);
	} else {

		//VERIFICA SE EXISTE "."(PONTO) NO E-MAIL
		pos = texto.indexOf(".")
		if (pos == -1 || pos == 0) {
			if (theForm.idioma.value == "1")
				{
					alert("Preencha o campo e-mail corretamente.");
				}
			if (theForm.idioma.value == "2")
				{
					alert("Please type your complete e-mail address.");
				}
			if (theForm.idioma.value == "3")
				{
					alert("Rellene el campo e-mail adecuadamente.");
				}

				theForm.email.focus();
				theForm.email.select();
				return (false);
		} else {

			ponto = texto.indexOf(".")
			tamanho = texto.length;
			parte = texto.substring(ponto,tamanho);

			//VERIFICA SE EXISTE MAIS DE 2 CARACTERES APÓS O "."(PONTO) NO E-MAIL
			if (parte.length < 3){
				if (theForm.idioma.value == "1")
					{
						alert("Preencha o campo e-mail corretamente.");
					}
				if (theForm.idioma.value == "2")
					{
						alert("Please type your complete e-mail address.");
					}
				if (theForm.idioma.value == "3")
					{
						alert("Rellene el campo e-mail adecuadamente.");
					}					

					theForm.email.focus();
					theForm.email.select();
					return (false);
			}

		}
	}
}
	
//------------------------------------------------------------------------


//****** CAMPO COMENTÁRIO ******
if (theForm.comentario.value == false){
	if (theForm.idioma.value == "1")
		{
			alert("Preencha o campo comentário.");
		}
	if (theForm.idioma.value == "2")
		{
			alert("Write your comments in the box below.");
		}
	if (theForm.idioma.value == "3")
		{
			alert("Rellene el campo comentario.");
		}
	theForm.comentario.focus();
	return (false);
}

//-------------------------------------------------------------------------------------------	
}
