function showEvent( elemento ){
		var c_obj = document.getElementById(elemento);
		if ( c_obj.style.display == 'none' ) c_obj.style.display = 'block';
		else c_obj.style.display = 'none';
	}

// Gravar/Alterar Perfil
function GravarContato()
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Seu browser não suporta AJAX!");
  return;
  } 
      x = document.getElementById('Cadastro');
  var NomeContato = document.getElementById('NomeContato').value;
  var EmailContato = document.getElementById('EmailContato').value;
  var Pagina = "Processamento/ProcessoCadastro.asp"
  var Acao = "Gravar"
  location.hash="#boxes";
  
  var Erro = "Nao"


 if (EmailContato == "")
 {document.getElementById('EmailContato').style.border = "1px solid #cc0033"; document.getElementById('EmailContato').focus(); Erro = "Sim"}
 else{document.getElementById('EmailContato').style.border = "1px solid #dfdfdf";}

 if (NomeContato == "")
 {document.getElementById('NomeContato').style.border = "1px solid #cc0033"; document.getElementById('NomeContato').focus(); Erro = "Sim"}
 else{document.getElementById('NomeContato').style.border = "1px solid #dfdfdf";}

 

 if (Erro == "Sim") { return(false);}
    else {
     var url=Pagina+"?Acao="+Acao+"&NomeContato="+NomeContato+"&EmailContato="+EmailContato;
         url=url+"&sid="+Math.random();
         xmlHttp.onreadystatechange=stateChanged;
         xmlHttp.open("GET",url,true);
         xmlHttp.send(null);
 
   }
}


// Gravar/Alterar Perfil
function Indicacao()
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Seu browser não suporta AJAX!");
  return;
  } 
      x = document.getElementById('Indique');
  var SeuNome = document.getElementById('SeuNome').value;
  var SeuEmail = document.getElementById('SeuEmail').value;
  var NomeAmigo = document.getElementById('NomeAmigo').value;
  var EmailAmigo = document.getElementById('EmailAmigo').value;

  var Pagina = "Processamento/ProcessoIndique.asp"
  var Acao = "Indicar"
  
  var Erro = "Nao"


 if (EmailAmigo == "")
 {document.getElementById('EmailAmigo').style.border = "1px solid #cc0033"; document.getElementById('EmailAmigo').focus(); Erro = "Sim"}
 else{document.getElementById('EmailAmigo').style.border = "1px solid #dfdfdf";}

 if (NomeAmigo == "")
 {document.getElementById('NomeAmigo').style.border = "1px solid #cc0033"; document.getElementById('NomeAmigo').focus(); Erro = "Sim"}
 else{document.getElementById('NomeAmigo').style.border = "1px solid #dfdfdf";}

 if (SeuEmail == "")
 {document.getElementById('SeuEmail').style.border = "1px solid #cc0033"; document.getElementById('SeuEmail').focus(); Erro = "Sim"}
 else{document.getElementById('SeuEmail').style.border = "1px solid #dfdfdf";}

 if (SeuNome == "")
 {document.getElementById('SeuNome').style.border = "1px solid #cc0033"; document.getElementById('SeuNome').focus(); Erro = "Sim"}
 else{document.getElementById('SeuNome').style.border = "1px solid #dfdfdf";}

 

 if (Erro == "Sim") { return(false);}
    else {
     var url=Pagina+"?Acao="+Acao+"&SeuNome="+SeuNome+"&SeuEmail="+SeuEmail+"&NomeAmigo="+NomeAmigo+"&EmailAmigo="+EmailAmigo;
         url=url+"&sid="+Math.random();
         xmlHttp.onreadystatechange=stateChanged;
         xmlHttp.open("GET",url,true);
         xmlHttp.send(null);
 
   }
}


// Gravar/Alterar Perfil
function Contato()
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Seu browser não suporta AJAX!");
  return;
  } 
      x = document.getElementById('Contato');
  var Nome = document.getElementById('Nome').value;
  var Email = document.getElementById('Email').value;
  var Setor = document.getElementById('Setor').value;
  var Mensagem = document.getElementById('Mensagem').value;

  var Pagina = "Processamento/ProcessoContato.asp"
  var Acao = "Contato"
  
  var Erro = "Nao"


 if (Mensagem == "")
 {document.getElementById('Mensagem').style.border = "1px solid #cc0033"; document.getElementById('Mensagem').focus(); Erro = "Sim"}
 else{document.getElementById('Mensagem').style.border = "1px solid #dfdfdf";}

 if (Setor == "")
 {document.getElementById('Setor').style.border = "1px solid #cc0033"; document.getElementById('Setor').focus(); Erro = "Sim"}
 else{document.getElementById('Setor').style.border = "1px solid #dfdfdf";}

 if (Email == "")
 {document.getElementById('Email').style.border = "1px solid #cc0033"; document.getElementById('Email').focus(); Erro = "Sim"}
 else{document.getElementById('Email').style.border = "1px solid #dfdfdf";}

 if (Nome == "")
 {document.getElementById('Nome').style.border = "1px solid #cc0033"; document.getElementById('Nome').focus(); Erro = "Sim"}
 else{document.getElementById('Nome').style.border = "1px solid #dfdfdf";}
 

 if (Erro == "Sim") { return(false);}
    else {
     var url=Pagina+"?Acao="+Acao+"&Nome="+Nome+"&Email="+Email+"&Mensagem="+Mensagem+"&Setor="+Setor;
         url=url+"&sid="+Math.random();
         xmlHttp.onreadystatechange=stateChanged;
         xmlHttp.open("GET",url,true);
         xmlHttp.send(null);
 
   }
}


// Gravar/Alterar Perfil
function LimpaForm()
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Seu browser não suporta AJAX!");
  return;
  } 
     
     x = document.getElementById('Cadastro');
     var Pagina = "Processamento/ProcessoCadastro.asp"
     var url=Pagina;
         url=url+"?sid="+Math.random();
         xmlHttp.onreadystatechange=stateChanged;
         xmlHttp.open("GET",url,true);
         xmlHttp.send(null);

		 
 
}



///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//FUNÇÃO STATECHANGED SETA ONDE OCORRERÁ O PROCESSAMENTO NA PÁGINA DE CHAMADA
function stateChanged() 
{ 
if (xmlHttp.readyState==1)
{ 
x.innerHTML="<div id='CarregadorCad' Style='float:left;margin-top:40px;width:100%;height:100%;text-align:center'> <img src=images/loading2.gif Style=float:center;></div>"
}
if (xmlHttp.readyState==4)
{ 

x.innerHTML=xmlHttp.responseText;

}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
};
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

