<!--
function Apenas_Numeros(caracter)
{
  var nTecla = 0;
  if (document.all) {
      nTecla = caracter.keyCode;
  } else {
      nTecla = caracter.which;
  }
  if ((nTecla> 47 && nTecla <58)
  || nTecla == 8 || nTecla == 127
  || nTecla == 0 || nTecla == 9  // 0 == Tab
  || nTecla == 13) { // 13 == Enter
      return true;
  } else {
      return false;
  }
}
function validaCPF(Objcpf) 
{
   var cpf = Objcpf.value;
    exp = /\.|\-/g
    cpf = cpf.toString().replace( exp, "" ); 
    var digitoDigitado = eval(cpf.charAt(9)+cpf.charAt(10));
    var soma1=0, soma2=0;
    var vlr =11;
    
    for(i=0;i<9;i++){
        soma1+=eval(cpf.charAt(i)*(vlr-1));
        soma2+=eval(cpf.charAt(i)*vlr);
        vlr--;
    }    
    soma1 = (((soma1*10)%11)==10 ? 0:((soma1*10)%11));
    soma2=(((soma2+(2*soma1))*10)%11);
    
    var digitoGerado=(soma1*10)+soma2;
    if(digitoGerado!=digitoDigitado)    
        alert('CPF Invalido!');      
}

//envento onkeyup
function maskCPF(CPF) {
    var evt = window.event;
    kcode=evt.keyCode;
    if (kcode == 8) return;
    if (CPF.value.length == 3) { CPF.value = CPF.value + '.'; }
    if (CPF.value.length == 7) { CPF.value = CPF.value + '.'; }
    if (CPF.value.length == 11) { CPF.value = CPF.value + '-'; }
}
function maskCEP(CPF) {
    var evt = window.event;
    kcode=evt.keyCode;
    if (kcode == 8) return;
    if (CPF.value.length == 5) { CPF.value = CPF.value + '-'; }
}

// evento onBlur

//-->
<!--
function showAviso(id,msg,img) {
	var obj = document.getElementById(id);
	obj.innerHTML = msg;
  	obj.style.display = "block";
	if(img=='aguarde'){
	obj.style.background= "#b4b4b4 url(imagens/time.png) no-repeat left 0px";
	}else{
	obj.style.background= "#b4b4b4 url(imagens/error.png) no-repeat left 0px";
	}
}
//-->
function limite(id,limite,falta){           
	var tt = document.getElementById(id).value.length; 
	var resta = limite - tt;
	y = event.keyCode; //8 = backspace           
		if( (resta < 0) && (y != 8) ) {
		  alert("Erro! O número de caracteres foi ultrapassado.")
		  return false;
		}
	document.getElementById(falta).innerHTML = "Restam "+ (limite - tt) +" caracteres";      
}

function showHide(id) {
 var obj = document.getElementById(id);
 if(obj.style.display == "none") {
  obj.style.display = "block";
 } else {
  obj.style.display = "none";
 }
}

function showHide2(id,id2) {
 var obj = document.getElementById(id);
 if(obj.style.display == "none") {
  obj.style.display = "block";
 } else {
  obj.style.display = "none";
 }
  var obj2 = document.getElementById(id2);
 if(obj2.style.display == "") {
  obj2.style.display = "none";
 } else {
  obj2.style.display = "";
 }
}


