function verifica_selecionado(e,a){for(var t=0,o=0;a>o;o++)if(parcelas_radios="p_"+e+"."+o,1==document.getElementById(parcelas_radios).checked){t=1;break}0==t&&(document.getElementById("p_"+e+".0")&&(document.getElementById("p_"+e+".0").checked=!0),document.getElementById("parcelas_"+e)&&(document.getElementById("parcelas_"+e).value=document.getElementById("p_"+e+".0").value))}function Selecionar(e){if("selected"==document.getElementById(e).className);else{for(var a=document.getElementById("FormasPagamento").getElementsByTagName("fieldset"),t=0;t',atualizaDiv(o,e),$(n).value=1)}function TrocarAba(e,a){if(""==document.getElementById(e).style.display);else{for(var t=document.getElementById("visualBlock").getElementsByTagName("div"),o=0;o0?(jQuery(this).attr("href",e.replace("&v="+o,"&v="+n)),r=!0):jQuery(this).attr("href",e+"&v="+n)}),r){var i=jQuery(location).attr("href");i=i.replace("&v="+o,"&v="+n),window.history.pushState({url:""+i},jQuery(document).attr("title"),i)}return jQuery.get("funcoes/atualiza_css.php?visualizar="+a),null}function loadXMLDoc(e,a){req=null,window.XMLHttpRequest?(req=new XMLHttpRequest,req.onreadystatechange=processReqChange,req.open("GET",e+"?criterio="+a,!0),req.send(null)):window.ActiveXObject&&(req=new ActiveXObject("Microsoft.XMLHTTP"),req&&(req.onreadystatechange=processReqChange,req.open("POST",e+"?criterio="+a,!0),req.send()))}function processReqChange(){4==req.readyState&&(200==req.status?document.getElementById("atualiza").innerHTML=req.responseText:alert("Houve um problema ao obter os dados:\n"+req.statusText))}function Atualiza(e,a){loadXMLDoc(e+".php",a),document.getElementById("atualiza").innerHTML="

Aguarde...atualizando formas de pagamento.

"}function ajaxRead(e,a){alert(e);var t=null;if(window.XMLHttpRequest)t=new XMLHttpRequest;else{if(!window.ActiveXObject)return;t=new ActiveXObject("Microsoft.XMLHTTP")}t.onreadystatechange=function(){1==t.readyState,4==t.readyState&&(200==t.status?(texto=unescape(t.responseText.replace(/\+/g," ")),updateObj(a,t.responseText)):alert("Houve um problema ao obter os dados:\n"+t.statusText))},t.open("GET",e,!0),t.send("")}function updateObj(e,a){$(e).innerHTML=a}function esconde_div_erro1(){$("erro1").style.display="none"}function esconde_div_erro2(){$("erro2").style.display="none"}function abre_popup_boleto(e){window.open("",e,"toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,screenX=0,screenY=0,left=0,top=0,width=750,height=600")}function valida_formas_pagamento_definido(e,a,t){return 1==e?valida_contrato_pagamento(a,t):void(1==a&&abre_popup_boleto(t))}function valida_contrato_pagamento(e,a){return document.getElementById("contrato")&&0==document.getElementById("contrato").checked?(document.getElementById("erro2").style.display="",document.getElementById("contrato").focus(),!1):void(1==e&&abre_popup_boleto(a))}function validaComent(e){return""==e.nota.value?(document.getElementById("erro").style.display="",document.getElementById("erro").innerHTML='Avaliação sobre o produto obrigatória.',!1):""==e.nome_cliente.value?(document.getElementById("erro").style.display="",document.getElementById("erro").innerHTML=' Campo nome obrigatório.',!1):""==e.email_cliente.value?(document.getElementById("erro").style.display="",document.getElementById("erro").innerHTML='Campo email obrigatório.',!1):-1==e.email_cliente.value.indexOf("@")&&""!=e.email_cliente.value?(document.getElementById("erro").style.display="",document.getElementById("erro").innerHTML='Formato de e-mail inválido.',!1):""==e.titulo.value?(document.getElementById("erro").style.display="",document.getElementById("erro").innerHTML='Campo título obrigatário.',!1):""==e.comentario.value?(document.getElementById("erro").style.display="",document.getElementById("erro").innerHTML='Campo comentário obrigatário.',!1):void 0}function removeAlert(){document.getElementById("erro").style.display="none"}function caracterRestante(e,a,t){var o=t-a;return 0>o?(valor=document.getElementById(e).value,valor=valor.substring(0,t),document.getElementById(e).value=valor,!1):void(document.getElementById("restante").innerHTML=o)}function limitaCaracteres(e,a,t){if(valor=e.value,restantes=a-valor.length,0>restantes){valor=valor.substring(0,a),e.value=valor;try{$(t).innerHTML="0"}catch(o){}return!1}try{$(t).innerHTML=restantes}catch(o){}}function Marcar(e,a,t,o,n){document.getElementById("id1").className="star",document.getElementById("id2").className="star",document.getElementById("id3").className="star",document.getElementById("id4").className="star",document.getElementById("id5").className="star",document.getElementById(e).className="starOK",document.getElementById(a).className="starOK",document.getElementById(t).className="starOK",document.getElementById(o).className="starOK",document.getElementById(n).className="starOK"}function Mostrar(e){document.getElementById("rate").innerHTML=e}function setNota(e){document.getElementById("nota").value=e}function mascara(e,a,t){if("undefined"!=typeof t&&(event=t),event.ctrlKey&&(65==event.keyCode||97==event.keyCode))return!1;var o=[37,38,39,40,8,16];o.indexOf(event.keyCode)<0&&(v_obj=e,campo_id=e.id,v_fun=a,execmascara(),ctrlA=!1)}function execmascara(){v_obj.value=v_fun(v_obj.value)}function valorBr(e){return e=e.replace(/\D/g,""),e=e.replace(/(\d)(\d{11})$/,"$1.$2"),e=e.replace(/(\d)(\d{8})$/,"$1.$2"),e=e.replace(/(\d)(\d{5})$/,"$1.$2"),e=e.replace(/(\d)(\d{2})$/,"$1,$2")}function letras(e){return e.replace(/[^ABCDEFGHIJKLMNOPQRSTUVXWYZabcdefghijklmnopqrstuvxwyz ]/g,"")}function numeros(e){return e.replace(/\D/g,"")}function telefone(e){return e=e.replace(/\D/g,""),e=e.replace(/^(\d\d)(\d)/g,"($1) $2"),e=e.replace(/(\d{4})(\d)/,"$1-$2")}function telefoneloja(e){var a=(e.substring(1,3),!1),t=!1;return("2"==e.charAt(5)||"3"==e.charAt(5)||"4"==e.charAt(5)||"1"==e.charAt(5))&&(t=!0),"8"!=e.charAt(5)&&"9"!=e.charAt(5)&&valida_nextel(e)||(a=!0),a&&!t?(jQuery("#"+campo_id).attr("maxlength","15"),e=e.replace(/\D/g,""),e=e.replace(/^(\d\d)(\d)/g,"($1) $2"),e=e.replace(/(\d{5})(\d)/,"$1-$2")):(jQuery("#"+campo_id).attr("maxlength","14"),e=e.replace(/\D/g,""),e=e.replace(/^(\d\d)(\d)/g,"($1) $2"),e=e.replace(/(\d{4})(\d)/,"$1-$2")),e}function valida_nextel(e){var a=e.substring(5,7);return"79"==a||"78"==a||"77"==a||"70"==a?!0:!1}function numeros2(e){return e.replace(/\D/g,"")}function cpf(e){return e=e.replace(/\D/g,""),e=e.replace(/(\d{3})(\d)/,"$1.$2"),e=e.replace(/(\d{3})(\d)/,"$1.$2"),e=e.replace(/(\d{3})(\d{1,2})$/,"$1-$2")}function cep(e){return e=e.replace(/D/g,""),e=e.replace(/^(\d{5})(\d)/,"$1-$2")}function data(e){return e=e.replace(/\D/g,""),e=e.replace(/(\d{2})(\d)/,"$1/$2"),e=e.replace(/(\d{2})(\d)/,"$1/$2")}function data2(e){return e=e.replace(/\D/g,""),e=e.replace(/(\d{2})(\d)/,"$1/$2"),e=e.replace(/(\d{2})(\d)/,"$1/$2"),e=e.slice(0,10)}function cnpj2(e){return e=e.replace(/\D/g,""),e=e.replace(/^(\d{2})(\d)/,"$1.$2"),e=e.replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3"),e=e.replace(/\.(\d{3})(\d)/,".$1/$2")}function romanos(e){for(e=e.toUpperCase(),e=e.replace(/[^IVXLCDM]/g,"");""!=e.replace(/^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/,"");)e=e.replace(/.$/,"");return e}function caracteres(e){return e=e.replace(/\W/g,""),e=e.replace(/_/g,"")}function geraPaginacaoAjax(e,a,t,o,n,r){var i=a/e;i=Math.floor(i),a%e!=0&&(i+=1),a>e?(produtos_exibir=a,cont=produtos_exibir-e):cont=0,url_link=r+"&cont="+cont+"&prod_visitados="+a+"&id="+o,geraLinkPaginacao(t,url_link),a>0&&(url_link=r+"&cont="+cont+"&prod_visitados="+a+"&id="+o,document.write(' 1 "),cont-=e,a-=e);for(var l=1;i>l;l++)e>=a&&(cont=0),url_link=r+"&cont="+cont+"&prod_visitados="+a+"&id="+o,document.write(' "+(l+1)+" "),cont-=e,a-=e;document.write("")}function changeClass(e,a,t){for(var o=document.getElementById(e).getElementsByTagName("a"),n=o.length,r=0;n>r;r++)o[r].className="";document.getElementById(a).className=t}function geraLinkPaginacao(e,a){new Ajax.Updater(e,a,{asynchronous:!0,evalScripts:!0,requestHeaders:["X-Update",e]})}function limpaInput(e){document.getElementById(e).value=""}function Trim(e){return e.replace(/^\s+|\s+$/g,"")}function Verify(e,a){return e=ParseNumb(e),0==e?!1:(g=e.length-2,TestDigit(e,a,g)?(g=e.length-1,TestDigit(e,a,g)?!0:!1):!1)}function TestDigit(e,a,t){var o=0,n=2;for(f=t;f>0;f--)o+=parseInt(e.charAt(f-1))*n,"CNPJ"==a&&n>8?n=2:n++;return o%=11,o=2>o?0:11-o,o!=parseInt(e.charAt(t))?!1:!0}function ShowCep(){open("http://www.correios.com.br/servicos/cep/cep_default.cfm","ShowCep","location=no,resize=no, width=730,height=600,left=18,top=18,maximized=0,scrollbars=1")}function select_drop(e,a){if(""!=a&&e.length>0)for(var t=e.length,o=0;t>o;o++)if(a==e.options[o].value){e.selectedIndex=o;break}return!0}function formatar(e,a){var t;t=document.frm2;var o=e.value.length,n=a.substring(0,1),r=a.substring(o);r.substring(0,1)!=n&&(e.value+=r.substring(0,1)),6==t.cep_1.value.length&&t.cep_2.focus()}function somente_numeros(e){if(document.all)var a=event.keyCode;else if(document.layers)var a=e.which;return a>47&&58>a?!0:8==a?!0:void(event.keyCode=0)}function limpaDiv(e){document.getElementById(e).innerHTML="",document.getElementById(e).style.display="none"}function volta_input_classe(e,a){document.getElementById(e+"_erro").innerHTML="",document.getElementById(e+"_erro").style.display="none",document.getElementById(e).className=a}function volta_span(e,a){return document.getElementById(a).innerHTML="",document.getElementById(a).style.display="none",document.getElementById(e).className="table obriga",!1}function volta_span_adicional(e,a){var t;return t="1"==document.getElementById("flagPfPj").value?"#ad_juridica":"#ad_fisica",jQuery(t+" #"+e).each(function(){this.className="table obriga"}),jQuery(t+" #"+a).each(function(){this.innerHTML="",this.style.display="none"}),!1}function volta_span2(e,a,t){return""==Trim(e.value)?(document.getElementById(a).innerHTML="",document.getElementById(a).style.display="none",document.getElementById(t).className="obriga table",!1):void 0}function volta_span_erro(e){document.getElementById(e+"_erro").style.display="none"}function volta_input(e,a){document.getElementById(e+"_erro")&&(document.getElementById(e+"_erro").innerHTML="",document.getElementById(e+"_erro").style.display="none"),document.getElementById(e).className=1==a||"Brasil"!=jQuery("#pais").val()&&("cep_1"==e||"cep_2"==e||"cep_internacional"==e)?"text opcional":"text obriga",1==a&&""==document.getElementById("telefone_cliente_erro_2").style.display&&(document.getElementById("telefone_cliente_erro_2").style.display="none",document.getElementById("telefone_cliente").className="text opcional",document.getElementById("telefone_cliente_2").className="text opcional")}function volta_input_adicional(e){var a;a="1"==document.getElementById("flagPfPj").value?"#ad_juridica":"#ad_fisica",jQuery(a+" #"+e+"_erro").each(function(){this.innerHTML="",this.style.display="none"}),jQuery(a+" #"+e).each(function(){this.className="text obriga"})}function volta_telefones(){document.getElementById("telefone_cliente_erro").innerHTML="",document.getElementById("telefone_cliente_2_erro").innerHTML="",document.getElementById("telefone_cliente_erro").style.display="none",document.getElementById("telefone_cliente_2_erro").style.display="none",document.getElementById("telefone_cliente").className="text opcional",document.getElementById("telefone_cliente_2").className="text opcional"}function volta_textarea(e){document.getElementById(e+"_erro").innerHTML="",document.getElementById(e+"_erro").style.display="none",document.getElementById(e).className="textarea obriga",document.getElementById("spanTextarea").className="obriga table"}function verifica_formato_email(e){var a=strpos(e,"email");if(a!==!1){var t=document.getElementById(e).value,o=String(t).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);if(!o)return document.getElementById(e+"_erro").style.display="",document.getElementById(e+"_erro").innerHTML=document.getElementById(e+"_mensagem_invalido").value,document.getElementById(e).className="text inputErro",document.getElementById(e).focus(),!1}}function valida_formularios(){var e=document.getElementsByName("campo_obrigatorio[]").length;for(r=0;e>r;r++){var a=document.getElementById("campo_obrigatorio_"+r).value,t=document.getElementById(a);if(""==Trim(t.value)||"0"==t.value)return document.getElementById(a+"_erro").style.display="",document.getElementById(a+"_erro").innerHTML=document.getElementById("mensagem_erro_"+r).value,"textarea"==t.className||"textarea obriga"==t.className?document.getElementById("spanTextarea").className="table inputErro":document.getElementById(a).className="text inputErro",document.getElementById(a).focus(),!1;var o=verifica_formato_email(a);if(0==o)return!1}}function verifica_campos_iguais(e,a){if(""!=document.getElementById(e).value){if(""==document.getElementById(a).value)return document.getElementById(a+"_erro").style.display="",document.getElementById(a+"_erro").innerHTML=document.getElementById(a+"_mensagem_novamente").value,document.getElementById(a).className="text inputErro",document.getElementById(a).focus(),!1;if(document.getElementById(e).value!=document.getElementById(a).value)return document.getElementById(a+"_erro").style.display="",document.getElementById(a+"_erro").innerHTML=document.getElementById(a+"_mensagem_erro").value,document.getElementById(a).className="text inputErro",document.getElementById(a).focus(),!1}}function strpos(e,a){var t=(e+"").indexOf(a);return-1===t?!1:t}function atualizaDiv(e,a,t){t=void 0==t||""==t?"id":t;var o="class"==t?".":"#";a.indexOf("comparar")<0&&(status=!0),1==Boolean(status)&&jQuery(o+a).length&&(status=!1,jQuery(o+a).load(e,function(){ancoras(a),status=!0}))}function atualizaLinkPagParcelado(e,a,t,o){var n=document.getElementById(e).value,r=n.split("|");if(r[0]=r[0].replace(".",""),r[0]=r[0].replace(",","."),document.getElementById(a)){var i=document.getElementById(a).getAttribute("title");document.getElementById(a).setAttribute("onclick","openLightWindow('pag_parcelado.php?IdProd="+t+"&id_variacao="+$("variacao").value+"&loja="+o+"', '"+i+"', null, null, null, 'page');")}}function alteraImagensVariacoes(e,a,t,o,n){(void 0==n||"undefined"==n)&&(n="true"),$$("#foto_a")&&jQuery.ajax({url:"/loja/view/view_imagens_variacoes.php?loja="+e+"&idBusca="+a+"&tipo="+t+"&idProd="+o+"&atualiza="+n,success:function(e){jQuery(e).filter("#foto_p").length&&jQuery("#foto_p").html(jQuery(e).filter("#foto_p").html()),jQuery("#foto_a").html(jQuery(e).filter("#foto_a").html())},async:!1}),alteraReferenciaVarProd(e,a,t)}function alteraVariacaoReferencia(e,a){alteraImagensVariacoes(e,a,"produto")}function alteraReferenciaVarProd(e,a,t){document.getElementById("referencia_variavel")&&(a?jQuery.ajax({type:"GET",url:"/loja/view/view_variacao_referencia.php?loja="+e+"&idBusca="+a+"&tipo="+t,success:function(e){e?(jQuery("#referencia_variavel_produto").hide(),jQuery("#referencia_variavel").html(e),jQuery("#referencia_variavel").show()):(jQuery("#referencia_variavel_produto").show(),jQuery("#referencia_variavel").hide())}}):(jQuery("#referencia_variavel_produto").show(),jQuery("#referencia_variavel").hide()))}function exibeValorProduto(e){jQuery.noConflict();var a=$(e).value,t=a.split("|"),o=$("verifica_clientes_aguardando").value,n=$("verifica_estoque_venda").value;return 1==o&&0==n&&mostraDetalhesPrecos(),t}function atualizaCarousel(){jQuery("#carousel").children().size()>4&&jQuery("#carousel").hasClass("jcarousel-skin-tango")&&jQuery("#carousel").jcarousel({itemFallbackDimension:300})}function mudaVariacaoSimples(e,a,t,o,n){var r=exibeValorProduto(e),i=r[0],l=0;valor_exibicao_preco=r[0].replace(".",""),valor_exibicao_preco=valor_exibicao_preco.replace(",","."),valor_exibicao_preco=parseFloat(valor_exibicao_preco);var c=verificaInfoAdicional();if(c.length){{getIdProduto()}valor_exibicao_preco=InformacaoAdicional.calculaPrecoProduto(1,valor_exibicao_preco),valor_exibicao_preco=number_format(valor_exibicao_preco,2,",","."),parseFloat(r[4])>0&&(valor_exibicao_preco+='
Pre�o Negociado!'),$(a).innerHTML=valor_exibicao_preco}else valor_exibicao_preco=number_format(valor_exibicao_preco,2,",","."),parseFloat(r[4])>0&&(valor_exibicao_preco+='
Pre�o Negociado!'),$(a).innerHTML=valor_exibicao_preco;if(parseFloat(r[4])>0||parseFloat(r[5])<=0)try{$("negociar")&&$("negociar").hide()}catch(d){}else try{$("negociar")&&$("negociar").show()}catch(d){}$("variacao").value=r[1];var s=$("hidden"+r[1]).value,u=$("estoque_"+r[1]).value,m=$("precoDeVar"+r[1]).value,p=$("precoDeVarDif"+r[1]).value,v=$("precoDeOriginal").value,g=$("precoDeDif").value,y=o.split("&"),f=y[0].split("?"),_=f[1],h=y[1];if(idLoja=_.split("="),idProd=h.split("="),idProd[1]=parseInt(idProd[1]),idProd[1]%1!=0&&(h=y[2],idProd=h.split("=")),""!=s?($("imgView").src=s,alteraImagensVariacoes(idLoja[1],r[1],"variacao",idProd[1]),r[1]>0&&alteraReferenciaVarProd(idLoja[1],r[1],"variacao",idProd[1])):($("antVariacao")&&($("imgView").src=$("antVariacao").value),alteraImagensVariacoes(idLoja[1],r[1],"variacao",idProd[1]),r[1]>0&&alteraReferenciaVarProd(idLoja[1],r[1],"variacao",idProd[1])),"null"==r[0]&&"null"==r[2]){mudaVariacaoSimples_clientesAguardando(r[1],e);try{$("negociar")&&$("negociar").hide()}catch(d){}return!1}var E=$("imgView").src,B=variacaoZoom(E);if(""!=u?$("estoque_variacao").innerHTML=" / "+u:$("estoque_variacao")&&($("estoque_variacao").innerHTML=""),changeLangVar("a_partir"),0==B&&swapImage("imageL_1","imageH_1"),$(t)&&($(t).innerHTML=""),$(t)&&($(t).style.display="none"),$("span_erro_cep")&&($("span_erro_cep").innerHTML=""),$("span_erro_cep")&&($("span_erro_cep").style.display="none"),r[0]==i)if(1==r[2])if(precoDeVarsFloat=parseFloat(m.replace(",",".")),valorZeroFloat=parseFloat(r[0].replace(",",".")),precoDeVarsFloat>0&&precoDeVarsFloat!=valorZeroFloat){$("precoDe").style.display="",$("precoDeValor")&&($("precoDeValor").style.display=""),$("economize").style.display="",$$("#economize span").each(function(e){e.style.display=""}),$$("#economize abbr.currency").each(function(e){e.style.display=""}),$("precoDeValor")&&($("precoDeValor").innerHTML=m);try{$("valorDeDif").innerHTML=p}catch(I){$("precoDeValor")&&($("precoDeValor").style.display="none")}}else $("precoDe")&&($("precoDe").style.display="none"),$("precoDeValor")&&($("precoDeValor").style.display="none"),$("economize").style.display="none";else if(parseFloat(m)>0&&m!=r[0]){$("precoDe").style.display="",$("precoDeValor").style.display="",$("precoDeValor").innerHTML=v;try{$("valorDeDif").innerHTML=g}catch(I){$("precoDeValor").style.display="none"}$("economize").style.display="",$("info_preco").style.display=""}else $("precoDe").style.display="none",$("precoDeValor").style.display="none",$("economize").style.display="none",$("info_preco").style.display="";else $("precoDe").style.display="none",$("precoDeValor").style.display="none",$("economize").style.display="none",$("info_preco").style.display="none";var b=r[0].replace(".",""),b=b.replace(",",".");if($("valor_desconto_especial")){"null"!=l&&($("valor_desconto_especial").value=l);var j=$("valor_desconto_especial").value}if(j>0&&(b=j),$("preco_atual").value=b,o=o+"&preco_calculo="+b+"&id_variacao="+$("variacao").value+"&atualiza=1",$(n)&&($(n).innerHTML='Loading Carregando Formas de Pagamento'),l>0&&(l=l.replace(".",","),$("desconto_especial").innerHTML=l),atualizaDiv("detalhes_formas.php?"+_+"&"+h+"&preco_calculo="+b,"detalhes_formas"),atualizaDiv(o,n),$("aba_formas").value=1,parseFloat(r[4])>0)consultaIdLance(r[1],_);else try{$("idLance").value=0}catch(w){}}function mudaVariacaoSimples_clientesAguardando(e,a){var t=$("verifica_clientes_aguardando").value,o=$("verifica_estoque_venda").value,n=$("layout_variacao").value,r=$("variacao_tipo2").innerHTML,i=$("define_radio_select").value;if("1"==n||"4"==n&&0==i)""==r?$("variacao_valor1").innerHTML=$("label_valor1_"+a).innerHTML:($("variacao_valor1").innerHTML=$("label_valor1_"+a).value,$("variacao_valor2").innerHTML=$("label_valor2_"+a).innerHTML);else if("2"==n||"4"==n&&1==i){var l=$(a).options[$(a).selectedIndex].text;if(""==r)$("variacao_valor1").innerHTML=l;else{var c=$("verifica_variacao_dupla_valor").value;$("variacao_valor1").innerHTML=c,$("variacao_valor2").innerHTML=l}}1==t&&0==o&&(jQuery("#produto_preco, #cepbox, #quantidade, #info, #bt_comprar, #Aba4, #span_erro_cep, #bonus_cupom").hide(),jQuery("#nao_disp, #img_nao_disp").show(),jQuery("#span_erro_cep").html(""),jQuery("#verifica_variacao").val(e))}function mudaVariacaoDupla(e,a,t,o,n,r,i,l,c,d,s,u){var m=$(n).value;if(valor_url=encodeURIComponent(m),document.getElementById("antVariacao"))var p=document.getElementById("antVariacao").value;preco_calculo=c.replace(",",".");var v=!1;if(""==valor_url&&zoomHabilitado&&(alteraImagensVariacoes(t,o,"produto"),referenciaAlterada=!0),0!=v&&alteraVariacaoReferencia(t,o),u){var g=parseFloat(preco_calculo)*(1-parseFloat(u));g=g.toFixed(2),$("valor_desconto_especial")&&($("valor_desconto_especial").value=g),preco_produto=g,preco_produto=preco_produto.toString(),preco_produto=preco_produto.replace(".",","),preco_calculo=g}else preco_produto=c;$("preco_atual").value=preco_calculo,valor_exibicao_preco=c;var y=verificaInfoAdicional();if(y.length){{getIdProduto()}valor_exibicao_preco=InformacaoAdicional.calculaPrecoProduto(1,valor_exibicao_preco),valor_exibicao_preco=number_format(valor_exibicao_preco,2,",","."),$(r).innerHTML=valor_exibicao_preco}else $(r).innerHTML=valor_exibicao_preco;document.getElementById("variacao").value="",p&&(document.getElementById("imgView").src=p),document.getElementById("estoque_variacao")&&(document.getElementById("estoque_variacao").innerHTML="");try{var f=document.getElementById("precoDeOriginal").value;"0,00"!==f&&(document.getElementById("precoDe").style.display="")}catch(_){}u>0&&(document.getElementById("desconto_especial").innerHTML=preco_produto),""==m?(document.getElementById(i).className="varTit",atualizaDiv("abas_produto.php?loja="+t+"&aba=formas&id_produto="+o+"&preco_calculo="+preco_calculo,"atualizaFormas")):document.getElementById(i).className="varTit onVar",document.getElementById("verifica_variacao_dupla_valor").value=m;var h="funcoes/executa_variacao_dupla.php?loja="+t+"&id_produto="+o+"&tipo="+a+"&valor="+valor_url+"&cont="+l+"&preco_prod="+c+"&pagamento="+d+"&tipo1="+escape(s)+"&preco_desconto_especial="+u;new Ajax.Updater(e,h,{asynchronous:!0,evalScripts:!0,requestHeaders:["X-Update",e]}),mostraDetalhesPrecos()}function mostraDetalhesPrecos(){$("produto_preco")&&($("produto_preco").style.display=""),$("cepbox")&&($("cepbox").style.display=""),$("quantidade")&&($("quantidade").style.display=""),$("info")&&($("info").style.display=""),$("bt_comprar")&&($("bt_comprar").style.display=""),$("Aba4")&&($("Aba4").style.display=""),$("nao_disp")&&($("nao_disp").style.display="none"),$("img_nao_disp")&&($("img_nao_disp").style.display="none"),$("verifica_variacao")&&($("verifica_variacao").value=""),$("bonus_cupom")&&($("bonus_cupom").style.display="")}function infoPrecoVariacao(e,a,t){var o=t.split("|");new Ajax.Request("funcoes/info_preco.php",{method:"post",parameters:{loja:e,idProduto:a,precoCalculo:o[0],idVariacao:o[1]},onSuccess:function(e){var a=e.responseText;$("info_preco").innerHTML=a,ancoras()}}),$("info_preco").show()}function mudaVariacaoDuplaCores(e,a,t,o,n,r,i,l,c,d,s,u){$("info_preco").style.display="none",idVariacao=n.split("var2");var m=$(n).value;valor_url=escape(m),alteraImagensVariacoes(t,idVariacao[1],"variacao",o,!1);var p=document.getElementById("antVariacao").value;if(preco_calculo=l.replace(",","."),s){var v=parseFloat(preco_calculo)*(1-parseFloat(s));v=v.toFixed(2),$("valor_desconto_especial")&&($("valor_desconto_especial").value=v),preco_produto=v,preco_produto=preco_produto.toString(),preco_produto=preco_produto.replace(".",","),preco_calculo=v}else preco_produto=l;$("preco_atual").value=preco_calculo,valor_exibicao_preco=l,document.getElementById("variacao").value="",document.getElementById("imgView").src=p,document.getElementById("estoque_variacao")&&(document.getElementById("estoque_variacao").innerHTML=""),document.getElementById("precoDe").style.display="",s>0&&(document.getElementById("desconto_especial").innerHTML=preco_produto),""==m&&atualizaDiv("abas_produto.php?loja="+t+"&aba=formas&id_produto="+o+"&preco_calculo="+preco_calculo,"atualizaFormas"),document.getElementById(r).innerHTML=valor_exibicao_preco,document.getElementById("verifica_variacao_dupla_valor").value=m;var g="funcoes/variacao_dupla_cores.php?loja="+t+"&id_produto="+o+"&tipo="+a+"&valor="+valor_url+"&cont="+i+"&preco_prod="+l+"&pagamento="+c+"&tipo1="+d+"&preco_desconto_especial="+s+"&tipo2="+u;new Ajax.Updater(e,g,{asynchronous:!0,evalScripts:!0,requestHeaders:["X-Update",e]}),mostraDetalhesPrecos(),0==zoomHabilitado?swapImage("imageL_1","imageH_1"):(imagem=jQuery("#carousel li a")[0]?jQuery("#carousel li a")[0].href:null,imagem&&mudaImagemCloudZoom(imagem))}function mudaVariacaoDuplaCompreJunto(e,a,t,o,n,r,i,l){var c="variacao"+n+"_"+t,d=encodeURI(jQuery("#"+r).val()),s="form_compre_junto_"+n;$(c).value="",$(i).className=""==d?"varTit":"varTit onVar",void 0==l&&(l=1),jQuery("#"+e).load("funcoes/variacao_dupla_compre_junto.php",{loja:a,id_produto:t,id_produto_principal:o,id_compre_junto:n,valor:d,quantidade:l}),sendDataBuyTogether(s,n,a)}function mudaImagemCloudZoom(e){!function(e){jQuery(document).ready(function(){jQuery("#imgView").attr("src",e),jQuery("#container_thumb").attr("href",e);var a=0!==jQuery(".zoom-on").length;a&&jQuery(".cloud-zoom, .cloud-zoom-gallery").CloudZoom()})}(e)}function mudaVariacaoDuplaBrinde(e,a,t,o,n,r,i){var l="brinde",c="variacao_brinde",d=encodeURI($(r).value);valor_url=escape(d),$(l).value="",$(c).value="",$(i).className=""==d?"varTit":"varTit onVar";var s="funcoes/variacao_dupla_compre_junto.php?loja="+a+"&id_produto="+t+"&id_produto_principal="+o+"&id_compre_junto="+n+"&valor="+valor_url;new Ajax.Updater(e,s,{asynchronous:!0,evalScripts:!0,requestHeaders:["X-Update",e]})}function mudaVariacaoCompreJunto(e,a,t,o,n){var r="variacao"+a+"_"+t,i=document.getElementById(e).value;valor=i.split("|"),$("erroCompreJunto"+a).hide();var l="form_compre_junto_"+a;document.getElementById(r).value=valor[0],sendDataBuyTogether(l,a,o,n)}function mudaVariacaoBrinde(e){var a="variacao_brinde",t=$(e).value;valor=t.split("|"),$(a).value=valor[0],$("erro_brinde_var").hide()}function mudaVariacaoSimplesFrete(e,a){var t=document.getElementById(e).value;document.getElementById("variacao").value=t,document.getElementById(a).innerHTML="",document.getElementById(a).style.display="none"}function mudaVariacaoDuplaFrete(e,a,t,o,n,r){var i=document.getElementById(o).value;valor_url=escape(i),document.getElementById("variacao").value="",document.getElementById("valor_var").value=i,document.getElementById(n).className=""==i?"varTit":"varTit onVar";var l="funcoes/variacao_simular_frete.php?loja="+a+"&id_produto="+t+"&atualiza_variacao=1&valor="+valor_url+"&cont="+r;new Ajax.Updater(e,l,{asynchronous:!0,evalScripts:!0,requestHeaders:["X-Update",e]})}function ParseNumb(e){return e=ClearStr(e,"-"),e=ClearStr(e,"/"),e=ClearStr(e,","),e=ClearStr(e,"."),e=ClearStr(e,"("),e=ClearStr(e,")"),e=ClearStr(e," "),parseFloat(e)/e!=1?parseFloat(e)*e==0?e:0:e}function enviaForm(e,a,t,o,n){var e=document.getElementById(e),r=validaEmail(e,t,o);return 0==r?!1:void new Ajax.Updater(a,n,{asynchronous:!0,evalScripts:!0,requestHeaders:["X-Update",a]})}function enviaFormulario(e){document.getElementById(e).submit()}function enviaComent(e,a,t){var o=validaNome("","nome_coment",a);if(0==o)return!1;if(o=validaEmail("","email_coment",a),0==o)return!1;if(o=validaMensagem("","mensagem_coment",a),0==o)return!1;if(o=validaVoto("","nota_comentario",a),0==o)return!1;var n=document.getElementById("nota_comentario").value,r=document.getElementById("exibe_email").checked;r=1==r?1:0;var i=document.getElementById("mensagem_coment").value;t=t+"¬a="+n+"&exibe_email="+r+"&comentario="+i,new Ajax.Updater(e,t,{asynchronous:!0,evalScripts:!0,requestHeaders:["X-Update",e]})}function exibeBotao(e){for(var a=document.getElementsByTagName("input"),t=0;t=0&&(o+=t);return o}function Formata(e,a,t,o){var n=t.keyCode;vr=Limpar(e.value,"0123456789"),tam=vr.length,dec=o,a>tam&&8!=n&&(tam=vr.length+1),8==n&&(tam-=1),(8==n||n>=48&&57>=n||n>=96&&105>=n)&&(dec>=tam&&(e.value=vr),tam>dec&&5>=tam&&(e.value=vr.substr(0,tam-2)+","+vr.substr(tam-dec,tam)),tam>=6&&8>=tam&&(e.value=vr.substr(0,tam-5)+"."+vr.substr(tam-5,3)+","+vr.substr(tam-dec,tam)),tam>=9&&11>=tam&&(e.value=vr.substr(0,tam-8)+"."+vr.substr(tam-8,3)+"."+vr.substr(tam-5,3)+","+vr.substr(tam-dec,tam)),tam>=12&&14>=tam&&(e.value=vr.substr(0,tam-11)+"."+vr.substr(tam-11,3)+"."+vr.substr(tam-8,3)+"."+vr.substr(tam-5,3)+","+vr.substr(tam-dec,tam)),tam>=15&&17>=tam&&(e.value=vr.substr(0,tam-14)+"."+vr.substr(tam-14,3)+"."+vr.substr(tam-11,3)+"."+vr.substr(tam-8,3)+"."+vr.substr(tam-5,3)+","+vr.substr(tam-2,tam)))}function openLightWindow(e,a,t,o,n,r){var i=new lightwindow;return void 0==n&&(n="none"),i.activateWindow({href:e,title:a,width:o,height:t,iframeNome:n,type:r||"external"}),!1}function closeLightWindow(){var e=new lightwindow;e.deactivate()}function editarComentario(e,a){return""!=comentario&&void 0!=comentario?!1:(comentario=document.getElementById(a).innerHTML,url=e.href,void atualizaDiv(url,a))}function cancelarComentario(e){document.getElementById(e).innerHTML=comentario,comentario=""}function atualizaComentario(e,a,t,o){var n=valida_formularios();if(0==n)return!1;var r=document.getElementById(t).value,i=document.getElementById(o).value;url=e.href+"&comentario="+r+"¬a="+i,atualizaDiv(url,a),comentario=""}function confirmSent(e,a){var t=confirm(a);return 1!=t?!1:void(window.location=e.href)}function cleanVisited(e,a){url=e.href,atualizaDiv(url,a),document.getElementById(a).style.display="none"}function clearItem(e,a){var t=e+a,o="funcoes/atualiza_navegacao.php?tipo="+e+"&id="+a;atualizaDiv(o,t),document.getElementById(t).style.display="none"}function swapImage(e,a){var t=document.getElementById("foto_p").getElementsByTagName("span"),o=t.length;for(i=0;o>i;i++)t[i].style.display="none";null!=document.getElementById(a)&&(document.getElementById(a).style.display="block")}function videoHide(e){e&&e.hide(),jQuery("#foto_p").find(".mousetrap")&&jQuery(".mousetrap").css("width","100%")}function swapVideo(e,a){jQuery("#foto_p").find(".mousetrap")&&jQuery(".mousetrap").css("width","0");var t=document.getElementById("foto_p").getElementsByTagName("span"),o=t.length;for(i=0;o>i;i++)t[i].style.display="none";if(e){var n=document.getElementById("foto_p").getElementsByTagName("a"),r=n.length;for(i=0;r>i;i++)n[i].style.display="none"}document.getElementById(a).style.display="block"}function inserirComparacao(e,a,t,o,n){n||(n=0),dados={loja:e,id_cat_p:a,id_produto:t};var r=jQuery(o).html();jQuery.post("/loja/funcoes/incluir_comparacao.php",dados).always(function(){jQuery(o).html("Carregando...")}).done(function(e){e=jQuery.parseJSON(e);var a=jQuery(o).parent();jQuery(o).remove(),jQuery(a).prepend(''),n>0&&(window.location.href="comparador-"+e.loja+"-"+e.id_cat_p)}).fail(function(){jQuery(o).html(r)}),event.preventDefault()}function removerComparacao(e,a,t,o){dados={loja:e,id_cat_p:a,id_produto:t};var n=jQuery(o).html();jQuery.post("/loja/funcoes/remover_comparacao.php",dados).always(function(){jQuery(o).html("Carregando...")}).done(function(e){e=jQuery.parseJSON(e);var a=jQuery(o).parent();jQuery(o).remove(),jQuery(a).prepend('')}).fail(function(){jQuery(o).html(n)}),event.preventDefault()}function atualizaFromas(e,a,t){0==$(a).value&&($(a).value=1,$(t).innerHTML='Loading Carregando Formas de Pagamento',atualizaDiv(e,t))}function enviaFormularioContatoAjax(e,a,t){var o=valida_formularios();return 0==o?!1:(e.request({onSuccess:function(){$(a).innerHTML="
"+t+"
",$(a).style.display=""}}),!1)}function calculaFrete(){return validaCalculoFrete("cep1","cep2","quant","span_erro_cep"),!1}function validaFormularioDepoimento(){var e=document.getElementById("nome_depoimento"),a=document.getElementById("email_depoimento"),t=document.getElementById("msg_depoimento"),o=document.getElementById("aviso_depoimento");return""==e.value?(o.innerHTML="
Campo nome obrigatório. Digite o seu nome completo por favor.
",o.style.display="",!1):""==a.value?(o.innerHTML="
Campo email obrigatório. Digite o seu email por favor.
",o.style.display="",!1):-1==a.value.indexOf("@")||-1==a.value.indexOf(".")?(o.innerHTML="
Formato de e-mail inválido. Digite o seu email por favor.
",o.style.display="",!1):""==t.value?(o.innerHTML="
Campo depoimento obrigatório. Digite o depoimento por favor.
",o.style.display="",!1):!0}function requestAjaxEnviaDepoimento(e){jQuery.ajax({url:e.attr("action"),type:"POST",data:e.serialize(),async:!1,success:function(a){var t=JSON.parse(a),o=document.getElementById("aviso_depoimento");t.hasOwnProperty("erro")?(o.innerHTML="
Formulário inválido, atualize esta tela e envie novamente.
",jQuery('input[name="g-recaptcha-response"]').remove()):(o.innerHTML="
Depoimento enviado com Sucesso!
",jQuery('input[name="g-recaptcha-response"]').remove(),e.trigger("reset"),setTimeout(function(){window.location.reload()},1e3)),o.style.display=""}})}function fecharBannerFlutuante(e){document.getElementById(e).style.display="none"}function atualizaSelectDepo(e,a){window.location.href="depoimentos.php?loja="+e+"&origem="+a.value}function validaBonus(e,a){a=parseInt(a),e.value>a&&(e.value=a)}function AbrirSub(e){$(e).style.display="block"}function FecharSub(e){$(e).style.display="none"}function setGift(e,a,t){new Ajax.Request("funcoes/produtos_presente.php?loja="+e+"&id_produto="+a+"&carrinho=1&transID="+t)}function exibeDetalheCartao(e,a,t){new Ajax.Request("funcoes/produtos_presente.php?loja="+t+"&id_produto="+a+"&cartao=1&id_cartao="+e);for(var o=$("lista_"+a).getElementsByTagName("div"),n=o.length,r=0;n>r;r++)"detalhe_cartao"==o[r].className&&(o[r].style.display="none");new Effect.BlindDown("cartao_"+a+"_"+e,{duration:1})}function exibeDetalheEmbalagem(e,a,t){new Ajax.Request("funcoes/produtos_presente.php?loja="+t+"&id_produto="+a+"&id_embalagem="+e+"&embalagem=1");for(var o=document.getElementById("lista_"+a).getElementsByTagName("div"),n=o.length,r=0;n>r;r++)"detalhe_embalagem"==o[r].className&&(o[r].style.display="none");var i="emb_"+a+"_"+e,l=$("#"+i);l||(l=$(i)),l.slideDown("slow")}function gravaTextoCartao(e,a,t,o){var n=jQuery("#"+e).val();jQuery.ajax("funcoes/produtos_presente.php",{method:"POST",data:{loja:o,id_produto:t,cartao_texto:"1",id_cartao:a,texto:n}})}function changeDisplay(e,a){$(e).show(),$(e+"_link").className="menu_esquerdo_ativado",$(a).hide(),$(a+"_link").className=""}function abreMenuSuperior(e){var a=e.getElementsByTagName("ul");a[0].style.display="block"}function fechaMenuSuperior(e){var a=e.getElementsByTagName("ul");a[0].style.display="none"}function fabreWinPagamento(){mpg_popup=-1!=navigator.appName.indexOf("Netscape")?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=440"):window.open("","mpg_popup","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,screenX=0,screenY=0,left=0,top=0,width=765,height=440")}function total_voce_quis_dizer(e,a){xmlhttp.open("POST","busca.php?rand="+Math.ceil(1e5*Math.random()),!0),xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),xmlhttp.send("palavra_busca="+e+"&ajax_voce_quis_dizer=1&loja="+a),xmlhttp.onreadystatechange=function(){if(4==xmlhttp.readyState&&200==xmlhttp.status){if(xmlhttp.responseText<=1)var a="item";else var a="itens";document.getElementById("total_voce_quis_dizer").innerHTML=e+" ("+xmlhttp.responseText+" "+a+")"}}}function validaCompreJunto(e,a,t,o){var n=document.getElementById(e);if(1==t&&1==document.getElementById("variacoes_"+a).value){var r=document.getElementById("erroCompreJunto"+a),l=n.getElementsByTagName("input"),c=l.length;for(i=0;c>i;i++)if("hidden"==l[i].type&&""==l[i].value)return r.style.display="block",!1}if(1==o){var d={action:n.action,type:"POST",data:jQuery(n).serialize()};return jQuery(document).trigger("continue_shopping",d),!1}}function sendDataBuyTogether(e,a,t){var o="",n=document.getElementById(e),r=(document.getElementById("erroCompreJunto"+a),n.getElementsByTagName("input")),l=r.length;for(i=0;l>i;i++)"hidden"==r[i].type&&""!=r[i].value&&(o+="&"+r[i].id+"="+r[i].value);var c="CompreJunto"+a,d="funcoes/compre_junto.php?loja="+t+o+"&id_compre_junto="+a;atualizaDiv(d,c)}function ativa_checkbox_variacao(e,a,t,o,n){0==document.getElementById(a).checked&&(document.getElementById(a).checked=!0),$(t).hide(),atualizaDiv("funcoes/variacao_texto_produto.php?loja="+e+"&id="+o+"&posicao_lista="+t+"&i="+n,t)}function ativa_checkbox_ie(e){var a=e.options[e.selectedIndex].onmouseup;setTimeout(a,1)}function desativa_checkbox_variacao(e,a){1==document.getElementById(e).checked&&(document.getElementById(e).checked=!1),$(a).hide(),$(a).innerHTML=""}function calculaTamanho(){var e=0;$$("#brindes li").each(function(){e+=100}),tamanho_brinde=e,$("brindes").style.width=e+"px"}function rolar(e){var a=$("brindes").style.width;a=a.replace("px",""),"menos"==e?(new Effect.Move("brindes",{duration:.5,x:100,transition:Effect.Transitions.sinoidal}),brinde_atual+=100):(new Effect.Move("brindes",{duration:.5,x:-100,transition:Effect.Transitions.sinoidal}),brinde_atual-=100),0==brinde_atual?new Effect.Fade("btmenos",{duration:1}):0>brinde_atual&&new Effect.Appear("btmenos",{duration:1}),brinde_atual==-(a-300)?new Effect.Fade("btmais",{duration:1}):new Effect.Appear("btmais",{duration:1})}function selecionaBrinde(e,a,t,o){var n="brinde",r="variacao_brinde",i="produto_brinde",l="nomeBrinde",c=$("imagem_"+e),d=($("link_"+e),$("variacao_brinde"),!0);$("span_erro_carrinho").hide(),$("span_erro_carrinho").innerHTML="",1==o?$$(".variacao select").each(function(e){0==e.selectedIndex&&(d=!1,$(r).value="")}):$(r).value="",1==d?($(n).value=e,$(i).value=a,$(l).innerHTML="Seu Brinde: "+t,$$("#brindes .imagem_produto").each(function(e){e.setStyle({border:"none"})}),c.setStyle({border:"2px solid #f00"}),"undefined"!=typeof myLightWindow&&myLightWindow.deactivate(),jQuery("#modal-form").length>0&&jQuery("#modal-form").modal("toggle")):$("erro_brinde_var").show()}function desativaBrinde(e,a,t){var o="brinde",n="variacao_brinde",r="produto_brinde",i=$("imagem_"+e),l=($("link_"+e),"nomeBrinde");if($(o).value==e){$(o).value="",$(n).value="",$(r).value="",$(l).innerHTML=t;var i=$("imagem_"+e);i.setStyle({border:"none"})}return!1}function validaSuperPay(e,a,t){var o="funcoes/dadosCartaoSuperPay.php?loja="+a+"&flag_contrato="+e+"&id_forma_pagamento="+t;return document.getElementById("contrato")&&0==document.getElementById("contrato").checked?(document.getElementById("erro2").style.display="",document.getElementById("contrato").focus(),!1):(openLightWindow(o,"Dados do Cart�o",360,600),!1)}function enviaDadosCartao(e,a,t){var o=valida_formularios();if(0==o)return!1;if($("dadosNumeroCartaoCredito").value.length0)var i=$("hidden"+r).value;else var i="";""!=i?($("imgView").src=i,alteraImagensVariacoes(o,r,"variacao",n),r>0&&alteraReferenciaVarProd(o,r,"variacao",n)):($("imgView").src=$("antVariacao").value,alteraImagensVariacoes(o,r,"variacao",n),r>0&&alteraReferenciaVarProd(o,r,"variacao",n))}}function ImagemInfoAdicional(e,a){e=e.replace(":","-"),imagem=jQuery("#option_"+e).attr("rel"),imagem&&(a?muda_imagem_zoom(imagem):trocaImagemInfoAdicional(imagem))}function limpa_erro_carrinho(){jQuery("#span_erro_carrinho").hide()}function number_format(e,a,t,o){var n=e,r=a;n=isFinite(+n)?+n:0,r=isFinite(+r)?Math.abs(r):0;var i,l,c="undefined"==typeof o?",":o,d="undefined"==typeof t?".":t,s=r>0?n.toFixed(r):Math.round(n).toFixed(r),u=Math.abs(n).toFixed(r);return u>=1e3?(i=u.split(/\D/),l=i[0].length%3||3,i[0]=s.slice(0,l+(0>n))+i[0].slice(l).replace(/(\d{3})/g,c+"$1"),s=i.join(d)):s=s.replace(".",d),s}function calculaBonusVariacao(e,a,t){if(null!==$("preco_atual")){var a=parseFloat($("preco_atual").value),e=e,t=parseFloat(t);if("preco"==e&&$("idBonusVariacao")){var o=Math.pow(10,0);$("idBonusVariacao").innerHTML=Math.floor(a/t*o)/o}}}function mudaSelecao(e){$$(".cor_variacao img").each(function(e){e.className=""}),$$(".lista_cor_variacao div").each(function(e){e.className=""}),$(e)&&($(e).className="cor_selecionada"),$("cor_nome")&&($("cor_nome").innerHTML="( "+$(e).title+" )")}function mudaSelecao2(e){$$(".cor_variacao2 img").each(function(e){e.className=""}),$$(".lista_cor_variacao2 div").each(function(e){e.className=""}),$(e).className="cor_selecionada",$("cor_nome2").innerHTML="( "+$(e).title+" )"}function consultaIdLance(e,a){var t="funcoes/consulta_lance.php?"+a+"&idVariacao="+e;new Ajax.Request(t,{method:"get",onSuccess:function(e){$("idLance").value=e.responseText}})}function exibirInfoPreco(e){$("info_preco").style.display=e?"block":"none"}function alteraInfoPreco(e,a,t,o){jQuery("#info_preco").hide(),jQuery.ajax({url:"/loja/funcoes/info_preco.php",type:"POST",data:{loja:e,idProduto:a,idVariacao:t,precoCalculo:o},async:!1,success:function(e){jQuery("#info_preco").html(e),jQuery("#info_preco").show()}})}function atualizaEconomize(e){$("valorDeDif")&&($("valorDeDif").innerHTML=e,"0,00"==e?($("precoDe").style.display="none",$("economize").style.display="none"):($("precoDe").style.display="block",$("precoDeValor").style.display="",$("economize").style.display="block"))}function semGarantiaEstendida(){$("garantiaProsseguir").show(),$("termos").hide()}function termosGarantiaEstendida(e,a){var t="funcoes/garantia_estendida.php?loja="+e,o="",n=0;new Ajax.Request(t,{method:"post",parameters:{acao:"termo",id:a},onSuccess:function(e){o=e.responseText,o.length>0?($("termos").show(),$("garantiaTermos").innerHTML=o,new Ajax.Request(t,{method:"post",parameters:{acao:"obrigatorio",id:a},onSuccess:function(e){n=e.responseText,1==n?($("btTermos").show(),$("garantiaProsseguir").hide()):($("btTermos").hide(),$("garantiaProsseguir").show())}})):($("termos").hide(),$("garantiaProsseguir").show())}})}function filtroCaracteristicas(e){new Ajax.Updater("filtroCarac","funcoes/filtro_caracteristicas.php",{parameters:{acao:"categoria",IdDep:e}})}function filtroAtualizaCaracteristicas(a,t,o,n){a++,""!=n?(new Ajax.Updater("carac"+a,"funcoes/filtro_caracteristicas.php",{parameters:{acao:"filtro",contador:a,IdDep:t,idCaracteristica:o,valor:n}}),e=$("carac"+a),e.disabled=""):($("carac"+a).disabled="disabled",$("carac"+a).options[0].selected="selected");var r=0;$$(".selectCarac").each(function(e){r>a&&(e.options.length&&(e.options[0].selected="selected"),e.disabled="disabled"),r++})}function filtroAtualizaPrecos(e,a,t,o){e++,""!=o?new Ajax.Updater("caracPreco","funcoes/filtro_caracteristicas.php",{parameters:{acao:"preco",contador:e,IdDep:a,idCaracteristica:t,valor:o}}):$("caracPreco").options[0].selected="selected"}function filtroCaracLimpar(){new Ajax.Request("funcoes/filtro_caracteristicas.php",{parameters:{acao:"limpar"}});var e=0;$$(".selectCarac").each(function(a){a.options.length&&(a.options[0].selected="selected"),e>0&&(a.disabled="disabled"),e++})}function ancoras(e){if(jQuery("base").length){var a=/#(.*)/,t=document.location.href;t=t.replace(a,"");var o="";tag_url=jQuery("tag_base").attr("href"),jQuery("a[href]").each(function(){if(o=jQuery(this).attr("href"),home_tabs=o.indexOf("home-tabs-"),-1==home_tabs&&(0==o.indexOf("#")||0==o.indexOf(tag_url+"#"))){var e=getAnchor(o);jQuery(this).attr("href",t+"#"+e[1])}})}jQuery("#carousel").length&&"foto_a"==e&&atualizaCarousel()}function getAnchor(e){for(var a=e.split("#"),t=["onchange","onclick","dblclick","onmouseup","onmousedown","onmouseover","onmouseout","onkeypress","onkeyup","onkeydown","onload"],o=0;o')},v.open("GET","/cep.php?return=pipe&cep="+e+"&loja="+u,!0),v.send(""),prefix="#box-"+jQuery(".ckeck_endereco_ativo:checked").attr("id"),jQuery(prefix).find(".pais")&&jQuery(prefix).find(".pais").val("Brasil")}function valida_formularios_com_captcha_v3(e){var a=document.getElementById(e);a.onsubmit=function(e){return e.preventDefault(),void 0===valida_formularios()?(a.submit(),!0):!1}}function overWriteToNativeReduce(){Array.prototype.reduce=function(e,a){for(var t=void 0===a?void 0:a,o=0;o=o;o++)t>=o?a.find("li").eq(o-1).addClass("star-on"):a.find("li").eq(o-1).removeClass("star-on")},t=function(){for(var a=e(".stars"),t=e("#nota_comentario").val(),o=1;5>=o;o++)o>t?a.find("li").eq(o-1).removeClass("star-on"):a.find("li").eq(o-1).addClass("star-on")},o=e(".starn");o.on("click",a),o.on("mouseenter",a),e(".stars").on("mouseenter",t)})}(jQuery);var VerifiqueTAB=!0,req,status=!0,comentario="";window.screen.width<900;var tamanho_brinde=0,brinde_atual=0;window.addEventListener?window.addEventListener("load",ancoras,!1):window.attachEvent&&window.attachEvent("onload",ancoras);