//$(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('

'+document.title+'

'); } if (!$("main").length && !$('[role="main"]').length){ $(".page-wrapper").attr("role","main"); } window.setTimeout(function(){ $("img.w-css-reset").remove(); }, 2000); $("img.w-css-reset").remove(); //$("body[class='oops.php'] .page-wrapper").wrap('
'); //$("h1").attr("href","/policies/privacy-policy#12-Privacy-Notice-for-California-Residents"); // window.setTimeout(function(){ // $(".press-releases-list .row a[href]").each(function(){ // //$(this).attr("href",$(this).attr("href").replace("#","?")+$(this).attr("href")); // //$(this).attr("href",'href="javascript:(function(){location.hash=\''+$(this).attr("href").replace("#","")+'\';})();"'); // }); // }, 400); $(".howwehire-steps a").attr("role","presentation").attr("aria-hidden","true"); //FixHeadingsOnTermsPage(); //FixAllHeadingsForAccessibility(); }); function FixAllHeadingsForAccessibility(){ // $(":header").each(function(index){ // $(this).closest("div").addClass("nmx-accessible-headings"); // //AddChildHeadings($(this)); // }); // $("div.nmx-accessible-headings").each(function(index){ // $(this).parent().addClass("nmx-accessible-headings"); // AddChildHeadings($(this)); // }); // our-story $("h5.headline-text.circle-subhead").before('

2

3

4

'); // login $(".heading-15.login-h4").before('

2

3

'); $("a[href*='applicant'],a[href*='contact.html']:contains('ontact')").each(function(){ $("a[href='"+$(this).attr("href")+"']").each(function(index){ if ($(this).attr("href").indexOf("#")==-1){ $(this).attr("href",$(this).attr("href")+"#axs"+index); } }); }); $("a[href]:contains('ck here')").each(function(){ $(this).text($(this).text().replace("lick here","heck here")); }); if ($('[aria-current="page"]:contains("Privacy")').length){ $(".right-of-sidebar h5:first").before('

2

3

4

'); } if ($('[aria-current="page"]:contains("Terms")').length){ $(".right-of-sidebar h6:first").before('

2

3

4

5
'); } $(".banner-scrolldown-button, .banner-scrolldown-button *").attr("role","presentation").attr("aria-hidden","true"); window.setTimeout(function(){ $('[src="https://fast.wistia.com/embed/medias/vb6hk0wddf/swatch"]').attr("alt","video poster"); $('[alt="Wistia video thumbnail"]').each(function(index){ $(this).attr("alt","Wistia video thumbnail "+index); }); // $("#w-vulcan-v2-33 > div.w-bottom-bar.w-css-reset > div.w-bottom-bar-lower.w-css-reset > div.w-bottom-bar-right.w-css-reset > div.w-bottom-bar-right-inner-anchor.w-css-reset > div > div:nth-child(1) > div > button").css("fill","#0a5733"); // $("#w-vulcan-v2-33 > div.w-bottom-bar.w-css-reset > div.w-bottom-bar-lower.w-css-reset > div.w-bottom-bar-right.w-css-reset > div.w-bottom-bar-right-inner-anchor.w-css-reset > div > div:nth-child(1) > div > button > div > svg").css("fill","#0a5733"); // $("#w-vulcan-v2-33 > div.w-bottom-bar.w-css-reset > div.w-bottom-bar-lower.w-css-reset > div.w-bottom-bar-right.w-css-reset > div.w-bottom-bar-right-inner-anchor.w-css-reset > div > div:nth-child(1) > div > button > div").css("fill","#0a5733"); }, 500); // if ($('[aria-current="page"][href*="Media"]').length){ // $(".right-of-sidebar h6").before('

2

3

4

5
'); // } //$("h2,h3,h4").attr("role","presentation"); //$("h3").attr("role","presentation"); } // function AddChildHeadings(obj){ // console.log("found "+obj.parent().prop("tagName")+"."+obj.parent().attr("class")+" "+obj.prop("tagName")+""); // } function FixHeadingsOnTermsPage(){ if ($("#01-what-type-of-information-is-collected-and-how-do-we-use-it").length){ //$(".policy-container em:first").attr("role","heading").attr("aria-level","5"); $("#01-what-type-of-information-is-collected-and-how-do-we-use-it").after('
2
3
4
5
'); //$("h6:nth-of-type(1)").before('

