//window.onerror = function(){ return true; }; //if(!String.prototype.trim) {String.prototype.trim = function () {return this.replace(/^\s+|\s+$/g,'');};} // fix .trim() in IE8 jQuery = nextQuery; if (location.href.indexOf("nutramaxstore.com")>-1){ // consumer var _prum = [['id', '54119783abe53d3d26b00907'], ['mark', 'firstbyte', (new Date()).getTime()]]; (function() { var s = document.getElementsByTagName('script')[0] , p = document.createElement('script'); p.async = 'async'; p.src = '//rum-static.pingdom.net/prum.min.js'; s.parentNode.insertBefore(p, s); })(); } else{ // vet } // use alternate storefront for nutramaxstore.com if (location.href.indexOf("nutramaxstore.com")>-1 && location.href.indexOf("/storefront.aspx")>-1){ location = location.href.replace("/storefront.aspx","/all-our-products-c34.aspx"); } // developer site switch if (location.href.indexOf(".ASPX")>-1 && getEnvironment()!="stg"){ location = location.href.toLowerCase().replace("https://store.nexternal.com/busnutramax","http://stg.vet-ez-order.com"); } else if (location.href.indexOf(".ASPX")>-1 && getEnvironment()!="www"){ location = location.href.toLowerCase().replace("https://store.nexternal.com/busnutramax","http://www.vet-ez-order.com"); } //jQuery("head").prepend(""); var animalProducts = ("ah-product|Calxequin®|CoMal® Q10|Consil®|Cosequin®|Cosevite®|Crananidin®|Curaflex®|Dasuquin®|Denamarin®|Denosyl®|Marin®|Proviable®|Quinicarn®|Welactin®").split("|"); var animalProductsBy = " sold by Nutramax Laboratories Veterinary Sciences, Inc."; var humanProducts = ("yh-product|Avmacol®|Avmacol™|Avoca ASU®|Cosamin®|OmegaMint™").split("|"); var humanProductsBy = " sold by Nutramax Laboratories Consumer Care, Inc."; var animalProductsLegal = "", humanProductsLegal = "", productsLegal = ""; window.setInterval(function(){ if (document.title.indexOf("(Staging)") == -1){ if(getEnvironment()=="stg"){ document.title = "(Staging) "+document.title.replace("(Staging) ",""); } } /* if (jQuery("#ctl00_ctl00_ctl00_cphMain_ctl00_ctrShoppingCart_spnCouponCode:contains('SPECIAL')") || jQuery("#pnlEmptySuperCartCoupon:contains('SPECIAL')")){ jQuery("#pnlEmptySuperCartCoupon").hide(); jQuery("#ctl00_ctl00_ctl00_cphMain_ctl00_ctrShoppingCart_tdCouponDiscountText").css('text-align','right').html('Save'); try { jQuery("#ctl00_ctl00_ctl00_cphMain_ctl00_ctrShoppingCart_tdCouponDiscountPrice").html(jQuery("#ctl00_ctl00_ctl00_cphMain_ctl00_ctrShoppingCart_tdCouponDiscountPrice").text().replace('-','').trim()); }catch(err){} } */ }, 1000); jQuery(document).ready(function(){ //hideCategories("Breast Health Products"); //hideCategories("Environmental"); //hideCategories("Wellness"); //hideProductByName("Avmacol™"); //hideProductByName("Avmacol®"); // add footer background back to pages jQuery("#tdBottom, .nextInnerWrapper").css('background','url("//cdn.nexternal.com/nutramax/images/footerOuterwrapper.png") repeat-x scroll center bottom transparent'); jQuery("img[src*='/nutramax/images/number-1-researched-icon.png']").attr("src",""+getFilePath()+"/img/number-1-researched-icon.png"); // consumer jQuery(".btoc img[src*='/nutramax/images/logo.png']").addClass("division-logo").attr("src",""+getFilePath()+"/img/logo_consumer_care.png").removeAttr("width").removeAttr("height"); jQuery(".btoc .header").attr("style","background: url('"+getFilePath()+"/img/consumer-header-bg.png') top left scroll no-repeat; height:175px; width:1023px;"); jQuery(".btoc .navigation:first ul").attr("style","padding-top:62px;"); jQuery(".btoc .navigation:first ul li").css("margin-left","8px"); jQuery(".btoc .navigation:first ul li.first").css("width","260px"); jQuery(".btoc .navigation").attr("style","position:absolute; top:2px;"); jQuery(".btoc .header").append('
NUTRAMAXSTORE.com
'); // vet jQuery(".btob img[src*='/nutramax/images/logo.png']").addClass("division-logo").attr("src",""+getFilePath()+"/img/logo_corporate.png").removeAttr("width").removeAttr("height"); jQuery(".btob .header").attr("style","background: url('"+getFilePath()+"/img/vet-header-bg.png') top left scroll no-repeat; height:175px;"); jQuery(".btob .navigation:first ul").attr("style","padding-top:62px;"); jQuery(".btob .navigation:first ul li").css("margin-left","8px"); jQuery(".btob .navigation:first ul li.first").css("width","260px"); jQuery(".btob .navigation").attr("style","position:absolute; top:2px;"); jQuery(".btob .header").append('
VET-EZ-ORDER.com
'); // move the overview button to header jQuery(".ui-mobile-viewport .overviewIcon").closest("a").appendTo(".nextHeader").html("?").attr("style","float: right;margin-right: 100px; padding-top:0px; margin-top: 3px;height: 34px;width: 37px;");//.attr("xstyle","margin-right: 100px;font-size: 25px;color: #fff;text-decoration: none;margin-top: 5px;float: right;border: solid 1px #263A26;width: 32px;height: 30px;border-radius: 10px;padding-top: 2px;text-align: center;background-color: #83B683;font-weight: normal;"); // center mobile logo jQuery(".ui-mobile-viewport img.division-logo").wrap('
'); // add vet disclaimer line to banner2 if (location.href.indexOf("/busnutramax")>-1 || location.href.indexOf("/nutramax/unsub/")>-1){ jQuery("body").addClass("ah"); jQuery(".copyR, .cus").css("margin-top","10px"); jQuery("body").append("
Human products on Vet-EZ-Order.com are sold by Nutramax Laboratories Consumer Care, Inc. Veterinary products on Vet-EZ-Order.com are sold by
Nutramax Laboratories Veterinary Sciences, Inc. All Intellectual Property is owned by Nutramax Laboratories, Inc.
"); jQuery(".ui-mobile-viewport #aspnetForm").append("

