/*  
Desenvolvido por Francke Silva		>> http://www.xmasters.com.br 
Editado por Andre Lima			>> http://www.linkti.net 
Data: Setembro de 2006.
*/

function funcao_dos_campos(valores_campo)
{
	if(valores_campo.value=="") 
	{valores_campo.style.backgroundColor = "#fff";}
	else 
	{  //valores_campo.value=""	
           valores_campo.style.backgroundColor = "#fff"; 
	   //if(valores_campo.value=="") 
	   {valores_campo.style.backgroundcolor = "#fff";}  
        }
}
function zerar()
{	document.f.nome.style.backgroundcolor = "#006600";
        document.f.email.style.backgroundcolor = "#006600";
}	
function escondeErro(campo)
{  var o = document.getElementById('div' + campo);
       o.style.display = 'none';	
       if(campo=='nome')
       {  document.f.nome.style.backgroundColor = "#fff";
 	  document.f.nome.focus()	
       }
       if(campo=='email')
       {  document.f.email.style.backgroundColor = "#fff";
 	  document.f.email.focus()	
       }
}
function enviar()
{   var nome        = document.f.nome.value;
    var email       = document.f.email.value;
    var ok = 0;

// verificar se o campo e-mail esta digitado corretamente!
        if(email!="")
	{  if (email.indexOf('@', 0) == -1 || email.indexOf('.', 0) == -1)
	   {      ok = 1 
              var o = document.getElementById('divemail2');
	          o.style.display = '';
		  //setTimeout("escondeErro('email2')",4000);  
           }
        }
// verificar se o campo e-mail esta vázio!
	 if(email=="")
	{     ok = 1 
          var o = document.getElementById('divemail');
	      o.style.display = '';
	      //setTimeout("escondeErro('email')",4000);	
       }
// verificar se o campo nome esta vázio!
	if(nome=="")
	{    ok = 1 
         var o = document.getElementById('divnome');
             o.style.display = '';
	     //setTimeout("escondeErro('nome')",4000);
        }
if(ok == 0)
{ return true }
else
{ return false }
}
//-->
