');
}
}
// window.setTimeout(function(){
// // prevent previous customer from staying logged in to store
// if (!!jQuery('body[class*="fullname_"]').length && !!jQuery('.withAvatar span').length){
// if (!jQuery('body[class*="'+jQuery('.withAvatar span').text().replace(" ","_").replace(".","")+'"]').length){
// window.close();
// } else {
// console.log("verified_fullname");
// }
// } else {
// console.log("not_verifying_fullname");
// }
// },400);
function VerifyFullname(){
// prevent previous customer from staying logged in to store
if (!!jQuery('.withAvatar span').length && !jQuery('body.name_verification_done').length){
if (!!jQuery('body[class*="fullname_"]').length){
if (!jQuery('body[class*="'+jQuery('.withAvatar span').text().replace(" ","_").replace(".","")+'"]').length){
//ga('dashboard.send', 'event', "User Events", "Vet-EZ-Order name verification failed", jQuery('.withAvatar span').text());
//window.setTimeout(function(){ window.close(); },100);
} else {
//ga('dashboard.send', 'event', "User Events", "Vet-EZ-Order name verification success", jQuery('.withAvatar span').text());
console.log("verified_fullname");
}
} else {
//ga('dashboard.send', 'event', "User Events", "Vet-EZ-Order name verification skipped", jQuery('.withAvatar span').text());
console.log("not_verifying_fullname");
}
jQuery('body').addClass("name_verification_done");
}
}
function VerifyCustomerType(){
// prevent previous customer type persisting in store
if (!!jQuery('.withAvatar span').length && !jQuery('body.type_verification_done').length){
if (!!jQuery('body[class*="shop_"]').length){
if (!!jQuery('body[class*="shop_clinic"]').length){
if (!jQuery('body[class*="Veterinarian"]').length){
//ga('dashboard.send', 'event', "User Events", "Vet-EZ-Order clinic type verification failed", jQuery('.withAvatar span').text());
//window.setTimeout(function(){ window.close(); },100);
} else {
//ga('dashboard.send', 'event', "User Events", "Vet-EZ-Order clinic type verification success", jQuery('.withAvatar span').text());
console.log("verified_clinic_type");
}
} else if (!!jQuery('body[class*="shop_pet"]').length){
if (!!jQuery('body[class*="Veterinarian"]').length){
//ga('dashboard.send', 'event', "User Events", "Vet-EZ-Order pet type verification failed", jQuery('.withAvatar span').text());
//window.setTimeout(function(){ window.close(); },100);
} else {
//ga('dashboard.send', 'event', "User Events", "Vet-EZ-Order pet type verification success", jQuery('.withAvatar span').text());
console.log("verified_pet_type");
}
}
} else {
//ga('dashboard.send', 'event', "User Events", "Vet-EZ-Order type verification skipped", jQuery('.withAvatar span').text());
console.log("not_verifying_type");
}
jQuery('body').addClass("type_verification_done");
}
}
var SpecialDropShipItems = "437,418,438,417,439,413,414,422,450,444,443,463,465,464,454,420,421,419,448,457,470,483";
jQuery(document).ready(function(){
window.setTimeout(function(){
// if (jQuery('.nextProduct485 .nextCartProdText:contains("Balance")').length){
// jQuery('.nextCheckOutButtonBottomWrapper input').click();
// }
jQuery('.nextProduct485 #ctl00_ctl00_ctl00_cphMain_cphMain_cphMain_pdtProduct_atcTabbed_hlAddToCart').attr("href",jQuery('.nextProduct485 #ctl00_ctl00_ctl00_cphMain_cphMain_cphMain_pdtProduct_atcTabbed_hlAddToCart').attr("href"));
//jQuery('#ctl00_ctl00_ctl00_cphMain_cphMain_cphMain_pdtProduct_atcTabbed_hlAddToCart').attr("href",jQuery('#ctl00_ctl00_ctl00_cphMain_cphMain_cphMain_pdtProduct_atcTabbed_hlAddToCart').attr("href")+';location = "/bus/invoice.aspx";');
//jQuery('.nextProduct485 #ctl00_ctl00_ctl00_cphMain_cphMain_cphMain_pdtProduct_atcTabbed_hlAddToCart').attr("href","?AddQuantity=4");
// /cosequinreg-asu-balance-pellets-case-of-4-1200-g-p485.aspx?AddQuantity=4
if (jQuery('.nextProduct485 .nextCartProdText:contains("Balance")').length){
location = "/bus/invoice.aspx";
}
if (jQuery('.ui-mobile .nextProduct485 .nextCartProdText:contains("Balance")').length){
location = "/bus/mobile/invoice.aspx";
}
}, 2000);
});
window.setInterval(function(){
//if (window.name.indexOf("vetez_store") > -1){
// once per page asap
if (!jQuery("html[mynutramax]").length){ MyNutramaxUpgrade(); }
if (jQuery('.nextCartProdText:contains("Balance")').length){
jQuery(".nextCartWarningsWrapper").html('You have started a pre-order. You must complete your pre-order, or start a new order before adding additional items. Start a new order');
jQuery(".nextAddToCartTable").hide();
}
if (jQuery("body").attr("class").indexOf("nextVeterinarian") > -1){
jQuery("html:not([mynutramax])").attr("mynutramax","clinic");
document.title = "Order for your Clinic";
} else if (jQuery("body").attr("class").indexOf("nextClinicStaff") > -1){
jQuery("html:not([mynutramax])").attr("mynutramax","staff");
document.title = "Order for your pet - Save 15%";
} else if (jQuery("body").attr("class").indexOf("VetStudent") > -1){
jQuery("html:not([mynutramax])").attr("mynutramax","student");
document.title = "Order for your pet - 50% Discount";
} else if (jQuery("body").attr("class").indexOf("VetFaculty") > -1){
jQuery("html:not([mynutramax])").attr("mynutramax","faculty");
document.title = "Order for your pet - 50% Discount";
}
//}
VerifyCustomerType();
//VerifyFullname();
},300);
var wparam;
function MyNutramaxUpgrade() {
// add nav back to MyNutramax etc.
console.log("MyNutramaxUpgrade");
wparam = (window.name+"|").split("|");
jQuery('#header a#logo').attr("target","dashboard|"+wparam[1]).attr("href","https://"+wparam[1]+"/dashboard/#");
if (jQuery("body").attr("class").indexOf("nextVeterinarian") > -1){
jQuery('#header #topNav [href*="contact-us-"]').attr("target","dashboard|"+wparam[1]).attr("href","https://"+wparam[1]+"/dashboard/#tile:contact_rep");
} else {
jQuery('#header #topNav [href*="contact-us-"]').attr("target","dashboard|"+wparam[1]).attr("href","https://"+wparam[1]+"/dashboard/#tile:contact_nutramax");
}
}
//jQuery("html").attr("referrer",);
// if (location.referrer.indexOf("mynutramax") > -1){
// if (getCookie("nmx_referrer") == "jbackus"){ alert(location.referrer); }
// setCookie("nmx_referrer", location.referrer, 2);
// }
window.setTimeout(function(){
jQuery(".nextProdDiscount").each(function(){
jQuery(this).html(jQuery(this).html().replace("Your CSP Price","Your Price"));
});
},2000);
//jQuery("head").append('');
LogOutIfNotLoggedIn();
window.setTimeout(function(){
HideRetailStore();
},3000);
window.setTimeout(function(){
jQuery(document).ready(function(){
VetDropShipSpecialItems(SpecialDropShipItems);
if (jQuery(".nextShipToCartProducts").length){ MonitorMobileCart(); }
});
},100);
CleanupAccountPage();
function CleanupAccountPage(){
window.setTimeout(function(){
jQuery(".nextContactDetails").find("a").prependTo(".nextContactAddress");//.css("display","block");//.css("margin-bottom","10px");
//jQuery(".nextContactAddress a").insertAfter(jQuery(".nextContactAddress b:first"));
jQuery(".nextContactDetails").empty().show();
jQuery(".nextContactAddress a").appendTo(".nextContactDetails");
},1000);
}
//GetCartData();
// function GetCartData(){
// jQuery.ajax({
// type: "POST",
// url: "https://www.vet-ez-order.com/bus/mobile/common/mobilecartservices.svc/GetCartData",
// success: function(){ return data; }
// });
// $.post( "https://www.vet-ez-order.com/bus/mobile/common/mobilecartservices.svc/GetCartData", function( data ) {
// $( ".result" ).html( data );
// });
// }
// PreselectDropShip();
// function PreselectDropShip(){
// window.setTimeout(function(){
// jQuery(".nextCartShipTo").find("b:first");
// },1000);
// }
WatchAndDismissShiptoLimitWarnings();
function WatchAndDismissShiptoLimitWarnings(){
if (jQuery('#ctl00_ctl00_ctl00_cphMain_ctl00_veValidationErrors_btnValErrorsClose').length){
jQuery('.nextCartWarningsWrapper').hide();
jQuery('.nextCartValidationError').text("Starting a new order").hide();
//jQuery('#ctl00_ctl00_ctl00_cphMain_ctl00_veValidationErrors_btnValErrorsClose').click();
document.location.reload();
}
if (jQuery('[class*="ClinicStaff"] .modal:contains("maximum number of Ship-To Addresses")').length){
jQuery('.nextCartValidationPopup').mobilePopup('hide');
jQuery('.nextWarningsNotification').hide();
}
if (jQuery('[class*="ClinicStaff"] .nextCartWarningsWrapper:contains("maximum number of Ship-To Addresses")').length){
jQuery('.nextCartWarningsWrapper').hide();
}
window.setTimeout(function(){
WatchAndDismissShiptoLimitWarnings();
},400);
}
function MonitorMobileCart(){
VetDropShipSpecialItems(SpecialDropShipItems);
window.setTimeout(function(){
MonitorMobileCart()
},1000);
}
function VetDropShipSpecialItems(ids){
if (jQuery("body").attr("class").indexOf("nextVeterinarian") == -1){ return; }
console.log("dropship...");
var dropship_singles = ids.split(",");
console.log("dropship: "+dropship_singles.length);
for (i = 0; i < dropship_singles.length; i++) {
jQuery(".nextListProduct"+dropship_singles[i]).addClass("drop-ship-only");
jQuery(".nextProduct"+dropship_singles[i]).addClass("drop-ship-only");
//jQuery(".nextProduct"+dropship_singles[i]).find(".nextProductWrapper").addClass("drop-ship-only");
}
//jQuery(".nextProductDetail .nextProductWrapper").addClass("nextProduct");
for (i = 0; i < dropship_singles.length; i++) {
if (!jQuery(".nextShipToCartProducts").length && jQuery('.nextCartProducts [href*="-p'+dropship_singles[i]+'.aspx"]').length){
jQuery("body").addClass("dropship_only_order");
//console.log("found "+dropship_singles[i]+" in cart");
}
if (jQuery(".nextShipToCartProducts a").length && jQuery('.nextShipToCartProducts [href*="-p'+dropship_singles[i]+'.aspx"]').length){
jQuery("body").addClass("dropship_only_order");
//console.log("found "+dropship_singles[i]+" in cart");
} else if (jQuery(".nextShipToCartProducts a").length){
jQuery("body").addClass("clinic_only_order");
//console.log("item "+dropship_singles[i]+" not in cart");
}
}
UpdateDropshipWarnings();
}
function RestartOrder(){
//jQuery(".nextCartDeleteAll").click();
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ctl00$ctl00$cphMain$ctl00$ctrShoppingCart$lbRemoveAll", "", true, "", "", false, true));
window.setTimeout(function(){ document.location.reload(); },500);
}
function UpdateDropshipWarnings(){
//jQuery(".nextVeterinarian.drop-ship-only .nextShipTo .ui-btn-text span").text("New Customer");
jQuery(".drop-ship-only .nextShipTo #ctl00_cphMain_ddlShipTo").find("option[value='0']").remove();
jQuery(".nextProduct.drop-ship-only .nextShipToMulti, body.drop-ship-only .nextProductWrapper .nextShipToMulti").find("option[value='0']").remove();
jQuery(".nextProduct:not(.drop-ship-only) .nextShipToMulti option:not([value=0]), .nextProductDetail:not(.drop-ship-only) .nextShipToMulti option:not([value=0])").remove();
//|| jQuery(".nextCartValidationError:contains('reached')").length
if (jQuery(".nextCartWarningsWrapper:contains('reached')").length || jQuery(".nextWarningsPopupMessage:contains('reached')").length || jQuery(".nextCartValidationError:contains('reached')").length){
if (jQuery("body.dropship_only_order").length){
jQuery(".nextProduct:not(.drop-ship-only)").addClass("mismatch-order-type");
jQuery(".nextProduct:not(.drop-ship-only) .nextAddToCartTable").remove();
jQuery(".nextCartWarningsWrapper:contains('reached')").html('This is a dropship only order. Products for your clinic cannot be addded to this order. Start a new order').show();
jQuery(".nextWarningsPopupMessage:contains('reached'), .nextCartValidationError:contains('reached')").html('This is a dropship only order. Products for your clinic cannot be addded to this order until you remove all dropship items.').show();
jQuery("body").addClass("dropship_only_order");
} else {
jQuery(".nextProduct.drop-ship-only").addClass("mismatch-order-type");
jQuery(".nextProduct.drop-ship-only .nextAddToCartTable").remove();
jQuery(".nextCartWarningsWrapper:contains('reached')").html('This order will be shipped to your Clinic. Dropship items cannot be added to this order. Start a new order').show();
jQuery(".nextWarningsPopupMessage:contains('reached'), .nextCartValidationError:contains('reached')").html('This order will be shipped to your Clinic. Products for dropship cannot be addded to this order until you remove all clinic items.').show();
jQuery("body").addClass("clinic_only_order");
if (location.hash == "#CustomerCart"){
jQuery('.ui-mobile #ctl00_mctMobileCart_pnlWarningsNotification').hide();
jQuery('.ui-mobile .nextCartValidationPopup').mobilePopup('hide');
}
}
} else {
//jQuery(".nextShipToMulti").insertBefore(".nextAddToCartTable");
jQuery(".nextProduct.drop-ship-only .nextShipToMulti").each(function(){
jQuery(this).insertBefore(jQuery(this).closest(".nextProduct").find(".nextAddToCartTable"));
});
jQuery("body.drop-ship-only .nextProductWrapper .nextShipToMulti").each(function(){
jQuery(this).insertBefore(jQuery(this).closest(".nextProductWrapper").find(".nextAddToCartTable"));
});
}
//jQuery(".drop-ship-only.clinic_only_order")
//jQuery(".nextVeterinarian.drop-ship-only .nextShipToMulti, .nextVeterinarian.drop-ship-only [data-key='ShipToIndex']").find("option[value=0]").remove();
//jQuery(".nextVeterinarian .drop-ship-only").find("option[value=0]").remove();
jQuery(".nextVeterinarian .drop-ship-only option:contains('someone else')").text("New Customer").prop("selected",true);
jQuery(".nextVeterinarian.drop-ship-only .nextShipToMulti option:contains('someone else'), .nextVeterinarian.drop-ship-only [data-key='ShipToIndex'] option:contains('someone else')").text("New Customer").prop("selected",true);
jQuery(".nextVeterinarian.drop-ship-only .nextShipTo .ui-btn-text span").text(jQuery(".nextVeterinarian.drop-ship-only [data-key='ShipToIndex'] option:selected").text());
jQuery(".nextVeterinarian.drop-ship-only [data-key='ShipToIndex'] option").css("padding-left","6px");
jQuery(".nextVeterinarian.drop-ship-only .nextShipTo .ui-btn-text").css("text-align","left");
if (jQuery(".nextVeterinarian .nextShipToMulti, .nextVeterinarian .nextShipName").length){
//UpdateDropshipDialog();
//jQuery("body.nextVeterinarian.drop-ship-only .main.productDetail")
if (!jQuery(".dropship-offer").length){
jQuery("body.nextVeterinarian.drop-ship-only .nextProductDetailBottom, body.nextVeterinarian.drop-ship-only .nextProductDetail").before('
In an effort to help you during these difficult times, Nutramax Laboratories is willing to ship this item directly to your clients free of charge. Some of you may already be using a direct-delivery service through your distributor and if so, we encourage you to continue to do so.
This is a Limited time offer. Nutramax Laboratories reserves the right to end or modify this offer at any time.
');
}
}
UpdateDropshipDialog();
}
WatchDropshipWarnings();
function WatchDropshipWarnings(){
if (jQuery(".dropship_only_order").length && (jQuery(".nextCartWarningsWrapper:contains('reached')").length || jQuery(".nextWarningsPopupMessage:contains('reached')").length || jQuery(".nextCartValidationError:contains('reached')").length)){
// if (jQuery(".nextCartWarningsWrapper:contains('reached')").length || jQuery(".nextWarningsPopupMessage:contains('reached')").length || jQuery(".nextCartValidationError:contains('reached')").length){
UpdateDropshipWarnings();
}
window.setTimeout(function(){ WatchDropshipWarnings(); }, 1000);
}
function UpdateDropshipDialog(){
//ctl00_ctl00_ctl00_cphMain_cphMain_cphMain_lvTileProducts_ctrl0_ctl02_tpTileProduct_atcTop_estShipTo_btnEnter
jQuery('.nextVeterinarian [autocomplete="nickname"], .nextVeterinarian .nextShipName input').removeAttr("autocomplete").attr("placeholder","Customer Name");
jQuery('.nextVeterinarian .nextShipName input[type="submit"].nextHTMLButton:not(.nextModalClose), .nextVeterinarian .ui-submit .ui-btn-text:contains("Enter")').val("Continue").text("Continue");
jQuery('.nextGeneralConfirmation.nextMobileDialog [data-key="Yes"]').attr('onclick','document.location.reload();');
if (!jQuery('.ui-mobile-viewport').length && (jQuery('.dropship_only_order .nextCartEmpty:contains("empty")').length || jQuery('.clinic_only_order .nextCartEmpty:contains("empty")').length)){
jQuery('.nextCartEmpty:contains("empty")').text("Please wait...");
jQuery('body').addClass("is-reloading");
//alert(123);
document.location.reload();
}
if (!jQuery('.dropship_only_order').length && !jQuery('.clinic_only_order').length){
jQuery('.nextCartWarningsWrapper:contains("reached")').text("Please wait...");
//document.location.reload();
}
if (!jQuery('.is-reloading').length){
window.setTimeout(function(){ UpdateDropshipDialog(); },500);
}
}
// if (){
// }
// jQuery("document").ready(function(){
// window.setTimeout(function(){
// if (nmxuser == "jbackus"){
// UseNewVetRegLoginPage();
// }
// }, 1500);
// });
//UseNewVetRegLoginPage(); // j20230216a - calling this from above need to wait until ga loads
function UseNewVetRegLoginPage(){
// if (jQuery(".nextNotLoggedIn.nextRegister").length){ //j20230216a - go to dashboard #vetez
// jQuery('body').hide();
// document.location = "https://www.mynutramax.com/#";
// ga('dashboard.send', 'event', "User Events", "Vet-EZ-Order redirect to My Nutramax", getCookie("reg-pg-login-attempt"));
// } else
if (location.pathname.indexOf("login.aspx") > -1 && location.search.toLowerCase().indexOf("stafflogin") == -1 && location.search.toLowerCase().indexOf("recover") == -1 && location.hash.indexOf("recover") == -1){
jQuery("body,html").hide();
window.setTimeout(function(){
var loc = location.href.toLowerCase().replace("login.aspx","register.aspx");
// fix desktop to mobile redirect after reg request
if (window.innerWidth > 768){
loc = loc.replace("/mobile/","/");
}
//document.location = loc;
jQuery('body').hide();
if (window.name.indexOf("vetez_store") > -1){
//ga('dashboard.send', 'event', "User Events", "Vet-EZ-Order returned to My Nutramax", "");
//document.location = "https://www.mynutramax.com/"; //j20230216a - always go to dashboard instead on login reg combo page
window.setTimeout(function(){ window.close(); },400);
} else {
window.name = "vetez_login";
//ga('dashboard.send', 'event', "User Events", "Vet-EZ-Order redirect to My Nutramax", "");
document.location = "https://www.mynutramax.com/"; //j20230216a - always go to dashboard instead on login reg combo page
}
},100);
return;
}
// new reg page script/css
jQuery("document").ready(function(){
if ( (location.pathname.indexOf("register.aspx") > -1 || location.pathname.indexOf("login.aspx") > -1 || jQuery(".nextLoggedIn.nextPending").length) && !jQuery(".nextVeterinarian").length && !jQuery(".nextVeterinarianNMX").length && !jQuery(".nextClinicStaff").length && !jQuery(".nextClinicStaffNMX").length ){
jQuery("head").append('');
jQuery("head").append('');
jQuery("head").append('');
} else {
}
});
}
// send to dashboard in not logged in
/////////////
// if (jQuery(".nextNotLoggedIn.nextRegister").length){
// jQuery('body').hide();
// document.location = "https://www.mynutramax.com/";
// }
////////////
jQuery("document").ready(function(){
//AjaxSpecials();
});
function AjaxSpecials(){
if(!jQuery(".specials-wrap .inline").length){
console.log("created node");
jQuery(".specials-wrap").append('');
}
jQuery(".specials-wrap .inline").load("https://www.nutramax.biz/email/ah/index.php",function(){
console.log("resizing iframe "+jQuery(".specials-wrap .inline").height());
jQuery(".specials-wrap iframe").css("max-height",jQuery(".specials-wrap .inline").height()+"px");
window.setTimeout(function(){ jQuery(".specials-wrap .inline").hide(); },1000);
});
}
jQuery("document").ready(function(){
jQuery(".corporate-links.forty ul.col2 li:first").after('
');
//AddConsumerStoreLinkToFooter();
/* if(jQuery(".nmxNewSiteLogin").length){
jQuery("body").removeClass("nmxLogOut");
jQuery("body").removeClass("nmxCosequin");
Cookies.remove('nmxStoreLogoutURL');
Cookies.remove('nmxAccountFullName');
jQuery("body").addClass("nmxSameSiteLogin");
} else{
AlternateStoreLoginTimeoutURL();
// for alternate stores to be able to log out with a URL
if(jQuery(".nmxLogOut").length
|| jQuery(".nmxCosequin.nextClinicStaffNMX").length
|| jQuery(".nmxCosequin.nextVeterinarianNMX").length
|| jQuery(".nmxCosequin.nextClinicStaff").length
|| jQuery(".nmxCosequin.nextVeterinarian").length
){
if(!jQuery(".nmxLogOut").length){
Cookies.set('nmxAlert','function_VetLoginSorryPage("other");');
if(jQuery("body[class*='nextVeterinarian']").length){ Cookies.set('nmxAlert','function_VetLoginSorryPage("vet");'); }
if(jQuery("body[class*='nextClinicStaff']").length){ Cookies.set('nmxAlert','function_VetLoginSorryPage("csp");'); }
}
Cookies.remove('nmxAccountFullName');
if(jQuery(".nextMisCustomerA").attr("href") != undefined){
eval( jQuery(".nextMisCustomerA").attr("href") );
}
if(jQuery(".nextCartLogout").attr("href") != undefined){
eval( jQuery(".nextCartLogout").attr("href") );
}
}
}*/
EnableReturnToRetail();
if(jQuery("body").hasClass("has_mobile_js")){ MobileMonthlySpecials(); }
else { TrackAnalyticsEvents(); }
//AddHolidayHours(); // this probably still works but it may also be hidden in the css
TrimDasuquinAdvancedPressBannerBottom();
//BlockRegPageIfNotLoggedIn();
});
function BlockRegPageIfNotLoggedIn(){
if (location.search.toLowerCase().indexOf("test") > -1 || location.search.toLowerCase().indexOf("login") > -1 || typeof vetstore_vet_reg !== 'undefined'){
// nothing
} else if (location.pathname.toLowerCase().indexOf("register.aspx") > -1 && jQuery(".nextNotLoggedIn").length){
jQuery('body').hide();
document.location = "https://www.vet-ez-order.com";
}
}
function NotLoggedIn(){
jQuery('body').hide();
if(jQuery(".nextCartLogout").length){
eval( jQuery(".nextCartLogout").attr("href") );
}
}
function LogOutIfNotLoggedIn(){
if (jQuery("#pnlPersistentCategories a").length > 2 || jQuery(".nextLogin").length){
console.log("not logging out");
} else if (jQuery("#pnlPersistentCategories a").length == 2){
console.log("logging out");
NotLoggedIn();
} else if (jQuery("#pnlPersistentCategories a").length == 0){
window.setTimeout(function(){ LogOutIfNotLoggedIn() },500);
}
}
function FirstAndLastNameReadOnly(){
console.log("name fields are disabled");
jQuery("#ctl00_ctl00_cphMain_cphMain_uafAddress_nfAddress_txtFirstName, #ctl00_ctl00_cphMain_cphMain_uafAddress_nfAddress_txtLastName, #ctl00_cphMain_uafAddress_mnfAddress_txtFirstName, #ctl00_cphMain_uafAddress_mnfAddress_txtLastName").addClass("disabled").on("focus",function(){
jQuery("#ctl00_ctl00_cphMain_cphMain_uafAddress_phnAddress_txtPhone").focus().blur();
jQuery("#ctl00_cphMain_uafAddress_mphnAddress_txtPhone").focus().blur();
});
}
jQuery("document").ready(function(){
if(jQuery(".account.nextLoggedIn.nextRegister").length){
FirstAndLastNameReadOnly();
}
// if(jQuery(".nextClinicStaffNMX, .nextClinicStaff").length){
// AddConsumerStoreLinkToFooter();
// /* use display none to hide banner for csp */
// //jQuery("#pnlPersistentCategory207, .nextListCategory262, #hlPersistentCategory22").remove();
// }
// if(jQuery(".nextVeterinarianNMX, .nextVeterinarian").length){
// AddConsumerStoreLinkToFooter();
// }
AddConsumerStoreLinkToFooter();
BreaknextShortDesc();
//
GetCustomerIDOnMobile();
//UseDynamicCopyright();
HideRetailStore();
AddCartTracking();
UpdatePrivacyPolicyLinks();
//AddHolidayHours();
AddSourceReferences();
AutoLinkMoreInfo();
QuickCorrectionsTmp();
ApplySuperScript();
ApplyTargetBlank();
});
function ApplyTargetBlank(){
jQuery('#tdBottom > div.footer > div.footer-bottom > div.cus > a').attr('target','_blank');
}
function ApplySuperScript(){
window.setTimeout(function(){
//if(!jQuery(".nmx").length){ return; }
jQuery(".nextProductDetail .nextProdName").each(function(){
jQuery(this).html(jQuery(this).html().replace(/®/g,"®"));
});
},800);
}
function AutoLinkMoreInfo(){
window.setTimeout(function(){
//if(!jQuery(".nmx").length){ return; }
console.log("adding source references");
if (jQuery(".more-info").length){
var milink = jQuery(".more-info").text().trim();
var midomain = milink.replace("http://","").replace("https://","").replace("//","");
midomain = midomain.substr(0,midomain.indexOf("/"));
if (midomain!=""){
jQuery(".more-info").addClass("ready").html('For more information on '+jQuery(".nextProdName").text().trim().replace(/[0-9]+\s+(count|ct).*/i, '')+' visit '+midomain+'.');
}
}
},800);
//console.log(jQuery(".nextProdName").text().trim().replace(/[0-9]+\s+(count|ct)/i, ''));
}
function QuickCorrectionsTmp(){
window.setTimeout(function(){
//if(!jQuery(".nmx").length){ return; }
return;
jQuery(".nextProdName").each(function(){
jQuery(this).text(jQuery(this).text().replace("Tablets","Tablet").replace("Tablet","Tablets"));
jQuery(this).text(jQuery(this).text().replace("Tablets Disp","Tablet Disp"));
if(jQuery(this).text().indexOf("Powder")==-1 &&
jQuery(this).text().indexOf("COUNT")==-1 &&
jQuery(this).text().indexOf("Count")==-1 &&
jQuery(this).text().toLowerCase().indexOf("pack")==-1 &&
jQuery(this).text().indexOf(" CT")==-1 &&
jQuery(this).text().toLowerCase().indexOf(" g)")==-1){
var count = jQuery(this).closest(".nextTabbedProduct, .nextTileProductWrapper").find(".nextSKU").text().replace(/\D/g,'');
console.log(["updating product names",count]);
if(jQuery(this).text().indexOf(count)==-1){
jQuery(this).text(jQuery(this).text()+" "+count+" Count");
}
}
jQuery(this).text(jQuery(this).text().replace("Cosequin® Soft Chew with MSM","Cosequin® DS Plus MSM & Boswellia Soft Chews"));
jQuery(this).text(jQuery(this).text().replace("Minis Maximum Strength with MSM Plus Omega-3s","Minis Plus MSM & Boswellia"));
//jQuery(this).text(jQuery(this).text().replace("for Cats Sprinkle Capsules","Maximum Strength Plus Boswellia for Cats Sprinkle Capsules"));
jQuery(this).text(jQuery(this).text().replace("Sprinkle Capsules for Cats","for Cats Sprinkle Capsules"));
jQuery(this).text(jQuery(this).text().replace("Standard Strength Chewable","Standard Strength Plus Boswellia & HA Chewable"));
//jQuery(this).text(jQuery(this).text().replace("COSEQUIN® MAXIMUM STRENGTH PROFESSIONAL LINE JOINT SUPPLEMENT PLUS MSM & HA CHEWABLE TABLETS 120CT 1200 COUNT","COSEQUIN® MAXIMUM STRENGTH PROFESSIONAL LINE JOINT SUPPLEMENT PLUS MSM & HA CHEWABLE TABLETS 120CT"));
jQuery(this).text(jQuery(this).text().replace(" CT"," Count"));
});
//jQuery(".nextLongDescription p").html(jQuery(".nextLongDescription p").html().replace("The best Cosequin choice for","").replace("maintaining your pets' mobility.",""));
},400);
}
function AddSourceReferences(){
window.setTimeout(function(){
//if(!jQuery(".nmx").length){ return; }
console.log("adding source references");
AddSourceReference("[ref='number-1-vet-recommend']",".nextProductDetailTabbed",'▼ Source: Among retail brands. Survey conducted among small animal veterinarians who recommended oral joint health supplements.');
},800);
}
function AddSourceReference(ref,loc,html){
if (jQuery(""+ref+":visible").length){
jQuery(""+loc).append('
'+html+'
');
}
}
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.
');
var holiday_closing_msg = '
Wishing you a Merry Christmas and Happy Holidays from our family to yours!
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 NotifyLeavingSite(url){
window.scrollTo(0,0);
if(jQuery(".leaving-site-dialog").length){ return; }
//ga('send', 'event', 'CSP Members', 'Consumer Store Sync/Link', masterServerVars.CustomerID);
jQuery("body").prepend('
You are leaving vet-ez-order.com and entering vet.nutramaxstore.com. Items already in your cart will remain on vet-ez-order.com. Items you add from vet.nutramaxstore.com will remain there. Your contact information is maintained by vet-ez-order.com. Separate checkout is required for each cart. Payment processing for each will be handled by its respective site.