"undefined"!=typeof analyticsJS&&analyticsJS&&analyticsJS.topicNamespace||(analyticsJS={storeId:0,catalogId:0,urlPath:null,miniShopCartTitle:"MiniShoppingCart",jsonPageView:"AnalyticsPageView",jsonProductView:"AnalyticsProductView",jsonElementView:"AnalyticsElementView",jsonShopcartView:"AnalyticsShopcartView",jsonRegistrationView:"AnalyticsRegistrationView",jsonConversionEventView:"AnalyticsConversionEventView",topicNamespace:"/wc/analytics/",pageView:"pageview",productView:"productview",cartView:"cartview",element:"element",registration:"registration",conversionEvent:"conversionevent",pageViewControl:!1,incTaxInUnitPriceForCart:"F",cartViewActionIdList:["AjaxAddOrderItem","AjaxDeleteOrderItem","AjaxUpdateOrderItem","AjaxAddOrderItemWithShipingInfo"],myAccountPageIdList:["UserRegistrationUpdate","updateAddressBook","profileUpdate"],myAddressBookPageIdList:["updateAddress","AddressDelete"],wishlistPageIdList:["AjaxInterestItemAdd","InterestItemDelete","AjaxGiftListServiceAddItem","AjaxGiftListServiceRemoveItem","ShoppingListServiceAddItem"],conversionEventList:["AjaxInterestItemAdd","AjaxGiftListServiceAddItem","AjaxInterestItemAddAndDeleteFromCart","ShoppingListServiceAddItem","AnalyticsConversionEvent"],registrationViewIdList:["UserRegistrationUpdate"],fastFinderEvents:[["filterResultsWithOrderBy","orderby",function(a){var b="";return a&&null!=a&&null!=a.options&&(b=a.options[a.selectedIndex].text),b}],["filterResultsWithPrice","price slider range",function(a){var b=a.getFormattedValues();return["[",b.lower," - ",b.upper,"]"].join("")}],["filterResultsWithView","view change"]],fastFinderCheckboxForms:[["BrandsForm","brands"],["FeatureNamesForm","features"]],publishAnalyticsView:function(a,b,c){var d=this,e={url:getAbsoluteURL()+a,encoding:"utf-8",handleAs:"json",content:dojo.mixin({storeId:d.storeId,catalogId:d.catalogId},b),error:function(a,b){dojo.publish("ajaxRequestCompleted")},load:function(a,b){c.call(d,a),dojo.publish("ajaxRequestCompleted")}};dojo.publish("ajaxRequestInitiated"),dojo.xhrGet(e)},publishTopic:function(a,b){var c=this.makeTopic(a);dojo.publish(c,b)},publishPageView:function(a){var b=this;this.publishAnalyticsView(b.jsonPageView,a,function(a){b.publishTopic(b.pageView,a)})},publishConversionEventView:function(a){var b=this;this.publishAnalyticsView(b.jsonConversionEventView,a,function(a){b.publishTopic(b.conversionEvent,a)})},publishCartView:function(){var a=this;this.publishAnalyticsView(a.jsonShopcartView,{storeId:a.storeId,incTaxInPrice:a.incTaxInUnitPriceForCart},function(b){a.publishTopic(a.cartView,b)})},publishRegistrationView:function(){var a=this;this.publishAnalyticsView(a.jsonRegistrationView,{storeId:a.storeId},function(b){a.publishTopic(a.registration,b)})},makeTopic:function(a){return[this.topicNamespace,a].join("")},getMiniShopCartPageCategory:function(){return"MiniShoppingCart"},getMiniShopCartPageName:function(){return["MiniShoppingCart: ",document.title].join("")},getMiniShopCartPageViewData:function(a){return{pagename:this.getMiniShopCartPageName(),category:this.getMiniShopCartPageCategory()}},registerMiniShopCartPageView:function(a){dojo.connect(null,"showMiniShopCartDropDown",function(){analyticsJS.publishMiniShopCartPageView(a)})},publishMiniShopCartPageView:function(a){var b=this;if(!b.pageViewControl){b.lockPageView();var c=this.getMiniShopCartPageViewData(a);this.publishPageView(c)}},lockPageView:function(){this.pageViewControl=!0,setTimeout("analyticsJS.pageViewControl = false;",3e3)},registerMiniShopCartCartView:function(){var a=this;dojo.forEach(this.cartViewActionIdList,function(b){dojo.subscribe("modelChanged/"+b,function(){a.publishCartView()})}),dojo.subscribe("CMAddToCart",function(){a.publishCartView()})},loadShopCartHandler:function(a){var b=this;1==a&&(b.incTaxInUnitPriceForCart="T"),b.registerMiniShopCartCartView(),b.registerShopCartPaginationPageView(),b.registerShippingBillingAddressEditPageView()},loadShopCartPaginationHandler:function(){this.registerShopCartPaginationPageView()},registerShopCartPaginationPageView:function(){var a=this;dojo.subscribe("ShopCartPaginationDisplay_Context/RenderContextChanged",function(){var b={pagename:document.title};a.publishPageView(b)}),dojo.subscribe("OrderItemPaginationDisplay_Context/RenderContextChanged",function(){var b={pagename:document.title};a.publishPageView(b)}),dojo.subscribe("traditionalShipmentDetailsContext/RenderContextChanged",function(){var b={pagename:document.title};a.publishPageView(b)}),dojo.subscribe("MSOrderItemPaginationDisplay_Context/RenderContextChanged",function(){var b={pagename:document.title};a.publishPageView(b)})},registerShippingBillingAddressEditPageView:function(){var a=this;dojo.subscribe("editShippingAddressContext/RenderContextChanged",function(){var b={pagename:document.title,category:"Shipping and biling address"};a.publishPageView(b)})},registerStoreLocatorPageViews:function(){var a=this;dojo.subscribe("selectedStoreListContext/RenderContextChanged",function(){var b={pagename:document.title,category:"Store locator"};a.publishPageView(b)}),dojo.subscribe("storeLocatorResultsContext/RenderContextChanged",function(){var b={pagename:document.title,category:"Store locator"};a.publishPageView(b)})},loadStoreLocatorPageViews:function(){var a=this;dojo.addOnLoad(function(){a.registerStoreLocatorPageViews()})},registerFastFinderEventHandlers:function(a){var b=this;dojo.forEach(b.fastFinderEvents,function(c){var d=c[0],e=c[1],f=c[2];dojo.connect(fastFinderJS,d,function(c){b.publishAnalyticsView(b.jsonElementView,{elementId:f?f(c):c,category:["Fast Finder:",e].join(""),pageId:document.title,pageCategory:a},function(a){b.publishTopic(b.element,a)})})})},registerFastFinderFormHandlers:function(){var a=this;dojo.forEach(a.fastFinderCheckboxForms,function(b){var c=b[0],d=b[1];dojo.forEach(document.forms[c].elements,function(b){a.connectFastFinderInputs(b,d)})})},connectFastFinderInputs:function(a,b){var c=this;dojo.connect(a,"onclick",function(){c.publishAnalyticsView(c.jsonElementView,{elementId:a.value,category:["Fast Finder: ",b].join(""),pageId:document.title,pageCategory:"Fast Finder",state:function(a){return a.checked?"checked":"unchecked"}(a)},function(a){c.publishTopic(c.element,a)})})},loadFastFinderHandlers:function(a){var b=this;dojo.addOnLoad(function(){b.registerFastFinderEventHandlers(a),b.registerFastFinderFormHandlers()})},registerUserRegUpdateHandler:function(){var a=this,b={pagename:"My Account:"+document.title,category:"MyAccountPage"};dojo.forEach(this.registrationViewIdList,function(b){dojo.subscribe("modelChanged/"+b,function(){a.publishRegistrationView()})}),dojo.forEach(this.myAccountPageIdList,function(c){dojo.subscribe("modelChanged/"+c,function(){a.publishPageView(b)})})},publishMyAccountPageView:function(a){var b=this,c=wc.render.getContextById(a),d=c.properties.workAreaMode,e="";"myAccountMain"==d?e="My Account:"+document.title:"personalInformation"==d?e="Personal Information:"+document.title:"addressBook"==d?e="My Address Book:"+document.title:"trackOrderStatus"==d?e="My Orders:"+document.title:"checkoutProfile"==d?e="Quick checkout profile:"+document.title:"wishList"==d?e="Personal Wishlist:"+document.title:"couponWallet"==d&&(e="My Coupons:"+document.title);var f={pagename:e,category:"MyAccountPage"};b.publishPageView(f)},registerMyAccountPageHandler:function(a){var b=this;dojo.connect(MyAccountDisplay,"loadContentFromURL",function(){b.publishMyAccountPageView(a)}),dojo.connect(wc.render.getRefreshControllerById("MyAccountCenterLinkDisplay_Controller"),"postRefreshHandler",function(){cX("onload")})},registerMyAddressBookHandler:function(){var a=this,b="My Address Book:"+document.title,c={pagename:b,category:"MyAccountPage"};dojo.forEach(this.myAddressBookPageIdList,function(b){dojo.subscribe("modelChanged/"+b,function(){a.publishPageView(c)})}),dojo.subscribe("addressBookContext/RenderContextChanged",function(){a.publishPageView(c)})},registerWishlistHandler:function(){var a=this,b=(document.title,{eventId:"AddToWishlist"});dojo.forEach(this.conversionEventList,function(c){dojo.subscribe("modelChanged/"+c,function(){a.publishConversionEventView(b)})})},loadWishlistHandler:function(){var a=this;dojo.addOnLoad(function(){a.registerWishlistHandler()})},loadMyAccountPageHandlers:function(){var a=this;dojo.addOnLoad(function(){a.registerUserRegUpdateHandler(),a.registerMyAccountPageHandler("MyAccountCenterLinkDisplay_Context"),a.registerMyAddressBookHandler()})},publishShopCartLoginTags:function(){var a=this;dojo.addOnLoad(function(){a.publishRegistrationView(),a.publishCartView()})},registerProductQuickInfoView:function(a){var b=this;"undefined"!=typeof QuickInfoJS&&dojo.connect(QuickInfoJS,"showDetails",function(){var c=document.getElementById(a).innerHTML;b.publishAnalyticsView(b.jsonProductView,{productId:c,storeId:b.storeId},function(a){b.publishTopic(b.productView,a)})})},loadProductQuickInfoHandler:function(a){var b=this;dojo.addOnLoad(function(){b.registerProductQuickInfoView(a)})},loadPagingHandler:function(){var a=this;dojo.addOnLoad(function(){var b={forward:"page forward",backward:"page backward"},c=[["CatalogSearchDisplayJS","goBack",b.backward],["CatalogSearchDisplayJS","goForward",b.forward],["CatalogSearchDisplayJS.HistoryTracker.prototype","back",b.backward],["CatalogSearchDisplayJS.HistoryTracker.prototype","forward",b.forward],["fastFinderJS","goBack",b.backward],["fastFinderJS","goForward",b.forward],["fastFinderJS","filterResultsWithPrevIndex",b.backward],["fastFinderJS","filterResultsWithNextIndex",b.forward],["fastFinderJS.HistoryTracker.prototype","back",b.backward],["fastFinderJS.HistoryTracker.prototype","forward",b.forward],["MyAccountDisplay","goBack",b.backward],["MyAccountDisplay","goForward",b.forward],["MyAccountDisplay.HistoryTracker.prototype","back",b.backward],["MyAccountDisplay.HistoryTracker.prototype","forward",b.forward],["Common","goBack",b.backward],["Common","goForard",b.forward],["Common.HistoryTracker.prototype","back",b.backward],["Common.HistoryTracker.prototype","forward",b.forward],["categoryDisplayJS","loadContentURL","view change"]];dojo.forEach(c,function(b){var c=dojo.getObject(b[0]),d=b[1],e=b[2];dojo.connect(c,d,function(){a.publishPageView({pagename:document.title,category:e})})})})},registerSearchResultPageView:function(refreshControllerId,resultInfoDivId,registerPageViewNow,advSearchFormDivId){var realSearch=!0,scope=this;if(registerPageViewNow&&null!=dojo.byId(resultInfoDivId)){var resultInfo=eval("("+dojo.byId(resultInfoDivId).innerHTML+")").searchResult,pageViewData={pagename:document.title};""!=resultInfo.searchTerms&&(pageViewData="0"!=resultInfo.totalResultCount?{pagename:"Search Successful:"+resultInfo.currentPageNumber}:{pagename:"Search Unsuccessful"},resultInfo.searchTerms.length>0&&(pageViewData.searchTerms=resultInfo.searchTerms,pageViewData.searchCount=resultInfo.totalResultCount),pageViewData.category="Search Results"),pageViewData.attributes=resultInfo.attributes,pageViewData.storeId=String(resultInfo.storeId);var cmData=[pageViewData];dojo.publish("ajaxRequestInitiated"),scope.publishTopic(scope.pageView,cmData),dojo.publish("ajaxRequestCompleted")}dojo.connect(wc.render.getRefreshControllerById(refreshControllerId),"postRefreshHandler",function(){var resultInfo=eval("("+dojo.byId(resultInfoDivId).innerHTML+")").searchResult,pageViewData={pagename:document.title};""!=resultInfo.searchTerms&&(pageViewData="0"!=resultInfo.totalResultCount?{pagename:"Search Successful:"+resultInfo.currentPageNumber}:{pagename:"Search Unsuccessful"},realSearch&&(resultInfo.searchTerms.length>0&&(pageViewData.searchTerms=resultInfo.searchTerms,pageViewData.searchCount=resultInfo.totalResultCount),pageViewData.category="Search Results")),pageViewData.attributes=resultInfo.attributes,scope.publishPageView(pageViewData)})},loadSearchResultHandler:function(a,b,c,d){var e=this;dojo.subscribe("CMPageRefreshEvent",function(){e.registerSearchResultPageView(a,b,c,d)})},registerPaymentPageView:function(a){var b=this;dojo.connect(a,"setNumberOfPaymentMethods",function(a,c,d){b.publishPageView({pagename:c.value,category:"payment method"}),c=null})},loadPaymentPageView:function(a){var b=this;dojo.addOnLoad(function(){b.registerPaymentPageView(a)})}});