function ajaxHTML(url)
{
objetoHTML=document.getElementById('dpolo');
objetoHTML.innerHTML="Processando Polo...";

try
{
	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(ee)
{
	try
	{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			xmlhttp = new XMLHttpRequest();
		}
		catch(E)
		{
			xmlhttp = false;
		}
	}
}

xmlhttp.open("GET",url);
xmlhttp.onreadystatechange=function()
{
	if (xmlhttp.readyState==4)
	{
		retorno=unescape(xmlhttp.responseText.replace(/\+/g," "));
		objetoHTML.innerHTML=retorno;
	}
}

xmlhttp.send(null);
};

function form_famup()
{
	if(document.getElementById('nome').value=='')
	{
		window.alert('O campo NOME é obrigatório e deve ser preenchido corretamente.');
		document.getElementById('nome').focus();
		return false;
	}
	if(document.getElementById('cpf').value.length=='')
	{
		window.alert('O campo CPF é obrigatório.');
		document.getElementById('cpf').focus();
		return false;
	}
	if(document.getElementById('cpf').value.length<11)
	{
		window.alert('CPF inválido.');
		document.getElementById('cpf').focus();
		return false;
	}
	if(document.getElementById('rg').value=='')
	{
		window.alert('O campo RG é obrigatório.');
		document.getElementById('rg').focus();
		return false;
	}
	if(document.getElementById('orgao_exp').value=='')
	{
		window.alert('Informe o órgão expedidor do seu RG.');
		document.getElementById('orgao_exp').focus();
		return false;
	}
	
	if(document.getElementById('rua').value=='')
	{
		window.alert('O campo rua é obrigatório e deve ser preenchido corretamente.');
		document.getElementById('rua').focus();
		return false;
	}
	if(document.getElementById('bairro').value=='')
	{
		window.alert('O campo bairro é obrigatório e deve ser preenchido corretamente.');
		document.getElementById('bairro').focus();
		return false;
	}
	if(document.getElementById('cidade').value=='')
	{
		window.alert('Favor informar sua cidade natal.');
		document.getElementById('cidade').focus();
		return false;
	}
	if(document.getElementById('telefone').value.length=='')
	{
		window.alert('O Campo Telefone é obrigatório.');
		document.getElementById('telefone').focus();
		return false;
	}
	if(document.getElementById('telefone').value.length=='')
	{
		window.alert('O Campo Telefone é obrigatório.');
		document.getElementById('telefone').focus();
		return false;
	}
	if(document.getElementById('telefone').value.length<8)
	{
		window.alert('Telefone inválido.');
		document.getElementById('telefone').focus();
		return false;
	}
	if(document.getElementById('profissao').value=='')
	{
		window.alert('O campo profissão é obrigatório e deve ser preenchido corretamente.');
		document.getElementById('profissao').focus();
		return false;
	}
	
	if(document.getElementById('municipio_vinculo').value=='0')
	{
		window.alert('Selecione um município.');
		document.getElementById('municipio_vinculo').focus();
		return false;
	}
	
	if(document.getElementById('orgao').value=='')
	{
       window.alert('O campo Órgão de Lotação é obrigatório.');
       document.getElementById('orgao').focus();
       return false;
	}
	if(document.getElementById('secretaria').value=="Selecione a Área de Atuação")
	{
       window.alert('O campo Área de Atuação é obrigatório.');
       document.getElementById('secretaria').focus();
       return false;
	}
	
	if(document.getElementById('matricula').value=='')
	{
		window.alert('O campo matrícula é obrigatório e deve ser preenchido corretamente.');
		document.getElementById('matricula').focus();
		return false;
	}
	if(document.getElementById('cargo').value=='')
	{
		window.alert('O campo cargo é obrigatório e deve ser preenchido corretamente.');
		document.getElementById('cargo').focus();
		return false;
	}
	if(document.getElementById('nivel').checked && document.getElementById('estabelecimento_ensino').value=='')
	{
		window.alert('Informe o estabelecimento de ensino onde concluiu o ensino médio.');
		document.getElementById('estabelecimento_ensino').focus();
		return false;
	}
	if(document.getElementById('nivel1').checked && document.getElementById('curso').value=='')
	{
		window.alert('Informe o curso de nível superior.');
		document.getElementById('curso').focus();
		return false;
	}
	if(document.getElementById('nivel1').checked && document.getElementById('instituicao').value=='')
	{
		window.alert('Informe a instituição de ensino onde cursou o ensino superior.');
		document.getElementById('instituicao').focus();
		return false;
	}
	if(document.getElementById('nivel1').checked && document.getElementById('ult_periodo').value=='')
	{
		window.alert('Informe o último período cursado no ensino superior.');
		document.getElementById('ult_periodo').focus();
		return false;
	}
	
	
	
	
	
return true;
}

