1function setCookie(cname, cvalue, exdays) { 2 var d = new Date(); 3 d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000); 4 var expires = "expires=" + d.toUTCString(); 5 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/;secure"; 6} 7 8function deleteCookie(name, path) { 9 document.cookie = 10 name + "=; Path=/" + path + "; Expires=Thu, 01 Jan 1970 00:00:01 GMT;"; 11} 12 13function getCookie(cname) { 14 var name = cname + "="; 15 var decodedCookie = decodeURIComponent(document.cookie); 16 var ca = decodedCookie.split(";"); 17 for (var i = 0; i < ca.length; i++) { 18 var c = ca[i]; 19 while (c.charAt(0) == " ") { 20 c = c.substring(1); 21 } 22 if (c.indexOf(name) == 0) { 23 return c.substring(name.length, c.length); 24 } 25 } 26 return ""; 27} 28 29function imgURLgen(path, type = 'src', deviceType = false, local = window.location.origin) { 30 var rPath; 31 if (type == 'srcset') { 32 var temp = []; 33 for (var i = 0; i < 3; i++) { 34 var imgXvalue = (i + 1) + 'x'; 35 temp[i] = local + path.replace('{xv}', imgXvalue) + ' ' + imgXvalue; 36 } 37 rPath = temp.join(); 38 } else if (type == 'src' && deviceType == false) { 39 rPath = local + path; 40 } else if (type == 'src' && deviceType == true) { 41 if (window.devicePixelRatio <= 1) { 42 rPath = local + path.replace('{xv}', '1x'); 43 } else if (window.devicePixelRatio <= 2 && window.devicePixelRatio > 1) { 44 rPath = local + path.replace('{xv}', '2x'); 45 } else if (window.devicePixelRatio > 2) { 46 rPath = local + path.replace('{xv}', '3x'); 47 } 48 } 49 return rPath; 50} 51 52function getInternetExplorerVersion() { 53 var ie = (!!window.ActiveXObject && +(/msie\s(\d+)/i.exec(navigator.userAgent)[1])) || NaN; 54 if (ie === 6) { 55 document.documentElement.className += ' ie6'; 56 } else if (ie === 7) { 57 document.documentElement.className += ' ie7'; 58 } else if (ie === 8) { 59 document.documentElement.className += ' ie8'; 60 } else if (ie === 9) { 61 document.documentElement.className += ' ie9'; 62 } else if (!!window.MSInputMethodContext && !!document.documentMode) { 63 ie = 11; 64 } 65 return ie; 66} 67 68var chetuNav = $("#chetu-nav"), 69 siteUrl = window.location.origin, 70 currLang = document.querySelector('html').getAttribute('lang'), 71 logoWhite = currLang == 'es' ? siteUrl + "/img/chetu-logo-white-spanish.png?v=2" : siteUrl + "/img/chetu-logo-white.png?v=2", 72 colorLogo = currLang == 'es' ? siteUrl + "/img/chetu-logo-color-spanish.png?v=2" : siteUrl + "/img/logo-new-home.png?v=2", 73 srchIconWhtSrcSet = imgURLgen("/img/home-page-img/random-icon/search-white-{xv}.png", 'srcset'), 74 srchIconBlkSrcSet = imgURLgen("/img/home-page-img/random-icon/search-black-{xv}.png", 'srcset'); 75 76var phoneIconBlkSrcSet, phoneIconwhiteSrcSet; 77 78if (currLang == 'es') { 79 phoneIconBlkSrcSet = imgURLgen("/img/home-page-img/random-icon/call-1x-b.png"); 80 phoneIconwhiteSrcSet = imgURLgen("/img/home-page-img/random-icon/call-1x-w.png"); 81} else { 82 phoneIconBlkSrcSet = imgURLgen("/img/home-page-img/random-icon/call-{xv}-b.png", 'srcset'); 83 phoneIconwhiteSrcSet = imgURLgen("/img/home-page-img/random-icon/call-{xv}-w.png", 'srcset'); 84} 85 var navHeader = $(".navbar-header"), 86 whiteNavPhnImg = $(".white-nav .phone img"), 87 whiteNavSrcImg = $(".white-nav .search img"); 88 89 90$(document).ready(function () { 91 92 var cname = getCookie("visitorCheck"); 93 94 if (!cname) { 95 $(".cookies-policy-sec").show(); 96 } else { 97 $(".cookies-policy-sec").hide(); 98 } 99 100 $("#cookie-acceptance").on("click", function () { 101 setCookie("visitorCheck", "yes", 90); 102 $(".cookies-policy-sec").hide(); 103 }); 104 105 $(document).scroll(function () { 106 var scroll_start = $(this).scrollTop(); 107 if (scroll_start > 50) { 108 $(".navbar-default").addClass("navColor"); 109 $(".scrollTop").fadeIn(); 110 $(".navbar-brand img").attr("src", colorLogo); 111 $(".searchClose")
112 .attr("src", siteUrl + "/img/home-page-img/random-icon/cross-black-1x.png") 113 .attr("srcset", imgURLgen("/img/home-page-img/random-icon/cross-black-{xv}.png", 'srcset')); 114 115 $(".opacity-top").addClass("sticky-top-bar"); 116 } else { 117 $(".navbar-default").removeClass("navColor"); 118 $(".scrollTop").fadeOut(); 119 $(".navbar-brand img").attr("src", logoWhite); 120 $(".white-nav .searchClose") 121 .attr("src", siteUrl + "/img/home-page-img/random-icon/cross-white-1x.png") 122 .attr("srcset", imgURLgen("/img/home-page-img/random-icon/cross-white-{xv}.png", 'srcset')); 123 124 $(".opacity-top").removeClass("sticky-top-bar"); 125 } 126 if ($(".white-nav").hasClass("navColor")) { 127 whiteNavSrcImg.attr("src", siteUrl + "img/home-page-img/random-icon/search-black-1x.png"); 128 whiteNavSrcImg.attr("srcset", srchIconBlkSrcSet); 129 whiteNavPhnImg.attr("src", siteUrl + "img/home-page-img/random-icon/call-1x-b.png"); 130 whiteNavPhnImg.attr("srcset", phoneIconBlkSrcSet); 131 } else { 132 whiteNavSrcImg.attr("src", siteUrl + "img/home-page-img/random-icon/search-white-1x.png"); 133 whiteNavSrcImg.attr("srcset", srchIconWhtSrcSet); 134 whiteNavPhnImg.attr("src", siteUrl + "img/home-page-img/random-icon/call-1x-b.png"); 135 whiteNavPhnImg.attr("srcset", phoneIconwhiteSrcSet); 136 } 137 $("#bar").click(function () { 138 whiteNavSrcImg.attr("src", siteUrl + "img/home-page-img/random-icon/search-black-1x.png"); 139 }); 140 }); 141}); /*Timer script*/ 142$(".counter").each(function () { 143 var $this = $(this), 144 countTo = $this.attr("data-count"); 145 $({ 146 countNum: $this.text() 147 }).animate({ 148 countNum: countTo 149 }, { 150 duration: 8000, 151 easing: "linear", 152 step: function () { 153 $this.text(Math.floor(this.countNum)); 154 }, 155 complete: function () { 156 $this.text(this.countNum); 157 }, 158 }); 159}); 160$(".anchor-click a").click(function (e) { 161 e.preventDefault(); 162 $("html,body").animate({ 163 scrollTop: $($(this).attr("href")).offset().top - 120 164 }, 1000); 165}); 166$(".search").click(function () { 167 $("#cd-primary-nav").css("display", "none"); 168 $(".search-form").css("display", "block"); 169 $(".search-form input").focus(); 170 if (window.innerWidth <= 1199) { 171 $('#lang-nav').hide(); 172 navHeader.css("float", "left"); 173 $(".cd-header-buttons").css("display", "none"); 174 navHeader.css("background", "transparent"); 175 if (window.innerWidth <= 767) { 176 $(".navbar-brand").css("display", "none"); 177 } 178 } 179 if ($(".navbar-collapse").hasClass("in")) { 180 $(".white-nav .navbar-brand img").attr("src", logoWhite); 181 $(".navColor.white-nav .navbar-brand img").attr("src", colorLogo); 182 $("body").css("overflow", "auto"); 183 $(".navbar").removeClass("nav-white"); 184 } 185 $(".search-button-new.mobile").css("display", "none"); 186}); 187$(".searchClose").click(function () { 188 $("#cd-primary-nav").css("display", "block"); 189 $(".search-form").css("display", "none"); 190 $(".navbar-brand").css("display", "block"); 191 if (window.innerWidth <= 1199) { 192 navHeader.css("float", "none"); 193 $(".cd-header-buttons").css("display", "block"); 194 if (window.innerWidth <= 767) { 195 navHeader.css("float", "none"); 196 $(".navbar-brand").css("display", "block"); 197 } 198 } 199 if (window.innerWidth <= 1199 && window.innerWidth > 480) { 200 $('#lang-nav').show(); 201 } 202 if (window.innerWidth > 1199) { 203 navHeader.css("float", "left"); 204 } 205 if ($(".navbar-collapse").hasClass("in")) { 206 navHeader.css("background", "#fff"); 207 $(".white-nav .navbar-brand img").attr("src", colorLogo); 208 $("body").css("overflow", "hidden"); 209 $(".navbar").addClass("nav-white"); 210 } else { 211 navHeader.css("background", "transparent"); 212 } 213 $(".cd-header-buttons").css("display", "block"); 214 $(".search-button-new.mobile").css("display", "block"); 215}); 216$(window).on("resize", function () { 217 if (window.innerWidth > 1199 && navHeader.css("float") == "none") { 218 navHeader.css("float", "left"); 219 } else if (window.innerWidth < 1199 && navHeader.css("float") == "left") { 220 navHeader.css("float", "none"); 221 } 222}); 223$('#chetu-nav').on('show.bs.collapse', function (e) { 224 $(".navbar").addClass("nav-white"); 225 if ($(".white-nav .navbar-brand img").attr("src") == logoWhite) { 226 $(".white-nav .navbar-brand img").attr("src", colorLogo); 227 } 228 $(".phone-number ul").css("background", "#0297a496"); 229 $(".phone-number ul li a").css("color", "#fff"); 230 $(".cross-icon").attr("src", imgURLgen('/img/home-page-img/random-icon/cross-black-{xv}.png', 'src', true)); 231 $(".cross-icon").attr("srcset", imgURLgen("/img/home-page-img/random-icon/cross-black-{xv}.png", 'srcset')); 232 whiteNavSrcImg.attr("src", imgURLgen('/img/home-page-img/random-icon/search-black-{xv}.png', 'src', true)); 233 whiteNavSrcImg.attr("srcset", srchIconBlkSrcSet); 234 whiteNavPhnImg.attr("src", imgURLgen('/img/home-page-img/random-icon/call-{xv}-b.png', 'src', true)); 235 whiteNavPhnImg.attr("srcset", phoneIconBlkSrcSet); 236 $("body").addClass("navigation-body-fix-mobile"); 237}); 238$('#chetu-nav, #close-but').on('hide.bs.collapse click', function (e) { 239 if (e.target.tagName !== "A") { 240 $(".navbar").removeClass("nav-white"); 241 $(".phone-number").css("display", "none"); 242 $(".phone-number ul").css("background", "rgba(255, 255, 255, 0.8)"); 243 $(".phone-number ul li a").css("color", "#000"); 244 if ($(".white-nav").hasClass("navColor")) { 245 $(".white-nav .navbar-brand img").attr("src", colorLogo); 246 } else { 247 $(".white-nav .navbar-brand img").attr("src", logoWhite); 248 } 249 if ($(".white-nav").hasClass("navColor")) { 250 whiteNavSrcImg.attr("src", imgURLgen('/img/home-page-img/random-icon/search-black-{xv}.png', 'src', true)); 251 whiteNavSrcImg.attr("srcset", srchIconBlkSrcSet); 252 whiteNavPhnImg.attr("src", imgURLgen('/img/home-page-img/random-icon/call-{xv}-b.png', 'src', true)); 253 whiteNavPhnImg.attr("srcset", phoneIconBlkSrcSet); 254 } else { 255 whiteNavSrcImg.attr("src", imgURLgen('/img/home-page-img/random-icon/search-white-{xv}.png', 'src', true)); 256 whiteNavSrcImg.attr("srcset", srchIconWhtSrcSet); 257 whiteNavPhnImg.attr("src", imgURLgen('/img/home-page-img/random-icon/call-{xv}-w.png', 'src', true)); 258 whiteNavPhnImg.attr("srcset", phoneIconwhiteSrcSet); 259 } 260 $("body").removeClass("navigation-body-fix-mobile"); 261 } 262}); 263$(".navbar-collapse").css("max-height", $(window).height() - navHeader.height()); 264$(document).ready(function () { 265 $(".phone").click(function () { 266 if ($("nav").hasClass("bg-white") || $("nav").hasClass("black-nav")) { 267 $(".phone-number ul").addClass("ul-white"); 268 } 269 $(".phone-number").toggle(); 270 }); 271 $(document).on("click", function (e) { 272 var $trigger = $(".phone"); 273 if ($trigger !== e.target && !$trigger.has(e.target).length) { 274 $(".phone-number").hide(); 275 } 276 }); 277 $(document).on("click", ".phone-number a", function (e) { 278 e.stopPropagation(); 279 }); 280}); 281$("#chetu-nav").on("shown.bs.dropdown", function () { 282 $(this).find(".open").children("a").addClass("arrow-cross"); 283}); 284$("#chetu-nav").on("hidden.bs.dropdown", function () { 285 $(this).find(".arrow-cross").removeClass("arrow-cross"); 286}); 287var currentDate = new Date(); 288var providedDate = new Date(2000, 03, 01); 289var get_Current_Year = document.getElementsByClassName("curr-year"), 290 i; 291if (currentDate.getMonth() >= providedDate.getMonth()) { 292 for (i = 0; i < get_Current_Year.length; i++) { 293 get_Current_Year[i].innerHTML = currentDate.getFullYear() - providedDate.getFullYear(); 294 } 295} else if (currentDate.getMonth() < providedDate.getMonth()) { 296 for (i = 0; i < get_Current_Year.length; i++) { 297 get_Current_Year[i].innerHTML = currentDate.getFullYear() - 1 - providedDate.getFullYear(); 298 } 299} 300$(".heroshotSlide").on("init", function (e, slick, direction) { 301 $(this).css("display", "block"); 302}); 303$(document).ready(function () { 304 if ($("body").attr("id") == "landing-page") { 305 $("#lang-nav").css("display", "none"); 306 if (window.innerWidth > 1199) { 307 $(".opacity-top p").css("margin-right", 30); 308 } 309 } 310}); 311var getSection = document.getElementById("HomeSlider"); 312var getClassSection = document.querySelector("section.sticker"); 313if ($(getSection).attr("id") == "HomeSlider" && getClassSection == null) { 314 var getNextSection = getSection.nextElementSibling; 315 getNextSection.insertAdjacentHTML("afterbegin", '<div class="container-fluid" id="breadcumb-head"><div class="row"><div class="col-xs-12 col-md-10 col-md-offset-1 no-padding"><ul id="breadcumb" class="breadcrumb text-capitalize"></ul></div></div></div>'); 316 getNextSection.style.setProperty("padding-top", "30px", "important"), getNextSection.style.setProperty("margin-top", "0px", "!important"); 317} else if (getClassSection != null) { 318 var getnextClassSection = getClassSection.nextElementSibling; 319 getnextClassSection.insertAdjacentHTML("afterbegin", '<div class="container-fluid" id="breadcumb-head"><div class="row"><div class="col-xs-12 col-md-10 col-md-offset-1 no-padding"><ul id="breadcumb" class="breadcrumb text-capitalize"></ul></div></div></div>'); 320 getnextClassSection.style.setProperty("padding-top", "30px", "important"); 321 getnextClassSection.style.setProperty("margin-top", "0px", "!important"); 322} 323var urlPath = "", 324 getclass = $("body").attr("class"), 325 linkName, basicURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : ""), 326 currentURL = basicURL + window.location.pathname, 327 icon = "<img src='https://www.chetu.com/img/icons/home.png'>", 328 temp = currentURL.replace(basicURL + "/", ""), 329 splitURL = temp.split("/"); 330if (currentURL.indexOf("/uk/") > 0) { 331 urlPath += '<li><a href="' + basicURL + '/uk">Home</a></li>'; 332 for (var i = 1; i < splitURL.length - 1; i++) { 333 urlPath += '<li><a id="level1" href="' + currentURL.substring(0, currentURL.indexOf(splitURL[i]) + splitURL[i].length) + '.php">' + splitURL[i].replace(/-/g, " ") + '</a></li>'; 334 } 335} else if (currentURL.indexOf("/es/") > 0) { 336 urlPath += "<li><a id='level1' href=" + basicURL + "/es>Hogar</a></li>"; 337 for (var i = 1; i < splitURL.length - 1; i++) { 338 if (splitURL[i] == "solutions"){ 339 splitURL[i] = "soluciones" 340 } 341 urlPath += '<li><a href="' + currentURL.substring(0, currentURL.indexOf(splitURL[i]) + splitURL[i].length) + '.php">' + splitURL[i].replace(/-/g, " ") + '</a></li>'; 342 } 343} else { 344 urlPath += '<li><a href="' + basicURL + '">Home</a></li>'; 345 for (var i = 0; i < splitURL.length - 1; i++) { 346 urlPath += '<li><a id="level1" href="' + currentURL.substring(0, currentURL.indexOf(splitURL[i]) + splitURL[i].length) + '.php">' + splitURL[i].replace(/-/g, " ") + '</a></li>'; 347 } 348} 349i = splitURL.length - 1; 350if (document.querySelector('#chetu-nav a[href="' + currentURL + '"]') === null) { 351 if (currentURL.indexOf("/uk/cookie-policy.php") > 0) { 352 linkName = "Cookie Policy"; 353 } else if (currentURL.indexOf("/es/cookie-policy") > 0) { 354 linkName = "PolÃtica de cookies"; 355 } else { 356 linkName = splitURL[i].replace(/-/g, " ").substring(0, splitURL[i].indexOf(".php")); 357 } 358} else { 359 linkName = document.querySelector('#chetu-nav a[href="' + currentURL + '"]').innerHTML; 360} 361 362urlPath += '<li><a id="level2" href="' + currentURL.substring(0, currentURL.indexOf(splitURL[i]) + splitURL[i].length) + '">' + linkName + '</a></li>'; 363var breadcrumbEle = document.getElementById("breadcumb"); 364if (breadcrumbEle != null) { 365 breadcrumbEle.innerHTML = urlPath; 366 if (document.location.href.indexOf("blogs") > -1 || document.location.href.indexOf("case-study") > -1 || getclass == "breadcrumb-hide") { 367 document.getElementById("breadcumb-head").style.display = "none"; 368 breadcrumbEle.innerHTML = ""; 369 } 370 var getChild = breadcrumbEle.children; 371 var count = getChild.length; 372 for (var i = 1; i < count; i++) { 373 var getText = getChild[i].innerText.toLowerCase(); 374 if (getText == "solutions" || getText == "soluciones" || getText == "uk" || getText == "Es") { 375 var pointerNone = breadcrumbEle.children[i].children[0]; 376 $(pointerNone).attr("href", "javascript:void(0)"); 377 pointerNone.style.setProperty("cursor", "not-allowed"); 378 } 379 } 380} 381var ie_ver = getInternetExplorerVersion(); 382if (ie_ver >= 9 && ie_ver <= 11) { 383 $(".search-form input").keyup(function () { 384 if ($(this).val() == undefined || $(this).val() == '') { 385 $("#ie-placeholder").show(); 386 $('.search-form input').attr('placeholder', '') 387 } else { 388 $("#ie-placeholder").hide(); 389 } 390 }); 391} 392var imageObserver = new IntersectionObserver(function (entries, imgObserver) {
393 entries.forEach(function (entry) { 394 if (entry.isIntersecting) { 395 var lazyImage = entry.target; 396 lazyImage.src = lazyImage.dataset.src; 397 if (lazyImage.dataset.srcset != undefined) { 398 lazyImage.srcSet = lazyImage.dataset.srcset; 399 } 400 imgObserver.unobserve(lazyImage); 401 } 402 }) 403}); 404if (ie_ver <= 10) { 405 $('.lazyload, .lazy').each(function () { 406 var src = $(this).attr('data-src'); 407 $(this).attr('src', src); 408 var srcSet = $(this).attr('data-srcset'); 409 $(this).attr('srcset', srcSet); 410 }); 411} else { 412 document.addEventListener("DOMContentLoaded", function () { 413 var lazyload = document.querySelectorAll('[class~=lazyload]'); 414 var lazyload_2 = document.querySelectorAll('[class~=lazy]'); 415 lazyload.forEach((v) => { 416 imageObserver.observe(v); 417 }); 418 lazyload_2.forEach((v) => { 419 imageObserver.observe(v); 420 }) 421 }) 422} /* Placing js from footer to js file 14-Dec-2020*/ /* Scroll Top Function on arrow click */ 423$("div.scrollTop").click(function () { 424 $("html, body").animate({ 425 scrollTop: 0 426 }, "slow"); 427 return false; 428}); /* Functionlaity for has linking */ 429var hashLink = window.location.hash + '-hash'; 430if (hashLink != '' & document.querySelector(hashLink) != null) { 431 var elePos = document.querySelector(hashLink).getBoundingClientRect().top; 432 window.scrollTo({ 433 top: elePos - 120 434 }); 435} 436// let latmCountries = ['AR', 'BZ', 'BO', 'BR', 'CL', 'BZ', 'CO', 'CR', 'EC', 'SV', 'GF', 'GT', 'GY', 'HN', 'MX', 'NI', 'PA', 'PY', 'PE', 'ES', '
436SR', 'UY', 'VE']; 437// let flagEle = document.querySelectorAll('.tel-icon img'); 438// if (latmCountries.indexOf(user_location.country_code) > -1) { 439// flagEle.forEach((ele) => { 440// ele.style.visibility = "hidden"; 441// ele.style.width = "0%"; 442// }) 443// }
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.