(function(n){"use strict";var r={},t={},u=function(){var t=[{sku:n(this).data("sku"),quantity:n(this).closest("div.buttons").find("input[name='product.Quantity']").val()}];n.ajax({url:"/cart/add",type:"POST",dataType:"JSON",data:JSON.stringify(t),contentType:"application/json; charset=utf-8",cache:!0,success:function(n){removeAjaxButtonWorking(),ko.postbox.publish("addToCart",n),ko.postbox.publish("productsAddedToCart",JSON.stringify(t))}})},i=function(){if(t&&t.length!==0){var i=n("#products > li .buttons-wrapper");i.each(function(){var i=n(this),r=i.next(".conditional-wrapper"),f=i.data("productid"),u=n.grep(t,function(n){return n.ProductId===f})[0];u&&(u.CanAddToCart===!0?i.removeClass("hidden").slideDown():i.slideUp(),r&&(r.empty(),r.append(n("<div/>"),u.Messages)))})}n(".conditional-wrapper").removeClass("hidden").slideDown()},f=function(){ko.postbox.subscribe("onConditionalProductsLoaded",function(n){t=n,i()}),ko.postbox.subscribe("onProductsLoaded",i);n(document).on("click","#products > li .addToCart",u)};n(document).ready(function(){r={Product:n("#products > li")},f(),n(".list-product-name a").each(function(t,i){n(i).parent().data("full-text",n(i).text())})}),n(window).load(function(){function t(i){if(n(i).height()>30){var r=n(i).text().substring(0,n(i).text().length-8);r=r+" (...) ",n(i).text(r),t(i)}else return}function i(){n(".product-list-container .list-product-name a").each(function(i,r){var u=n(r).parent().data("full-text");n(r).text(u),t(r)})}i(),n(window).resize(n().throttle(i,500))})})(jQuery),function(n){"use strict";var i={},t={tags:null,ratings:null,highPrice:null,lowPrice:null},r=function(r){r.preventDefault(),t.tags=i.Tags.filter(":checked").map(function(){return n(this).attr("id")}).get().join(),ko.postbox.publish("filterChanged",t)},u=function(){t.lowPrice=i.Slider.data("min"),t.highPrice=i.Slider.data("max"),i.Slider.slider({min:t.lowPrice,max:t.highPrice,values:[t.lowPrice,t.highPrice],range:!0,slide:function(n,r){t.lowPrice=r.values[0],t.highPrice=r.values[1],i.PriceRange.html(Globalize.format(t.lowPrice,"c")+" - "+Globalize.format(t.highPrice,"c"))}}),i.PriceRange.html(Globalize.format(t.lowPrice,"c")+" - "+Globalize.format(t.highPrice,"c"));n(document).on("click","#product-filter",r);i.Tags.setDefaultEnter({defaultButton:n("#product-filter")})};n(document).ready(function(){i={Window:n(window),Document:n(document),Body:n("body"),Tags:n("#menu input[type=checkbox]"),Slider:n("#slider-range"),PriceRange:n("#price-range")},u()})}(jQuery),function(n){"use strict";var t={},i={inCallback:!1,endOfPage:!1,resultsFound:!1},r={page:0,sortBy:0,tags:null,ratings:null,highPrice:null,lowPrice:null},u={show:function(){t.Loading.show()},hide:function(){t.Loading.hide()}},f=function(){r.page=-1,i.endOfPage=!1,t.ProductList.hide("slow",function(){t.ProductList.empty(),e(function(){t.Container.contents().filter(function(){return this.nodeType===3}).remove(),i.resultsFound===!1&&t.Container.append(t.ProductList.data("noproducts"))})})},o=function(){e()},e=function(f){AVON.products&&AVON.products.predictiveUrl&&i.endOfPage!==!0&&i.inCallback!==!0&&(i.inCallback=!0,r.page=r.page+1,u.show(),n.ajax({url:AVON.products.predictiveUrl,type:"GET",data:r,cache:!0,success:function(r){if(typeof r=="string"){var e=n(r).html();n(e).length?(t.ProductList.append(e),t.ProductList.show(),i.resultsFound=!0):(i.endOfPage=!0,i.resultsFound=!1)}i.inCallback=!1,u.hide(),autofixBrokenProductImages(),f&&f(),ko.postbox.publish("onProductsLoaded")}}))},s=function(){t.Window.scroll(function(){t.Window.scrollTop()>=t.Document.height()-t.Window.height()-200&&o()}),ko.postbox.subscribe("sortChanged",function(n){r.sortBy=n,f()}),ko.postbox.subscribe("filterChanged",function(t){n.extend(r,t),f()})};n(document).ready(function(){t={Window:n(window),Document:n(document),Loading:n("#loading"),Container:n("#product-list"),ProductList:n("#product-list ul#products"),Body:n("body")},s()})}(jQuery),function(n){"use strict";var t={},i=function(n){ko.postbox.publish("sortChanged",n.value)},r=function(){t.SortBy.selectbox({}).unbind().change(function(){i(this)});t.StackButton.on("click",function(){n(this).closest("#container.category").hide(),n(this).closest("#container.category").removeClass("list-layout-grid"),n(this).closest("#container.category").show()});t.GridButton.on("click",function(){n(this).closest("#container.category").hide(),n(this).closest("#container.category").addClass("list-layout-grid"),n(this).closest("#container.category").show()})};n(document).ready(function(){t={SortBy:n("#sort-by"),Body:n("body"),StackButton:n("#list-layout-stack-button"),GridButton:n("#list-layout-grid-button")},r()})}(jQuery),$(function(){"use strict";var n=function(){this.init=function(){var n=$(".vkontakte_share"),t=$("#vk_groups"),u=n.data("image"),i=n.length>0&&n.data("appid")!="",r=t.length>0&&t.data("appid")!="";(i||r)&&($.getScript("https://vk.com/js/api/openapi.js?87",function(){var n=setInterval(function(){undefined!=window.VK&&(r&&(i||window.VK.init({apiId:t.data("appid"),onlyWidgets:!0}),window.VK.Widgets.Group("vk_groups",{mode:2,wide:1,width:"200",height:"290"},t.data("groupid"))),clearInterval(n))},100)}),$.getScript("https://vk.com/js/api/share.js?85",function(){var t=setInterval(function(){undefined!=window.VK&&(i&&(window.VK.init({apiId:n.data("appid"),onlyWidgets:!1}),window.VK.Share._base_domain="https://vk.com/",n.html(window.VK.Share.button({image:u,noparse:!0},{type:"round",text:n.data("sharetext")}))),clearInterval(t))},100)}))}};window.AVON.vkontakteWidget=new n}),!function(n,t,i){var r,u=n.getElementsByTagName(t)[0];n.getElementById(i)||(r=n.createElement(t),r.id=i,r.src="//platform.twitter.com/widgets.js",u.parentNode.insertBefore(r,u))}(document,"script","twitter-wjs"),function(n,t,i){var r,f=t.getElementsByTagName("SCRIPT")[0],o=i.length,u=0,e=function(){for(u=0;u<o;u=u+1)r=t.createElement("SCRIPT"),r.type="text/javascript",r.async=!0,r.src=i[u],f.parentNode.insertBefore(r,f)};n.attachEvent?n.attachEvent("onload",e):n.addEventListener("load",e,!1)}(window,document,["//assets.pinterest.com/js/pinit.js"]),$(function(){$.getScript("//connect.facebook.net/"+$("body").attr("lang").replace("-","_")+"/all.js",function(){FB.init({appId:$("#facebook-share").data("appid"),status:!0,xfbml:!0})}),window.AVON.vkontakteWidget.init();$("img.recommend,#share-button-email").off().on("click",function(n){n.preventDefault();var t="/layout/recommend?link="+$(this).data("url");$("body").modal({windowId:"ShareEmailPopup",loadUrl:t}),ko.postbox.publish("socialClicked",{socialName:"share:email",pagePath:window.location.href,socialType:"Share"})});$(".sm-controls #vkontakte").on("click",function(){ko.postbox.publish("socialClicked",{socialName:"social:vk",pagePath:window.location.href,socialType:"Social"})});$(".sm-controls .twitter-share-button").on("click",function(){ko.postbox.publish("socialClicked",{socialName:"social:twitter",pagePath:window.location.href,socialType:"Social"})})}),function(n,t){function u(t){n.open(t,"","width=480px,height=500px,location=0,menubar=0,status=0,toolbar=0")}var r=n.location.href.replace(n.location.pathname,"");t(".article-list").on("click","div.share-google-plus",function(){var e=t(this).attr("data-title"),i=r+t(this).attr("data-url")+"?exm=share-social-googleplus",f="https://plus.google.com/share?url="+i;u(f),ko.postbox.publish("socialClicked",{socialName:"social:googleplus",pagePath:n.location.href,socialType:"Social"})});t(".article-list").on("click","div.share-facebook",function(){var i=t(this).attr("data-title"),f=t(this).attr("data-description"),e=r+t(this).attr("data-url")+"?exm=share-social-facebook",o=r+t(this).attr("data-image"),s="https://www.facebook.com/sharer/sharer.php?s=100&p[title]="+i.replace(/&#39;/g,"%27")+"&p[summary]="+f.replace(/&#39;/g,"%27")+"&p[images][0]="+encodeURIComponent(o)+"&p[url]="+encodeURIComponent(e);u(s),ko.postbox.publish("socialClicked",{socialName:"social:facebook",pagePath:n.location.href,socialType:"Social"})});t(".article-list").on("click","div.share-twitter",function(){var i=t(this).attr("data-title"),f=r+t(this).attr("data-url")+"?exm=share-social-twitter",e="https://twitter.com/intent/tweet?text="+i+" "+f;u(e),ko.postbox.publish("socialClicked",{socialName:"social:twitter",pagePath:n.location.href,socialType:"Social"})})}(window,jQuery)