$D = function(id) 
{
	return document.getElementById(id);
}
function mudaDDD(id,nextId)
{	
	var ddd = $D(id).value;	
	if(ddd.length == 2)	
	{		
		$D(nextId).focus();	
	}
}
function mudaTel(id,nextId)
{	
	var tel = $D(id).value;	
	if(tel.length == 4)	
	{		
		$D(id).value = tel+'-';	
	}	
	else if(tel.length == 9)	
	{			
		$D(nextId).focus();	
	}
}

function mudaCep(id,nextId)
{	
	var cep = $D(id).value;	
	if(cep.length == 5)	
	{		
		$D(id).value = cep+'-';	
	}	
	else if(cep.length == 9)	
	{			
		$D(nextId).focus();	
	}
}

function mudaData(id,nextId)
{	
	var data = $D(id).value;	
	if(data.length == 2)	
	{		
		$D(id).value = data+'/';	
	}	
	else if(data.length == 5)	
	{			
		$D(id).value = data+'/';
	}
	else if(data.length == 10)	
	{	
		$D(nextId).focus();	
	}
}
function someValue(id)
{
	$D(id).value = '';
}

function apareceCnpj()
{
	if($D('tipoInscricao').value=='Associado')
	{
		//alert('ok');
		$D('apareceCnpj').style.display = '';
	}else
	{
		//alert('ok1');
		$D('apareceCnpj').style.display = 'none';
	}
}

function limpaForm()
{	
	document.form1.reset();	
}