2

3

4

5
'); //$("body").prepend('

1

'); //$("h5:first").before(''); //window.setTimeout(function(){ FixHeadingForAccessibility(6); }, 500); // window.setTimeout(function(){ // if ($("h6").length){ FixHeadingForAccessibility(6); } else // if ($("h5").length){ FixHeadingForAccessibility(5); } else // if ($("h4").length){ FixHeadingForAccessibility(4); } else // if ($("h3").length){ FixHeadingForAccessibility(3); } else // if ($("h2").length){ FixHeadingForAccessibility(2); } else // if ($("h1").length){ FixHeadingForAccessibility(1); } // }, 400); } // if ($("h6").length){ FixHeadingForAccessibility(6); } else // if ($("h5").length){ FixHeadingForAccessibility(5); } else // if ($("h4").length){ FixHeadingForAccessibility(4); } else // if ($("h3").length){ FixHeadingForAccessibility(3); } else // if ($("h2").length){ FixHeadingForAccessibility(2); } else // if ($("h1").length){ FixHeadingForAccessibility(1); } } function FixHeadingForAccessibility(p){ if (p<1){ return; } var h = p-1; console.log("H"+p+" ok"); if (h>0){ //console.log("checking for H"+h); if (!$("h"+h).length && $("h"+p).length){ console.log("adding H"+h); //$("p:nth-of-type("+h+")").attr("role","heading").attr("aria-level",h); $("h"+p+":first").before(''); } FixHeadingForAccessibility(h); } } /* accessibility fixes */ /* jbackus 20200724_0516 - added */ // errors $("form.search-field").html(""); $("form[name='email-form-2']").html(""); $('[href="/our-standard"], [href="our-standard.html"]').filter(":contains('More Details')").text("Learn More"); $("a._404_logo-container").removeAttr("href"); // contrast errors //$(".w-playbar__time").html(""); $(".videoembed-in-border video").attr("aria-hidden","true").removeAttr("style").css("color","red"); // alerts $(".sitelogo").attr("alt","Nutramax logo"); /* this is rediculous - noscript cannot be used */ $("noscript").remove(); /* accessibility (move ada scripts below here) */ //nmxSiteAccessibilityR(20, 100); //window.setTimeout(function(){ nmxSiteAccessibility(30, 100); },3000); function nmxSiteAccessibilityR(c, i){ if (c > 0){ c--;window.setTimeout(function(){ nmxSiteAccessibilityR(c--, i); },i); } //jQuery(".pagesection:first, #skip-to-content").attr("role","main"); jQuery("#skip-to-content").parent().attr("role","main"); ScrollToMainLink(); } function ScrollToMainLink(){ jQuery(".skip-to-content-link, a:contains('Skip to main')").not(".skip-link").remove(); // if (jQuery('[hostname="www.imuquin.com"]').length){ // jQuery(".maintext > .w3-content:first").attr("role","main"); // ScrollToMainLink(); // } if (!jQuery(".skip-link").length){ jQuery("body").before(''); jQuery("head").append(''); } jQuery(".skip-link").attr("href","javascript:ScrollToMain();"); if (!jQuery("body[main]").length){ if (jQuery("[main]").length){ jQuery("body").attr("main","[main]"); } else if (jQuery("[role='main']").length){ jQuery("body").attr("main","[role='main']"); } else if (jQuery("#main").length){ jQuery("body").attr("main","#main"); } else if (jQuery("section:first").length){ jQuery("body").attr("main","section:first"); } else if (jQuery("div.main").length){ jQuery("body").attr("main","div.main"); } else if (jQuery("[name='about-container']").length){ jQuery("body").attr("main","div.main"); } else if (jQuery("section#one").length){ jQuery("body").attr("main","section#one"); } else { jQuery("body").attr("main","[role='main']"); } jQuery(jQuery("body").attr("main")).attr("role","main"); console.log("acs main: "+jQuery("body").attr("main")); } } function ScrollToMain(){ console.log("acs scroll to main "+jQuery("body").attr("main")); jQuery([document.documentElement, document.body]).animate({ scrollTop: jQuery(jQuery("body").attr("main")).offset().top }, 100); }