(function(n){function t(){function n(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+n+"=([^&#]*)"),t=i.exec(location.search);return t===null?"":decodeURIComponent(t[1].replace(/\+/g," "))}function t(t){return parseInt(n(t))}return{url:{getParam:n,getParamInt:t}}}n.saputo=n.saputo||{};n.saputo.helpers=t()})(window),function(n){function t(){function l(n){n=n||{ready:!1,recipe:""};t(n.ready,"interaction recipe","recipe","use autocomplete search",n.recipe)}function a(){jq("[data-saputo-gtm]").each(function(){var t=jq(this),u=ft(t,"saputo-gtm"),n,i;for(n in u)n==="click"?(i=function(){tt(u[n])},t.unbind("click",i),t.bind("click",i)):r!=="prod"&&console.log("GoogleTagManager, bindEvents unknown",n)})}function v(n){n=n||{country:"",ready:!1};t(n.ready,"career","conversion","career opportunities",n.country)}function y(i){i=i||{ready:!1,url:""};i.url===""&&(i.url=n.location.href);t(i.ready,"interaction","click on carrousel link",i.url)}function p(n){n=n||{country:"",ready:!1};t(n.ready,"contact","conversion","contact us by phone",n.country)}function w(n){n=n||{ready:!1,subject:""};t(n.ready,"form","conversion","contact form submitted",n.subject)}function b(n){n=n||{name:"",ready:!1};t(n.ready,"form","conversion","contest form submitted",n.name)}function k(i){i=i||{ready:!1};t(i.ready,"coupon","conversion","coupon viewed",n.location.href)}function d(n){n=n||{ready:!1,type:"",title:""};t(n.ready,"download","download documentation",n.type,n.title)}function g(n){n=n||{ready:!1,type:"",name:""};t(n.ready,"download","download documentation",n.type,n.name)}function nt(n){n=n||{ready:!1};t(n.ready,"share","conversion","share by email")}function tt(n){var t,r,i;for(t in n)(r=n[t],i=h[t],typeof i=="function")&&i(r)}function it(n){n=n||{question:"",ready:!1};t(n.ready,"faq","other interaction","faq",n.question)}function rt(n){n=n||{ready:!1,product:""};t(n.ready,"interaction product","product","click on featured product",n.product)}function ut(n){n=n||{ready:!1,recipe:""};t(n.ready,"interaction recipe","recipe","click on featured recipe",n.recipe)}function ft($element,dataKey){var trigger=$element.data(dataKey),triggerObject;r==="prod"&&$element.removeAttr(dataKey);triggerObject=null;try{trigger=trigger.replace(/(\r\n|\n|\r)/gm,"");triggerObject=eval("({"+trigger+"})")}catch(err){r!=="prod"&&console.log("GoogleTagManager, getTriggers error","({"+trigger+"})",err)}return triggerObject}function et(n){n=n||{ready:!1,recipe:""};t(n.ready,"interaction recipe","recipe","view of main recipes from the homepage",n.recipe)}function ot(n){n=n||{ready:!1};t(n.ready,"newsletter","conversion","newsletter form submitted","referrer: "+document.referrer)}function st(n){n=n||{ready:!1,keyword:""};t(n.ready,"interaction recipe","recipe","autocomplete search result not found",n.keyword)}function ht(n){n=n||{keyword:"",ready:!1};t(n.ready,"search result","no matches for this research",n.keyword)}function ct(n){n=n||{product:"",ready:!1};t(n.ready,"interaction product","product","nutritional information",n.product)}function lt(n){n=n||{ready:!1,recipe:""};n.recipe===""&&(n.recipe=document.title);t(n.ready,"print","conversion","print",n.recipe)}function at(n){n=n||{product:"",ready:!1};t(n.ready,"interaction product","product","see a product",n.product)}function vt(n){n=n||{productCategory:"",ready:!1};t(n.ready,"interaction product category","product category","see a product category",n.productCategory)}function yt(n){n=n||{recipe:"",ready:!1};t(n.ready,"interaction product","recipe","click on non featured recipe",n.recipe)}function pt(n){n=n||{product:"",ready:!1};t(n.ready,"interaction recipe","recipe","products viewed in the recipe",n.product)}function wt(n){n=n||{filter:"",ready:!1};t(n.ready,"filter","click on search filter",n.filter)}function bt(n){n=n||{ready:!1};t(n.ready,"newsletter","other interaction","sign up to our newsletter")}function kt(n){n=n||{ready:!1,socialMedia:""};t(n.ready,"share","conversion","share on social media","share on "+n.socialMedia)}function t(t,i,u,f,e){function o(n){return n!==undefined&&n!==null?n.replace(/''/g,'"').toLowerCase():n}function s(){n.dataLayer=n.dataLayer||[];var t={event:o(i),eventCategory:o(u),eventAction:o(f),eventLabel:o(e)};(r==="test"||r==="dev")&&console.log("GoogleTagManager, dataLayer.push",t);r!=="dev"&&dataLayer.push(t)}if(t){jq(document).ready(s);return}s()}function dt(n){n=n||{ready:!1,typeRecipe:""};t(n.ready,"interaction recipe","recipe","type of recipe from the toolbar",n.typeRecipe)}function gt(n){n=n||{ready:!1,keyword:""};t(n.ready,"search","internal search","use autocomplete search",n.keyword)}function i(){var n=document.getElementById("gtm-tracked-video"),t=n.getAttribute("title");sessionStorage.getItem("videoIsFullScreen")!=="1"?(f("fullscreenVideo",t),sessionStorage.setItem("videoIsFullScreen","1")):sessionStorage.setItem("videoIsFullScreen","0")}function ni(){jq(document).ready(function(){var t=document.getElementsByTagName("video"),r=t.length,n;r&&(n=document.getElementById("gtm-tracked-video"),n&&(n.addEventListener?(n.addEventListener("timeupdate",s,!1),n.addEventListener("play",o,!1),n.addEventListener("pause",e,!1),n.addEventListener("fullscreenchange",i,!1),n.addEventListener("webkitfullscreenchange",i,!1),n.addEventListener("mozfullscreenchange",i,!1),n.addEventListener("msfullscreenchange",i,!1)):n.attachEvent&&(n.attachEvent("timeupdate",s,!1),n.attachEvent("play",o,!1),n.attachEvent("pause",e,!1),n.attachEvent("fullscreenchange",i,!1),n.attachEvent("webkitfullscreenchange",i,!1),n.attachEvent("mozfullscreenchange",i,!1),n.attachEvent("msfullscreenchange",i,!1))))})}function f(n,i){t(!0,"videoInteraction","video",n,i)}function e(){var n=document.getElementById("gtm-tracked-video"),t=n.getAttribute("title");f("pauseVideo",t)}function o(){var n=document.getElementById("gtm-tracked-video"),t=n.getAttribute("title");f("playVideo",t);c(n.duration)}function u(n,i){t(!0,"videoProgress","video",n,i)}function c(n){var i=(n/100).toFixed(1),t;sessionStorage.setItem("onePercent",i);t=(n/10).toFixed(1);sessionStorage.setItem("tenPercent",t);sessionStorage.setItem("fiftyPercent",5*t);sessionStorage.setItem("ninetyPercent",9*t)}function s(){var i=document.getElementById("gtm-tracked-video"),n=i.getAttribute("title"),t=i.currentTime.toFixed(1);parseInt(t)>=parseInt(sessionStorage.getItem("onePercent"))?(u("1%",n),sessionStorage.setItem("onePercent",null)):parseInt(t)>=parseInt(sessionStorage.getItem("tenPercent"))?(u("10%",n),sessionStorage.setItem("tenPercent",null)):parseInt(t)>=parseInt(sessionStorage.getItem("fiftyPercent"))?(u("50%",n),sessionStorage.setItem("fiftyPercent",null)):parseInt(t)>=parseInt(sessionStorage.getItem("ninetyPercent"))&&(u("90%",n),sessionStorage.setItem("ninetyPercent",null))}function ti(n){n=n||{ready:!1,recipe:""};t(n.ready,"interaction recipe","recipe","you may also like these recipes",n.recipe)}var r=n.saputo.environment,h={autocompleteSearch:l,bindEvents:a,career:v,carouselTracking:y,contactByPhone:p,contactForm:w,contestSubscription:b,couponTracking:k,download:d,downloadProductAndSellSheet:g,emailTracking:nt,faq:it,featuredProducts:rt,featuredRecipes:ut,mainRecipesInTheHomePage:et,newsletterSubscription:ot,noAutocompleteSearchResult:st,noSearchResult:ht,nutritionInformation:ct,printARecipe:lt,productClick:at,productCategoryClick:vt,recipeClick:yt,productsInTheRecipes:pt,searchFilterTracking:wt,signupToOurNewsletter:bt,socialMediaTracking:kt,typeOfRecipe:dt,useAutocompleteSearch:gt,videoFullScreen:i,videoInit:ni,videoInteraction:f,videoPause:e,videoPlay:o,videoProgress:u,videoSetKeyframes:c,videoTimeUpdate:s,youMayAlsoLikeTheseRecipes:ti};return h}n.saputo=n.saputo||{};n.saputo.gtm=t();n.saputo.gtm.videoInit()}(window),function(n){function t(){function t(t){jq(n).on("popstate",function(){t(history.state)})}function i(t,i){history!==null&&history.pushState!==null&&history.pushState(t,document.title,n.location.protocol+"//"+n.location.host+n.location.pathname+i)}function r(t){history!==null&&history.replaceState!==null&&history.replaceState(t,document.title,n.location.href)}return{pop:t,push:i,replace:r}}n.saputo=n.saputo||{};n.saputo.location=t()}(window)