// MASCARAS

//*** APENAS NUMEROS ***************************************************************************

	 function valida_numeros(evt){
			var charCode = (evt.which) ? evt.which : event.keyCode;
					return (charCode>=48 && charCode<=57 || charCode<20);
      }

// APENAS NUMEROS COM BARRAS  ***************************************************************************

	 function valida_numeros_barra(evt){
			var charCode = (evt.which) ? evt.which : event.keyCode;
					return (charCode>=42 && charCode<=57 || charCode<20);
      }
	  

// DATA *************************************************************************************************

	 function validar_data(campo,valor) {
		
		if (valor != '') {
		var date=valor;
		var ardt=new Array;
		var ExpReg=new RegExp("(0[1-9]|[12][0-9]|3[01])/(0[1-9]|1[012])/[12][0-9]{3}");
		ardt=date.split("/");
		erro=false;
		if ( date.search(ExpReg)==-1){
			erro = true;
			}
		else if (((ardt[1]==4)||(ardt[1]==6)||(ardt[1]==9)||(ardt[1]==11))&&(ardt[0]>30))
			erro = true;
		else if ( ardt[1]==2) {
			if ((ardt[0]>28)&&((ardt[2]%4)!=0))
				erro = true;
			if ((ardt[0]>29)&&((ardt[2]%4)==0))
				erro = true;
		}
		if (erro) {
			alert('Data inválida.\nDigite novamente.') 	
			campo.focus();
			campo.value = "";
			return false;
		}
		return true;
		}
	}
	
//MASCARA TELEFONE *********************************************************************************

		function maskTel(obj){
			str_TEL = obj.value
				if (str_TEL.length == 4) {
					document.frm.txtTelefone.value = str_TEL + "."
					}
		}


// VOLTAR AVANÇAR TOP ******************************************************************************************

		function voltar() {
			history.back();		
		}
		
		function avancar() {
			history.forward();	
		}
		
		function topo() {
			location.href = "?#ancorTopo"
		}