© 2009-2014 Nutramax Laboratories, Inc. All rights reserved

Human products on Vet-EZ-Order.com are sold by Nutramax Laboratories Consumer Care, Inc. Veterinary products on Vet-EZ-Order.com are sold by
Nutramax Laboratories Veterinary Sciences, Inc. All Intellectual Property is owned by Nutramax Laboratories, Inc.

"); /* if(jQuery(".banner1 .nextBannerCell.nextBannerCellCenter").html().indexOf("®")>-1){ jQuery(".banner1 .nextBannerCell.nextBannerCellCenter").append('
is sold by Nutramax Laboratories Veterinary Sciences, Inc.
'); } else if(jQuery(".nextHierarchyFinalText").text().trim()!="Products for You" && jQuery(".nextHierarchyFinalText").text().trim()!="Bargain Buys"){ jQuery(".banner1 .nextBannerCell.nextBannerCellCenter").closest("table").after('
Products sold by Nutramax Laboratories Veterinary Sciences, Inc.
'); } jQuery(".sold-by-disclaimer").attr("style","font-style:italic; font-weight:normal; text-align:center;"); jQuery(".sold-by-disclaimer.vet2").attr("style","font-style:italic; font-weight:normal; text-align:center; color:#333; margin-bottom:20px;");*/ animalProductsLegal = getDisclaimer(animalProducts, animalProductsBy).trim(); humanProductsLegal = getDisclaimer(humanProducts, humanProductsBy).trim(); var productNamesInDisclaimers = false; //productNamesInDisclaimers = true; if (humanProductsLegal == "" && animalProductsLegal != "" ){ jQuery("body").addClass("ah-products"); } if (humanProductsLegal != "" && animalProductsLegal == ""){ jQuery("body").addClass("yh-products"); } // both divisions if(humanProductsLegal != "" && animalProductsLegal != "" || productNamesInDisclaimers){ productsLegal = " "; } else if(humanProductsLegal != "" || animalProductsLegal != ""){ productsLegal = humanProductsLegal+" "+animalProductsLegal; //jQuery(".ui-btn").css("background","none"); if (humanProductsLegal == "" && animalProductsLegal != "" ){ jQuery("body").addClass("ah"); jQuery("body").addClass("ah-products"); } if (humanProductsLegal != "" && animalProductsLegal == ""){ jQuery("body").removeClass("ah"); jQuery("body").addClass("yh"); jQuery("body").addClass("yh-products"); } // one division or the other if (humanProductsLegal == "" && animalProductsLegal.indexOf(" are ") > -1 ){ productsLegal = "These products are " + animalProductsBy; } else if (animalProductsLegal == "" && humanProductsLegal.indexOf(" are ") > -1 ){ productsLegal = "These products are " + humanProductsBy; } // no products mentioned if (animalProductsLegal == "" && humanProductsLegal == ""){ productsLegal = ""; } } if (productsLegal.trim() != ""){ //jQuery("#ctl00_cphMain_mhrCategoryHeader_pnlMobileHeader") jQuery(".ui-mobile-viewport .nextTopBanner:visible").after('
'+productsLegal+'
'); //jQuery(".sold-by-disclaimer.mobile-top").attr("style","font-style:italic; font-weight:normal; text-align:left; color:#333; padding-left:20px; padding-right:20px; margin-bottom:20px; -border-top:solid 1px #d8d8d8; -border-bottom:solid 1px #d8d8d8;"); jQuery(".main.subcategories").append('
'+productsLegal+'
'); //jQuery(".sold-by-disclaimer.bottom").attr("style","display:inline-block; font-style:italic; font-weight:normal; text-align:left; color:#333; margin-bottom:20px; margin-top:100px;"); jQuery(".ui-mobile-viewport .sold-by-disclaimer.bottom").hide();//.appendTo("#aspnetForm"); jQuery(".nextProductDetailTabbedTable").after('
'+productsLegal+'
'); //jQuery(".sold-by-disclaimer.details").attr("style","width:250px; font-style:italic; font-weight:normal; text-align:left; color:#333; margin-bottom:20px; margin-top:30px;"); jQuery(".nextTileProductBanner").after('
'+productsLegal+'
'); //jQuery(".sold-by-disclaimer.top").attr("style","font-style:italic; font-weight:normal; text-align:center; color:#333; margin-bottom:20px;"); //jQuery(".nextProductListWrapper").append('
'+productsLegal+'
'); //jQuery(".sold-by-disclaimer.bottom2").attr("style","font-style:italic; font-weight:normal; text-align:center; color:#333; margin-bottom:50px; margin-top:50px;"); } } else{ jQuery("body").addClass("yh"); // //jQuery(".ui-mobile-viewport .nextCatalogFooter") jQuery(".ui-mobile-viewport .nextContent").after(''); jQuery(".ui-mobile-viewport .nextCatalogFooter").appendTo(jQuery(".ui-mobile-viewport .nextContent")); } if (jQuery("body").hasClass("ui-mobile-viewport")){ // mobile // cart jQuery(".nextCartProductListHeader").removeClass().addClass("nextCartProductListHeader"); jQuery(".nextPoweredBy").hide(); // fix incorrect mobile links in desktop content if (location.href.indexOf("/storefront/")>-1){ jQuery("[href*='/mobile/']").each(function(){ jQuery(this).attr("href",jQuery(this).attr("href").replace("/mobile/","/storefront/")); }); } jQuery(".header a[onclick*='redirect.aspx?Target=orderinfo.aspx']").each(function(){ jQuery(this).attr("onclick",jQuery(this).attr("onclick").replace("redirect.aspx","login.aspx").replace("redirect.aspx","login.aspx")); }); jQuery("body").addClass(jQuery(".nextTopBanner:visible").text().toLowerCase().replace(/\s/g,"").trim()); if(jQuery(".nextTopBanner h2").length && jQuery(".nmx-mobile h3.catName").length){ jQuery(".nextTopBanner h2").text(jQuery(".nmx-mobile h3.catName").hide().text()); } if (1==1){ jQuery(".ah .nextHeader").css("background-image","linear-gradient(#035396,#013C6F)").css("color","#ffffff").css("text-shadow","none"); jQuery(".ah .nextHeader .vetStoreOverviewOpenBtn").remove(); jQuery(".ah #ctl00_cphMain_mdDisclaimerTop_hlTextDialog").attr("style","display: inline; margin-left: 10px; font-weight: normal; font-size: 18px; color:#E05B00!important;"); //.css("margin-left","10px").css("font-weight","normal").css("font-size","18px").css("color","#013C6F"); jQuery(".ah .nextTopBanner, .ah .nextCartProductListHeader").css("background-image","linear-gradient(#ffffff,#ffffff)").css("color","#013C6F").css("text-shadow","none").css("border","none"); //jQuery(".ah .nextTopBanner, .ah .nextCartProductListHeader").css("background-image","linear-gradient(#035396,#013C6F)").css("color","#ffffff").css("text-shadow","none"); //jQuery(".ah .ui-btn").css("background-image","linear-gradient(#404040,#7d7d7d)"); //jQuery(".ah .ui-icon").css("background-color","#013C6F"); jQuery(".ah .nextMobileButton, .ah .nextHeader .vetStoreOverviewOpenBtn").css("background-image","linear-gradient(#EE8700,#E05B00)").css("text-shadow","none").find("*").css("color","#ffffff"); jQuery(".ah .nextAddToCartButton").css("background-image","linear-gradient(#035396,#013C6F)"); //jQuery(".ah .nextCartButton").css("background-image","linear-gradient(#ffb959,#EE8700)"); jQuery(".ah .nextCartButtonIcon").css("background-image","url(//cdn.nexternal.com/net/mobile/stylesheet/jquerymobile/images/cart_white.png)"); } if (1==1){ jQuery(".yh .nextTopBanner, .yh .nextCartProductListHeader").css("background-image","linear-gradient(#ffffff,#ffffff)").css("color","#562B9D").css("text-shadow","none").css("border","none"); jQuery(".yh .nextHeader").css("background-image","linear-gradient(#8A5DD5,#562B9D)").css("color","#ffffff").css("text-shadow","none"); jQuery(".yh .nextHeader .vetStoreOverviewOpenBtn").remove(); //jQuery(".yh .ui-icon").css("background-color","#E2C804"); //jQuery(".yh .nextTopBanner, .yh .nextCartProductListHeader").css("background-image","linear-gradient(#8A5DD5,#562B9D)").css("color","#ffffff").css("text-shadow","none"); //jQuery(".yh .ui-btn").css("background-image","linear-gradient(#404040,#7d7d7d)"); jQuery(".yh .nextMobileButton").css("background-image","linear-gradient(#FBDD00,#E2C804)").css("text-shadow","none").find("*").css("color","#333333"); jQuery(".yh .nextAddToCartButton").css("background-image","linear-gradient(#8A5DD5,#562B9D)"); //jQuery(".yh .nextCartButton").css("background-image","linear-gradient(#af88e3,#6128ac)"); jQuery(".yh .nextCartButtonIcon").css("background-image","url(//cdn.nexternal.com/net/mobile/stylesheet/jquerymobile/images/cart_black.png)"); } if (1==1){ jQuery(".contactus .nextTopBanner, .yh .nextCartProductListHeader").css("background-image","linear-gradient(#ffffff,#ffffff)").css("color","#17731c").css("text-shadow","none").css("border","none"); jQuery(".contactus .nextHeader").css("background-image","linear-gradient(#17731c,#0f4a12)").css("color","#ffffff").css("text-shadow","none"); jQuery(".contactus .nextHeader .vetStoreOverviewOpenBtn").remove(); jQuery(".contactus .nextMobileButton").css("background-image","linear-gradient(#4f4f4f,#202020)").css("text-shadow","none").find("*").css("color","#ffffff"); jQuery(".contactus .nextAddToCartButton").css("background-image","linear-gradient(#17731c,#0f4a12)"); jQuery(".contactus .nextCartButtonIcon").css("background-image","url(//cdn.nexternal.com/net/mobile/stylesheet/jquerymobile/images/cart_white.png)"); } useMobileSwitch(); } updateFootnoteText(); //if (location.href.indexOf("nutramaxstore.com")>-1){ //hideCategories("Breast Health Products"); //hideCategories("Environmental"); //hideCategories("Wellness"); //hideProductByName("Cosevite"); //} updateListContainers(); // seperate products into two lists with headings and disclaimers //if (jQuery(".nextSubcategoriesBanner:contains('Products by Name')").length){ seperateBrandCategoryLists(); } //useMobileCookie(); }); // SEPERATE BRAND LISTS function useMobileCookie(){ // set mobile cookie setCookie("Mobile+"+getSiteId(),getIsMobile(),4); if (getCookie("Mobile+"+getSiteId()) == "true" && location.href.indexOf("/storefront/") > -1){ location = location.href.replace("/storefront/","/mobile/"); } //getCookie("Mobile+"+getSiteId()); } // SEPERATE BRAND LISTS function seperateBrandCategoryLists(){ jQuery(".nextSubcategoriesBanner, .nextCategorySpacer").hide(); //if (jQuery("table.nextTileProducts").length && !jQuery(".nmxProductList").length){ jQuery("table.nextTileProducts").hide().before('
'); } //if (jQuery("table.nextCategoryTable").length && !jQuery(".nmxCategoryList").length){ jQuery("table.nextCategoryTable").hide().before('
 
