/********************************************************************************************
ABAS
********************************************************************************************/
function abas(n, qtde){
 for(x=1;x<=qtde;x++){
  aba = eval('document.getElementById("aba' + x + '");');
		aba_cont = eval('document.getElementById("aba_cont' + x + '").style;');
  if(x==n){
   aba.className = 'current';
			aba_cont.display = '';
  }else {
   aba.className = '';
			aba_cont.display = 'none';
  }
 }
}
/********************************************************************************************
FIM: ABAS
********************************************************************************************/

/*******************************************************************************************
VALIDA E-MAIL
*******************************************************************************************/
function email_valido(email) {
 var formato_errado = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
 var formato_certo = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$";
 var errado = new RegExp(formato_errado);
 var certo = new RegExp(formato_certo);
 return (!errado.test(email) && certo.test(email))
}
/*******************************************************************************************
FIM: VALIDA E-MAIL
*******************************************************************************************/

/******************************************************************************************
PULA TEXTO
******************************************************************************************/
function exibeValor(nomeCampo, lenCampo, controle){
 if ((nomeCampo.value.length == lenCampo) && (checarTabulacao)){	
  var i=0;
  for (i=0; i<document.form.elements.length; i++){
   if (document.form.elements[i].name == nomeCampo.name){
  while ((i+1) < document.form.elements.length){
   if (document.form.elements[i+1].type != "hidden"){
    document.form.elements[i+1].focus();
  break;}i++;}
  checarTabulacao=false;
  break;
}}}}

function stopTabCheck(nomeCampo){
 checarTabulacao=false;
}

function startTabCheck(){
 checarTabulacao=true;
}

function ContaTexto(CampoMsg,CampoContador, TamMax)
{
	if (CampoMsg.value.length > TamMax)
		CampoMsg.value = CampoMsg.value.substring(0, TamMax);
	else
		CampoContador.value = TamMax - CampoMsg.value.length;
}
/*******************************************************************************************
FIM: PULA TEXTO
/*******************************************************************************************/