// JavaScript Document

function manageColor(obj,flag)
{
  if(flag==0)
  {
  obj.runtimeStyle.color="#FFFFFF";
  obj.parentElement.runtimeStyle.backgroundColor="#993366";
  } else {
  obj.parentElement.runtimeStyle.backgroundColor="#FFFFFF"; 
  obj.runtimeStyle.color="#000000"; 
  }
}

function ValidateForm()
{

if ((document.confirm.familiar.checked==true) && (document.confirm.observacoes.value.length==0))

  {alert("É necessário preencher o campo Observações com elementos do agregado familiar");

   return false; }
   
if ((document.confirm.outro.checked==true) && (document.confirm.observacoes.value.length==0))

  {alert("É necessário preencher o campo Observacoes com o tipo de Atestado que pretende");

   return false; }   

if (document.confirm.nome.value.length==0) 

  {alert("È necessário preencher o campo Nome!");

   return false;}

 if (document.confirm.filia.value.length==0)

  {alert("É necessário preencher o campo Filiação");

   return false; }

 if (document.confirm.naturalidade.value.length==0)

  {alert("É necessário preencher o campo Naturalidade");

   return false; }
   
   if (document.confirm.freguesia.value.length==0)

  {alert("É necessário preencher o campo Freguesia");

   return false; } 
   
if (document.confirm.concelho.value.length==0)

  {alert("É necessário preencher o campo Concelho");

   return false; }     
   
   
   
if (document.confirm.bi.value.length==0)

  {alert("É necessário preencher o campo B.I.");

   return false; }   

if (document.confirm.arquivo.value.length==0)

  {alert("É necessário preencher o campo Arquivo");

   return false; }   
   
if (document.confirm.nacional.value.length==0)

  {alert("É necessário preencher o campo Nacionalidade");

   return false; }   

if (document.confirm.profissao.value.length==0)

  {alert("É necessário preencher o campo Profissão");

   return false; }   

if (document.confirm.residencia.value.length==0)

  {alert("É necessário preencher o campo Residência");

   return false; }   

if (document.confirm.telefone.value.length==0)

  {alert("É necessário preencher o campo Telefone");

   return false; }   
   
if (document.confirm.telemovel.value.length==0)

  {alert("É necessário preencher o campo Telemovel");

   return false; }   
   
if (document.confirm.eleitor.value.length==0)

  {alert("É necessário preencher o campo Eleitor");

   return false; }   
         

   
return true;
} 
