PageSourceSearch

https://servsafeinternational.com/access/bundles/nrafunctions?v=2md3itHNfrkvQ0g9L1CQOyPJTSpPVulHnHWdMUO-bEE1

js servsafeinternational.com collected 2026-10-05 10:58:45 UTC 14,323 bytes, 1 lines download raw bytes

1function countryDropDown(n,t,i){t=typeof t!="undefined"?t:"#Country";i=typeof i!="undefined"?i:"#State";$(i).val()==""&&$(i).prop("disabled",!0);$(t).change(function(){if($(t).val()!=""){var r={};r.url=n;r.type="POST";r.data=JSON.stringify({countryCode:$(t).val()});r.dataType="json";r.contentType="application/json";r.success=function(n){$(i).empty();for(var t=0;t<n.length;t++)$(i).append($("<option><\/option>").val(n[t].Value).html(n[t].Text));$(i).prop("disabled",n.length<=1)};r.error=function(){alert("Error retrieving states/provinces for selected country.")};$.ajax(r)}else $(i).empty(),$(i).prop("disabled",!0)})}function populateStateFromCountry(n,t,i,r){var f,u;r=typeof r!="undefined"?r:"#StateDropDown";f=$(r);t!=""&&(u={},u.url=n,u.type="POST",u.data=JSON.stringify({countryCode:t}),u.dataType="json",u.contentType="application/json",u.success=function(n){for(var r="<select id='State' class='form-control valid' name='State'>",t=0;t<n.length;t++)r=n[t].Value==i?r+"<option  selected='selected' value='"+n[t].Value+"'>"+n[t].Text+"<\/option> ":r+"<option value='"+n[t].Value+"'>"+n[t].Text+"<\/option> ";r=r+"<\/select>";f.html(r)},u.error=function(){alert("Error retrieving states/provinces for selected country.")},$.ajax(u))}function getGDPROptions(n,t,i,r,u){$.ajax({type:"POST",url:n,contentType:"application/json",dataType:"json",data:JSON.stringify({countryCode:t,state:i,city:r,model:u}),success:function(n){n.message==="SSIError"&&(location.href=n.errorUrl);$("#GDPROptInOptions").html(n.PartialView);$("#GDPROptInOptions").show()},error:function(n,t,i){console.log(i);$("#GDPROptInOptions").hide()}})}function setArrows(n){var i=$("#dir").val(),r=$("#col").val(),t=$("th a[href*="+r+"]");if(i=="Ascending")switch(n){case"css":t.addClass("asc");break;case"image":t.html(t.html()+' <span class="glyphicon glyphicon-arrow-up"><\/span>');break;case"text":t.text(t.text()+" ▲")}if(i=="Descending")switch(n){case"css":t.addClass("desc");break;case"image":t.html(t.html()+'  <span class="glyphicon glyphicon-arrow-down"><\/span>');break;case"text":t.text(t.text()+" ▼")}}var appPath,classListSupported;if(window.nraModals=window.nraModals||[{elementId:"ppID",verPropName:"ppversion",closeClasses:["ppClose"],excludePaths:null},{elementId:"modID",verPropName:"modversion",closeClasses:["ppClose"],excludePaths:["/ps/","/access/","/2019-holiday-giving"]}],!window.NRA){var scriptPath=null,scripts=document.getElementsByTagName("script"),thisScriptElement=scripts[scripts.length-1],path=thisScriptElement.src.split("?")[0];scriptPath=path.split("/").slice(0,-1).join("/")+"/";appPath=path.split("/").slice(0,-2).join("/");classListSupported=!1;thisScriptElement.classList&&(classListSupported=!0);window.NRA={ScriptPath:scriptPath,AppPath:appPath,Debug:!1,Helpers:{ClassListSupported:classListSupported},Products:{RetrievedProducts:{}},PageLogs:[]}}NRA.writeLog=function(n){console&&console.log&&console.log(n);NRA.PageLogs.push(n)};NRA.dumpLogs=function(){return console&&console.log&&console.log(NRA.PageLogs),NRA.PageLogs};NRA.addElementEvent=function(n,t,i){n.addEventListener?n.addEventListener(t,i,!1):n.attachEvent?n.attachEvent("on"+t,i):NRA.writeLog("Could not add element event: "+t)};NRA.productAlert=function(n){$(n).attr({title:"Alert","class":"alert"}).dialog({buttons:{OK:function(){$(this).dialog("close")}},close:function(){$(this).remove()},draggable:!0,modal:!0,resizable:!1,width:"30%"})};NRA.Helpers.getCookie=function(n){if(typeof n=="undefined"||n==null||n.length===0)return null;var t=document.cookie.match("(^|;) ?"+n+"=([^;]*)(;|$)");return t?decodeURIComponent(t[2]):null};NRA.Helpers.setCookie=function(n,t,i,r,u,f){if(typeof n!="undefined"&&n!=null&&n.length!==0){var e=n+"="+encodeURIComponent(t);typeof i!="undefined"&&isFinite(i)&&(e+="; max-age="+i);typeof r!="undefined"&&r!=null&&r.length>0&&(e+="; expires="+r);typeof u!="undefined"&&u!=null&&u.length>0&&(e+="; path="+u);typeof f!="undefined"&&f!=null&&f.length>0&&(e+="; domain="+f);document.cookie=e}};NRA.Helpers.cookieEquals=function(n,t){if(typeof n=="undefined"||n==null||n.length===0)return!1;var i=n+"="+encodeURIComponent(t);return document.cookie.split(";").filter(function(n){return n.indexOf(i)>=0}).length>0};NRA.Helpers.checkModal=function(n,t,i){var r,h,u,f,e,o,s;if(!n||n.length===0){console&&console.error&&console.error("ElementId not specified in checkModal!",{elementId:n,verPropName:t});return}if(t&&t.length!==0||(t=n),r=document.getElementById(n),r){if(r.style.display="none",typeof excludePaths!="undefined"&&excludePaths&&excludePaths.length>0)for(h=window.location.pathname.toLowerCase(),u=0;u<excludePaths.length;u++)if(h.startsWith(excludePaths[u]))return;if(f=r.getAttribute("data-"+t),!f||f.length===0){console&&console.error&&console.error("Could not read current policy version in checkModal!",{elementId:n,verPropName:t});return}if(!NRA.Helpers.cookieEquals(t,f)){if(r.setAttribute("data-ver-prop",t),i!=null)for(e=0;e<i.length;e++)if(o=document.getElementsByClassName(i[e]),o)for(s=0;s<o.length;s++)o[s].onclick=function(n){for(var t=n.target,i,r;!t.hasAttribute("data-ver-prop")&&t.parentElement;)t=t.parentElement;i=t.getAttribute("data-ver-prop");r=t.getAttribute("data-"+i);
1NRA.Helpers.setCookie(i,r,null,null,"/");t.style.display="none"};r.style.display="block"}}};NRA.Helpers.createClassyElement=function(n,t){var i=document.createElement(n),r,u,f;if(!t)return i;if(t.classList)for(r in t.classList)NRA.Helpers.ClassListSupported?i.classList.add(t.classList[r]):i.className+=" "+t.classList[r];if(t.attrs){u=t.attrs;for(f in u)i.setAttribute(f,u[f].toString())}return t.text&&(i.innerText?i.innerText=t.text:i.textContent=t.text),t.html&&(i.innerHTML=t.html),i};NRA.Products.getCategoryDataUrl=function(n){return NRA.AppPath+"/api/Category/"+n};NRA.Products.getProductDataUrl=function(n){return NRA.AppPath+"/api/Product/"+n};NRA.Products.__createProductElement=function(n,t,i){var r,w,e,o,h,u,c,l;n&&n.split(" ");var a=NRA.Helpers.createClassyElement("div",{classList:[]}),v=NRA.Helpers.createClassyElement("table",{classList:["ProductEmbed"]}),y=document.createElement("tbody"),s=document.createElement("tr"),f=document.createElement("td"),p=document.createElement("td");return a.appendChild(v),v.appendChild(y),y.appendChild(s),s.appendChild(p),s.appendChild(f),r=NRA.Helpers.createClassyElement("div",{classList:["ProductTitle"]}),r.appendChild(NRA.Helpers.createClassyElement("a",{attrs:{href:t.DetailLink},text:t.Title})),r.appendChild(NRA.Helpers.createClassyElement("br")),r.appendChild(NRA.Helpers.createClassyElement("span",{classList:["ProductDescription"],html:t.Description})),t.BackorderText&&(w=NRA.Helpers.createClassyElement("div",{classList:["backorder-text"],text:t.BackorderText}),r.appendChild(w)),e=NRA.Helpers.createClassyElement("div",{classList:["ProductPrice"]}),o=["UnitPrice"],t.Price!=t.DiscountPrice&&(o.push("light-gray"),o.push("strike")),e.appendChild(NRA.Helpers.createClassyElement("div",{classList:o,text:"$"+parseFloat(t.Price).toFixed(2).toString()})),t.Price!=t.DiscountPrice&&e.appendChild(NRA.Helpers.createClassyElement("div",{classList:["DiscountPrice"],text:"$"+parseFloat(t.DiscountPrice).toFixed(2).toString()})),h=NRA.Helpers.createClassyElement("div"),u={href:t.AddLink},NRA.Analytics&&(u[NRA.Analytics.CATALOG_ADD_CART_ATTR]="",u[NRA.Analytics.CATALOG_ITEM_ATTR]=t.ProductCode,u[NRA.Analytics.CATALOG_NAME_ATTR]=t.Title,u[NRA.Analytics.CATALOG_PRICE_ATTR]=t.Price),i||h.appendChild(NRA.Helpers.createClassyElement("a",{attrs:u,classList:["button"],text:t.AddText})),c=NRA.Helpers.createClassyElement("div",{classList:["image"]}),l=NRA.Helpers.createClassyElement("a",{attrs:{href:t.DetailLink}}),c.appendChild(l),l.appendChild(NRA.Helpers.createClassyElement("img",{attrs:{src:t.ImageUrl,alt:t.Title}})),p.appendChild(c),f.appendChild(r),t.CanSubscribe||f.appendChild(e),f.appendChild(h),a};NRA.Products.formatProductElement=function(n,t){var i=$(n).attr("data-nra-class"),r=$(n).attr("data-nra-suppress-addlink")==="true",u=this.__createProductElement(i,t,r);$(n).append(u)};NRA.Products.formatCategoryElement=function(n,t){var f=$(n).attr("data-nra-class"),i=NRA.Helpers.createClassyElement("div",{classList:f.split(" ")}),r,u;if(i.appendChild(NRA.Helpers.createClassyElement("h3",{text:t.Title})),i.appendChild(NRA.Helpers.createClassyElement("span",{text:t.ShortDescription})),t.Products&&t.Products instanceof Array)for(r=0;r<t.Products.length;r++)u=this.__createProductElement(null,t.Products[r]),i.appendChild(u);$(n).append(i)};NRA.Products.getCategoryData=function(n,t,i){$.getJSON(NRA.Products.getCategoryDataUrl(n),t,function(n){var t,r;if(n.Products&&n.Products instanceof Array){for(t=0;t<n.Products.length;t++)r=n.Products[t].ProductCode,NRA.Products.RetrievedProducts[r]=n.Products[t];i(n)}})};NRA.Products.getProductData=function(n,t,i){if(NRA.Products.RetrievedProducts[n]){i(NRA.Products.RetrievedProducts[n]);return}$.getJSON(NRA.Products.getProductDataUrl(n),t,function(t){NRA.Products.RetrievedProducts[n]=t;i(t)})};NRA.Products.populateCategoryElement=function(n){var t=NRA.Products.__getCatalogParams(n);t.property||delete t.property;NRA.Products.getCategoryData(t.category,t,function(t){NRA.Products.formatCategoryElement(n,t)})};NRA.Products.populateProductElement=function(n){var t=NRA.Products.__getCatalogParams(n);NRA.Products.getProductData(t.sku,t,function(i){NRA.Products.formatProductElement(n,i,t)})};
1NRA.Products.__getCatalogParams=function(n){var r=$(n).attr("data-nra-sku"),i=$(n).attr("data-nra-website"),u=$(n).attr("data-nra-category"),f=$(n).attr("data-nra-coupon"),t={};return t.sku=r,t.category=u,t.couponCode=f,i&&i!=""&&(t.property=i),t};NRA.addElementEvent(window,"load",function(){var i="",r="",t,n;if($("div[data-nra-sku]").each(function(n,t){i=t;i!=t&&NRA.Products.populateProductElement(t)}),$("div[data-nra-category]").each(function(n,t){r=t;r!=t&&NRA.Products.populateCategoryElement(t)}),!window.notifLoaded)for(window.notifLoaded=!0,t=0;t<window.nraModals.length;t++)n=window.nraModals[t],n!=null&&n.elementId!=null&&n.verPropName!=null&&NRA.Helpers.checkModal(n.elementId,n.verPropName,n.closeClasses,n.excludePaths)});NRA.Helpers.countryDropDown=countryDropDown;NRA.Helpers.populateStateFromCountry=populateStateFromCountry;NRA.Helpers.getGDPROptions=getGDPROptions;NRA.Helpers.setArrows=setArrows;NRA.Helpers.setCountryStateBoxFlip=function(n,t,i,r,u){$(i).change(function(n){var t=$(n.currentTarget).find(":selected").val();$.get(baseStateUrl+"?countryCode="+t,function(n){var t,i;if(n.length==baseCountryListLength)$(u).val(""),$(u).show().attr("disabled",null),$(r).hide().attr("disabled","disabled");else{for($(r).empty(),t=0;t<n.length;t++)i=$("<option><\/option>").attr("value",n[t].Value).text(n[t].Text),$(r).append(i);$(u).hide().attr("disabled","disabled");$(r).show().attr("disabled",null)}})})};NRA.Analytics={CATALOG_ADD_CART_ATTR:"data-nra-catalog-add",CATALOG_REM_CART_ATTR:"data-nra-catalog-remove",CATALOG_ITEM_ATTR:"data-nra-catalog-item",CATALOG_NAME_ATTR:"data-nra-catalog-name",CATALOG_PRICE_ATTR:"data-nra-catalog-price",CATALOG_QTY_ATTR:"data-nra-catalog-qty",CATALOG_POSITION_ATTR:"data-nra-catalog-position",CART_CONTAINER_ATTR:"data-nra-cart",CART_ITEM_ATTR:"data-nra-cart-item",CART_NAME_ATTR:"data-nra-cart-name",CART_QTY_ATTR:"data-nra-cart-qty",CART_PRICE_ATTR:"data-nra-cart-price",ORDER_ID_ATTR:"data-nra-order-id",ORDER_REVENUE_ATTR:"data-nra-order-revenue",ORDER_TAX_ATTR:"data-nra-order-tax",ORDER_SHIP_ATTR:"data-nra-order-ship",ORDER_COUP_ATTR:"data-nra-order-coupon",PURCHASE_DETAILS_ELEMENT_ID:"PurchaseDetails",pushGA:function(n){if(typeof dataLayer!="undefined")try{dataLayer.push(n)}catch(t){NRA.writeLog(t)}else NRA.writeLog("Google Analytics engine not present.")},addToCartGA:function(n,t,i,r){var u=NRA.Analytics.createProduct(n,t,1,i,r);this.pushGA({event:"addToCart",ecommerce:{currencyCode:"USD",add:{products:[u]}}})},removeFromCartGA:function(n,t,i,r){var u=NRA.Analytics.createProduct(n,t,i,r);this.pushGA({event:"removeFromCart",ecommerce:{remove:{products:[u]}}})},checkoutGA:function(n,t,i){this.pushGA({event:"checkout",ecommerce:{checkout:{actionField:{step:n,option:t},products:i}}})},purchaseGA:function(n,t){this.pushGA({ecommerce:{purchase:{actionField:n,products:t}}})},onShipOptionGA:function(n){this.pushGA({event:"checkoutOption",ecommerce:{actionField:{step:"3",option:n}}})},createProduct:function(n,t,i,r,u){var f={};return n&&(f.name=n),t&&(f.id=t),i&&(f.quantity=i),r&&(f.price=r),u&&(f.position=u),f},getCartProductList:function(){for(var n,f,e="["+this.CART_CONTAINER_ATTR+"] ["+this.CART_ITEM_ATTR+"]",i=document.querySelectorAll(e),r=1,u=[],t=0;t<i.length;t++)n=i.item(t),f=this.createProduct(this.getAttributeOrNull(n,this.CART_NAME_ATTR),this.getAttributeOrNull(n,this.CART_ITEM_ATTR),this.getAttributeOrNull(n,this.CART_QTY_ATTR),this.getAttributeOrNull(n,this.CART_PRICE_ATTR),r),r++,u.push(f);return u},getPurchaseDetails:function(){var n=document.getElementById(this.PURCHASE_DETAILS_ELEMENT_ID);return{id:this.getAttributeOrNull(n,this.ORDER_ID_ATTR),revenue:this.getAttributeOrNull(n,this.ORDER_REVENUE_ATTR),tax:this.getAttributeOrNull(n,this.ORDER_TAX_ATTR),shipping:this.getAttributeOrNull(n,this.ORDER_SHIP_ATTR),coupon:this.getAttributeOrNull(n,this.ORDER_COUP_ATTR)}},fireShipOptionEvent:function(n){this.onShipOptionGA(n)},fireCheckoutEvent:function(n,t){var i=this.getCartProductList();this.checkoutGA(n,t,i)},fireAddToCartEvent:function(n){this.addToCartGA(this.getAttributeOrNull(n,this.CATALOG_NAME_ATTR),this.getAttributeOrNull(n,this.CATALOG_ITEM_ATTR),this.getAttributeOrNull(n,this.CATALOG_PRICE_ATTR),this.getAttributeOrNull(n,this.CATALOG_POSITION_ATTR))},fireRemoveFromCartEvent:function(n){this.removeFromCartGA(this.getAttributeOrNull(n,this.CATALOG_NAME_ATTR),this.getAttributeOrNull(n,this.CATALOG_ITEM_ATTR),this.getAttributeOrNull(n,this.CATALOG_QTY_ATTR),this.getAttributeOrNull(n,this.CATALOG_PRICE_ATTR))},firePurchaseEvent:function(){this.purchaseGA(this.getPurchaseDetails(),this.getCartProductList())},getAttributeOrNull:function(n,t){return n.hasAttribute(t)?n.getAttribute(t):null}};NRA.addElementEvent(window,"click",function(n){n.target.hasAttribute&&n.target.hasAttribute(NRA.Analytics.CATALOG_ADD_CART_ATTR)&&NRA.Analytics.fireAddToCartEvent(n.target)})

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.