PageSourceSearch

http://www.pantanalnature.com.br/sysjs/funcoes.js?v=20231219

js pantanalnature.com.br collected 2026-10-02 21:32:14 UTC 9,762 bytes, 176 lines download raw bytes

1function PreparaCampos(seletor) {
2	$(seletor).find("input, select, textarea").focus(function() { CheckLabel($(this)); }).blur(function(){ CheckLabel($(this)); }).keypress(function(){ CheckLabel($(this)); }).change(function(){ CheckLabel($(this)); }).each(function(index, element) { CheckLabel($(this)); });;
3	$(seletor).find(".ajxcheck").focus(function(e) { ChecarCampo($(this).attr("id")); }).change(function(e) { ChecarCampo($(this).attr("id")); }).keyup(function(e) { ChecarCampo($(this).attr("id")); }).keypress(function(e) { ChecarCampo($(this).attr("id")); }).each(function(index, element) { $(this).after('<div class="ajxalerta" id="ajx'+$(this).attr("id")+'"></div>').closest(".linha").addClass("ajx"); ChecarCampo($(this).attr("id")); });
4	setTimeout(function(){ $(seletor).find(".labelinterno").each(function(index, element) { CheckLabel($(this)); }); }, 1);
5}
6$(document).ready(function() {
7	IEUpdate();
8	PreparaCampos("html");
9	setTimeout(function(){ $("html").addClass("carregado"); }, 100);
10	if ( !document.cookie.includes("lgpd=ok",0) ) { $(".lgpd").fadeIn(); }
11});
12function WhatsApp() {$(".whatsapps").fadeToggle();}
13function FecharLGPD() {var d = new Date();d.setTime(d.getTime() + (30 * 24*60*60*1000));document.cookie = "lgpd=ok; expires=" + d.toUTCString() + "; path=/;";$(".lgpd").fadeOut();}
14function MenuMobile() { $("#bot-mobile,#menu").toggleClass("ativo").not("#bot-mobile").stop().fadeToggle(); }
15function IEUpdate() {
16	var tmpua = window.navigator.userAgent;
17	var tmpie = tmpua.indexOf("MSIE ");
18	tmpiev = "";
19	tmpdcss = "position:fixed;z-index:111111;right:0;top:0;left:0;border-bottom:1px solid #A29330;background:#FDF2AB;text-align:left;font-family:Arial;color:#000;font-size:12px;padding:5px 36px 5px 10px;"
20	tmpacss = "font-family:Arial;color:#00a1f1;font-size:12px;text-decoration:underline;";
21	tmpccss = "font-family:Arial;color:#000;cursor:pointer;position:absolute;right:6px;top:0;bottom:0;width:12px;font-weight:bold;font-size:18px;"
22	if (tmpie > 0) {
23		tmpie = parseInt(tmpua.substring(tmpie+5,tmpua.indexOf(".",tmpie)));
24		if (tmpie < 9) {
25			tmpiev = " (Internet Explorer "+tmpie+")";
26			$("body").prepend('<div style="'+tmpdcss+'">Seu navegador'+tmpiev+' está <b>desatualizado</b>. Ele possui <b>falhas de segurança</b>, e pode <b>apresentar problemas</b> para exibir este site. <a href="http://outdatedbrowser.com/pt-br" target="_blank" style="'+tmpacss+'">Veja como atualizar o seu navegador</a><div style="'+tmpccss+'" onClick="$(this).parent().hide();">×</div></div>');
27		}
28	}
29}
30function CheckLabel(elemento) {
31	if ( elemento.closest(".linha").find(".erro").css("opacity") == 1 && ( $("html.carregado").length == 1 || elemento.closest(".linha").find(".erro.fixo").length == 0 ) )
32		elemento.removeClass("comerro").closest(".linha").find(".erro").fadeOut();
33	if ( elemento.val() != "" || elemento.is(":focus") )
34		elemento.closest(".linha").find(".label").addClass("ativo");
35	else
36		elemento.closest(".linha").find(".label").removeClass("ativo");
37
38}
39function CampoCheck(id,checagem,mensagem) {
40	if ( checagem ) {
41		if ( idfoco == "" ) {
42			idfoco = id;
43			if ( $("#"+id).closest(".linha").length == 1 ) {
44				if ( $(window).scrollTop() > $("#"+id).closest(".linha").offset().top )
45					$(window).scrollTop($("#"+id).closest(".linha").offset().top);
46			}
47			$("#"+id).focus();
48		}
49		if ( mensagem != "" )
50			$("#"+id).closest(".linha").find(".erro").html(mensagem);
51		else if ( $("#"+id+"erro").length == 1 )
52			$("#"+id).closest(".linha").find(".erro").html(decodeURIComponent(escape(""+$("#"+id+"erro").val())));
53		$("#"+id).addClass("comerro").closest(".linha").find(".erro").stop(true,true).fadeIn();
54
55	}
56}
57function ChecarCampo(nome) {
58	clearTimeout(window["timer"+nome]);
59	window["timer"+nome] = setTimeout(function(){ ChecarCampoTimer(nome) }, 200);
60}
61function ChecarCampoTimer(nome) {
62	valor = $("#"+nome).val();
63	if ( window["old"+nome] != valor ) {
64		window["old"+nome] = valor;
65		ChecarCampoAjx(nome,valor);
66	}
67}
68function ChecarCampoAjx(nome,valor) {
69	$("#ajx"+nome).html("");
70	tipo = $("#"+nome).attr("name");
71	pasta = $("#ajx"+nome).closest("form").attr("data-pasta");
72	if ( (tipo != "cpf" || VCPF(valor)) && (tipo != "cnpj" || VCNPJ(valor)) && (tipo != "email" || VEmail(valor)) && (tipo != "usuario" || (valor.length >= 6 && valor.match(/^(?=.*\d)/) ) ) )
73		$.ajax({url: pasta+"/ajx-check.asp?tipo="+tipo+"&valor="+valor}).done(function(data) {$("#ajx"+nome).html(data); });
74}
75var idfoco = "";
76var recaptchasucesso = false;
77function RecaptchaOk() { recaptchasucesso = true; $("#recaptchadiv .erro").hide(); }
78var win = null;
79function VContato() {
80	idfoco = "";
81	CampoCheck("nome",(!$("#nome").val()),"");
82	CampoCheck("email",(!VEmail($("#email").val())),"");
83	CampoCheck("assunto",($("#assunto").length == 1 && !$("#assunto").val()),"");
84	CampoCheck("mensagem",(!$("#mensagem").val()),"");
85	if ( $("#recaptchadiv").length == 1 && !recaptchasucesso ) {
86		$("#recaptchadiv .erro").fadeOut();
87		CampoCheck("recaptchacheck",(!recaptchasucesso),"");
88	}
89	return (idfoco == "");
90}
91function VOrcamento() {
92	idfoco = "";
93	CampoCheck("nome",(!$("#nome").val()),"");
94	CampoCheck("email",(!VEmail($("#email").val())),"");
95	CampoCheck("assunto",($("#assunto").length == 1 && !$("#assunto").val()),"");
96	CampoCheck("mensagem",(!$("#mensagem").val()),"");
97	if ( $("#recaptchadiv").length == 1 && !recaptchasucesso ) {
98		$("#recaptchadiv .erro").fadeOut();
99		CampoCheck("recaptchacheck",(!recaptchasucesso),"");
100	}
101	return (idfoco == "");
102}
103function AjxContato() {
104	if ( VContato() ) {
105		$.ajax($("#siteurl").val()+"contato/ajx-mail.asp?nome="+$("#nome").val()+"&email="+$("#email").val()+"&fone="+$("#fone").val()+"&cidade="+$("#cidade").val()+"&assunto="+$("#assunto").val()+"&mensagem="+$("#mensagem").val()).done(function(html) {
106			$("#ajxretorno").html(html);
107			$("#formcontato").trigger("reset");
108		});
109	}
110	return false;	
111}
112var idfoco = "";
113function VBusca() {
114	if ($("#busca").val() != "")
115		document.location.href = document.location.protocol+"//"+document.location.host+"/diario-do-airsoft/busca.asp?busca="+$("#busca").val();
116	else
117		document.location.href = document.location.protocol+"//"+document.location.host+"/diario-do-airsoft";
118	return false;
119}
120function Busca() {
121	endereco_x = $("#pasta").val();
122	if ( $("#busca").val() )
123		endereco_x += "/?busca="+$("#busca").val();
124	document.location.href = endereco_x;
125	return false;
126}
127function Filtrar() {
128	endereco_x = $("#fabricantes").val();
129	if ( $("#categorias").val() )
130		endereco_x += $("#categorias").val();
131	if ( $("#busca").val() )
132		endereco_x += "/?busca="+$("#busca").val();
133	document.location.href = endereco_x;
134}
135function VNewsletter() {
136	idfoco = "";
137	CampoCheck("newsnome",(!$("#newsnome").val()),"");
138	CampoCheck("newsemail",(!VEmail($("#newsemail").val())),"");
139	return (idfoco == "");
140}
141function trimToDigits(string) {
142	s = "";
143	var Numeros = /\d/;
144	for (i = 0; i <= string.length; i++) 
145		if (Numeros.test(string.substr(i,1))) s += string.substr(i,1);
146	return s;	
147}
148function VData(data) {
149	data = trimToDigits(data);
150	if (data.length < 8) return false;
151	dia = data.substr(0,2);
152	mes = data.substr(2,2);
153	ano = data.substr(4,4);
154	if(ano >= 0 && ano < 1900) return false; 
155	if(ano > 2100 || ano < 0 || mes > 12 || mes < 1) return false; 
156	numero = ((parseInt(ano) - 1884) / 4) 
157	dias = (numero == Math.floor(numero)) ? "312931303130313130313031" : "312831303130313130313031"; 
158	diamax = parseInt(dias.substring((mes - 1) * 2, ((mes - 1) * 2) + 2)); 
159	if(dia < 1 || dia > diamax) return false; 	
160	return true;
161}
162function VEmail( strEmail ) {
163	strEmail = $.trim(strEmail);
164	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
165	return (filter.test(strEmail));
166}
167function NewWindow(a,b,c,d,e){LeftPosition=parseInt(screen.width?(screen.width-c)/2:0),TopPosition=parseInt(screen.height?(screen.height-d)/2:0),settings="width="+c+",height="+d+",top="+TopPosition+",left="+LeftPosition+",scrollbars="+e+",noresizable,status=yes",win=window.open(a,b,settings)}function Redimensiona(a,b){"Microsoft Internet Explorer"==navigator.appName?(a=parseInt(a)+10,b=parseInt(b)+60):(a=parseInt(a)+6,b=parseInt(b)+60);var c=navigator.userAgent,d=c.search(/\bMSIE 7.0\b/g);d>0&&(b=parseInt(b)+30);var c=navigator.userAgent,d=c.search(/\bMSIE 8.0\b/g);d>0&&(b=parseInt(b)+40);var c=navigator.userAgent,d=c.search(/\bMSIE 9.0\b/g);d>0&&(b=parseInt(b)+40);var c=navigator.userAgent,d=c.search(/\bFirefox\/3\b/g);d>0&&(b=parseInt(b)+30);var c=navigator.userAgent,d=c.search(/\bFirefox\/4\b/g);d>0&&(b=parseInt(b)+40);var c=navigator.userAgent,d=c.search(/\bSafari\b/g);d>0&&(b=parseInt(b)+25),window.resizeTo(a,b),LeftPosition=parseInt(screen.width?(screen.width-a)/2:0),TopPosition=parseInt(screen.height?(screen.height-b)/2:0),window.moveTo(LeftPosition,TopPosition),window.focus()}var win=null,ua=navigator.userAgent,ver=parseInt(navigator.appVersion),opera=/opera [56789]|opera\/[56789]/i.test(ua),ie=!opera&&/MSIE/.test(ua),ie6=ie&&/MSIE [0123456]/.test(ua),ie7=ie&&/MSIE [789]/.test(ua),ieBox=ie&&(null==document.compatMode||"CSS1Compat"!=document.compatMode),moz=!opera&&/gecko/i.test(ua),nn6=!opera&&/netscape.*6\./i.test(ua);
168function VCPF(cpf) {
169	if((cpf = cpf.replace(/[^\d]/g,"").split("")).length != 11) return false;
170	if(new RegExp("^" + cpf[0] + "{11}$").test(cpf.join(""))) return false;
171	for(var s = 10, n = 0, i = 0; s >= 2; n += cpf[i++] * s--);
172	if(cpf[9] != (((n %= 11) < 2) ? 0 : 11 - n)) return false;
173	for(var s = 11, n = 0, i = 0; s >= 2; n += cpf[i++] * s--);
174	if(cpf[10] != (((n %= 11) < 2) ? 0 : 11 - n)) return false;
175	return true;
176}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.