var winId; var caminho = ''; var timeoutAviso; atualizajs(); function scrollToAnchor(aid){ var aTag = $("[id='"+ aid +"']"); $('html,body').animate({scrollTop: aTag.offset().top-150},'slow'); } function buscaPedido() { if ($('#busca_ped_id').val()=='') { alert("Preencha o número do pedido"); return false; } else { getAjaxc('/painel_pedidos_lista.php','ped_id='+$('#busca_ped_id').val(),'listapedidos'); } } function volta_form_contato() { getAjax(caminho+'/_form_contato.php','','div_contatorodape'); } function volta_form_newsletter() { getAjax(caminho+'/_form_newsletter.php','','div_newsletter'); } function enviabuscablog(txt) { if (txt.length<3) { alert("Remplissez les champs correctement"); $('#buscablog').focus(); } else { var url = '/Blog_1__'+txt+'/pg.html'; document.location.href=url; } return false; } function enviabuscaprod(txt,cat) { if (txt.length<3) { alert("Remplissez les champs correctement"); $('#qyprod').focus(); } else { dadosform = { cat: cat, qy: txt } $.get(caminho+'/categoria_menu.php',dadosform, function(r){ $("#menu").html(r); }); $.get(caminho+'/categoria_produtos.php',dadosform, function(r){ $("#listaprodutos").html(r); atualizajs(); fechaAvisoPost(); }); } return false; } function envia_filtrotodosex(cat) { avisoPost(); if (typeof cat !== 'undefined') { var dadosform = { cat: cat }; } else { var dadosform = {} } $.get(caminho+'/categoria_menu-express.php',dadosform, function(r){ $("#menu").html(r); }); $.get(caminho+'/categoria_produtos-express.php',dadosform, function(r){ $("#listaprodutos").html(r); atualizajs(); fechaAvisoPost(); }); return true; } function envia_filtrotodos(cat) { avisoPost(); var dadosform = { cat: cat }; $.get(caminho+'/categoria_menu.php',dadosform, function(r){ $("#menu").html(r); }); $.get(caminho+'/categoria_produtos.php',dadosform, function(r){ $("#listaprodutos").html(r); atualizajs(); fechaAvisoPost(); }); return true; } function envia_filtromenu(campo,valor) { avisoPost(); var dadosform = { cat: $('#cat').val() }; dadosform[campo]= valor; $.get('/categoria_menu.php',dadosform, function(r){ $("#menu").html(r); }); $.get('/categoria_produtos.php',dadosform, function(r){ $("#listaprodutos").html(r); atualizajs(); fechaAvisoPost(); }); return true; } function envia_filtro(campo,valor) { avisoPost(); if (typeof campo !== 'undefined') { $('#'+campo).val(valor); } var dadosform = $('form#formfiltros').serialize(); $.get(caminho+'/categoria_menu.php',dadosform, function(r){ $("#menu").html(r); }); $.get(caminho+'/categoria_produtos.php',dadosform, function(r){ $("#listaprodutos").html(r); atualizajs(); fechaAvisoPost(); }); return true; } function atualizajs() { $(document).ready(function() { $(".mask-cep").mask("99999-999"); $("input[type=text][name*=data]").mask("99/99/9999"); $("input[type=text][name*=nascimento]").mask("99/99/9999"); $("input[type=text][name*=_fone_]").mask("(99) 9999-9999"); $("input[type=text][name*=mesano]").mask("99/9999"); $("input[type=text][name*=anoinicio]").mask("9999"); $("input[type=text][name*=anoconclusao]").mask("9999"); /* //Select all anchor tag with rel set to tooltip $('a[rel=tooltip]').mouseover(function(e) { //Grab the title attribute's value and assign it to a variable var tip = $(this).attr('title'); //Remove the title attribute's to avoid the native tooltip from the browser $(this).attr('title',''); //Append the tooltip template and its value $(this).append('
' + tip + '
'); //Show the tooltip with faceIn effect $('#tooltip').fadeIn('500'); $('#tooltip').fadeTo('10',0.9); }).mousemove(function(e) { //Keep changing the X and Y axis for the tooltip, thus, the tooltip move along with the mouse $('#tooltip').css('top', e.pageY + 10 ); $('#tooltip').css('left', e.pageX + 20 ); }).mouseout(function() { //Put back the title attribute's value $(this).attr('title',$('.tipBody').html()); //Remove the appended tooltip template $(this).children('div#tooltip').remove(); }); */ }); } function enviaNewsRodape() { if ($('#news_nome').val()=='' || $('#news_email').val()=='') { alert("Remplissez les champs correctement"); return false; } var dadosform = $('form#formnews').serialize(); $.post(caminho+'/_sendavisoproduto.php',dadosform, function(r){ $("#div_newsletter").html(r); }); return true; } function enviaContatoRodape() { if ($('#rodape_nome').val()=='' || $('#rodape_email').val()=='' || $('#rodape_mensagem').val()=='' || $('#gd_string').val()=='' ) { alert("Remplissez les champs correctement"); return false; } var dadosform = $('form#contatorodape').serialize(); $.post(caminho+'/_sendavisoproduto.php',dadosform, function(r){ $("#div_contatorodape").html(r); }); return true; } function setopcproduto(obj, proid, cor1,cor2) { $('.opcao_cor').removeClass('cor_selecionado'); $(obj).parent().addClass('cor_selecionado'); getAjaxc(caminho+'/_busca_segundo_param.php','proid='+proid+'&cor1='+cor1+'&cor2='+cor2,'lista_segundo_param'); } function getAjax(url,parametro,localdiv) { avisoPost(); $.get(url,parametro, function(r){ $("#"+localdiv).html(r); fechaAvisoPost();}); } function getAjaxPg(url,parametro,localdiv) { avisoPost(); $.get(url,parametro, function(r){ $("#"+localdiv).html(r); scrollToAnchor('topopagina'); fechaAvisoPost();}); } function getAjaxp(url,parametro,localdiv) { avisoPost(); $.post(url,parametro, function(r){ $("#"+localdiv).html(r); fechaAvisoPost();}); } function getAjaxc(url,parametro,localdiv) { avisoPost(); $("#"+localdiv).html(''); $.get(url+'?'+parametro, function(r){ $("#"+localdiv).html(r); fechaAvisoPost(); }); } function postaFormPainel(form,pagina,div) { var dadosform = $('form#'+form).serialize(); $.post(pagina,dadosform, function(r){ $("#"+div).html(r); }); return true; } function marcados(reg) { for (count = 0; count < reg.length; count++) { if (listapro[reg[count]] == '1') { $('#pro_'+reg[count]).attr('checked',true); } } } function enderecoEntrega() { if ($('#end_igual').is(':checked')) { $('#usu_entcep').val($('#usu_cep').val()); $('#usu_entendereco').val($('#usu_endereco').val()); $('#usu_entnumero').val($('#usu_numero').val()); $('#usu_entcomplemento').val($('#usu_complemento').val()); $('#usu_entbairro').val($('#usu_bairro').val()); $('#usu_entcidade').val($('#usu_cidade').val()); $('#usu_entestado').val($('#usu_estado').val()); } } function checa_tamanho(obj, tamanho) { if (obj.value.length != tamanho && obj.value != '') { alert('O campo deve ter '+tamanho+' caracteres'); return false } else { return true; } } function checa_tamanho_varia(obj, tamanho1,tamanho2) { if ((obj.value.length < tamanho1 || obj.value.length > tamanho2) && obj.value != '') { alert('O campo deve ter entre '+tamanho1+' e '+tamanho2+' de numeros'); return false } else { return true; } } function checaprod(situacao,valor) { var olax = ''; var tot = 0; for (count = 0; count < listapro.length; count++) { if (listapro[count] == '1') { tot++; } } if (tot>=3 && situacao) { $('#pro_'+valor).attr('checked',false); alert("Selecione apenas 3 produtos"); return true; } if (situacao==true) { listapro[valor] = '1'; } else { delete(listapro[valor]); } for (count = 0; count < listapro.length; count++) { if (listapro[count] == '1') { olax = olax+'-'+count; } } $('#usu_desejo').val(olax); } function apenasNumero(objCampo,e) { var scan = getKey(e); var tecla = String.fromCharCode(scan); var mask = "0123456789" if (scan == 13 || scan == 8 || scan == 0) return true; if (mask.indexOf(tecla) == -1) { return false; } return true; } function apenasValor(objCampo,e) { var scan = getKey(e); var tecla = String.fromCharCode(scan); var mask = "0123456789." if (scan == 13 || scan == 8 || scan == 0) return true; if (mask.indexOf(tecla) == -1) { return false; } return true; } function getKey(e) { return (window.event) ? event.keyCode : e.which } function verificacupom() { if ($('#cupom').val().length==18) { return true; } else { alert('Preencha o código do Cupom de Desconto corretamente'); return false; } } function enviapedido() { if ($('#npedido').val().length<2) { alert('Digite o Número do Pedido corretamente'); $('#npedido').focus(); return false; } return true; } function enviacep() { if ($('#usu_email').val()=='') { alert('Digite seu EMAIL corretamente'); $('#usu_email').focus(); return false; } if ($('#cep').val().length!=9) { alert('Digite o CEP corretamente'); $('#cep').focus(); return false; } return true; } function cadastropessoa(tipo) { if (tipo=="fisica") { $("#tdnome").html("Nome Completo *"); $("#tdcpf").html("CPF *"); $("#tdrg").html("R.G."); $("#trdata").show(); $("#trsexo").show(); $("#trresp").hide(); $("#trcpfresp").hide(); } if (tipo=="juridica") { $("#tdnome").html("Razão Social *"); $("#tdcpf").html("CNPJ *"); $("#tdrg").html("Inscrição Estadual"); $("#trdata").hide(); $("#trsexo").hide(); $("#trresp").show(); $("#trcpfresp").show(); } } function trocapadraocad (tipo) { if (tipo=='fisica') { $('#cadastro').attr('class','cad_fisica'); $('#titendereco').html('Meu Endereço'); } else { $('#cadastro').attr('class','cad_juridica'); $('#titendereco').html('Endereço Comercial'); } getAjax('_meiocadastro.php','tipo='+tipo,'meiocadastro'); } function checaopcproduto() { var boolValid = false; if ($('#opc').val()!='') { $('#opcid').val($('#opc').val()); boolValid = true; } if ($('#quant').val()<1) { alert("A quantidade deve ser maior que zero"); return false; } if(boolValid == false) { alert("Selecione uma opção do produto!"); return false; } return true; } function verificacep() { if ($('#cep').val().length==9) { return true; } else { alert('Preencha o CEP corretamente'); return false; } } function checaopcpagamento() { var boolValid = false; var sele; $('.opcPagamento').each(function() { if ( $(this).is(':checked') ) { boolValid = true; sele = $(this).val(); } }); if(boolValid == false) { alert("Selecione uma opção pagamento!"); return false; } if ( $("#enviadadoscartao_"+sele).length ){ if ( $("#enviadadoscartao_"+sele).val()=='1' ){ if ($('#card_numero').val()=='') { alert("Preencha corretamente o Número de seu Cartão de Crédito"); $('#card_numero').focus(); return false; } else { if ($('#interface_'+sele).val()=='pgto_dinersnovo') { if ($('#card_numero').val().length<14 || $('#card_numero').val().length>16) { alert("Você deve informar entre 14 e 16 números de seu Cartão de Crédito"); return false; } } else if ($('#interface_'+sele).val()=='pgto_amexnovo') { if ($('#card_numero').val().length<13 || $('#card_numero').val().length>16) { alert("Você deve informar entre 13 e 16 números de seu Cartão de Crédito"); return false; } } else { if ($('#card_numero').val().length!=16) { alert("Você deve informar 16 números de seu Cartão de Crédito"); return false; } } } if ($('#card_nome').val()=='') { alert("Preencha corretamente o Nome escrito em seu Cartão de Crédito"); $('#card_nome').focus(); return false; } if ($('#card_mes').val()=='' || $('#card_mes').val().length != 2) { alert("Preencha corretamente o Mês de Validade de seu Cartão de Crédito"); $('#card_mes').focus(); return false; } if ($('#card_ano').val()=='' || $('#card_ano').val().length != 2) { alert("Preencha corretamente o Ano de Validade de seu Cartão de Crédito"); $('#card_ano').focus(); return false; } if ($('#card_codseg').val()=='' || ($('#card_codseg').val().length != 3 && $('#card_codseg').val().length != 4) ) { alert("Preencha corretamente o Código de Segurança que esta no verso de seu Cartão de Crédito"); $('#card_codseg').focus(); return false; } } } avisoPost(); if ($('#interface_'+sele).val()=='pgto_visa') { $('#formPgto').attr('target','mpg_popup'); mpg_popup = window.open("", "mpg_popup","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,screenX=0,screenY=0,left=0,top=0,width=765,height=540"); window.location="https://www.solabia.com.br/redirecionacbp.php"; } if ($('#interface_'+sele).val()=='pgto_mastercielo') { $('#formPgto').attr('target','mpg_popup'); mpg_popup = window.open("", "mpg_popup","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,screenX=0,screenY=0,left=0,top=0,width=765,height=540"); window.location="https://www.solabia.com.br/redirecionacbp.php"; } if ($('#interface_'+sele).val()=='pgto_mastercard') { $('#formPgto').attr('target','mpg_popup'); mpg_popup = window.open("", "mpg_popup","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,screenX=0,screenY=0,left=0,top=0,width=780,height=540"); window.location="/aguardando_pagamento"; } if ($('#interface_'+sele).val()=='pgto_diners') { $('#formPgto').attr('target','mpg_popup'); mpg_popup = window.open("", "mpg_popup","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,screenX=0,screenY=0,left=0,top=0,width=780,height=540"); window.location="/aguardando_pagamento"; } if ($('#interface_'+sele).val()=='pgto_itaushop') { $('#formPgto').attr('target','mpg_popup'); mpg_popup = window.open('', 'mpg_popup', 'toolbar=yes,menubar=yes,resizable=yes,status=no,scrollbars=yes,width=675,height=485'); window.location="/aguardando_pagamento"; } if ($('#interface_'+sele).val()=='pgto_caixadeb') { $('#formPgto').attr('target','mpg_popup'); mpg_popup = window.open('', 'mpg_popup', 'toolbar=yes,menubar=yes,resizable=yes,status=no,scrollbars=yes,width=675,height=485'); window.location="/aguardando_pagamento"; } return true; } function popWin(URL,NAME,WIDTH,HEIGHT,RESIZE,SCROLL) { winId = window.open(URL,NAME,'width='+WIDTH+',height='+HEIGHT+',resizable='+RESIZE+',scrollbars='+SCROLL+',menubar=no,toolbar=no,location=no,directories=no,status=no'); var clientWidth = screen.availWidth; var clientHeight = screen.availHeight; var xPos = (clientWidth - WIDTH)/2; var yPos = (clientHeight - HEIGHT)/2; winId.moveTo(xPos,yPos); } var arrPageSizes = new Array(); var arrPageScroll = new Array(); function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;} var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;} windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;} if(yScroll'); arrPageSizes = ___getPageSize(); arrPageScroll = ___getPageScroll(); $('#jquery-overlay').css({backgroundColor:'#000',opacity:0.8,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn(); $('body').append('
'); $('#jquery-overlay').click(function(){ fechaJAN(); }); $('#jquery-lightbox').css({width:'620px',height:'600px',top:arrPageScroll[1]+(arrPageSizes[3]/10),left:(arrPageSizes[2]/2)-3100}).show(); $('#jquery-conteudo').css({width:'600px',height:'500px',top:(arrPageScroll[1]+(arrPageSizes[3]/10))+20,left:(arrPageSizes[2]/2)-300}).show(); $.get(caminho+"/revenda_cad.php", function(r){ $("#jquery-conteudo").html(r); }); } function enviaIndisponivel() { if ($('#ind_nome').val()=='') { alert("Preencha seu nome"); $('#ind_nome').focus(); return false; } if ($('#ind_email').val()=='') { alert("Preencha seu E-mail"); $('#ind_email').focus(); return false; } var dados = $('#formDisponivel').serialize(); getAjaxp(caminho+'/_sendavisoproduto.php',dados,'resultadoindisponivel'); return false; } function enviaConsultenos() { if ($('#con_nome').val()=='') { alert("Preencha seu nome"); $('#con_nome').focus(); return false; } if ($('#con_email').val()=='') { alert("Preencha seu E-mail"); $('#con_email').focus(); return false; } var dados = $('#formConsulte').serialize(); getAjaxp(caminho+'/_sendavisoproduto.php',dados,'resultadoconsulte'); return false; } function enviaAmigo() { if ($('#env_amigonome').val()=='') { alert("Preencha o Nome do amigo"); $('#env_amigonome').focus(); return false; } if ($('#env_amigoemail').val()=='') { alert("Preencha o E-mail do amigo"); $('#env_amigoemail').focus(); return false; } if ($('#env_meunone').val()=='') { alert("Preencha seu Nome"); $('#env_meunone').focus(); return false; } var dados = $('#formAmigo').serialize(); getAjaxp(caminho+'/_sendavisoproduto.php',dados,'caixaamigo'); return false; } function ComprarJunto() { $("form#formCompreJunto").submit(); return true; } function VerificarCompreJunto() { var itensVendaCasada = $(".chkVendaCasada:checked"); if (itensVendaCasada.length > 0) { $("#spaCompreJunto").html(""); } else { $("#spaCompreJunto").html(""); } } /******************* * Método: scrollTo * Finalidade: acessa uma âncora, rolando a página dinamicamente *********************/ $.getPos = function (e) { var l = 0; var t = 0; var w = $.intval($.css(e,'width')); var h = $.intval($.css(e,'height')); var wb = e.offsetWidth; var hb = e.offsetHeight; while (e.offsetParent){ l += e.offsetLeft + (e.currentStyle?$.intval(e.currentStyle.borderLeftWidth):0); t += e.offsetTop + (e.currentStyle?$.intval(e.currentStyle.borderTopWidth):0); e = e.offsetParent; } l += e.offsetLeft + (e.currentStyle?$.intval(e.currentStyle.borderLeftWidth):0); t += e.offsetTop + (e.currentStyle?$.intval(e.currentStyle.borderTopWidth):0); return {x:l, y:t, w:w, h:h, wb:wb, hb:hb}; }; $.getClient = function(e) { if (e) { w = e.clientWidth; h = e.clientHeight; } else { w = (window.innerWidth) ? window.innerWidth : (document.documentElement && document.documentElement.clientWidth) ? document.documentElement.clientWidth : document.body.offsetWidth; h = (window.innerHeight) ? window.innerHeight : (document.documentElement && document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.offsetHeight; } return {w:w,h:h}; }; $.getScroll = function (e) { if (e) { t = e.scrollTop; l = e.scrollLeft; w = e.scrollWidth; h = e.scrollHeight; } else { if (document.documentElement && document.documentElement.scrollTop) { t = document.documentElement.scrollTop; l = document.documentElement.scrollLeft; w = document.documentElement.scrollWidth; h = document.documentElement.scrollHeight; } else if (document.body) { t = document.body.scrollTop; l = document.body.scrollLeft; w = document.body.scrollWidth; h = document.body.scrollHeight; } } return { t: t, l: l, w: w, h: h }; }; $.intval = function (v) { v = parseInt(v); return isNaN(v) ? 0 : v; }; $.fn.ScrollTo = function(s) { o = $.speed(s); return this.each(function(){ new $.fx.ScrollTo(this, o); }); }; $.fx.ScrollTo = function (e, o) { var z = this; z.o = o; z.e = e; z.p = $.getPos(e); z.s = $.getScroll(); z.clear = function(){clearInterval(z.timer);z.timer=null}; z.t=(new Date).getTime(); z.step = function(){ var t = (new Date).getTime(); var p = (t - z.t) / z.o.duration; if (t >= z.o.duration+z.t) { z.clear(); setTimeout(function(){z.scroll(z.p.y, z.p.x)},13); } else { st = ((-Math.cos(p*Math.PI)/2) + 0.5) * (z.p.y-z.s.t) + z.s.t; sl = ((-Math.cos(p*Math.PI)/2) + 0.5) * (z.p.x-z.s.l) + z.s.l; z.scroll(st, sl); } }; z.scroll = function (t, l){window.scrollTo(l, t)}; z.timer=setInterval(function(){z.step();},13); }; function retornava() { var boolValid = false; var radioValue; $('.opccomenta').each(function() { if ( $(this).is(':checked') ) { boolValid = true; radioValue = $(this).val(); } }); if(boolValid == false) { alert("Selecione a Avaliação"); return false; } if ($('#ava_texto').val()=='') { alert("Preencha seu Comentário"); $('#ava_texto').focus(); return false; } if ($('#ava_nome').val()=='') { alert("Preencha seu Nome"); $('#ava_nome').focus(); return false; } if ($('#ava_email').val()=='') { alert("Preencha seu Email"); $('#ava_email').focus(); return false; } if ($('#ava_cidade').val()=='') { alert("Preencha sua Cidade"); $('#ava_cidade').focus(); return false; } if ($('#ava_estado').val()=='') { alert("Preencha seu Estado"); $('#ava_estado').focus(); return false; } getAjax(caminho+'/_comenta.php','proid='+$('#proid').val()+'&actc=insert&ava_valor='+radioValue+'&ava_texto='+$('#ava_texto').val()+'&ava_nome='+$('#ava_nome').val()+'&ava_email='+$('#ava_email').val()+'&ava_cidade='+$('#ava_cidade').val()+'&ava_estado='+$('#ava_estado').val(),'comentalist'); } function abrepopredir(url) { WIDTH = '800'; HEIGHT = '600'; if (winId == undefined) { winId = window.open(url,'janela_pgto','width='+WIDTH+',height='+HEIGHT+',resizable=no,scrollbars=yes,menubar=no,toolbar=no,location=no,directories=no,status=no'); var clientWidth = screen.availWidth; var clientHeight = screen.availHeight; var xPos = (clientWidth - WIDTH)/2; var yPos = (clientHeight - HEIGHT)/2; winId.moveTo(xPos,yPos); } else { winId.focus(); } document.location.href = caminho+'/finaliza_pedido'; } function abrepop(url) { WIDTH = '800'; HEIGHT = '600'; if (winId == undefined) { winId = window.open(url,'janela_pgto','width='+WIDTH+',height='+HEIGHT+',resizable=no,scrollbars=yes,menubar=no,toolbar=no,location=no,directories=no,status=no'); var clientWidth = screen.availWidth; var clientHeight = screen.availHeight; var xPos = (clientWidth - WIDTH)/2; var yPos = (clientHeight - HEIGHT)/2; winId.moveTo(xPos,yPos); } else { winId.focus(); } } function valida_email(str){ var testresults; var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; if (filter.test(str)) {testresults=true} else {testresults=false} return (testresults)} function salvalead() { if ($('#lea_nome').val()=='') { alert('Prénom et Nom Champs obligatoire'); return false; } if ($('#lea_empresa').val()=='') { alert('Société Champs obligatoire'); return false; } if ($('#lea_email').val()=='' || !valida_email($('#lea_email').val())) { alert('Email Champs obligatoire'); return false; } dados = $('#formcadlead').serialize(); $('#janlead').modal('hide'); $.post('_salva_lead_sessao.php',dados,function(r) { retorno = $.parseJSON(r); if (retorno.status=='1') { baixafile(retorno.id); } else { alert(retorno.msg); } }); } function abrejanlead(id) { $('#idarq').val(id); $('#janlead').modal('show'); } function baixafile(id,cat) { dados = { id: id, cat: cat } $.post('_valida_download_arquivos.php',dados,function(r) { retorno = $.parseJSON(r); if (retorno.metodo=='boxpub') { abrejanlead(id); } else if (retorno.metodo=='authuser') { alert(retorno.msg); window.location.href='login?go='+retorno.url; } else if (retorno.metodo=='download') { window.location.href=retorno.url; } else { alert(retorno.msg); } }); }