//$(document).ready(function(){ }); window.setTimeout(function(){ TrackRLRI2021(); },2000); function TrackRLRI2021(){ if (!$('[name="Marketing-Checkbox"]').length){ return; } $('[name="email-form-3"]').on('submit',function(){ ga('create', 'UA-741540-1', 'auto', {'name': 'nmx'}); if ($('[name="Marketing-Checkbox"]').prop("checked")){ ga('nmx.send', 'event', 'Form Submit', "Real Life Real Impact 2021", "Opt-In"); } else { ga('nmx.send', 'event', 'Form Submit', "Real Life Real Impact 2021", "Not Opt-In"); } }); } $(document).ready(function(){ var bas = document.querySelectorAll(".brand-animal-selector-contain"); var dogs = document.querySelector('.section.dogs-only'); var cats = document.querySelector('.section.cats-only'); var horses = document.querySelector('.section.horses-only'); var allpets = document.querySelector('.section.allpets'); [].forEach.call(bas, function (el,i) { el.addEventListener('click', function() { allpets.style.display = 'none'; switch (el.classList[1]) { case 'dog': showHideFunFun("block","none","none"); break; case 'cat': showHideFunFun("none","block","none"); break; case "horse": showHideFunFun("none","none","block"); } function showHideFunFun(eins,zwei,drei) { dogs.style.display = eins; cats.style.display = zwei; horses.style.display = drei; } }); }); }); //$('.utils_beforFoot__zVy4a .utils_mediaButton__lSaqr [href*="/our-products/products-for-your-dog-cat-horse"]').attr("href","/#explorer-products"); $(document).ready(function(){ if (location.hash == "#explore-products"){ $('html').animate({ scrollTop: $("#explore-products").offset().top-150 }, 100); } }); function TrackCustomMultiEvent(category, action, label){ ga('create', 'UA-741540-1', 'auto', {'name': 'nmx_UA7415401'}); // Nutramax // ga('create', 'UA-741540-11', 'auto', {'name': 'nmx_UA74154011'}); // Dashboard // ga('create', 'UA-741540-13', 'auto', {'name': 'nmx_UA74154013'}); // Consumer brand // ga('create', 'UA-741540-14', 'auto', {'name': 'nmx_UA74154014'}); // Vet brand ga('nmx_UA7415401.send', 'event', category, action, label); fbq('trackSingleCustom', '3423505847672618', category,{action:action, label:label}); } $(document).ready(function(){ $('.quality-hero-banner-content a:contains("EXPLORE NUTRAMAX SUPPLEMENTS")').one("mousedown",function(){ TrackCustomMultiEvent("Button click", "Explore Nutramax Supplements", "hero"); }); $('.quality-cta a:contains("Explore Nutramax Supplements")').one("mousedown",function(){ TrackCustomMultiEvent("Button click", "Explore Nutramax Supplements", "bottom"); }); //TrackCustomMultiEvent("Button click", "Explore Nutramax Supplements", "bottom"); }); function mar1() { var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); var div1 = document.querySelector('#div1'); var div2 = document.querySelector('#div2'); var marq = document.querySelectorAll('.marquee'); function hoverFun(hel,mo) { [].forEach.call(hel, function (el,i) { el.addEventListener(mo, function() { div1.classList.add('hover') div2.classList.add('hover') }); }); } function hoverFunOut(hel,mo) { [].forEach.call(hel, function (el,i) { el.addEventListener(mo, function() { div1.classList.remove('hover') div2.classList.remove('hover') }); }); } // hoverFun(marq,'mouseover'); // hoverFunOut(marq,'mouseout'); // hoverFun(marq,'touchstart'); // hoverFunOut(marq,'touchend'); function tooManyto(els) { var markme = document.querySelectorAll(els); if(markme !== null){ [].forEach.call(markme, function (el, i) { el.classList.add("item".concat(i)); }); } } tooManyto("._100vh-bottom-spacer"); tooManyto(".half-slider.w-slide"); function addIE (el) { var ele = document.querySelector(el); ele.classList.add('--ie'); } function addIEAll (el) { var ele = document.querySelectorAll(el); [].forEach.call(ele, function (el,i) { el.classList.add('--ie'); }); } } function ran404(){ var randomNumber = Math.floor(Math.random()*4+1); var body404 = document.getElementById('404-Cat'); if (body404) { var stext = document.getElementById("404-Heading".concat(randomNumber)); stext.style.display = "inline"; } } function addBodyClass() { // jbackus was erroring, put in try try { var pageN = window.location.pathname.split("/").pop(); var newStr = pageN.replace(/-/g, ""); var b = document.querySelector('body'); b.classList.add(newStr); } catch (exceptionVar) { console.log(exceptionVar); } } function hoverRot() { var op = document.querySelectorAll('.ourpassion .main-mask.w-slider-mask .full-width-slider'); [].forEach.call(op, function (el,i) { el.classList.add("item".concat(i)); }); function hoverFun2(hel,mo,cname) { [].forEach.call(hel, function (el,i) { el.addEventListener(mo, function() { el.classList.add(cname); if(el.nextSibling){ el.nextSibling.classList.add('other') } else { el.previousElementSibling.classList.add('other') } }); }); } function hoverFunOut2(hel,mo,cname) { [].forEach.call(hel, function (el,i) { el.addEventListener(mo, function() { el.classList.remove(cname); if(el.nextSibling){ el.nextSibling.classList.remove('other') } else { el.previousElementSibling.classList.remove('other') } }); }); } hoverFun2(op,'mouseover', 'over'); hoverFunOut2(op,'mouseout', 'over'); } function ffClean() { var div2b = document.querySelector('.joinourfamily #div1'); div2b.classList.add('ffix'); } function isInTest() { var body = document.querySelector('body'); setTimeout(function () { if (body.hasAttribute('testmode')) { body.classList.add('test') console.log("Test class added") } }, 3500); } function initializeMar() { mar1(); addBodyClass(); isInTest(); // setTimeout(function () { // var p = document.querySelector('.ourpassion .main-mask.w-slider-mask'); // if(p !== null){ // hoverRot(); // } // }, 1000); setTimeout(function () { var d = document.querySelector('.joinourfamily #div2'); if(d !== null){ ffClean() } }, 16500); ran404(); } jQuery(document).ready(function($) { var bod = document.querySelector('body'); setTimeout(function () { var marqueeZ = document.querySelector('.marquee-wrapper.homelogos'); if(marqueeZ !== null ){ marqueeZ.classList.remove("hidden"); } if (bod.classList.contains('joinourfamily')) { $('#div1').owlCarousel({ items: 15, loop:true, margin:10, nav:false, dots:false, autoplay:true, autoplayTimeout: 1520, autoWidth:true, autoHeight:true, smartSpeed: 1660, responsive:{ 0:{ items:5, autoHeight:true, smartSpeed: 1660 }, 600:{ items:6, autoHeight:true, smartSpeed: 2000 }, 1000:{ items:7, } } }); } else { $('#div1').owlCarousel({ items: 10, loop:true, margin:10, nav:true, autoplay:true, autoplayTimeout: 1520, autoWidth:false, autoHeight:true, smartSpeed: 4000, responsive:{ 0:{ items:3, nav:false, dots:false, smartSpeed: 2000, }, 600:{ items:3, nav:false, dots:false }, 1000:{ items:5, nav:false, dots:false } } }); } }, 1000); }); window.onload = initializeMar; /* jb20200620a - added deep links for dogs/cats/horses pages */ $(document).ready(function(){ if (location.search == "?dogs"){ $(".brands-pet-tabs.dog:contains('Dogs')").closest("a")[0].click(); } if (location.search == "?cats"){ $(".brands-pet-tabs.dog:contains('Cats')").closest("a")[0].click(); } if (location.search == "?horses"){ $(".brands-pet-tabs.dog:contains('Horses')").closest("a")[0].click(); } if (location.search == "?dogs" || location.search == "?cats" || location.search == "?horses"){ //#List-of-Pet-Brands //.brand-list-animal-headline $('html, body').animate({ scrollTop: parseInt($("#List-of-Pet-Brands").offset().top) }, 0); //$(".nav-main").height(60); } }); /* jb20200620a - added tmp fix for policy link in footer */ // $(window).unbind("resize.menu_fix").on("resize.menu_fix",function(){ }); $(document).ready(function(){ $(".footer-wrapper a[href*='/privacy-policy#']").attr("href","/policies/privacy-policy#donotsell"); }); /* jb20200921a - added speak function for screen readers */ function Speak(text){ console.log("acs speak "+text); jQuery("#speakerbox").text(" "); window.setTimeout(function(){ jQuery("#speakerbox").text(text); }, 200); } AddSpeakers(); function AddSpeakers(){ if (!jQuery("#speakerbox").length){ console.log("acs created speaker box"); jQuery("body").append('
'); } jQuery(".w-slider-arrow-left").not("[speak]").attr("speak","previous").on("click",function(){ Speak("Previous slide"); }); jQuery(".w-slider-arrow-right").not("[speak]").attr("speak","next").on("click",function(){ Speak("Next slide"); }); // jQuery(".scroll-up-arrow").not("[speak]").attr("speak","previous").on("click",function(){ Speak("Previous section"); }); // jQuery(".scroll-dn-arrow").not("[speak]").attr("speak","next").on("click",function(){ Speak("Next section"); }); window.setTimeout(function(){ AddSpeakers(); }, 1000); } // kidding // window.setInterval(function(){ if ($("#sidebar_container #alert span").length && $("#sidebar_container #alert span").text() != "0") { $("#sidebar_container #sidebar_wrapper #summary #alert span").text("0"); } }, 1000); $(document).ready(function(){ if (!$("h1").length){ $("body").prepend('