'); } jQuery(".nmxCategoryListAll").before('
'); jQuery(".ah-product.brand").closest(".nextCatLinks").appendTo(".nmxAnimalBrandCategoryList"); jQuery(".yh-product.brand").closest(".nextCatLinks").appendTo(".nmxHumanBrandCategoryList"); jQuery(".ah-brand-legal").hide()//.prependTo(".nmxAnimalBrandCategoryList"); jQuery(".yh-brand-legal").hide()//.prependTo(".nmxHumanBrandCategoryList"); //jQuery(".nmxAnimalBrandCategoryList").prepend('

For Your Pet

'); //jQuery(".nmxHumanBrandCategoryList").prepend('

For Your Health

'); jQuery(".nmxAnimalBrandCategoryList").prepend('

Pet/Equine Products

'); jQuery(".nmxHumanBrandCategoryList").prepend('

Products

'); } // HIDE BREAST HEALTH CATEGORY function hideCategories(name){ jQuery(".nextTopCategory:contains('"+name+"')").hide(); jQuery(".nextCatName:contains('"+name+"')").closest("tr").hide(); } function hideProductByName(name){ //if (!jQuery(".nmxProductList").length){ jQuery("table.nextTileProducts").hide().before('
'); } jQuery(".nextTileProductWrapper.nextProductWrapper").filter(":contains('"+name+"')").hide();//.appendTo(".nmxProductList").css("float","left").css("padding-left","20px").css("width","240px").css("height","300px"); //if (!jQuery(".nmxCategoryList").length){ jQuery("table.nextCategoryTable").hide().before('
 
