window.onerror = function(){ return false; }
console.log("loading");
/*
nutramaxstore.com
To remove see:
Nexternal > Settings > Policies, Addenda, and Disclaimers > Tracking Code
*/
jQuery = nextQuery;
console.log("/nmx.nutramax.js");
HideFlickerTimeout();
/*if(navigator.userAgent.toLowerCase().indexOf("mobile")>-1 && location.href.indexOf("/mobile/")==-1 && jQuery(".bundles.nextProductList,.bundles.nextProductDetail").length){
console.log("try allow mobile");
jQuery("body").append('');
window.setTimeout(function(){ document.location = document.location.href.replace("?redirect","")+"?PersistentBodyClass=nutramaxstore"; });
}*/
//if(!document.attachEvent && navigator.userAgent.toLowerCase().indexOf("Trident/7")>-1){
//Object.prototype.attachEvent=function(event,func){
// this.addEventListener(event.split('on')[1], func);
//}
//}
jQuery("document").ready(function(){
if(getCookie("debug")=="123" || jQuery("body.debug").length){
jQuery("document").ready(function(){
jQuery("head").append('');
//jQuery("head").append('');
jQuery("head").append('');
jQuery("head").append('');
jQuery("head").append('');
//jQuery("head").append('');
}
function AllowPromoCodes(){
if (jQuery("body.RequirePromoCode").length){
jQuery("head").append('');
}
}
function RelatedProductsColumnToSidebar(){
//jQuery(".nextRelatedProductsColumn").insertAfter(".nextCartWrapper");
jQuery(".nextRelatedProductsColumn").insertAfter(".nextPersistWrapper");
jQuery("body.nmx").addClass("show-related");
}
function AddScheduledClass(start_date,end_date,cls,delay){
// class is removed at 12:00:01 AM on the morning AFTER the end_date
var d = new Date();
var year = d.getFullYear();
var month = ("0"+(d.getMonth()+1)).substr(("0"+(d.getMonth()+1)).length - 2);
var day = ("0"+d.getDate()).substr(("0"+d.getDate()).length - 2);
console.log("Today: "+year+""+month+""+day);
if((year+""+month+""+day)*1 >= start_date && (year+""+month+""+day)*1 <= end_date){
window.setTimeout(function(){
jQuery("body").addClass(cls);
//ScheduledClassCheck();
},delay);
console.log("Scheduled class: "+cls);
}
}
function ScheduledClassCheck(){
}
ShowHideSpecialsBanner();
jQuery("document").ready(function(){
TrackAnalyticsEvents();
BreaknextShortDesc();
AddRetailCSPContactEditButton();
AddCSPStoreLinks();
if(jQuery(".nextClinicStaffNMX").length || jQuery(".nextClinicStaff").length){
StartCSPScripts();
}
AddCartTracking();
UpdatePrivacyPolicyLinks();
AddHolidayHours();
});
function AddHolidayHours(){
//jQuery(".nextCartPolicies").after('
Nutramax Laboratories would like to wish you a very Merry Christmas and a Holy Holiday Season.
In order for our employees and their families to enjoy the holiday season, we will be closed December 24 through January 3, 2017.
Orders placed by 2:00 PM EST on December 23, 2016 will be shipped that day. All orders placed after 2:00 PM EST on December 23, 2016, will be shipped on or after January 3, 2017.
Note: We are unable to ship on December 24, due to restricted shipping by UPS.
We will reopen at 8:30 AM EST on Tuesday, January 3, 2017.
In order for our employees and their families to enjoy the holiday season, our business office will be closed from Friday, December 21 at 5:00 PM EST through Tuesday, January 1, 2019. We will reopen at 8:30 AM EST on Wednesday, January 2, 2019. Orders placed by 2:00 PM EST on Friday, December 21 will be shipped that day.
'); jQuery(".holiday-closing-msg").append('All orders placed after 2:00 PM EST on Friday, December 21 will be shipped on or after December 27, 2018.
'); } function UpdatePrivacyPolicyLinks(){ jQuery("a[href]:contains('Privacy Policy')").hide().after('Privacy Policy'); jQuery("a[href]:contains('Do Not Sell')").attr("target","_blank").attr("href","https://www.nutramaxlabs.com/policies/privacy-policy-consumer-care#donotsell"); if (jQuery("a[href]:contains('Do Not Sell')").length){ jQuery("a[href]:contains('Do Not Sell')").attr("target","_blank").attr("href","https://www.nutramaxlabs.com/policies/privacy-policy-consumer-care#donotsell"); } else { jQuery(".footer a[href]:contains('Privacy Policy')").closest("li").clone().insertAfter(jQuery(".footer a[href]:contains('Privacy Policy')").closest("li"));//.after('Privacy Policy'); jQuery(".footer a[href]:contains('Privacy Policy'):last").attr("target","_blank").attr("href","https://www.nutramaxlabs.com/policies/privacy-policy-consumer-care#donotsell").text("Do Not Sell My Information"); } jQuery("a[href]:contains('Terms of Use'), .nextLegalDisclaimer a").attr("target","_blank").attr("href","http://downloads.nutramaxlabsconsumercare.com/NMX-Consumer-Care-Terms-Of-Use.pdf"); } function UseEnhanedEcommerceTracking(){ ga('require', 'ec'); if(jQuery(".nextProductDetail").length){ // details view ga('ec:addProduct', { 'id': jQuery(".nextSKU").text().trim(), 'name': jQuery(".nextProdName").text().trim(), 'category': jQuery("meta[property='og:category']").attr("content") }); ga('ec:setAction', 'detail'); ga('send', 'pageview'); } } function AddCartTracking(){ //window.setTimeout(function(){ if (jQuery("td[id*='TotalQuantity']").length){ console.log(jQuery("td[id*='TotalQuantity']").text().trim()+' items in cart'); ga('send', 'event', 'Shopping Carts', jQuery("td[id*='TotalQuantity']").text().trim()+' items in cart', masterServerVars.CustomerID); jQuery("td[id*='DisplayQuantity']").each(function(){ var ProductText = jQuery(this).closest("tr").find("td[id*='ProductText']").text().trim(); var ProductPrice = jQuery(this).closest("tr").find("td[id*='ProductPrice']").text().trim(); console.log('('+jQuery(this).text().trim()+') '+ProductText); console.log(ProductPrice); ga('send', 'event', 'Shopping Carts', ProductText, '('+jQuery(this).text().trim()+') '+ProductPrice); }); } //},1000); } function HideFlickerTimeout(){ window.setTimeout(function(){ if(jQuery(".hide-flicker").length){ jQuery(".hide-flicker").removeClass("hide-flicker"); ga('send', 'event', 'Issue', 'HideFlickerTimeout over 5 seconds', masterServerVars.CustomerID); } },5000); } function LocalClassReady(){ if(!jQuery(".nmx").length){ return; } // internal below here in this function } function TrackAnalyticsEvents(){ if(jQuery(".nextLoginSuccess").length){ if(jQuery(".nextClinicStaffNMX, .nextClinicStaff").length){ ga('send', 'event', 'CSP Members', 'Auto Login', masterServerVars.CustomerID); } if(jQuery(".nextVeterinarianNMX, .nextVeterinarian").length){ ga('send', 'event', 'Veterinarians', 'Auto Login', masterServerVars.CustomerID); } if(jQuery(".nextStudent").length){ ga('send', 'event', 'Student', 'Auto Login', masterServerVars.CustomerID); } if(jQuery(".nextFaculty").length){ ga('send', 'event', 'Faculty', 'Auto Login', masterServerVars.CustomerID); } if(jQuery(".nextConsumerNMX, .nextConsumer").length){ ga('send', 'event', 'Consumers', 'Login', masterServerVars.CustomerID); } } } function StartCSPScripts(){ //return; console.log("StartCSPScripts()"); LogIntegrationLogging(); //ShowEntryWelcome(); AddCSPLimitsCartBanner(); EnableIntegrationOnMobile(); EnableCSPReturnOnLogout(); } function CatchCSPPasswordRecovery(){ if(jQuery(".nextMobileDialog:contains('csp.login'), .nextPasswordReminder:contains('csp.login')").length){ jQuery(".nextMobileDialog:contains('csp.login'), .nextPasswordReminder:contains('csp.login')").html('Wrong Site'); document.location = "https://www.vet-ez-order.com/"; } else{ window.setTimeout(function(){ CatchCSPPasswordRecovery(); },100); } } function UseDynamicCopyright(){ //var d = new Date(); //var year = d.getFullYear(); //if (!jQuery(".copyright").length && !jQuery(".copyR").length ){ jQuery("body .nextContentMain").append(''); } //jQuery(".copyright.auto").html('© 2009-'+year+' Nutramax Laboratories All rights reserved'); jQuery(".copyR").text("946 Quality Dr, Lancaster, SC 29720"); if(jQuery(".nmxCompaniesLegal center").length){ jQuery(".nmxCompaniesLegal center").html(jQuery(".nmxCompaniesLegal center").html().replace("owned by Nutramax Laboratories, Inc.","owned by Nutramax Laboratories")); } } function EnableCSPReturnOnLogout(){ if(jQuery(".nextClinicStaffNMX.nextLogin").length || jQuery(".nextClinicStaff.nextLogin").length || jQuery(".nextLogin").length){ eval(jQuery("#lbTempLogOut").attr("href")); //document.location = "https://www.vet-ez-order.com/bus/login.aspx?BodyClass=stafflogin&Mode=Timeout"; } } function AddCSPLimitsCartBanner(){ if(!jQuery(".ui-mobile-viewport").length){ // desktop jQuery(".nextClinicStaffNMX #upCartData, .nextClinicStaff #upCartData").after('
');
} else{
// mobile
jQuery(".nextClinicStaffNMX .nextContent, .nextClinicStaff .nextContent").append('
');
}
}
function EnableIntegrationOnMobile(){
// ATTENTION REMOVE CSS BEFORE REMOVING REMOVING FUNCTION
if(jQuery(".bundles").length && location.search.indexOf("noredirect")>-1 && location.search.indexOf("nextIntegrationSuccess")>-1){
document.location = document.location.href.replace("&noredirect","").replace("?noredirect","");
}
else { jQuery(".hide-flicker").removeClass("hide-flicker"); }
window.setTimeout(function(){
if(!jQuery("body:visible").length){ document.location = "http://store.nutramaxstore.com"; }
}, 3000);
}
function CustomExpCouponMessage(){
//console.log("checking for coupon message");
jQuery(".nextStandardStoreFrontLink a:contains('Version')").text("Non-Mobile Version");
if (jQuery("#ctl00_ctl00_ctl00_cphMain_ctl00_cpnEnterCoupon_pnlError").length){
if(jQuery("#ctl00_ctl00_ctl00_cphMain_ctl00_cpnEnterCoupon_pnlError .nextBannerText").text().toLowerCase().indexOf("activation error")>-1){
if(jQuery("#ctl00_ctl00_ctl00_cphMain_ctl00_cpnEnterCoupon_pnlError p").text().toLowerCase().indexOf("nmxfriend20")>-1){
//jQuery("#ctl00_ctl00_ctl00_cphMain_ctl00_cpnEnterCoupon_pnlError .nextBannerText:first").text("Sorry");
jQuery("#ctl00_ctl00_ctl00_cphMain_ctl00_cpnEnterCoupon_pnlError p").html('
');
var ReturnToVetHref = 'https://www.vet-ez-order.com/bus/?PersistentBodyClass=ReturnFromRetail';
//ReturnToVetHref = jQuery("#lbFullLogOut").attr("href");
//jQuery(".nextVeterinarianNMX .header .navigation, .nextClinicStaffNMX .header .navigation, .nextClinicStaff .header .navigation")
jQuery(".header .navigation").next().addClass("csp-vet-title").html('PRODUCTS FOR YOU');
jQuery(".csp-vet-return-nav").append(' | Consumer Account');
jQuery(".csp-vet-return-nav").append(' | Update Contact Information');
//jQuery(".nextVeterinarianNMX .nextCartContents, .nextClinicStaffNMX .nextCartContents, .nextClinicStaff .nextCartContents")
jQuery(".nextCartContents").prepend('');
//jQuery(".nextVeterinarianNMX .nextCartPolicies, .nextClinicStaffNMX .nextCartPolicies, .nextClinicStaff .nextCartPolicies")
jQuery(".nextCartPolicies").prependTo(".nextCartWrapper");
}
function TrackCheckoutForProduct(){
console.log("fb watching checkout button");
window.setTimeout(function(){
if(location.href.toLowerCase().indexOf("avmacol")>-1 || jQuery(".nextInnerTable").text().toLowerCase().indexOf("avmacol")>-1 && (location.href.indexOf("orderinfo.aspx")==-1 && location.href.indexOf("invoice")==-1)){
//fbq('init', '127651984363149');
//console.log("fb 127651984363149");
console.log("fb viewcontent");
//fbq('track', 'PageView');
fbq('track', 'ViewContent');
//if(jQuery(".nextInnerTable").text().toLowerCase().indexOf("avmacol")>-1){ console.log("fb viewcontent"); fbq('track', 'PageView'); fbq('track', 'ViewContent'); }
}
if(location.href.indexOf("invoice")>-1){
//fbq('init', '127651984363149');
//console.log("fb 127651984363149");
console.log("fb purchase");
//fbq('track', 'PageView');
fbq('track', 'Purchase');
}
if(location.href.indexOf("orderinfo.aspx")>-1){
//console.log("fb avmacol checkout");
//fbq('track', 'AvmacolCheckout');
if(jQuery(".nextCartProdText[href*='avmacol']").length){ console.log("fb avmacol checkout"); fbq('track', 'AvmacolCheckout'); }
}
},1000);
jQuery(".nextAddToCartButton").each(function(){
if(jQuery(this).closest(".nextTileProductWrapper, .nextProductDetailTop").text().toLowerCase().indexOf("avmacol") > -1){
jQuery(this).attr("onmousedown","fbq('track', 'AddToCart'); console.log('fb avmacol addtocart');");
}
});
jQuery(".nextCheckOutButton").unbind("mousedown").mousedown(function(){
//if(jQuery(".nextCartProdText[href*='avmacol']").length){ console.log("fb avmacol checkout"); fbq('track', 'AvmacolCheckout'); }
if(jQuery(".nextCartProdText[href*='avmacol-immune']").length){ console.log("avmacol-order"); __adroll.record_user({"adroll_segments": "1366246a"}); }
if(jQuery(".nextCartProdText[href*='tivose']").length){ console.log("tivose-order"); __adroll.record_user({"adroll_segments": "f1272d60"}); }
});
}
function AddToCartButtonClicked(){
}
function AddRetailCSPContactEditButton(){
//jQuery(".nextClinicStaffNMX a[href*='register.aspx'], .nextClinicStaff a[href*='register.aspx']")
jQuery("a[href*='register.aspx']").attr("href",'javascript:NotifyLeavingSite(\'https://www.vet-ez-order.com/bus/register.aspx?PersistentBodyClass=ReturnToRetail&Target=account.aspx\');');
}
function BreaknextShortDesc(){
jQuery(".nextProdName").each(function(){ jQuery(this).html(jQuery(this).html().replace(" 60 Tablets (","
*THESE STATEMENTS HAVE NOT BEEN EVALUATED BY THE FOOD AND DRUG ADMINISTRATION. THIS PRODUCT IS NOT INTENDED TO DIAGNOSE, TREAT, CURE, OR PREVENT ANY DISEASE.
' jQuery(".fda-disclaimer").remove(); if(!jQuery(".fda-disclaimer").length && !jQuery("*:contains('THESE STATEMENTS')").length && jQuery(".nextProductWrapper:contains('*')").length){ if(jQuery(".nextProductDetailTabbed").length){ jQuery(".nextProductDetailTabbed:first").append(fda_disclaimer); } else { jQuery("#tdBottom").prepend(fda_disclaimer); } } jQuery(".fda-disclaimer").attr("style","font-family:Arial; width:520px; max-width:90%;"); } function Buy(folder,id){ if(jQuery(".nextDirectCheckoutProduct"+id).length){ //jQuery(".nextDirectCheckoutProduct"+id).append(''); jQuery(".nextDirectCheckoutProduct"+id).append(''); jQuery(".nextDirectCheckoutProduct"+id).append(''); } } console.log("loaded");