function ValidaForm(strIdioma)
{
	bolOk = true;

	//verifica se o nome foi preenchido
	if ((bolOk) && (TiraEspacos(document.getElementById("txtNome").value) == ""))
	{
		if (strIdioma == "pt")
			alert("Por favor, informe seu nome.");
		else
			alert("Please, fill your name.");
			
		document.getElementById("txtNome").focus();
		bolOk = false;
	}

	//verifica se o sobrenome foi preenchido
	if ((bolOk) && (TiraEspacos(document.getElementById("txtSobrenome").value) == ""))
	{
		if (strIdioma == "pt")
			alert("Por favor, informe seu sobrenome.");
		else
			alert("Please, fill your last name.");
			
		document.getElementById("txtSobrenome").focus();
		bolOk = false;
	}

	//verifica preenchimento do e-mail
	if ((bolOk) && ((!isEmail(document.getElementById("txtEmail").value)) || (TiraEspacos(document.getElementById("txtEmail").value) == "")))
	{
		if (strIdioma == "pt")
			alert("Por favor, informe um e-mail válido.")
		else
			alert("Please, fill a valid e-mail.");
			
		document.getElementById("txtEmail").focus();
		bolOk = false;
	}

	//verifica se o telefone foi preenchido
	if ((bolOk) && (TiraEspacos(document.getElementById("txtFone").value) == ""))
	{
		if (strIdioma == "pt")
			alert("Por favor, informe seu telefone.");
		else
			alert("Please, fill your phone number.");
			
		document.getElementById("txtFone").focus();
		bolOk = false;
	}

	//se país for Brasil, validar CPF
	if ((bolOk) && (document.getElementById("ddlPais").value == 'br'))
	{
		if (!validaCPF(document.getElementById("txtCPF").value))
		{
			if (strIdioma == "pt")
				alert("Por favor, informe um CPF válido.");
			else
				alert("Please, fill a valid CPF.");
			
			document.getElementById("txtCPF").focus();
			bolOk = false;
		}
	}

	//se país não for Brasil, verificar preenchimento do estado
	if ((bolOk) && (document.getElementById("ddlPais").value != 'br') && (TiraEspacos(document.getElementById("txtUF").value) == ""))
	{
		alert("Please, fill in your state.");
		document.getElementById("txtUF").focus();
		bolOk = false;
	}
	
	//verifica se a cidade foi preenchida
	if ((bolOk) && (TiraEspacos(document.getElementById("txtCidade").value) == ""))
	{
		if (strIdioma == "pt")
			alert("Por favor, informe sua cidade.");
		else
			alert("Please, fill your city.");
			
		document.getElementById("txtCidade").focus();
		bolOk = false;
	}

	//verifica se o bairro foi preenchido
	if ((bolOk) && (TiraEspacos(document.getElementById("txtBairro").value) == ""))
	{
		if (strIdioma == "pt")
			alert("Por favor, informe seu bairro.");
		else
			alert("Please, fill your neighborhood.");
			
		document.getElementById("txtBairro").focus();
		bolOk = false;
	}

	//verifica se o endereço foi preenchido
	if ((bolOk) && (TiraEspacos(document.getElementById("txtEndereco").value) == ""))
	{
		if (strIdioma == "pt")
			alert("Por favor, informe seu endereco.");
		else
			alert("Please, fill your address.");
			
		document.getElementById("txtEndereco").focus();
		bolOk = false;
	}

	//verifica se o número do endereço foi preenchido
	if ((bolOk) && (TiraEspacos(document.getElementById("txtNumero").value) == ""))
	{
		if (strIdioma == "pt")
			alert("Por favor, informe o número do seu endereco.");
		else
			alert("Please, fill the number of your address.");
			
		document.getElementById("txtNumero").focus();
		bolOk = false;
	}

	//verifica se o CEP foi preenchido
	if ((bolOk) && (TiraEspacos(document.getElementById("txtCEP").value) == ""))
	{
		if (strIdioma == "pt")
			alert("Por favor, informe seu CEP.");
		else
			alert("Please, fill your ZIP Code.");
			
		document.getElementById("txtCEP").focus();
		bolOk = false;
	}

	//se país for Brasil, validar CEP
	if ((bolOk) && (document.getElementById("ddlPais").value == 'br'))
	{
		var re = new RegExp("[0-9]{5}-[0-9]{3}");
		
		str = document.getElementById("txtCEP").value
		if (!str.match(re))
		{
			if (strIdioma == "pt")
				alert("Por favor, informe um CEP válido.");
			else
				alert("Please, fill a valid CEP.");
			
			document.getElementById("txtCEP").focus();
			bolOk = false;
		}
	}

	if (bolOk)
	{
		document.frmContato.hdnNomePais.value = document.frmContato.ddlPais.item(document.frmContato.ddlPais.selectedIndex).text;
		document.frmContato.action = "index.asp?strArea=3&strSub=1";
		document.frmContato.submit();
		return true;
	}
	else
		return false;
}

function Pais(campo)
{
	if (campo.value == 'br')
	{
		document.getElementById("ddlUF").style.display = "block";
		document.getElementById("txtUF").style.display = "none";
		document.getElementById("txtUF").value = "";
		document.getElementById("tdCPF").style.visibility = "visible";
	}
	else
	{
		document.getElementById("ddlUF").style.display = "none";
		document.getElementById("txtUF").style.display = "block";
		document.getElementById("txtUF").style.width = "249px";
		document.getElementById("tdCPF").style.visibility = "hidden";
	}
}

function ResetForm()
{
	document.frmContato.reset();
	document.getElementById("ddlUF").style.display = "block";
}