'); } jQuery(".nextCategoryTable .nextCatLinks").filter(":contains('"+name+"')").hide();//.appendTo(".nmxCategoryList"); } // UPDATE LIST CONTAINERS function updateListContainers(){ // hide first if required if (jQuery("table.nextTileProducts").length && !jQuery(".nmxProductList").length){ jQuery("table.nextTileProducts").hide().before('
'); } jQuery(".nextTileProductWrapper.nextProductWrapper").appendTo(".nmxProductList").css("float","left").css("padding-left","20px").css("width","240px").css("height","320px"); if (jQuery("table.nextCategoryTable").length && !jQuery(".nmxCategoryList").length){ jQuery("table.nextCategoryTable").hide().before('
 
'); } jQuery(".nextCategoryTable .nextCatLinks").appendTo(".nmxCategoryList"); } // SWITCH MOBILE function useMobileSwitch(){ if (qs("Mobile")=="False" && location.href.indexOf("/mobile/") > -1){ javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$cphFooter$mcfFooter$lbStandardStoreFront", "", true, "", "", false, true)); } //else if (qs("Mobile")=="True"){ javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$cphFooter$mcfFooter$lbStandardStoreFront", "", false, "", "", false, true)); } } // RESEARCHED BADGE LEGAL DISCLAIMER TEXT function updateFootnoteText(){ //window.setTimeout(function(){ jQuery(".footnote").filter(":contains(', Cosamin is the most researched')").each(function(index){ //jQuery(this).html(jQuery(this).html().replace(disclaimerTag,disclaimerText)); jQuery(this).html(' Based on published studies in U.S. peer-reviewed journals, the Cosamin brand, which includes Cosamin DS and Cosamin ASU, is the most researched glucosamine/chondroitin brand.'); }); //},0); } function getDisclaimer(products, soldBy){ var tmp,addclass=products[0];disclaimer = ""; jQuery.each(products, function(index,value){ if(jQuery(".nextCategoryTable .nextCatLinks, .nextProdName, .nextProductTarget, .nextCategoryTarget").filter(":contains('"+value.trim()+"')").length){ disclaimer += ", "+value; jQuery(".nextCategoryTable .nextCatLinks, .nextProdName, .nextProductTarget, .nextCategoryTarget").filter(":contains('"+value.trim()+"')").each(function(){ jQuery(this).addClass("brand").addClass(addclass); }); } }); if (disclaimer.trim().lastIndexOf(", ") == -1){ return ""; } else if (disclaimer.trim().lastIndexOf(", ") == 0){ disclaimer = disclaimer.replace(", ","")+" is "+soldBy; return disclaimer; } disclaimer = disclaimer.replace(", ","").trim(); if (disclaimer.indexOf(", ") == disclaimer.lastIndexOf(", ") && disclaimer.lastIndexOf(", ")>-1){ disclaimer = disclaimer.replace(", "," and "); } else{ tmp = disclaimer.substring(disclaimer.lastIndexOf(", ")); disclaimer = disclaimer.replace(tmp, tmp.replace(", ",", and ")); } return disclaimer+" are "+soldBy; } // mobile //jQuery(document).on('pagebeforeshow', function(){ //}); /* UTILITIES */ function getEnvironment(){ // stg, www return jQuery("head script[src*='/js/nmx.js']").attr("src").replace("//ws.nutramax.biz/store/","").replace("/js/nmx.js","").substr(0,jQuery("head script[src*='/js/nmx.js']").attr("src").replace("//ws.nutramax.biz/store/","").replace("/js/nmx.js","").indexOf("/")); } function getSiteId(){ // nutramax, nutramax2 return jQuery("head script[src*='/js/nmx.js']").attr("src").replace("//ws.nutramax.biz/store/","").replace("/js/nmx.js","").substring(jQuery("head script[src*='/js/nmx.js']").attr("src").replace("//ws.nutramax.biz/store/","").replace("/js/nmx.js","").indexOf("/")+1); } function getIsMobile(){ if (location.href.indexOf("/mobile/")>-1){ return true; } return false; } function getFilePath(){ // ws.nutramax.biz/store/*/* return jQuery("head script[src*='/js/nmx.js']").attr("src").replace("/js/nmx.js",""); } function getCookie(c_name){ //var cookie = document.cookie.replace(/; /g, ";") + ";"; var cookie = document.cookie; if (cookie.length > 0) { c_start = cookie.indexOf(c_name + "="); if (c_start != -1) { c_start = c_start + c_name.length + 1; c_end = cookie.indexOf(";", c_start); if (c_end == -1) c_end = cookie.length; return unescape(cookie.substring(c_start, c_end)); } } return ""; } function setCookie(c_name, value, expiredays){ var exdate = new Date(); exdate.setDate(exdate.getDate() + expiredays); document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toUTCString()) + "; path=/"; } function qs(name){ name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec(window.location.href); if( results == null ){ return ""; } else { return decodeURIComponent(results[1].replace(/\+/g, " ")); } }