var dinConfigs={"siteCode":3572,"clientCode":310713,"listCode":1,"domain":"frigelar.com.br","updateMode":"AS","crawlForms":true,"crawlEcommerce":true,"formHashConfig":{"Missing action form":{"fieldRules":{"Variable":{"new-email":{"Field":"1","Type":"VC"}}},"listCode":"1","updateMode":"AS"}},"logLevel":2,"dinTargetForm":{"primary_color":"#ccc"},"leadTracking":{"ACTIVE":true,"AUTOMATION_URL_RULES":{"1":{"73":{"RULES":[{"TYPE":"CONTAINS","VALUE":"cart"}],"TEST_URLS":["https://www.frigelar.com.br/cart"],"TITLE":"Oportunidades"},"74":{"RULES":[{"TYPE":"CONTAINS","VALUE":"confirmation"}],"TEST_URLS":["https://www.frigelar.com.br/confirmation/59268067-d50c-4514-8a56-3ad50a551d9e"],"TITLE":"Clientes"},"75":{"RULES":[{"TYPE":"CONTAINS","VALUE":"ar-condicionado/c"},{"TYPE":"CONTAINS","VALUE":"ar-condicionado"}],"TEST_URLS":["https://a7833275c1tst-store.occa.ocs.oraclecloud.com/ar-condicionado/c"],"TITLE":"Ar-condicionado"},"76":{"RULES":[{"TYPE":"CONTAINS","VALUE":"eletrodomesticos"},{"TYPE":"CONTAINS","VALUE":"adega"},{"TYPE":"CONTAINS","VALUE":"cervejeira"},{"TYPE":"CONTAINS","VALUE":"coifa"},{"TYPE":"CONTAINS","VALUE":"cooktop"},{"TYPE":"CONTAINS","VALUE":"fogao"},{"TYPE":"CONTAINS","VALUE":"forno"},{"TYPE":"CONTAINS","VALUE":"freezer"},{"TYPE":"CONTAINS","VALUE":"geladeira"},{"TYPE":"CONTAINS","VALUE":"lava"},{"TYPE":"CONTAINS","VALUE":"micro-ondas"},{"TYPE":"CONTAINS","VALUE":"secadora"},{"TYPE":"CONTAINS","VALUE":"eletroportateis"},{"TYPE":"CONTAINS","VALUE":"lavadora"},{"TYPE":"CONTAINS","VALUE":"depurador"},{"TYPE":"CONTAINS","VALUE":"frigobar"},{"TYPE":"CONTAINS","VALUE":"refrigerador"},{"TYPE":"CONTAINS","VALUE":"seca"}],"TEST_URLS":[],"TITLE":"Eletrodomésticos"},"77":{"RULES":[{"TYPE":"CONTAINS","VALUE":"eletroportateis/c"},{"TYPE":"CONTAINS","VALUE":"abridor-vinho"},{"TYPE":"CONTAINS","VALUE":"abridor-de-vinho"},{"TYPE":"CONTAINS","VALUE":"air-fryer"},{"TYPE":"CONTAINS","VALUE":"airfryer"},{"TYPE":"CONTAINS","VALUE":"aspirador-po"},{"TYPE":"CONTAINS","VALUE":"aspirador-de-po"},{"TYPE":"CONTAINS","VALUE":"batedeira"},{"TYPE":"CONTAINS","VALUE":"bebedouro"},{"TYPE":"CONTAINS","VALUE":"purificador"},{"TYPE":"CONTAINS","VALUE":"filtro-refil"},{"TYPE":"CONTAINS","VALUE":"cafeteira"},{"TYPE":"CONTAINS","VALUE":"chaleira"},{"TYPE":"CONTAINS","VALUE":"churrasqueira"},{"TYPE":"CONTAINS","VALUE":"maquina-de-gelo"},{"TYPE":"CONTAINS","VALUE":"lavadora-de-pressao"},{"TYPE":"CONTAINS","VALUE":"lavadora-de-alta-pressao"},{"TYPE":"CONTAINS","VALUE":"liquidificador"},{"TYPE":"CONTAINS","VALUE":"sorveteira"},{"TYPE":"CONTAINS","VALUE":"maquina-de-sorvete"},{"TYPE":"CONTAINS","VALUE":"maquina-sorvete"},{"TYPE":"CONTAINS","VALUE":"mixer"},{"TYPE":"CONTAINS","VALUE":"panela"},{"TYPE":"CONTAINS","VALUE":"processador"}],"TEST_URLS":[],"TITLE":"Eletroportáteis"},"78":{"RULES":[{"TYPE":"CONTAINS","VALUE":"climatizacao/c"},{"TYPE":"CONTAINS","VALUE":"aquecedor"},{"TYPE":"CONTAINS","VALUE":"desumidificador"},{"TYPE":"CONTAINS","VALUE":"umidificador"},{"TYPE":"CONTAINS","VALUE":"ventilador"},{"TYPE":"CONTAINS","VALUE":"climatizador"},{"TYPE":"CONTAINS","VALUE":"circulador"},{"TYPE":"CONTAINS","VALUE":"exaustor"},{"TYPE":"CONTAINS","VALUE":"cortina"}],"TEST_URLS":["https://www.frigelar.com.br/climatizacao/c"],"TITLE":"Climatização"},"79":{"RULES":[{"TYPE":"CONTAINS","VALUE":"pecas-e-acessorios/c"}],"TEST_URLS":["https://www.frigelar.com.br/pecas-e-acessorios/c"],"TITLE":"Peças"},"80":{"RULES":[{"TYPE":"CONTAINS","VALUE":"ferramentas/c"},{"TYPE":"CONTAINS","VALUE":"ferramentas-eletricas"},{"TYPE":"CONTAINS","VALUE":"parafusadeira"},{"TYPE":"CONTAINS","VALUE":"furadeira"},{"TYPE":"CONTAINS","VALUE":"serra"},{"TYPE":"CONTAINS","VALUE":"ferramenta"},{"TYPE":"CONTAINS","VALUE":"flangeador"},{"TYPE":"CONTAINS","VALUE":"lixadeira"},{"TYPE":"CONTAINS","VALUE":"esmerilhadeira"},{"TYPE":"CONTAINS","VALUE":"macarico"},{"TYPE":"CONTAINS","VALUE":"manifold"},{"TYPE":"CONTAINS","VALUE":"soprador"},{"TYPE":"CONTAINS","VALUE":"alicate"},{"TYPE":"CONTAINS","VALUE":"termometro"},{"TYPE":"CONTAINS","VALUE":"trena"},{"TYPE":"CONTAINS","VALUE":"mangueira"},{"TYPE":"CONTAINS","VALUE":"multimetro"},{"TYPE":"CONTAINS","VALUE":"mala"},{"TYPE":"CONTAINS","VALUE":"maleta"}],"TEST_URLS":["https://www.frigelar.com.br/ferramentas/c"],"TITLE":"Ferramentas"},"81":{"RULES":[{"TYPE":"CONTAINS","VALUE":"servicos/c"}],"TEST_URLS":["https://www.frigelar.com.br/servicos/c"],"TITLE":"Serviços"},"82":{"RULES":[{"TYPE":"CONTAINS","VALUE":"camaras-frias/c"}],"TEST_URLS":["https://www.frigelar.com.br/camaras-frias/c"],"TITLE":"Câmaras Frias"},"83":{"RULES":[{"TYPE":"CONTAINS","VALUE":"produtos-eos/c"},{"TYPE":"CONTAINS","VALUE":"eos"}],"TEST_URLS":["https://www.frigelar.com.br/produtos-eos/c"],"TITLE":"EOS"},"90":{"RULES":[{"TYPE":"CONTAINS","VALUE":"metalfrio"}],"TEST_URLS":[],"TITLE":"Metalfrio"},"91":{"RULES":[{"TYPE":"CONTAINS","VALUE":"piso-teto"},{"TYPE":"CONTAINS","VALUE":"cassete"},{"TYPE":"CONTAINS","VALUE":"multi-split"},{"TYPE":"CONTAINS","VALUE":"teto"}],"TEST_URLS":[],"TITLE":"Ar Alta Capacidade"},"92":{"RULES":[{"TYPE":"CONTAINS","VALUE":"cortina-de-ar"}],"TEST_URLS":[],"TITLE":"Cortinas de Ar"},"93":{"RULES":[{"TYPE":"EQUAL","VALUE":"robo-aspirador-po-inteligente-eos-smart-self-clean-laser-map-controle-alexa-google-ear03-110v/p/kit8958"},{"TYPE":"EQUAL","VALUE":"robo-aspirador-po-inteligente-eos-smart-self-clean-laser-map-controle-alexa-google-ear03-220v/p/kit10603"}],"TEST_URLS":["https://www.frigelar.com.br/robo-aspirador-po-inteligente-eos-smart-self-clean-laser-map-controle-alexa-google-ear03-220v/p/kit10603","https://www.frigelar.com.br/robo-aspirador-po-inteligente-eos-smart-self-clean-laser-map-controle-alexa-google-ear03-110v/p/kit8958"],"TITLE":"Robô Aspirador Smart Clean EAR03"}}},"HASH":"8185","HISTORY_URL_RULES":[],"LIST":"1","REQUIRE_CONSENT":false},"dinWhatsAppIntegration":{"forms":null},"dinEcommerceTools":{"hashsInterestItems":[],"hashsPurchase":["bhzIu58My0IdaTA="],"hashsUnfinishedPurchase":["bhzIu58My05WFw=="],"maxInterestItems":5}};if(typeof dinVERSION=='undefined'){var dinVERSION='1.0';var dinFunctions={request:function(method,url,params=null){var xmlhttp=new XMLHttpRequest();xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==XMLHttpRequest.DONE){if(xmlhttp.status>=200&&xmlhttp.status<=299){}else{dinLogger.Write(dinLogger.DEBUG,'Request returned status code '+xmlhttp.status);}}} if(params!=null&&typeof params!=='string'){var len=params.length;if(len!=undefined){for(var x=0;x=200&&xmlhttp.status<=299){}else{dinLogger.Write(dinLogger.DEBUG,'Request returned status code '+xmlhttp.status);}}} xmlhttp.open("POST",url,false);xmlhttp.send();},requestFetch:function(url,data){if(typeof data!=="object"){data={};} return fetch(url,{method:'POST',mode:'cors',cache:'no-cache',credentials:'omit',headers:{},redirect:'follow',referrer:'client',keepalive:true,});},setCookie:function(cname,cvalue,exdays){var d=new Date();d.setTime(d.getTime()+(exdays*24*60*60*1000));var expires="expires="+d.toUTCString();document.cookie=cname+"="+cvalue+";"+expires+";path=/";dinLogger.Write(dinLogger.DEBUG,"Cookie set. cname:["+cname+"] cvalue:["+cvalue+"] exdays:["+exdays+"]");},getCookie:function(cname){var name=cname+"=";var allCookies=document.cookie;var ca=allCookies.split(';');for(var i=0;i9);i^=1;} return r%10==0&&r>0;},validateEmail:function(email){var regex=/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;return regex.test(email);},isMobileRes:function(){var width=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;if(dinFunctions.checkOrientation()=='portrait')return(width<500);var height=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;return(height<500)},matchesRulesParser:function(url,show_filterin,type,value){var show_filter=[];var exRules=[];var coRules=[];var ncRules=[];var len=show_filterin.length;for(var x=0;x0){for(var x=0;xmaxTextSize){options[x].title=options[x].textContent;options[x].textContent=options[x].textContent.substring(0,maxTextSize)+"...";}}}},attachEventOnElement:function(element,eventType,eventFunction){if(element.attachEvent){element.attachEvent('on'+eventType,eventFunction);dinLogger.Write(dinLogger.DEBUG,"event ["+eventType+"] attached to the element ["+element+"] using [attachEvent]");return} element.addEventListener(eventType,eventFunction,false);dinLogger.Write(dinLogger.DEBUG,"event ["+eventType+"] attached to the element ["+element+"] using [addEventListener]");},getReferrer:function(){return document.referrer?document.referrer.match(/:\/\/(.[^/]+)/)[1]:"";},hasWhatsForm:function(){var width=(document.documentElement.clientWidth-10);var height=(document.documentElement.clientHeight-10);var arrayofelements=document.elementsFromPoint(width,height);if(arrayofelements.length>0){for(var x=0;xheight)return'landscape' return'portrait'},validateDuplicity:function(form,name){var inputs=form.querySelectorAll('input[name="'+name+'"]');if(inputs.length==0){return false;} var type=inputs[0].type;for(var i=1;i0){var len=this.config.popover.length;for(var p=0;p0){popUpActivate=dinFunctions.matchesRulesParser(url,this.config.popover[p].show_filter,"type","exp");} if(popUpActivate){this.appendForm('popover',this.config.popover[p],appendIn);}} if(popUpActivate){this.backElement=document.createElement('div');this.backElement.id='dinTargetFormBackground';appendIn.appendChild(this.backElement);}}} if(this.config.scrollbox){dinLogger.Write(dinLogger.DEBUG,"Found "+this.config.scrollbox.length+" 'scrollbox' popups");if(this.config.scrollbox.length>0){var len=this.config.scrollbox.length;for(var p=0;p0){popUpActivate=dinFunctions.matchesRulesParser(url,this.config.scrollbox[p].show_filter,"type","exp");} if(popUpActivate){this.appendForm('scrollbox',this.config.scrollbox[p],appendIn);}}}} if(this.config.topbar){dinLogger.Write(dinLogger.DEBUG,"Found "+this.config.topbar.length+" 'topbar' popups");if(this.config.topbar.length>0){var len=this.config.topbar.length;for(var p=0;p0){popUpActivate=dinFunctions.matchesRulesParser(url,this.config.topbar[p].show_filter,"type","exp");} if(popUpActivate){this.appendForm('topbar',this.config.topbar[p],appendIn);}}}} if(this.config.embedded){dinLogger.Write(dinLogger.DEBUG,"Found "+this.config.embedded.length+" 'embedded' popups");if(this.config.embedded.length>0){var len=this.config.embedded.length;for(var p=0;p0){popUpActivate=dinFunctions.matchesRulesParser(url,this.config.embedded[p].show_filter,"type","exp");} if(popUpActivate){var findFor=this.config.embedded[p].insert_into;var appendInE=document.getElementById(findFor);if(!appendInE){appendInE=document.getElementsByClassName(findFor);if(!appendInE){continue;} for(var ai=0;ai=me.scrollElement.scroll){dinLogger.Write(dinLogger.DEBUG,"Required scroll triggered ["+me.scrollElement.scroll+"]. Opening popup");me.openDialog(me.scrollElement.formId);}};dinFunctions.attachEventOnElement(window,'scroll',fn) var fnResize=function(ev){if(me.dialogsHasClosed[me.scrollElement.formId]){return;} if(me.scrollElement.percent>0){me.scrollElement.scroll=dinFunctions.calcScrollPercentage(me.scrollElement.percent);}} dinFunctions.attachEventOnElement(window,'resize',fnResize)} if(this.timeElement!=null){var me=this;window.setTimeout(function(){dinLogger.Write(dinLogger.DEBUG,"Delay elapsed ["+me.timeElement.delay+"s]. Opening popup");me.openDialog(me.timeElement.formId);},me.timeElement.delay*1000);} if(this.config.local_mode=='embedded'){this.config.close_buttom='';} dinLogger.Write(dinLogger.DEBUG,"InitPopup done");},appendForm:function(mode,conf,appendIn){this.formId=conf.id;var me=this;var dialogElement=document.createElement('div');dialogElement.id='dinTargetFormDialog'+this.formId;dialogElement.setAttribute('dinTargetFormId',this.formId);dialogElement.className='dinTargetFormDialog '+mode;dialogElement.style.height=conf.height+'px';if(mode!="topbar"){dialogElement.style.width=conf.width+'px';} var content=document.createElement('div');content.className='dinTargetFormContent';var iframe=document.createElement('iframe');content.appendChild(iframe);dialogElement.appendChild(content);if(conf.close_buttom=='X'){var close=document.createElement('div');close.className='dinTargetFormCloseButtom';close.innerHTML="X";dialogElement.appendChild(close);close.onclick=function(){var formId=this.parentNode.getAttribute('dinTargetFormId');me.closeDialog(formId);}} appendIn.appendChild(dialogElement);var iframeHtml=dinFunctions.base64Decode(conf.dialog_html);var iframeContent=iframe.contentWindow.document;iframeContent.open();iframeContent.write(iframeHtml);iframeContent.close();var button=iframeContent.getElementById("closeButton");if(button!=undefined){button.onclick=function(){if(conf.redirect_buttom!=undefined&&conf.redirect_buttom!=""){location.href=conf.redirect_buttom;} me.closeDialog(dialogElement.getAttribute('dinTargetFormId'));}} var form=iframeContent.getElementsByClassName("formIntegration")[0];if(form==undefined){form=iframeContent.getElementById("formIntegration");} dinFunctions.addCookieToForm(iframeContent,form) if(conf.redirect_buttom!=undefined&&conf.redirect_buttom!=""){if(form!=undefined){var fn=function(){var inputError=iframeContent.getElementsByClassName("field-error");if(!inputError.length){setTimeout(function(){location.href=conf.redirect_buttom;},2000);}} dinFunctions.attachEventOnElement(form,'submit',fn)}} if(conf.close_buttom!='X'&&form!=undefined){var fn=function(){var inputError=iframeContent.getElementsByClassName("field-error");if(!inputError.length){setTimeout(function(){me.closeDialog(dialogElement.getAttribute('dinTargetFormId'));},2000);}} dinFunctions.attachEventOnElement(form,'submit',fn)} this.formsConfig[this.formId]=conf;if(mode=='embedded'){return;} switch(conf.show_mode){case"mouse_out":var moe={formId:this.formId};if(this.mouseoutElement){dinLogger.Write(dinLogger.DEBUG,"Popup ignored. There is already a popup appended in the 'mouse out' trigger. FormId ["+moe.formId+"]");break;} this.mouseoutElement=moe;break;case"scroll_move":var scrollShow=conf.scroll_show;var perc=0;if(scrollShow.indexOf('%')!=-1){perc=parseInt(scrollShow);if(!isNaN(perc)){var scrollShow=dinFunctions.calcScrollPercentage(perc);}} var se={scroll:scrollShow,formId:this.formId,percent:perc};if(this.scrollElement!=null){if(this.scrollElement.scroll>se.scroll){dinLogger.Write(dinLogger.DEBUG,"Popup ignored. There is already a popup appended in the 'scroll' trigger. FormId ["+this.scrollElement.formId+"]");}else{dinLogger.Write(dinLogger.DEBUG,"Popup ignored. There is already a popup appended in the 'scroll' trigger. FormId ["+se.formId+"]");break;}} this.scrollElement=se;break;default:var te={delay:conf.delay_open,formId:this.formId};if(this.timeElement!=null){if(this.timeElement.delay>te.delay){dinLogger.Write(dinLogger.DEBUG,"Popup ignored. There is already a popup appended in the 'time' trigger. FormId ["+this.timeElement.formId+"]");}else{dinLogger.Write(dinLogger.DEBUG,"Popup ignored. There is already a popup appended in the 'time' trigger. FormId ["+te.formId+"]");break;}} this.timeElement=te;break;} this.dialogElement[this.formId]=dialogElement;dinLogger.Write(dinLogger.DEBUG,"Popup append done");},openDialog:function(formId){if(this.dialogIsOpened||this.dialogsHasClosed[formId]){return;} var conf=this.formsConfig[formId];if(conf&&conf.remember_closed&&dinFunctions.getCookie('dinTargetForm_dead_'+formId)==1){return;} var ff=this.dialogElement[formId];if(!ff||(dinFunctions.isMobileRes()&&(conf.is_mobile_active==undefined||!conf.is_mobile_active))||(ff.classList.contains('scrollbox')&&dinFunctions.hasWhatsForm())){return;} ff.style.display='block';if(this.backElement!=null&&ff.classList.contains('popover')){this.backElement.style.display='block';} dinFunctions.fixDialogHeight(ff,this.getHeightIncrease(ff));var me=this;var fnResize=function(ev){if(me.dialogsHasClosed[formId]){return;} dinFunctions.fixDialogHeight(ff,me.getHeightIncrease(ff));} dinFunctions.attachEventOnElement(window,'resize',fnResize) this.dialogIsOpened=formId;},closeDialog:function(formId){var ff=this.dialogElement[formId];if(!this.dialogIsOpened||!ff||ff.style.display=='none'){return;} ff.style.display='none';if(this.backElement!=null){this.backElement.style.display='none';} this.dialogIsOpened=false;this.dialogsHasClosed[formId]=true;var conf=this.formsConfig[formId];if(conf&&conf.remember_closed){dinFunctions.setCookie('dinTargetForm_dead_'+formId,'1',conf.cookie_dead_days);}},closeMessage:function(){this.msgElement.style.display='none';},FormClosed:function(msg){if(this.dialogIsOpened){var conf=this.formsConfig[this.dialogIsOpened];if(conf.close_after_submit){this.closeDialog(this.dialogIsOpened);}} if(msg){this.msgElement.innerHTML='
X
'+msg+'';this.msgElement.style.display='table';}},cssStyle:function(){var style=` `;return style;},getHeightIncrease:function(dialogElement){var iframeContent=dialogElement.querySelector('iframe').contentWindow.document;var contentElement=iframeContent.querySelector('.content');var fatherElement=contentElement.parentElement;switch(fatherElement.className){case'scrollbox-03':case'scrollbox-04':return 20;default:return null;} return null;}} var dinWhatsForm={config:dinConfigs.dinWhatsAppIntegration,dialogElement:{},formsConfig:{},formId:0,Init:function(){if(this.config&&this.config.forms){dinLogger.Write(dinLogger.DEBUG,"InitWhatsIntegration Called");var url=window.location.href;var appendIn=document.body;dinFunctions.addViewportMetaTag();var style=document.createElement('div');style.id='dinWhatsFormStyle';style.innerHTML=this.cssStyle();appendIn.appendChild(style);var configObject=this.config.forms;if(configObject.length){var shouldDisplay=true,len=configObject.length;dinLogger.Write(dinLogger.DEBUG,"Found "+len+" 'whatsapp integrations");for(var p=0;p @viewport { width: device-width; height: device-height; zoom: 1.0 ; } @-ms-viewport { width: device-width; height: device-height;} .dinWhatsFormDialog { z-index: 999999999; position: fixed; right: 0; bottom: 0;max-width: 80vw; max-height: calc(98vh - 70px); } .dinWhatsFormDialog.dinBottomLeft{right: unset; left: 0;} .dinWhatsFormDialog .dinWhatsFormContent { width: 100%; height: 100%; -webkit-overflow-scrolling:touch; overflow: auto; } .dinWhatsFormDialog > .dinWhatsFormContent iframe { border: 0px; width: 100%; height: 100%; position: absolute; top:0;left:0;right:0;bottom:0;} .dinWhatsFormDialog > .dinWhatsFormContent{ right: 7px; bottom: 70px; position: absolute; visibility: visible; transition: 1s; -webkit-box-shadow: 1px 1px 5px 1px rgba(50, 50, 50, 0.75); -moz-box-shadow: 1px 1px 5px 1px rgba(50, 50, 50, 0.75); box-shadow: 1px 1px 5px 1px rgba(50, 50, 50, 0.75); border-radius: 25px; } .dinWhatsFormDialog.dinBottomLeft > .dinWhatsFormContent{right: 0px; left: 7px;} .dinWhatsFormDialog > .dinWhatsFormContent.hideContent{ right: -300px; opacity: 0; visibility: hidden; transition: 1s; } .dinWhatsFormDialog.dinBottomLeft > .dinWhatsFormContent.hideContent{ right: 0px; left: -300px;} .dinWhatsFormDialog > .dinWhatsFormIco { float: right; position: fixed; opacity: 0.75; bottom: 3px; right: 7px; cursor: pointer; } .dinWhatsFormDialog.dinBottomLeft > .dinWhatsFormIco {float: left; left: 7px; right:unset;} .dinWhatsFormDialog > .dinWhatsFormIco img{ width: 100%; transition: 1s; } .dinWhatsFormDialog > .dinWhatsFormIco .close ~img { opacity: 0; } .dinWhatsFormDialog > .dinWhatsFormIco .close { margin: 7px; display: flex; position: absolute; width: 60%; height: 60%; opacity: .6; border: 4px solid; border-radius: 50%; justify-content: center; align-items: center; } .dinWhatsFormDialog > .dinWhatsFormIco .close:hover { opacity: 1; } .dinWhatsFormDialog > .dinWhatsFormIco .close:before, .dinWhatsFormIco .close:after { position: absolute; content: ' '; height: 80%; width: 6px; background-color: #333; } .dinWhatsFormDialog > .dinWhatsFormIco .close:before { transform: rotate(45deg); } .dinWhatsFormDialog > .dinWhatsFormIco .close:after { transform: rotate(-45deg); } .dinWhatsFormDialog.dinShake > .dinWhatsFormIco { animation: dinShake 5s; animation-iteration-count: infinite; } @keyframes dinShake { 0.0% { transform: translate(1px, 1px) rotate(0deg); } 0.5% { transform: translate(-1px, -2px) rotate(-2deg); } 1.0% { transform: translate(-3px, 0px) rotate(2deg); } 1.5% { transform: translate(3px, 2px) rotate(0deg); } 2.0% { transform: translate(1px, -1px) rotate(2deg); } 2.5% { transform: translate(-1px, 2px) rotate(-2deg); } 3.0% { transform: translate(-3px, 1px) rotate(0deg); } 3.5% { transform: translate(3px, 1px) rotate(-2deg); } 4.0% { transform: translate(-1px, -1px) rotate(2deg); } 4.5% { transform: translate(1px, 2px) rotate(0deg); } 5.0% { transform: translate(1px, -2px) rotate(-2deg); } 5.5% { transform: translate(-1px, -1px) rotate(2deg); } 6.0% { transform: translate(1px, 1px) rotate(0deg); } } `;return style;}} var dinSearchForm={DebugMode:false,Init:function(){let ultimoEmailEnviado='';let funcDetectFillInputEmail=function(event){if(event.target.tagName!=='INPUT'||dinFunctions.hasSkipAttribute(event.target)){return} if(event.target.form&&dinFunctions.hasSkipAttribute(event.target.form)){return} let inputType=event.target.getAttribute("type");inputType=(typeof inputType=='string'?inputType.toLowerCase():'');if(inputType!="text"&&inputType!="email"&&inputType!=""){return} if(event.type==='input'){if(event.target.getAttribute('dinCheckAutoFill')=='1'){return} event.target.setAttribute('dinCheckAutoFill','1');} let tratarValorDoInput=function(){let valorCampo=event.target.value;if(valorCampo===''){return} if(dinFunctions.validateEmail(valorCampo)){if(ultimoEmailEnviado==valorCampo){return} ultimoEmailEnviado=valorCampo;dinLeadTracker.SetLeadEmail(valorCampo);dinLogger.Write(dinLogger.INFO,"Fill input with e-mail "+valorCampo+" by "+event.type+" event");}} if(event.type=="change"){window.setTimeout(tratarValorDoInput,1000);return} tratarValorDoInput()} document.addEventListener('blur',funcDetectFillInputEmail,true);document.addEventListener('input',funcDetectFillInputEmail,true);document.addEventListener('change',funcDetectFillInputEmail,true);if(!dinConfigs.crawlForms){dinLogger.Write(dinLogger.DEBUG,"Forms wont be crawled");return} let funcFindForm=function(){var form=document.getElementsByTagName("form");for(var i=0;i100){elemList[elemName]="(...)";dinLogger.Write(dinLogger.INFO,"Value discarded for large hidden field ",elem);} break;} break;case"SELECT":elemList[elemName]=[];var optionElements=elem.getElementsByTagName('option');for(var y=0;y2&&eventObject[0]=='event'){eventName=eventObject[1];eventObject=eventObject[2];} if(!eventObject){eventObject={};} if(typeof eventObject.purchase!=='undefined'&&eventName==''){eventName='purchase';} if(typeof eventName==='string'&&eventName!=''){for(var i=0;i0){for(let i=0;i0){this.viewItemInfo={id:(prods[0].id||prods[0].item_id||null),name:(prods[0].name||prods[0].item_name),value:prods[0].price,image:dinFunctions.normalizeUrl(prods[0].thumbnail||prods[0].image||null),quantity:1,link:dinFunctions.normalizeUrl(document.location.pathname)};let prod=this.ProductInfo.New();prod.searchInfoInViewPage(this.viewItemInfo);if(this.cartItems.searchItemAndCheckUpdate(prod)==-1){this.interestItems.insertItem(prod.info,'isPageProductDetail');this.sendInterest('product info found');} return}}} if(livemode){dinLogger.Write(dinLogger.DEBUG,"Evento dataLayer não tratado:",args[0]);}},findCart:function(){var foundBtnCheckout=false;let allBtn=document.querySelectorAll('button, a, input[type="submit"]');for(let i=0;i6){continue} if(allBtn[i].clientWidth==0){continue} dinLogger.Write(dinLogger.DEBUG,"Checkout button found",allBtn[i]);foundBtnCheckout=true;break;}} if(!foundBtnCheckout){return false;} return true;},searchCartProducts:function(){this.runSearchCartProducts=1;let hasCart=this.findCart();if(!hasCart){dinLogger.Write(dinLogger.INFO,"Not found cart elements");this.runSearchCartProducts=2;return false;} var selector="";for(let s=0;sthis.maxReturnLevel*(multiLevel-1);r--){let objLevel=dinFunctions.getParentElement(removeBtn,r);let removeBtns=objLevel.querySelectorAll(this.btnRemoveSelector[s]);let counter=0;let identifyStrFirst=null;for(let i=0;i1){continue;} let product=this.ProductInfo.New();if(!product.search(objLevel)){break;} rewind=r;}} if(!rewind){continue;} selector=this.btnRemoveSelector[s];break;} if(selector==""){this.runSearchCartProducts=2;return false;} let removeBtns=document.querySelectorAll(selector);let cartItems=[];for(let i=0;i0){for(let i=0;i30){isAddCart=false} if(!isAddCart){continue} let subElem=allBtn[i].querySelectorAll('*');if(subElem&&subElem.length>6){continue} dinLogger.Write(dinLogger.DEBUG,"Buy button found",allBtn[i]);totalFound++;let fnBuyButton=function(e){let cancelEvent='';if(e.type=='mousedown'){cancelEvent='click';} if(e.type=='click'){cancelEvent='mousedown';} if(cancelEvent){this.removeEventListener(cancelEvent,fnBuyButton);dinLogger.Write(dinLogger.DEBUG,"Event '"+cancelEvent+"' removed");} let isProductPage=false;let ref=dinFunctions.getParentElement(this,dinEcommerceTools.maxReturnLevel);let inputCep=ref.querySelectorAll('input');for(let c=0;c5){stopNow=true;} if(dinEcommerceTools.searchCartProducts()){stopNow=true;} if(stopNow){clearInterval(dinEcommerceTools.checkCartTimer);}},1000);},loadData:function(){this.cartItems.load() this.interestItems.load()},cleanData:function(){this.cartItems.cleanItems();this.interestItems.cleanItems();},updateLeadEmail:function(){if(typeof this.config=="undefined"){return} if(dinConfigs.crawlEcommerce){this.sendCart('update lead email');this.sendInterest('update lead email');}},sendCart:function(source){if(!this.config.hashsUnfinishedPurchase){return;} for(let i=0;i0){for(let i=0;i=unixtime&&this.lastPurchaseSent.amount==amount&&this.lastPurchaseSent.source==source){dinLogger.Write(dinLogger.WARN,"duplicate purchase record ("+source+") Amount:",amount);return} for(let i=0;ivteximg.com.br\/arquivos\/ids\/[0-9]+-)(?[0-9]+)-([0-9]+|auto)\//,rep:'\$256-auto/'},{reg:/(?vtexassets.com\/arquivos\/ids\/[0-9]+-)(?[0-9]+)-([0-9]+|auto)/,rep:'\$256-auto'},{reg:/(?cdn.awsli.com.br\/)(?[0-9]+)x(?[0-9]+)\//,rep:'\$256x256/'},{reg:/(?fbitsstatic.net\/img\/p\/[0-9]+\/[^?]+)\?w=(?[0-9]+)&h=(?[0-9]+)/,rep:'\$?w=256&h=256'},{reg:/(?cdn.vnda.com.br\/)(?[0-9]+)x\//,rep:'\$256x/'},];for(let u=0;u0&&this.list.length==this.maxItems){let removed=this.list.shift();dinLogger.Write(dinLogger.INFO,"Removed item by max items in "+this.typeName+" ("+source+")",removed);} this.list.push(prod);dinLogger.Write(dinLogger.INFO,"Inserted product in "+this.typeName+" ("+source+")",prod);return true;} return false;},removeItem:function(prod,source){let foundPos=this.searchItemAndCheckUpdate(prod);if(foundPos!=-1){let newItems=[];for(let i=0;i=final;};if(ltr){initKey=0;finalKey=allElem.length;increment=1;condition=function(key,final){return key3){continue;} let s=getComputedStyle(allElem[i]);if(s.display.match(/none/g)||allElem[i].offsetParent==null){continue;} if(s.textDecoration.match(/line-through/g)){continue;} var v=allElem[i].textContent.match(re);if(v){elementosComValor.push({obj:allElem[i],value:v[v.length-1].trim()});continue} var v=allElem[i].textContent.match(reC);if(v){elementosComValor.push({obj:allElem[i],value:v[v.length-1].trim()});continue}} let maiorFontSize=0;const fatorPadrao=1.2;for(var i=0;i0){for(let e=0;e img');if(findImage){this.info.image=findImage.getAttribute("src");}} var elemFindPrice=document;var titles=document.querySelectorAll('h1');let strLenFound=0;for(var i=0;istrLenFound){this.info.name=product_name;elemFindPrice=dinFunctions.getParentElement(titles[i].parentElement,dinEcommerceTools.maxReturnLevel);strLenFound=product_name.length;} if(!this.info.name){this.info.name=product_name;elemFindPrice=dinFunctions.getParentElement(titles[i].parentElement,dinEcommerceTools.maxReturnLevel);}}} if(!this.info.name){this.info.name=document.title;} if(!this.info.value){var valuesElem=elemFindPrice.querySelectorAll('.cost, .price, .best-price');for(var i=valuesElem.length-1;i>=0;i--){var subElem=valuesElem[i].querySelectorAll("*") if(subElem&&subElem.length>3){continue;} if(getComputedStyle(valuesElem[i]).textDecoration.match(/line-through/g)){continue;} var v=valuesElem[i].textContent.match(re);if(v){this.info.value=v[v.length-1].trim();break} var v=valuesElem[i].textContent.match(reC);if(v){this.info.value=v[v.length-1].trim();break}}} if(!this.info.quantity){this.info.quantity="1";} return;},searchInfoInMultiCard:function(btnObj){let seletorSame=btnObj.tagName+'[class="'+btnObj.getAttribute('class')+'"]';let sameBtns=document.querySelectorAll(seletorSame);if(sameBtns.length<=1){return;} let par=btnObj.parentElement;let me=par;while(par.querySelectorAll(seletorSame).length==1){me=par;par=par.parentElement;if(!par){return;}} if(!me){return;} this.info.name=dinFunctions.getPriorityContentSelector(me,['h1','h2','h3','img[title]','img[alt]','[title]','p']);this.info.link=dinFunctions.normalizeUrl(document.location.pathname);let image=me.querySelector('img[src]');let findLink=false;if(image){this.info.image=dinFunctions.normalizeUrl(image.getAttribute('src'));let objParent=image;for(let i=0;i<5;i++){objParent=objParent.parentElement;if(!objParent){break} if(objParent.tagName=="A"){let l=objParent.getAttribute('href');if(!l.match(/^#/)&&!l.match(/^javascript/)){this.info.link=dinFunctions.normalizeUrl(l);findLink=true} break}}} if(!findLink){let links=me.querySelectorAll('a[href]');for(let i=0;i=level){console.log.apply(this,slicedArgs);} break;case this.INFO:if(this.mode>=level){console.info.apply(this,slicedArgs);} break;case this.WARN:console.warn.apply(this,slicedArgs);break;case this.ERROR:console.error.apply(this,slicedArgs);break;}}};var DIN_BI_RM="0123456789abcdefghijklmnopqrstuvwxyz";function dinInt2char(n){return DIN_BI_RM.charAt(n);} var dinB64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var dinB64pad="=";function dinHex2b64(h){var i;var c;var ret="";for(i=0;i+3<=h.length;i+=3){c=parseInt(h.substring(i,i+3),16);ret+=dinB64map.charAt(c>>6)+dinB64map.charAt(c&63);} if(i+1==h.length){c=parseInt(h.substring(i,i+1),16);ret+=dinB64map.charAt(c<<2);} else if(i+2==h.length){c=parseInt(h.substring(i,i+2),16);ret+=dinB64map.charAt(c>>2)+dinB64map.charAt((c&3)<<4);} while((ret.length&3)>0){ret+=dinB64pad;} return ret;} var dinExtendStatics=function(d,b){dinExtendStatics=Object.setPrototypeOf||({__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b;})||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p];};return dinExtendStatics(d,b);};function din__extends(d,b){dinExtendStatics(d,b);function __(){this.constructor=d;} d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __());} var dinDecoder$1;var dinBase64={decode:function(a){var i;if(dinDecoder$1===undefined){var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var ignore="= \f\n\r\t\u00A0\u2028\u2029";dinDecoder$1=Object.create(null);for(i=0;i<64;++i){dinDecoder$1[b64.charAt(i)]=i;} for(i=0;i=4){out[out.length]=(bits>>16);out[out.length]=(bits>>8)&0xFF;out[out.length]=bits&0xFF;bits=0;char_count=0;} else{bits<<=6;}} switch(char_count){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:out[out.length]=(bits>>10);break;case 3:out[out.length]=(bits>>16);out[out.length]=(bits>>8)&0xFF;break;} return out;},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(a){var m=dinBase64.re.exec(a);if(m){if(m[1]){a=m[1];} else if(m[2]){a=m[2];} else{throw new Error("RegExp out of sync");}} return dinBase64.decode(a);}};var dinMax=10000000000000;var dinInt10=(function(){function Int10(value){this.buf=[+value||0];} Int10.prototype.mulAdd=function(m,c){var b=this.buf;var l=b.length;var i;var t;for(i=0;i0){b[i]=c;}};Int10.prototype.sub=function(c){var b=this.buf;var l=b.length;var i;var t;for(i=0;i=0;--i){s+=(dinMax+b[i]).toString().substring(1);} return s;};Int10.prototype.valueOf=function(){var b=this.buf;var v=0;for(var i=b.length-1;i>=0;--i){v=v*dinMax+b[i];} return v;};Int10.prototype.simplify=function(){var b=this.buf;return(b.length==1)?b[0]:this;};return Int10;}());var dinStream=(function(){function Stream(enc,pos){this.hexDigits="0123456789ABCDEF";if(enc instanceof Stream){this.enc=enc.enc;this.pos=enc.pos;} else{this.enc=enc;this.pos=pos;}} Stream.prototype.get=function(pos){if(pos===undefined){pos=this.pos++;} if(pos>=this.enc.length){throw new Error("Requesting byte offset "+pos+" on a stream of length "+this.enc.length);} return("string"===typeof this.enc)?this.enc.charCodeAt(pos):this.enc[pos];};Stream.prototype.hexByte=function(b){return this.hexDigits.charAt((b>>4)&0xF)+this.hexDigits.charAt(b&0xF);};Stream.prototype.hexDump=function(start,end,raw){var s="";for(var i=start;i6){throw new Error("Length over 48 bits not supported at position "+(stream.pos-1));} if(len===0){return null;} buf=0;for(var i=0;i>6;this.tagConstructed=((buf&0x20)!==0);this.tagNumber=buf&0x1F;if(this.tagNumber==0x1F){var n=new dinInt10();do{buf=stream.get();n.mulAdd(128,buf&0x7F);}while(buf&0x80);this.tagNumber=n.simplify();}} ASN1Tag.prototype.isUniversal=function(){return this.tagClass===0x00;};ASN1Tag.prototype.isEOC=function(){return this.tagClass===0x00&&this.tagNumber===0x00;};return ASN1Tag;}());var dinDbits;var dinCanary=0xdeadbeefcafe;var dinJ_lm=((dinCanary&0xffffff)==0xefcafe);var dinBigInteger=(function(){function BigInteger(a,b,c){if(a!=null){if("number"==typeof a){console.warn("REMOVED")} else if(b==null&&"string"!=typeof a){this.fromString(a,256);} else{this.fromString(a,b);}}} BigInteger.prototype.toString=function(b){if(this.s<0){return"-"+this.negate().toString(b);} var k;if(b==16){k=4;} else if(b==8){k=3;} else if(b==2){k=1;} else if(b==32){k=5;} else if(b==4){k=2;} else{return this.toRadix(b);} var km=(1<0){if(p>p)>0){m=true;r=dinInt2char(d);} while(i>=0){if(p>(p+=this.DB-k);} else{d=(this[i]>>(p-=k))&km;if(p<=0){p+=this.DB;--i;}} if(d>0){m=true;} if(m){r+=dinInt2char(d);}}} return m?r:"0";};BigInteger.prototype.negate=function(){var r=dinNbi();BigInteger.ZERO.subTo(this,r);return r;};BigInteger.prototype.abs=function(){return(this.s<0)?this.negate():this;};BigInteger.prototype.compareTo=function(a){var r=this.s-a.s;if(r!=0){return r;} var i=this.t;r=i-a.t;if(r!=0){return(this.s<0)?-r:r;} while(--i>=0){if((r=this[i]-a[i])!=0){return r;}} return 0;};BigInteger.prototype.bitLength=function(){if(this.t<=0){return 0;} return this.DB*(this.t-1)+dinNbits(this[this.t-1]^(this.s&this.DM));};BigInteger.prototype.mod=function(a){var r=dinNbi();this.abs().divRemTo(a,null,r);if(this.s<0&&r.compareTo(BigInteger.ZERO)>0){a.subTo(r,r);} return r;};BigInteger.prototype.modPowInt=function(e,m){var z;if(e<256||m.isEven()){z=new dinClassic(m);} else{z=new dinMontgomery(m);} return this.exp(e,z);};BigInteger.prototype.clone=function(){var r=dinNbi();this.copyTo(r);return r;};BigInteger.prototype.intValue=function(){if(this.s<0){if(this.t==1){return this[0]-this.DV;} else if(this.t==0){return-1;}} else if(this.t==1){return this[0];} else if(this.t==0){return 0;} return((this[1]&((1<<(32-this.DB))-1))<0)?this:a;};BigInteger.prototype.not=function(){var r=dinNbi();for(var i=0;i=0;--i){r[i]=this[i];} r.t=this.t;r.s=this.s;};BigInteger.prototype.fromInt=function(x){this.t=1;this.s=(x<0)?-1:0;if(x>0){this[0]=x;} else if(x<-1){this[0]=x+this.DV;} else{this.t=0;}};BigInteger.prototype.fromString=function(s,b){var k;if(b==16){k=4;} else if(b==8){k=3;} else if(b==256){k=8;} else if(b==2){k=1;} else if(b==32){k=5;} else if(b==4){k=2;} else{this.fromRadix(s,b);return;} this.t=0;this.s=0;var i=s.length;var mi=false;var sh=0;while(--i>=0){var x=(k==8)?(+s[i])&0xff:dinIntAt(s,i);if(x<0){if(s.charAt(i)=="-"){mi=true;} continue;} mi=false;if(sh==0){this[this.t++]=x;} else if(sh+k>this.DB){this[this.t-1]|=(x&((1<<(this.DB-sh))-1))<>(this.DB-sh));} else{this[this.t-1]|=x<=this.DB){sh-=this.DB;}} if(k==8&&((+s[0])&0x80)!=0){this.s=-1;if(sh>0){this[this.t-1]|=((1<<(this.DB-sh))-1)<0&&this[this.t-1]==c){--this.t;}};BigInteger.prototype.dlShiftTo=function(n,r){var i;for(i=this.t-1;i>=0;--i){r[i+n]=this[i];} for(i=n-1;i>=0;--i){r[i]=0;} r.t=this.t+n;r.s=this.s;};BigInteger.prototype.drShiftTo=function(n,r){for(var i=n;i=0;--i){r[i+ds+1]=(this[i]>>cbs)|c;c=(this[i]&bm)<=0;--i){r[i]=0;} r[ds]=c;r.t=this.t+ds+1;r.s=this.s;r.clamp();};BigInteger.prototype.rShiftTo=function(n,r){r.s=this.s;var ds=Math.floor(n/this.DB);if(ds>=this.t){r.t=0;return;} var bs=n%this.DB;var cbs=this.DB-bs;var bm=(1<>bs;for(var i=ds+1;i>bs;} if(bs>0){r[this.t-ds-1]|=(this.s&bm)<>=this.DB;} if(a.t>=this.DB;} c+=this.s;} else{c+=this.s;while(i>=this.DB;} c-=a.s;} r.s=(c<0)?-1:0;if(c<-1){r[i++]=this.DV+c;} else if(c>0){r[i++]=c;} r.t=i;r.clamp();};BigInteger.prototype.multiplyTo=function(a,r){var x=this.abs();var y=a.abs();var i=x.t;r.t=i+y.t;while(--i>=0){r[i]=0;} for(i=0;i=0){r[i]=0;} for(i=0;i=x.DV){r[i+x.t]-=x.DV;r[i+x.t+1]=1;}} if(r.t>0){r[r.t-1]+=x.am(i,x[i],r,2*i,0,1);} r.s=0;r.clamp();};BigInteger.prototype.divRemTo=function(m,q,r){var pm=m.abs();if(pm.t<=0){return;} var pt=this.abs();if(pt.t0){pm.lShiftTo(nsh,y);pt.lShiftTo(nsh,r);} else{pm.copyTo(y);pt.copyTo(r);} var ys=y.t;var y0=y[ys-1];if(y0==0){return;} var yt=y0*(1<1)?y[ys-2]>>this.F2:0);var d1=this.FV/yt;var d2=(1<=0){r[r.t++]=1;r.subTo(t,r);} BigInteger.ONE.dlShiftTo(ys,t);t.subTo(y,y);while(y.t=0){var qd=(r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);if((r[i]+=y.am(0,qd,r,j,0,ys))0){r.rShiftTo(nsh,r);} if(ts<0){BigInteger.ZERO.subTo(r,r);}};BigInteger.prototype.invDigit=function(){if(this.t<1){return 0;} var x=this[0];if((x&1)==0){return 0;} var y=x&3;y=(y*(2-(x&0xf)*y))&0xf;y=(y*(2-(x&0xff)*y))&0xff;y=(y*(2-(((x&0xffff)*y)&0xffff)))&0xffff;y=(y*(2-x*y%this.DV))%this.DV;return(y>0)?this.DV-y:-y;};BigInteger.prototype.isEven=function(){return((this.t>0)?(this[0]&1):this.s)==0;};BigInteger.prototype.exp=function(e,z){if(e>0xffffffff||e<1){return BigInteger.ONE;} var r=dinNbi();var r2=dinNbi();var g=z.convert(this);var i=dinNbits(e)-1;g.copyTo(r);while(--i>=0){z.sqrTo(r,r2);if((e&(1<0){z.mulTo(r2,g,r);} else{var t=r;r=r2;r2=t;}} return z.revert(r);};BigInteger.prototype.chunkSize=function(r){return Math.floor(Math.LN2*this.DB/Math.log(r));};BigInteger.prototype.toRadix=function(b){if(b==null){b=10;} if(this.signum()==0||b<2||b>36){return"0";} var cs=this.chunkSize(b);var a=Math.pow(b,cs);var d=dinNbv(a);var y=dinNbi();var z=dinNbi();var r="";this.divRemTo(d,y,z);while(y.signum()>0){r=(a+z.intValue()).toString(b).substr(1)+r;y.divRemTo(d,y,z);} return z.intValue().toString(b)+r;};BigInteger.prototype.fromRadix=function(s,b){this.fromInt(0);if(b==null){b=10;} var cs=this.chunkSize(b);var d=Math.pow(b,cs);var mi=false;var j=0;var w=0;for(var i=0;i=cs){this.dMultiply(d);this.dAddOffset(w,0);j=0;w=0;}} if(j>0){this.dMultiply(Math.pow(b,j));this.dAddOffset(w,0);} if(mi){BigInteger.ZERO.subTo(this,this);}};BigInteger.prototype.dMultiply=function(n){this[this.t]=this.am(0,n-1,this,0,0,this.t);++this.t;this.clamp();};BigInteger.prototype.dAddOffset=function(n,w){if(n==0){return;} while(this.t<=w){this[this.t++]=0;} this[w]+=n;while(this[w]>=this.DV){this[w]-=this.DV;if(++w>=this.t){this[this.t++]=0;} ++this[w];}};BigInteger.prototype.square=function(){var r=dinNbi();this.squareTo(r);return r;};return BigInteger;}());var dinNullExp=(function(){function NullExp(){} NullExp.prototype.convert=function(x){return x;};NullExp.prototype.revert=function(x){return x;};NullExp.prototype.mulTo=function(x,y,r){x.multiplyTo(y,r);};NullExp.prototype.sqrTo=function(x,r){x.squareTo(r);};return NullExp;}());var dinClassic=(function(){function Classic(m){this.m=m;} Classic.prototype.convert=function(x){if(x.s<0||x.compareTo(this.m)>=0){return x.mod(this.m);} else{return x;}};Classic.prototype.revert=function(x){return x;};Classic.prototype.reduce=function(x){x.divRemTo(this.m,null,x);};Classic.prototype.mulTo=function(x,y,r){x.multiplyTo(y,r);this.reduce(r);};Classic.prototype.sqrTo=function(x,r){x.squareTo(r);this.reduce(r);};return Classic;}());var dinMontgomery=(function(){function Montgomery(m){this.m=m;this.mp=m.invDigit();this.mpl=this.mp&0x7fff;this.mph=this.mp>>15;this.um=(1<<(m.DB-15))-1;this.mt2=2*m.t;} Montgomery.prototype.convert=function(x){var r=dinNbi();x.abs().dlShiftTo(this.m.t,r);r.divRemTo(this.m,null,r);if(x.s<0&&r.compareTo(dinBigInteger.ZERO)>0){this.m.subTo(r,r);} return r;};Montgomery.prototype.revert=function(x){var r=dinNbi();x.copyTo(r);this.reduce(r);return r;};Montgomery.prototype.reduce=function(x){while(x.t<=this.mt2){x[x.t++]=0;} for(var i=0;i>15)*this.mpl)&this.um)<<15))&x.DM;j=i+this.m.t;x[j]+=this.m.am(0,u0,x,i,0,this.m.t);while(x[j]>=x.DV){x[j]-=x.DV;x[++j]++;}} x.clamp();x.drShiftTo(this.m.t,x);if(x.compareTo(this.m)>=0){x.subTo(this.m,x);}};Montgomery.prototype.mulTo=function(x,y,r){x.multiplyTo(y,r);this.reduce(r);};Montgomery.prototype.sqrTo=function(x,r){x.squareTo(r);this.reduce(r);};return Montgomery;}());function dinNbi(){return new dinBigInteger(null);} function dinParseBigInt(str,r){return new dinBigInteger(str,r);} function dinAm1(i,x,w,j,c,n){while(--n>=0){var v=x*this[i++]+w[j]+c;c=Math.floor(v/0x4000000);w[j++]=v&0x3ffffff;} return c;} function dinAm2(i,x,w,j,c,n){var xl=x&0x7fff;var xh=x>>15;while(--n>=0){var l=this[i]&0x7fff;var h=this[i++]>>15;var m=xh*l+h*xl;l=xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);c=(l>>>30)+(m>>>15)+xh*h+(c>>>30);w[j++]=l&0x3fffffff;} return c;} function dinAm3(i,x,w,j,c,n){var xl=x&0x3fff;var xh=x>>14;while(--n>=0){var l=this[i]&0x3fff;var h=this[i++]>>14;var m=xh*l+h*xl;l=xl*l+((m&0x3fff)<<14)+w[j]+c;c=(l>>28)+(m>>14)+xh*h;w[j++]=l&0xfffffff;} return c;} if(dinJ_lm&&(navigator.appName=="Microsoft Internet Explorer")){dinBigInteger.prototype.am=dinAm2;dinDbits=30;} else if(dinJ_lm&&(navigator.appName!="Netscape")){dinBigInteger.prototype.am=dinAm1;dinDbits=26;} else{dinBigInteger.prototype.am=dinAm3;dinDbits=28;} dinBigInteger.prototype.DB=dinDbits;dinBigInteger.prototype.DM=((1<>>16)!=0){x=t;r+=16;} if((t=x>>8)!=0){x=t;r+=8;} if((t=x>>4)!=0){x=t;r+=4;} if((t=x>>2)!=0){x=t;r+=2;} if((t=x>>1)!=0){x=t;r+=1;} return r;} dinBigInteger.ZERO=dinNbv(0);dinBigInteger.ONE=dinNbv(1);var dinArcfour=(function(){function Arcfour(){this.i=0;this.j=0;this.S=[];} Arcfour.prototype.init=function(key){var i;var j;var t;for(i=0;i<256;++i){this.S[i]=i;} j=0;for(i=0;i<256;++i){j=(j+this.S[i]+key[i%key.length])&255;t=this.S[i];this.S[i]=this.S[j];this.S[j]=t;} this.i=0;this.j=0;};Arcfour.prototype.next=function(){var t;this.i=(this.i+1)&255;this.j=(this.j+this.S[this.i])&255;t=this.S[this.i];this.S[this.i]=this.S[this.j];this.S[this.j]=t;return this.S[(t+this.S[this.i])&255];};return Arcfour;}());function dinPrng_newstate(){return new dinArcfour();} var dinRng_psize=256;var dinRng_state;var dinRng_pool=null;var dinRng_pptr;if(dinRng_pool==null){dinRng_pool=[];dinRng_pptr=0;var dinT=void 0;if(window.crypto&&window.crypto.getRandomValues){var z=new Uint32Array(256);window.crypto.getRandomValues(z);for(dinT=0;dinT=256||dinRng_pptr>=dinRng_psize){if(window.removeEventListener){window.removeEventListener("mousemove",onMouseMoveListener_1,false);} else if(window.detachEvent){window.detachEvent("onmousemove",onMouseMoveListener_1);} return;} try{var mouseCoordinates=ev.x+ev.y;dinRng_pool[dinRng_pptr++]=mouseCoordinates&255;this.count+=1;} catch(e){}};if(window.addEventListener){window.addEventListener("mousemove",onMouseMoveListener_1,false);} else if(window.attachEvent){window.attachEvent("onmousemove",onMouseMoveListener_1);}} function dinRng_get_byte(){if(dinRng_state==null){dinRng_state=dinPrng_newstate();while(dinRng_pptr=0&&n>0){var c=s.charCodeAt(i--);if(c<128){ba[--n]=c;} else if((c>127)&&(c<2048)){ba[--n]=(c&63)|128;ba[--n]=(c>>6)|192;} else{ba[--n]=(c&63)|128;ba[--n]=((c>>6)&63)|128;ba[--n]=(c>>12)|224;}} ba[--n]=0;var rng=new dinSecureRandom();var x=[];while(n>2){x[0]=0;while(x[0]==0){rng.nextBytes(x);} ba[--n]=x[0];} ba[--n]=2;ba[--n]=0;return new dinBigInteger(ba);} var dinRSAKey=(function(){function RSAKey(){this.n=null;this.e=0;this.d=null;this.p=null;this.q=null;this.dmp1=null;this.dmq1=null;this.coeff=null;} RSAKey.prototype.doPublic=function(x){return x.modPowInt(this.e,this.n);};RSAKey.prototype.encrypt=function(text){var m=dinPkcs1pad2(text,(this.n.bitLength()+7)>>3);if(m==null){return null;} var c=this.doPublic(m);if(c==null){return null;} var h=c.toString(16);if((h.length&1)==0){return h;} else{return"0"+h;}};return RSAKey;}());var dinJSEncryptRSAKey=(function(_super){din__extends(JSEncryptRSAKey,_super);function JSEncryptRSAKey(key){var _this=_super.call(this)||this;if(key){if(typeof key==="string"){_this.parseKey(key);} else if(JSEncryptRSAKey.hasPrivateKeyProperty(key)||JSEncryptRSAKey.hasPublicKeyProperty(key)){_this.parsePropertiesFrom(key);}} return _this;} JSEncryptRSAKey.prototype.parseKey=function(pem){try{var modulus=0;var public_exponent=0;var reHex=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/;var der=reHex.test(pem)?Hex.decode(pem):dinBase64.unarmor(pem);var asn1=dinASN1.decode(der);if(asn1.sub.length===3){asn1=asn1.sub[2].sub[0];} if(asn1.sub.length===9){modulus=asn1.sub[1].getHexStringValue();this.n=dinParseBigInt(modulus,16);public_exponent=asn1.sub[2].getHexStringValue();this.e=parseInt(public_exponent,16);var private_exponent=asn1.sub[3].getHexStringValue();this.d=dinParseBigInt(private_exponent,16);var prime1=asn1.sub[4].getHexStringValue();this.p=dinParseBigInt(prime1,16);var prime2=asn1.sub[5].getHexStringValue();this.q=dinParseBigInt(prime2,16);var exponent1=asn1.sub[6].getHexStringValue();this.dmp1=dinParseBigInt(exponent1,16);var exponent2=asn1.sub[7].getHexStringValue();this.dmq1=dinParseBigInt(exponent2,16);var coefficient=asn1.sub[8].getHexStringValue();this.coeff=dinParseBigInt(coefficient,16);} else if(asn1.sub.length===2){var bit_string=asn1.sub[1];var sequence=bit_string.sub[0];modulus=sequence.sub[0].getHexStringValue();this.n=dinParseBigInt(modulus,16);public_exponent=sequence.sub[1].getHexStringValue();this.e=parseInt(public_exponent,16);} else{return false;} return true;} catch(ex){return false;}};JSEncryptRSAKey.hasPublicKeyProperty=function(obj){obj=obj||{};return(obj.hasOwnProperty("n")&&obj.hasOwnProperty("e"));};JSEncryptRSAKey.prototype.parsePropertiesFrom=function(obj){this.n=obj.n;this.e=obj.e;if(obj.hasOwnProperty("d")){this.d=obj.d;this.p=obj.p;this.q=obj.q;this.dmp1=obj.dmp1;this.dmq1=obj.dmq1;this.coeff=obj.coeff;}};return JSEncryptRSAKey;}(dinRSAKey));var DinJSEncrypt=(function(){function DinJSEncrypt(options){options=options||{};this.default_key_size=parseInt(options.default_key_size,10)||1024;this.default_public_exponent=options.default_public_exponent||"010001";this.log=true;this.key=null;} DinJSEncrypt.prototype.setKey=function(key){if(this.log&&this.key){console.warn("A key was already set, overriding existing.");} this.key=new dinJSEncryptRSAKey(key);};DinJSEncrypt.prototype.setPublicKey=function(pubkey){this.setKey(pubkey);};DinJSEncrypt.prototype.encrypt=function(str){try{return dinHex2b64(this.getKey().encrypt(str));} catch(ex){return false;}};DinJSEncrypt.prototype.getKey=function(cb){if(!this.key){this.key=new dinJSEncryptRSAKey();if(cb&&{}.toString.call(cb)==="[object Function]"){this.key.generateAsync(this.default_key_size,this.default_public_exponent,cb);return;} this.key.generate(this.default_key_size,this.default_public_exponent);} return this.key;};DinJSEncrypt.version="3.0.0-rc.1";return DinJSEncrypt;}());window.DinJSEncrypt=DinJSEncrypt;var dinLeadTracker={COOKIE_NAME:"dinLeadTrack",TYPE_EMAIL:"EM",TYPE_EXTERNAL_CODE:"CE",TYPE_ID:"ID",TYPE_POSCLICK:"PC",POSCLICK_URL:"https://receiver.posclick.dinamize.com",PUBLIC_KEY:"-----BEGIN RSA PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsXbGia7iTXEjq1/K2+Sj\nJA519Kvm4AloHv/gG9iu+9NrEMG8VMmI7eX9qBOoJk+qX13+mQaP2xbJP3XUYqsf\nPFDHjCyGNN3BfneZ8lAexr3JvMYw2DTKL4QNSTix8V3SPoBaqpCfm7BwTulng1YB\n9MZUJjv0Cjp3auICiOZEtfJPWd74YJ5NfgJYYU4q6ub/CNSgcgRzqZyciPFP7Hy7\nyLF17UF+miteKzOLfE+v6E9uTcT5drObBoTTlmXoRW1nBi90huZdz+wxIH1xm6S+\nmcDUDec6S7KXzRjseNgL2NsRNuE35M6exYQD2XLPkS5yDc8JdhswTeWJghHfIY4V\nHQIDAQAB\n-----END RSA PUBLIC KEY-----",LastUrlPosted:"",StoredPosclickId:"",DebugMode:false,Init:function(){if(this.isActive()){dinLogger.Write(dinLogger.DEBUG,"LeadTracking is active");}else{dinLogger.Write(dinLogger.DEBUG,"LeadTracking is inactive");return} var referer=dinFunctions.getReferrer();var hostname=window.location.hostname;if(referer!==""&&referer!=hostname){this.setReferrer(referer);} var query=dinFunctions.getQueryParams(document.location.search);if(typeof query.__dPosclick!=="undefined"){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: Posclick info detected");if(this.getUserConsent()){this.setLeadPosclick(query.__dPosclick);return} dinLogger.Write(dinLogger.DEBUG,"LeadTracker: Posclick info will be used when the user give consent to be tracked");this.StoredPosclickId=query.__dPosclick;return} this.post();},encrypt:function(str){if(str.length>245){dinLogger.Write(dinLogger.ERROR,"LeadTracker: Email is too big for encryption");return;} var encrypt=new DinJSEncrypt({"default_key_size":2048});encrypt.setPublicKey(this.PUBLIC_KEY);str=encrypt.encrypt(str);str=dinFunctions.replaceAll(str,"+","-") str=dinFunctions.replaceAll(str,"/","_") return str;},SetLeadEmail:function(email){if(typeof email!=="string"||email.trim()===""){return} if(dinFunctions.isExampleEmail(email)){return} if(!this.getUserConsent()){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: The user didnt give consent to save his info on cookies");return} this.setCookieUserInfo(this.TYPE_EMAIL,this.encrypt(email));dinEcommerceTools.updateLeadEmail();},SetLeadExternalId:function(id){if(typeof id!=="string"){return} this.setCookieUserInfo(this.TYPE_EXTERNAL_CODE,id);},setLeadPosclick:function(pcInfo){this.setCookieUserInfo(this.TYPE_POSCLICK,pcInfo);},SetLeadId:function(id){if(typeof id==="number"){id=id.toString(10);} if(typeof id!=="string"||id.trim()===""){return} this.setCookieUserInfo(this.TYPE_ID,id);},RemoveLeadInfo:function(){this.LastUrlPosted="";dinFunctions.deleteCookie(this.COOKIE_NAME);},hasCookieInfo:function(){let cookieObj=this.getCookieObj();if(typeof cookieObj.user_info_type!=="undefined"&&typeof cookieObj.user_info!=="undefined"){return true;} return false;},getCookieObj:function(){var cookie=dinFunctions.getCookie(this.COOKIE_NAME);var cookieObj={};if(cookie!==""){cookieObj=JSON.parse(atob(cookie));} return cookieObj;},setCookieObj:function(cookieObj){var cookieData=btoa(JSON.stringify(cookieObj));dinFunctions.setCookie(this.COOKIE_NAME,cookieData,90);},setCookieUserInfo:function(user_info_type,user_info){if(!this.isActive()){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: Will not set cookie. LeadTracker is inactive");return} if(!this.getUserConsent()){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: The user didnt give consent to save his info on cookies");return} this.StoredPosclickId="";dinLogger.Write(dinLogger.DEBUG,"LeadTracker: Setting lead info on cookie. Type:["+user_info_type+"]");var cookieObj=dinLeadTracker.getCookieObj();cookieObj.user_info_type=user_info_type;cookieObj.user_info=user_info;dinLeadTracker.setCookieObj(cookieObj);this.post();},SetUserConsent:function(consent){var cookieObj=dinLeadTracker.getCookieObj();cookieObj.consent=consent;if(!consent){cookieObj.user_info_type=undefined;cookieObj.user_info=undefined;} dinLeadTracker.setCookieObj(cookieObj);if(consent&&this.StoredPosclickId!=""){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: Consent given. The stored posclick info will be used");this.setLeadPosclick(this.StoredPosclickId);}},getUserConsent:function(){if(!this.isActive()){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: Will not set cookie. LeadTracker is inactive");return} if(typeof dinConfigs.leadTracking.REQUIRE_CONSENT==="undefined"||!dinConfigs.leadTracking.REQUIRE_CONSENT){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: Will not ask for consent") return true;} var cookieObj=dinLeadTracker.getCookieObj();if(typeof cookieObj.consent==="undefined"){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: No consent info on cookie") return false;} return cookieObj.consent;},isActive:function(){if(typeof dinConfigs.leadTracking==="undefined"||dinConfigs.leadTracking==null){return false;} if(typeof dinConfigs.leadTracking.ACTIVE==="undefined"||dinConfigs.leadTracking.ACTIVE==null){return false;} return dinConfigs.leadTracking.ACTIVE},validate:function(ignoreCookie){if(typeof ignoreCookie!=="boolean"){ignoreCookie=false;} if(!this.isActive()){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: Inactive");return false;} if(!this.getUserConsent()){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: The user didnt give consent to be tracked") return false;} if(this.LastUrlPosted===dinFunctions.getDomainPathUrl()){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: This url was already posted");return false;} if(!ignoreCookie){var cookieObj=dinLeadTracker.getCookieObj();if(typeof cookieObj.user_info_type==="undefined"||typeof cookieObj.user_info==="undefined"){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: There is no user info on cookie to post");return false;}} return this.checkUrlRules();},checkUrlRules:function(){var url=window.location.href;if(typeof dinConfigs.leadTracking.HISTORY_URL_RULES==="undefined"||dinConfigs.leadTracking.HISTORY_URL_RULES.length===0){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: No history config. All browsing will be tracked");return true;} if(dinFunctions.matchesRulesParser(url,dinConfigs.leadTracking.HISTORY_URL_RULES,"TYPE","VALUE")){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: This url matched a history rule");return true;} var list=dinConfigs.leadTracking.LIST;if(typeof dinConfigs.leadTracking.AUTOMATION_URL_RULES==="undefined"||dinConfigs.leadTracking.AUTOMATION_URL_RULES.length===0||typeof dinConfigs.leadTracking.AUTOMATION_URL_RULES[list]==="undefined"||dinConfigs.leadTracking.AUTOMATION_URL_RULES[list].length===0){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: This url didnt match any rules");return false;} var triggers=dinConfigs.leadTracking.AUTOMATION_URL_RULES[list];for(trigId in triggers){if(triggers[trigId].RULES.length===0){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: Found an automation without url rules. All browsing will be tracked");return true;} if(dinFunctions.matchesRulesParser(url,triggers[trigId].RULES,"TYPE","VALUE")){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: This url matched a automation rule");return true;}} dinLogger.Write(dinLogger.DEBUG,"LeadTracker: Url didnt match any rule");return false;},setReferrer:function(referer){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: Trying to set referrer");if(typeof referer!=="string"||referer===""){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: Empty referrer");return} var cookieObj=dinLeadTracker.getCookieObj();if(cookieObj.referrer_posted){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: Referrer already posted");return} dinLogger.Write(dinLogger.DEBUG,"LeadTracker: Setting referrer");if(cookieObj.referrer!==referer){cookieObj.referrer=referer;cookieObj.referrer_posted=false;dinLeadTracker.setCookieObj(cookieObj);}},useReferrer:function(){var cookieObj=dinLeadTracker.getCookieObj();if(typeof cookieObj.referrer==="undefined"||cookieObj.referrer===""){return"";} if(typeof cookieObj.referrer_posted==="undefined"||cookieObj.referrer_posted){return"";} cookieObj.referrer_posted=true;dinLeadTracker.setCookieObj(cookieObj);return cookieObj.referrer;},post:function(){dinLogger.Write(dinLogger.DEBUG,"LeadTracker: Starting to post");if(!this.validate()){return} var cookieObj=dinLeadTracker.getCookieObj();var params=[{"type":cookieObj.user_info_type},{"value":cookieObj.user_info},{"list":dinConfigs.leadTracking.LIST},{"s":dinConfigs.siteCode},{"x-referrer":window.location.href}];var referrer=this.useReferrer();if(referrer!==""){params.push({"referrer":referrer})} this.LastUrlPosted=dinFunctions.getDomainPathUrl();dinFunctions.request("POST",this.POSCLICK_URL+"/leadtracking/"+dinConfigs.leadTracking.HASH+"/"+dinConfigs.clientCode+"/",params);dinLogger.Write(dinLogger.DEBUG,"LeadTracker: Access submitted successfully");}} var _dPosclickSite=String(dinConfigs.siteCode);var dinPosclick={version:"1.0",Init:function(){var query=this.getQueryParams(document.location.search);if(query.__dPosclick!=undefined){this.setCookie('_dPosclickCookie',query.__dPosclick);} var value=this.getCookie("_dPosclickCookie");if(value!=null&&value!=""){var tagScript=document.createElement('script');tagScript.type='text/javascript';tagScript.async=true;tagScript.src='https://receiver.posclick.dinamize.com/posclick/js/'+this.version+'?dPosclickCookie='+value+'&dPosclickSite='+dinConfigs.siteCode;var altScriptTag=document.getElementsByTagName('script')[0];altScriptTag.parentNode.insertBefore(tagScript,altScriptTag);}},getQueryParams:function(querystring){querystring=querystring.split("+").join(" ");var params={},tokens,regexpStr=/[?&]?([^=]+)=([^&]*)/g;while(tokens=regexpStr.exec(querystring)){params[decodeURIComponent(tokens[1])]=decodeURIComponent(tokens[2]);} return params;},setCookie:function(name,val){var Exdate=new Date();var Time=Exdate.getTime();Time+=3600*1000;Exdate.setTime(Time);document.cookie=name+'='+val+'; expires='+Exdate.toGMTString()+'; path=/';},getCookie:function(name){var I,X,Y,arrayCookies=document.cookie.split(";");for(I=0;I=3){text=form.elements[fieldName+"_DDI"].value res=text.match(patPhone);if(res!==null){resultDDI=res.join("");form.elements[fieldName].value=resultDDI+resultNum;}else{this.addClass("field-error",form.elements[fieldName+"_DDI"]);enviar=false;}}} if(classList.indexOf("field-required")!=-1){if(classList.indexOf("type_LVM")==-1){if(elem[i].value.trim()==""){this.addClass("field-error",elem[i]);enviar=false;}} if(classList.indexOf("type_LVM")!=-1){var hdName=elem[i].getAttribute("hd-name");var ok=false;this.removeClass("field-error",form.getElementsByClassName("containerMultiple_"+hdName)[0]);var checkboxes=form.getElementsByClassName("chk_"+hdName);for(var j=0;j0){for(var k=0;k=200&&xmlhttp.status<=299){if((form.elements["redirect-url-pp"].value.includes(window.location.origin))){parent.location.href=form.elements["redirect-url-pp"].value;}else{window.open(form.elements["redirect-url-pp"].value,"_blank");}dinForms.Spinner(form,false);dinForms.ResetFormValues(form);}else{dinForms.Spinner(form,false);var msgErrorDep=form.getElementsByClassName("divMessageError")[0];if(msgErrorDep){msgErrorDep.style.display="block";} var msgAlert=form.getElementsByClassName("DinamizeDivMessageAlert")[0];if(msgAlert){msgAlert.style.display="block";}}}};if(typeof params==="string"&¶ms!==""){url+="?"+params;} xmlhttp.open("POST",url,true);xmlhttp.send();},Spinner:function(form,show){var submitElement=form.getElementsByClassName("dinSubmit")[0];var spinnerElement=form.getElementsByClassName("spinner")[0];if(show){if(spinnerElement) spinnerElement.style.display="block";if(submitElement) submitElement.value="";}else{if(spinnerElement) spinnerElement.style.display="none";if(submitElement) submitElement.value=submitElement.getAttribute("original-value");}},GetCookie:function(cname){var name=cname+"=";var decodedCookie=decodeURIComponent(document.cookie);var ca=decodedCookie.split(";");for(var i=0;i=0;i=i-1){if(form.elements[i].name===""){continue}switch(form.elements[i].nodeName){case"INPUT":switch(form.elements[i].type){case"text":case"hidden":case"password":case"button":case"reset":case"submit":q.push(form.elements[i].name+"="+encodeURIComponent(form.elements[i].value));break;case"checkbox":case"radio":if(form.elements[i].checked){q.push(form.elements[i].name+"="+encodeURIComponent(form.elements[i].value))}break;case"file":break}break;case"TEXTAREA":q.push(form.elements[i].name+"="+encodeURIComponent(form.elements[i].value));break;case"SELECT":switch(form.elements[i].type){case"select-one":q.push(form.elements[i].name+"="+encodeURIComponent(form.elements[i].value));break;case"select-multiple":for(j=form.elements[i].options.length-1;j>=0;j=j-1){if(form.elements[i].options[j].selected){q.push(form.elements[i].name+"="+encodeURIComponent(form.elements[i].options[j].value))}}break}break;case"BUTTON":switch(form.elements[i].type){case"reset":case"submit":case"button":q.push(form.elements[i].name+"="+encodeURIComponent(form.elements[i].value));break}break}}return q.join("&")},};} if(typeof dinControllerLoadFunction=='undefined'){var dinControllerLoadFunction=1;} function dinLoadFunction(){if(typeof dinControllerLoadFunction!='undefined'&&dinControllerLoadFunction!=1){dinLogger.Write(dinLogger.WARN,"dinLoadFunction duplicate call");return;} dinControllerLoadFunction=0;dinLogger.Write(dinLogger.DEBUG,"dinLoadFunction called");let referer=dinFunctions.getReferrer();let hostname=window.location.hostname;if(referer!=hostname){let jsonParams={"url":window.location.href,"referer":document.referrer};let cookieData=btoa(JSON.stringify(jsonParams));dinFunctions.setCookie('dinTrafficSource',cookieData,90);} dinTargetForm.Init();dinWhatsForm.Init();dinSearchForm.Init();dinEcommerceTools.Init();dinLeadTracker.Init();dinPosclick.Init();dinForms.onLoad();dinLogger.Write(dinLogger.DEBUG,"dinLoadFunction done");} if(dinConfigs.logLevel!==undefined){dinLogger.Set(dinConfigs.logLevel);} if(localStorage.getItem('dinConfigs_logLevel')!==null){dinLogger.Set(parseInt(localStorage.getItem('dinConfigs_logLevel')));} if(document.readyState==='complete'){dinLogger.Write(dinLogger.DEBUG,"document was already loaded. Calling dinLoadFunction");dinLoadFunction();}else{dinFunctions.attachEventOnElement(window,'load',dinLoadFunction)}}else{dinLogger.Write(dinLogger.WARN,"dinLoadFunction duplicate call");}