// JavaScript Document
var  $D = function(id) 
{
	//alert(id);
	return document.getElementById(id);
}




function validaContato()
{
	var retorno = '0';
	
	retorno += abreDiv('nomeComple','nomeComple');
	retorno += abreDiv('empresa','empresa');
	retorno += abreDiv('email','email');
	retorno += abreDiv('tel1','tel1');
	retorno += abreDiv('tel2','tel2');
	retorno += abreDiv('tel3','tel3');
	retorno += abreDiv('cep1','cep1');
	retorno += abreDiv('cep2','cep2');
	
	if(retorno!='0')
	{
		
		return false;	
	}
	
	
}
function abreDiv(idV,idFocus)
{	
	if(($D(idV).value=='') || ($D(idV).title!='.'))
	{		
		$D(idFocus).style.backgroundColor = '#ADCAFB';		
		return 1;	
	}
	else	
	{		
		$D(idFocus).style.backgroundColor = '';
		return '';	
	}
}


function limpaTexto(idCampo)
{
	if($D(idCampo).title=='')	
	{
		$D(idCampo).value = '';
		$D(idCampo).title = '.';
	}
}

function validaEmail01(id)
{	
		$D(id).style.backgroundColor = '#ADCAFB';		
		var email = $D(id).value;		
		if(email.indexOf("@")==-1 || email.indexOf(".")==-1)		
		{				
			$D(id).style.backgroundColor = '#ADCAFB';	
			//$D('emailObrigatorio1').value = '';
			
			$D(id).focus();	
			return false;		
		}
		else
		{
			$D(id).style.backgroundColor = '';
			//$D('emailObrigatorio1').value = '1';
		}		
}

function pulaTel(id,idProx,campos)
{
		var IDpula = document.getElementById(id).value;
		if(IDpula.length==campos)
		{
			document.getElementById(idProx).focus();
		}
}

