var klevu_storeCurrency="";var klevu_layout={addLayoutToPage:function(h){var u=document,g=u.createElement("div"),d=u.createElement("div"),i=u.createElement("div"),q=u.createElement("div"),n=u.createElement("div"),r=u.createElement("div"),s=u.createElement("div"),f,t,p,j,l,m,o,k="",a,c,b;if(!h){h=u.getElementsByTagName("body")[0]}if(klevu_fluidLayoutEnabled){p=u.createElement("div");p.setAttribute("class","klevu-fluid");p.setAttribute("role","region");p.setAttribute("aria-label","Klevu Search Container");if("undefined"!==typeof klevu_bigCommerceStore&&klevu_bigCommerceStore){p.setAttribute("data-prevent-quick-search-close","")}}if(klevu_userOptions.cmsEnabled){k=" klevu-searching-with-cms"}if(klevu_filtersEnabled){o="klevu-searching-area"+k;klevu_showPopuralTerms=false}else{if(klevu_showPopuralTerms){o="klevu-searching-area klevu-popular-terms"+k}else{o="klevu-searching-area klevu-without-filter"+k}}g.setAttribute("class",o);g.setAttribute("id","klevuSearchingArea");g.setAttribute("tabindex","-1");g.style.display="none";this.addMinimumLtrDiv(h);if(!klevu_userOptions.fullpageLayoutEnabled){this.addLoaderDiv(h,"klevu-min-ltr")}else{this.addLoaderDiv(g,"klevu-no-records")}if(klevu_showPopularSearches||klevu_showRecentSerches||klevu_userOptions.showRecentlyViewedItems||klevu_userOptions.showTrendingProducts){j=u.createElement("div");j.setAttribute("class","klevu-pt-rs-hover");j.setAttribute("id","klevu-pt-rs-hover");j.setAttribute("tabindex","-1");j.style.display="none";if(klevu_fluidLayoutEnabled){m=u.createElement("div");m.setAttribute("class","klevu-fluid");m.setAttribute("role","region");m.setAttribute("aria-label","Klevu Personalisation Container");m.appendChild(j);h.appendChild(m)}else{h.appendChild(j)}var e=false;if(klevu_showPopularSearches){e=this.addPopularSearchesDiv(j)}if(klevu_showRecentSerches){e=this.addRecentSearchesDiv(j)}if(!e){j.style.display="none"}}this.addNoResultsFoundDiv(g);if(klevu_showPopuralTerms){this.addPopularTermsDiv(g)}if("undefined"!==typeof klevu_showBannerAds&&klevu_showBannerAds){klevu_layout.addElementToParent(g,"div",{"class":"klevu-banner-ad",id:"klevuBannerAdTop",style:"padding:0px;"})}if(klevu_filtersEnabled&&klevu_commons.isMobileDevice()){a=klevu_layout.addElementToParent(g,"div",{"class":"klevu-filter-refine-mobile klevu-expand",id:"klevuFilterRefineMobile",style:"display:none;",onclick:"klevu_filters.showFiltersOnMobile();"});a.innerHTML=klevu_uiLabels.narrowBy}if(klevu_filtersEnabled&&klevu_filtersOnLeft){this.addFiltersDiv(g)}d.setAttribute("class","klevu-sorting-results");d.setAttribute("id","klevuSortingResultsDiv");if(klevu_userOptions.fullpageLayoutEnabled){s.setAttribute("class","klevu-search-for");s.setAttribute("id","klevu-search-for");d.appendChild(s);s.innerHTML='
'}q.setAttribute("class","klevu-sorting-area");q.setAttribute("id","klevu-sorting-area");this.addViewIcons(q);this.addTotalResultsDiv(q);if(klevu_showPrices){this.addSortingIcons(q)}n.setAttribute("class","klevu-clear-left");q.appendChild(n);d.appendChild(q);if("undefined"!==typeof klevu_similarProductsFoundMsg&&klevu_similarProductsFoundMsg){klevu_layout.addElementToParent(d,"div",{"class":"klevu-results-for",id:"klevu-results-for"})}r.setAttribute("class","klevu-grid-view");r.setAttribute("id","klevuSearchSuggest");if(!klevu_userOptions.fullpageLayoutEnabled){r.onscroll=function(){if((r.scrollTop+50)>=(r.scrollHeight-r.offsetHeight)){if(klevu_searchedTerm.trim().length>0){klevu_search.fetchResults(klevu_searchedTerm,"a")}}}}else{klevu_commons.attachEvent(window,"scroll",klevu_layout.fullpageScroll)}if(klevu_userOptions.cmsEnabled){f=klevu_layout.addElementToParent(d,"div",{"class":"klevu-product-content",id:"klevu-product-content"});f.appendChild(r);t=klevu_layout.addElementToParent(d,"div",{"class":"klevu-other-content",id:"klevu-other-content"});l=klevu_layout.addElementToParent(t,"div",{"class":"klevu-other-content-view",id:"klevu-other-content-view"});if(!klevu_userOptions.fullpageLayoutEnabled){l.onscroll=function(){if((l.scrollTop)>=(l.scrollHeight-l.offsetHeight)){if(klevu_searchedTerm.trim().length>0){klevu_search.fetchCmsResults(klevu_searchedTerm,"a")}}}}else{klevu_commons.attachEvent(window,"scroll",klevu_layout.fullpageScroll)}t.style.display="none"}else{d.appendChild(r)}g.appendChild(d);if(klevu_filtersEnabled&&!klevu_filtersOnLeft){this.addFiltersDiv(g)}i.setAttribute("class","klevu-clear-both");g.appendChild(i);if("undefined"!==typeof klevu_showBannerAds&&klevu_showBannerAds){klevu_layout.addElementToParent(g,"div",{"class":"klevu-banner-ad",id:"klevuBannerAdBottom",style:"padding:0px;"})}if(!klevu_logoFreeSearch){this.addPoweredByDiv(g)}if(klevu_fluidLayoutEnabled){p.appendChild(g);h.appendChild(p);c=p;b=m}else{h.appendChild(g);c=g;b=j}if(("undefined"!=typeof klevu_layoutView)&&klevu_layoutView){this.setView(klevu_layoutView)}this.addElementToParent(c,"div",{onkeydown:"klevu_commons.setupNextTabForLastChild();",tabindex:"0"});if(klevu_showPopularSearches||klevu_showRecentSerches||klevu_userOptions.showRecentlyViewedItems||klevu_userOptions.showTrendingProducts){this.addElementToParent(b,"div",{onkeydown:"klevu_commons.setupNextTabForLastChild();",tabindex:"0"})}},fullpageScroll:function(){var a=document.getElementById("klevuSearchSuggest");if(typeof klevu_enableAjaxSearch!="undefined"&&!klevu_enableAjaxSearch){return}var c=0;if(typeof pageYOffset!="undefined"){c=pageYOffset}else{var d=document.body;var b=document.documentElement;b=(b.clientHeight)?b:d;c=b.scrollTop}if(a&&c>=(a.offsetHeight-Math.floor(a.offsetHeight/2))){if(klevu_searchedTerm.trim().length>0){if(klevu_userOptions.cmsEnabled){if(klevu_productTabEnabled){klevu_search.fetchResults(klevu_searchedTerm,"a")}else{klevu_search.fetchCmsResults(klevu_searchedTerm,"a")}}else{klevu_search.fetchResults(klevu_searchedTerm,"a")}}}},addElementToParent:function(d,c,a){var b=document.createElement(c);for(var e in a){if(a.hasOwnProperty(e)){b.setAttribute(e,a[e])}}d.appendChild(b);return b},addMinimumLtrDiv:function(a){var b=this.addElementToParent(a,"div",{"class":"klevu-min-ltr",id:"klevuMinLtr",role:"region","aria-label":"Klevu search term length message"});b.innerHTML=klevu_uiLabels.minimumLtrText;return},addLoaderDiv:function(c,b){var a=this.addElementToParent(c,"div",{"class":b,id:"klevuLoader",role:"region","aria-label":"Klevu loader container"});a.innerHTML='';a.style.textAlign="center";return},addPopularSearchesDiv:function(e){if("undefined"!==typeof klevu_webstorePopularTerms){var g=document,b=this.addElementToParent(e,"div",{"class":"klevu-pt-hover-box",id:"klevu-pt-hover-box"}),h="",d=0,a=klevu_webstorePopularTerms,f=1,c=document.getElementById("klevu-rs-hover-box");if(a&&a.length>0){h+=""+klevu_uiLabels.popularSearches+" ";h+='';for(d=0;d
"+klevu_commons.encodeHtml(decodeURIComponent(a[d]))+"";if(f==5){break}f++}h+=' ';b.innerHTML=h;b.style.display="block";return true}else{if(!c||c.innerHTML.trim()==""){b.parentNode.removeChild(b)}return false}}},addRecentSearchesDiv:function(d){var e=klevu_commons.readCookie(klevu_RSCookieName),c,a="";if(e&&e.trim()!=""){e=e.split("#-#");a=""+klevu_uiLabels.recentSearch+"";a+='';if(e[0].indexOf("javascript:")!==-1){e=e.join(", ");a+=e}else{for(var b=0;b"+klevu_commons.encodeHtml(e[b])+""}}a+='
';c=this.addElementToParent(d,"div",{"class":"klevu-rs-hover-box",id:"klevu-rs-hover-box"}),c.innerHTML=a;return true}else{return false}},addNoResultsFoundDiv:function(a){var b=this.addElementToParent(a,"div",{"class":"klevu-no-records",id:"klevu-no-records"});b.style.display="none";return},addPopularTermsDiv:function(a){this.addElementToParent(a,"div",{"class":"klevu-pt-rs",id:"klevu-pt-rs"});return},addFiltersDiv:function(a){this.addElementToParent(a,"div",{"class":"klevu-filters",id:"klevu-filters"});return},addViewIcons:function(a){var b=this.addElementToParent(a,"div",{"class":"klevu-view",id:"klevu-view"});b.innerHTML=''+klevu_uiLabels.gridView+' '+klevu_uiLabels.listView+"";return},setView:function(a){var b=document;if(a==="list"){b.getElementById("klevuSearchSuggest").className="klevu-list-view";b.getElementById("klevu-listview-btn").className="klevu-list-btn klevu-current-view";b.getElementById("klevu-gridview-btn").className="klevu-grid-btn"}else{if(a==="grid"){b.getElementById("klevuSearchSuggest").className="klevu-grid-view";b.getElementById("klevu-gridview-btn").className="klevu-grid-btn klevu-current-view";b.getElementById("klevu-listview-btn").className="klevu-list-btn"}}},addTotalResultsDiv:function(b){if(klevu_userOptions.cmsEnabled){var a=this.addElementToParent(b,"div",{"class":"klevu-total-results-tab",id:"kuTotPopupResults"});a.innerHTML='"}else{this.addElementToParent(b,"div",{"class":"klevu-total-results",id:"kuTotPopupResults"})}return},addSortingIcons:function(b){var a=this.addElementToParent(b,"div",{"class":"klevu-sorting",id:"klevu-sorting"});a.innerHTML=''+klevu_uiLabels.relevance+' '+klevu_uiLabels.priceLTH+' '+klevu_uiLabels.priceHTL+"";return},changeSortingValue:function(a,c){var b=document;klevu_userOptions.sortingValue=a;klevu_pagination.startPosition=0;if(klevu_userOptions.cmsEnabled){klevu_pagination.startPositionCms=0}b.getElementById("sort-rel").className="klevu-rel-btn";b.getElementById("sort-lth").className="klevu-price-low-btn";b.getElementById("sort-htl").className="klevu-price-high-btn";b.getElementById(c).className+=" klevu-current-sort";klevu_search.fetchResults(klevu_searchedTerm)},changeContentTab:function(c){var d=document,a=d.getElementById("klevu-filters"),b="";if("undefined"!==typeof klevu_multiSelectFilters&&klevu_multiSelectFilters){b=" klevu-multi-check"}if(c==="product"){d.getElementById("klevu-product-content").style.display="block";d.getElementById("klevu-other-content").style.display="none";d.getElementById("klevu-product-content-tab").className="klevu-tab-selected";d.getElementById("klevu-other-content-tab").className="";if(a){a.className="klevu-filters"+b;if(klevu_landingFilterTxt&&klevu_landingFilterTxt.trim()!==""){a.innerHTML=klevu_landingFilterTxt}}d.getElementById("klevu-view").className="klevu-view";if(klevu_showPrices){d.getElementById("klevu-sorting").className="klevu-sorting"}klevu_productTabEnabled=true;if(klevu_addSelectedFiltersToUrl){klevu_commons.addSelectedFiltersToPageUrl("",klevu_cmsFilterParam);klevu_commons.addSelectedFiltersToPageUrl(klevu_userOptions.selectedFilters,klevu_productFilterParam)}}else{if(c==="other"){d.getElementById("klevu-product-content").style.display="none";d.getElementById("klevu-other-content").style.display="block";d.getElementById("klevu-product-content-tab").className="";d.getElementById("klevu-other-content-tab").className="klevu-tab-selected";if(a){if(klevu_landingFilterCmsTxt&&klevu_landingFilterCmsTxt.trim()!==""){a.className="klevu-filters"+b;a.innerHTML=klevu_landingFilterCmsTxt}else{a.className="klevu-filters disableKlevuFilter"+b}}d.getElementById("klevu-view").className="klevu-view disableKlevuFilter";if(klevu_showPrices){d.getElementById("klevu-sorting").className="klevu-sorting disableKlevuFilter"}klevu_productTabEnabled=false;if(klevu_addSelectedFiltersToUrl){klevu_commons.addSelectedFiltersToPageUrl("",klevu_productFilterParam);klevu_commons.addSelectedFiltersToPageUrl(klevu_userOptions.selectedCmsFilters,klevu_cmsFilterParam)}}}klevu_cmsTabClicked=1;klevu_manuallyClickedTab=c;klevu_currentClickedTab=c;klevu_search.handleSearchQuery(klevu_activeSearchBox.value)},addPoweredByDiv:function(a){var b=this.addElementToParent(a,"div",{style:"display:block !important; height:23px !important; padding:1px 6px!important; font-weight:normal !important; background-color:#eee !important; text-align:right !important; visibility: visible !important;"}),c=this.addElementToParent(b,"a",{href:"http://www.klevu.com/",target:"_blank",style:"display:block !important; color:#333 !important; font-size:10px !important; text-decoration:none !important; height: inherit !important;visibility: visible !important; line-height: 23px !important;"});c.innerHTML=klevu_uiLabels.poweredBy+' ';return},getSearchBoxPosition:function(m){var k=0,i=0,h=m,a,d,l=document,f=l.body,e=false,c=0,g=window;while(h&&h.tagName.toLowerCase()!=="body"){if(!g.getComputedStyle){g.getComputedStyle=function(o,n){this.searchBox=o;this.getPropertyValue=function(q){var p=/(\-([a-z]){1})/g;if(q==="float"){q="styleFloat"}if(p.test(q)){q=q.replace(p,function(){return arguments[2].toUpperCase()})}return o.currentStyle[q]?o.currentStyle[q]:null};return this}}a=g.getComputedStyle(h,null);if(a){d=a.getPropertyValue("position");if(d==="fixed"){e=true;break}else{h=h.parentNode}}else{h=h.parentNode}}var j=1,b=(g.pageYOffset!==undefined)?g.pageYOffset:(l.documentElement||f.parentNode||f).scrollTop;while(m&&!isNaN(m.offsetLeft)&&!isNaN(m.offsetTop)){k+=m.offsetLeft-m.scrollLeft;if(e&&j===1){i+=m.offsetTop+b;j=0}else{i+=m.offsetTop}m=m.offsetParent}return{top:i,left:k}},getScreenWidth:function(){var f=document,c=f.body,a=f.documentElement,e=window,d,b;if(typeof(c.clientWidth)=="number"){d=c.clientWidth}else{if(typeof e.innerWidth!=="undefined"){d=e.innerWidth}else{if(typeof a!="undefined"&&typeof a.clientWidth!="undefined"&&a.clientWidth!=0){d=a.clientWidth}else{d=f.getElementsByTagName("body")[0].clientWidth}}}return d},positionOnScroll:function(){var a=document.getElementById("klevuSearchingArea").style;if(a&&a.display.indexOf("block")!==-1){klevu_layout.positionLayout(klevu_activeSearchBox)}},positionLayout:function(q){var s=document,k=s.getElementById("klevu-pt-rs-hover"),c=s.getElementById("klevuSearchingArea"),l=s.getElementById("klevuMinLtr"),i=s.getElementById("klevuLoader"),o=klevu_result_left_margin.trim(),b=klevu_result_top_margin.trim(),h,g,f;if(o!==""&&b!==""){h=b+"px";f=o+"px";g="auto"}else{var r,a,j,e,p,n,m,d;r=this.getSearchBoxPosition(q);j=r.top;a=r.left;e=q.offsetWidth;p=q.offsetHeight;n=this.getScreenWidth();d=n/2;m=e;if(m<250){m=250}l.style.width=m+"px";i.style.width=m+"px";h=p+j+"px";if(a>=d){g=n-(a+e)+"px";f="auto"}else{g="auto";f=a+"px"}if(klevu_userOptions.fullpageLayoutEnabled){i.setAttribute("style","display:none;")}}c.style.right=g;c.style.top=h;c.style.left=f;l.style.right=g;l.style.top=h;l.style.left=f;i.style.right=g;i.style.top=h;i.style.left=f;if(k){k.style.right=g;k.style.top=h;k.style.left=f}},clearResults:function(c){var h=document,b=h.getElementById("klevuSearchingArea"),j=h.getElementById("klevuMinLtr"),d=h.getElementById("klevu-pt-rs-hover"),f=h.getElementById("klevuLoader"),a=klevu_activeSearchBox,e=arguments[1],i=false,g=false;if((a&&a.value.trim().length=klevu_userOptions.minimumLetters&&h.style&&h.style.display==="none"){klevu_search.handleSearchQuery(g.value)}else{if(c){if(h.style&&h.style.display==="block"){c.style.display="none"}else{b=(e&&e.innerHTML.trim()!==""),d=(a&&a.innerHTML.trim()!=="");if(b||d){c.style.display="block"}else{c.style.display="none"}}}}},showLoader:function(b){var c=document,a=c.getElementById("klevuLoader");if(a&&b!=="klp"){if(c.getElementById("klevuSearchingArea").style.display==="none"){if(klevu_userOptions.fullpageLayoutEnabled){if(c.getElementById("klevu-filters")){c.getElementById("klevu-filters").style.display="none"}if(c.getElementById("klevuSortingResultsDiv")){c.getElementById("klevuSortingResultsDiv").style.display="none"}c.getElementById("klevuSearchingArea").style.display="block"}if(c.getElementById("klevuMinLtr")){c.getElementById("klevuMinLtr").style.display="none"}a.style.display="block"}else{c.getElementById("kuTotPopupResults").innerHTML=''}}},hideLoader:function(){var b=document,a=b.getElementById("klevuLoader");if(a){a.style.display="none"}},hideSearchSuggestDiv:function(){var a=document.getElementById("klevuSearchSuggest");if(a){a.style.display="none"}},showTotalResultsFoundText:function(e,b,a){if(e){if(klevu_userOptions.cmsEnabled){var f=klevu_uiLabels.products.indexOf("#")===-1?""+b+" "+klevu_uiLabels.products:klevu_uiLabels.products.replace("#",""+b+" "),c=klevu_uiLabels.otherContent.indexOf("#")===-1?""+a+" "+klevu_uiLabels.otherContent:klevu_uiLabels.otherContent.replace("#",""+a+" "),d=document;if(b===-1){if(d.getElementById("klevu-product-content-tab")){f=d.getElementById("klevu-product-content-tab").innerHTML}else{f=klevu_uiLabels.products.replace("#","")}}else{if(b===0){c=klevu_uiLabels.otherContent.indexOf("#")===-1?""+b+" "+klevu_uiLabels.otherContent:klevu_uiLabels.otherContent.replace("#",""+b+" ")}}if(a===-1){if(d.getElementById("klevu-other-content-tab")){c=d.getElementById("klevu-other-content-tab").innerHTML}else{c=klevu_uiLabels.otherContent.replace("#","")}}else{if(a===0){c=klevu_uiLabels.otherContent.indexOf("#")===-1?""+a+" "+klevu_uiLabels.otherContent:klevu_uiLabels.otherContent.replace("#",""+a+" ")}}e.innerHTML='";e.style.display="block"}else{if(klevu_uiLabels.resultsFound.indexOf("#")===-1){e.innerHTML=""+b+" "+klevu_uiLabels.resultsFound}else{e.innerHTML=klevu_uiLabels.resultsFound.replace("#",""+b+" ").replace(":A","'"+klevu_searchedTerm+"'")}}}},showSearchForTermText:function(b){var a="",c;a=klevu_uiLabels.searchResultFor+" '"+b+"'";if(arguments.length>1){c=arguments[1];if(c.typeOfQuery.indexOf("OR")!==-1||c.typeOfQuery.indexOf("FUZZY")!==-1){if("undefined"!==typeof klevu_similarProductsFoundMsg&&klevu_similarProductsFoundMsg){a+='
('+klevu_similarProductsFoundMsg.replace("#","'"+b+"'")+")"}}}document.getElementById("klevu-for-title").innerHTML=a},renderResults:function(f,t){var x="",m=document,ag=m.getElementById("klevuSearchSuggest"),Z=m.getElementById("klevuSearchingArea"),O=m.getElementById("klevuSortingResultsDiv"),C=100,y=f.result,G=f.meta,D=f.popularProducts,d,c,I,s,ab=0,ac,w=true,q=m.getElementById("kuTotPopupResults"),k=m.getElementById("klevu-no-records"),J=m.getElementById("klevuMinLtr"),z=m.getElementById("klevu-filters"),j,U,S="",p="",Q="",T="",e="",u="",o="",K="",A="",V="",ad="",W="",a="",g="",r="",b="",B="",ae="",L="",H="",aa,Y,N,E,R="",n="",h="",X="",F=f.price,v=false,P,af,M=0,l=m.createElement("div");d=Number(klevu_pagination.recordsPerPage);c=Number(klevu_pagination.startPosition);I=Number(klevu_pagination.totalResultsFound);if(c!==0&&c>=I){return}if(c!==0){s=I-c;if(s<=d){d=s}}klevu_layout.hideLoader();if(t!=="a"){ag.innerHTML=""}ag.style.display=y.length<1?"none":"block";if(typeof G.totalResultsFound!="undefined"&&G.totalResultsFound!=null){I=Number(G.totalResultsFound)}if(y.length>0){if(m.getElementById("klevu-pt-rs-hover")){m.getElementById("klevu-pt-rs-hover").style.display="none"}}else{}this.showTotalResultsFoundText(q,I,-1);if(klevu_userOptions.fullpageLayoutEnabled){this.showSearchForTermText(klevu_searchedTerm,G)}else{if("undefined"!==typeof klevu_similarProductsFoundMsg&&klevu_similarProductsFoundMsg){klevu_commons.showSimilarProductsFoundMessage(klevu_searchedTerm,G,"klevu-results-for")}}if(klevu_userOptions.selectedFilters.indexOf("klevu_price")!==-1&&"undefined"!==typeof klevu_showPriceSlider&&klevu_showPriceSlider&&I===0){v=true}if(klevu_userOptions.cmsEnabled){if(I===0){if(klevu_cmsTabClicked===0){if(!v){m.getElementById("klevu-product-content").style.display="none";m.getElementById("klevu-product-content-tab").className="";m.getElementById("klevu-other-content-tab").className="klevu-tab-selected";m.getElementById("klevu-other-content").style.display="block";klevu_zeroproducts++;if(klevu_zeroproducts<2){klevu_productTabEnabled=false;klevu_search.handleSearchQuery(klevu_activeSearchBox.value);return}}}else{m.getElementById("klevu-product-content").style.display="block";m.getElementById("klevu-product-content-tab").className="klevu-tab-selected";m.getElementById("klevu-other-content-tab").className="";m.getElementById("klevu-other-content").style.display="none";m.getElementById("klevu-view").className="klevu-view";if(klevu_showPrices){m.getElementById("klevu-sorting").className="klevu-sorting"}ag.innerHTML=klevu_layout.displayNoResultData(klevu_commons.getNoResultsData(klevu_uiLabels.noRecords,D));ag.style.display="block"}}else{m.getElementById("klevu-product-content").style.display="block";m.getElementById("klevu-product-content-tab").className="klevu-tab-selected";m.getElementById("klevu-other-content-tab").className="";m.getElementById("klevu-other-content").style.display="none";m.getElementById("klevu-view").className="klevu-view";if(klevu_showPrices){m.getElementById("klevu-sorting").className="klevu-sorting"}klevu_zeroproducts=0}}if(m.getElementById("klevuSearchSuggestUL")){w=false}if(w){x+=''}for(ab=0;abC){S=S.replace(/^(.{100}[^\s]*).*/,"$1")+" ..."}j=S.lastIndexOf("");if(j>U){S=S.substring(0,j-1)}P={productCode:e,productImage:A,productBrand:T,productUrl:g,productName:p,productDescription:S,productPrice:K,salePrice:u,currency:V,priceToDisplay:W,startPrice:B,toPrice:ae,totalProductVariants:a,productSku:H,inStock:L,discount:o,rating:R,size:n,groupPrices:ad,manufacturer:b,deliveryInfo:h,deliveryInfoClass:X,productPosition:M,productItemGroupId:r};for(af in y[ab]){if(y[ab].hasOwnProperty(af)){P[af]=y[ab][af]}}x+=klevu_layout.showProductData(P);l.innerHTML=""}if(w){x+="
";ag.innerHTML+=x}else{m.getElementById("klevuSearchSuggestUL").innerHTML+=x}if(klevu_showPopuralTerms||(t&&t!=="ps")){klevu_layout.showPopularTerms(f.popularTerms,t)}if(klevu_userOptions.fetchFilters){klevu_filters.showFilters(f.filters);if(F&&F.min&&F.max){klevu_layout.showPricingSlider(F,klevu_storeCurrency)}}ac=(Number(c)+d);klevu_pagination.totalResultsFound=Number(I);klevu_pagination.startPosition=ac;if(Number(I)>ac){klevu_pagination.recordsPerPage=Number(d)}if(Z){Z.style.cssText+=";display : block !important;"}if(O){O.style.cssText+=";display : block !important;"}if("function"===typeof klevu_afterQuickSearchResultsLoaded&&y.length>0){klevu_afterQuickSearchResultsLoaded(y,"products")}if(v){ag.innerHTML=''+klevu_uiLabels.noRecordsForSelection+"
";ag.style.display="block";klevu_commons.showBannerAdForGivenTerm(klevu_searchedTerm)}else{if(!klevu_userOptions.cmsEnabled){if(y.length===0){k.innerHTML=klevu_layout.displayNoResultData(klevu_commons.getNoResultsData(klevu_uiLabels.noRecords,D));k.style.cssText+=";display : block !important;";O.style.cssText+=";display : none !important;";if(z){z.style.display="none"}klevu_commons.showBannerAdForGivenTerm("")}else{k.style.cssText+=";display : none !important;";klevu_commons.showBannerAdForGivenTerm(klevu_searchedTerm)}}else{if(klevu_zeroproducts>=2){k.innerHTML=klevu_layout.displayNoResultData(klevu_commons.getNoResultsData(klevu_uiLabels.noRecords,D));k.style.cssText+=";display : block !important;";O.style.cssText+=";display : none !important;";if(z){z.style.display="none"}klevu_zeroproducts=0;klevu_commons.showBannerAdForGivenTerm("")}else{k.style.cssText+=";display : none !important;";O.style.cssText+=";display : block !important;";klevu_commons.showBannerAdForGivenTerm(klevu_searchedTerm)}}}J.style.display="none"},showProductData:function(k){var g="",f="",i=false,c="klevu-saleprice",b="",l,j,e=false,m="",d,a=document.createElement("div"),h=k.additionalDataToReturn?JSON.parse(k.additionalDataToReturn):false;k=klevu_productCustomizations(k);k.additionalFlags=h;if(k.productImage.trim().length===0){k.productImage=klevu_userOptions.noImageUrl}if(klevu_userOptions.openProductClicksInNewWindow){b=' target="_blank"'}else{b=' onclick="klevu_analytics.stopClickDefault( event );" target="_self"'}m="{data: {code: '"+escape(k.productCode)+"',url: '"+escape(k.productUrl)+"',name: '"+escape(k.productName)+"',salePrice: '"+escape(k.salePrice)+"',rating: '"+escape(k.rating)+"',position: "+k.productPosition+",category: '"+escape(k.category)+"',sku: '"+escape(k.sku)+"',itemGroupId: '"+escape(k.productItemGroupId)+"'}}";g+="";g+=''}else{g+=' onmousedown="return klevu_analytics.trackClickedProduct(event, '+m+');" onkeydown="return klevu_eventHandler.handleElementKeydownEvent(event, '+m+', klevu_analytics.trackClickedProduct);" '+b+" >"}a.innerHTML=k.productName;d=a.textContent||a.innerText||"";g+='';if("undefined"!==typeof klevu_showDiscountBadge&&klevu_showDiscountBadge&&k.discount!=""&&k.discount!="0"&&k.discount!="0.0"){if(klevu_uiLabels.discountBadgeText.indexOf("#")===-1){g+=''+klevu_uiLabels.discountBadgeText+" "+Number(k.discount).toFixed(0)+"%
"}else{g+=''+klevu_uiLabels.discountBadgeText.replace("#",Number(k.discount).toFixed(0)+"%")+"
"}}g+=''+k.productName+'
'+k.productDescription+"
";g+=klevu_userOptions.showRatingsOnQuickSearches!==false?klevu_productElements.showRating(k,klevu_userOptions.showRatingsCountOnQuickSearches):"";g+="
";g+='';if(klevu_showPrices){g+=klevu_productElements.showPrices(k,c)}if(klevu_userOptions.vatCaption.trim().length>0){g+='
('+klevu_userOptions.vatCaption+")
"}if(k.totalProductVariants&&k.totalProductVariants!="0"){g+='
+'+k.totalProductVariants+" "+klevu_uiLabels.variants+"
"}if(klevu_userOptions.outOfStockCaption.trim().length>0){if((k.inStock)&&k.inStock==="no"){g+='
'+klevu_userOptions.outOfStockCaption+"
"}}g+="
";g+='';g+="";if(klevu_commons.showAddToCartButton(k.inStock,k.hideAddToCart)){g+=klevu_productElements.showAddtocart(k)}g+="";return g},getPriceDivs:function(b,d,e,a){if(b==="ORIG"){return''+d+"
"}if(b==="SALE"){var c="";c+='';if(e!==""){c+=''+e+" "}c+=d+"
";return c}},sendProductToCart:function(a,c){var b=1;if(arguments.length>2){if(document.getElementById(arguments[2])){b=Number(document.getElementById(arguments[2]).value);if(b<=0){b=1}}}klevu_addtocart(a,c,b)},showPopularTerms:function(h){if(arguments.length>1&&arguments[1]==="pt"){return}var g=document,b=g.getElementById("klevu-pt-rs"),e="",d,c="",a="",f=g.getElementById("klevuSearchingArea");if(klevu_userOptions.cmsEnabled){a=" klevu-searching-with-cms"}if(b&&h){b.innerHTML="";if(h.length>0){f.className="klevu-searching-area klevu-popular-terms"+a;e+=''+klevu_uiLabels.filter_popularTerms+'
";b.innerHTML=e}else{f.className="klevu-searching-area klevu-without-filter"+a}}else{f.className="klevu-searching-area klevu-without-filter"+a}},renderCmsResults:function(b,t){var y="",I=document,F=I.getElementById("klevu-other-content-view"),u=I.getElementById("klevuSearchingArea"),r=I.getElementById("klevuSortingResultsDiv"),A=100,z=b.result,l=b.meta,w=b.popularProducts,e,J,s,m,B=0,g,o=true,p=I.getElementById("kuTotPopupResults"),h=I.getElementById("klevu-no-records"),k=I.getElementById("klevuMinLtr"),D=I.getElementById("klevu-filters"),v,n,C="",H="",a="",j="",f="",c,E,q,x,d=0,G=I.createElement("div");e=Number(klevu_pagination.cmsRecordsPerPage);J=Number(klevu_pagination.startPositionCms);s=Number(klevu_pagination.totalCmsResultsFound);if(J!==0&&J>=s){return}if(J!==0){m=s-J;if(m<=e){e=m}}klevu_layout.hideLoader();if(t!=="a"){F.innerHTML=""}F.style.display=z.length<1?"none":"block";if(typeof l.totalResultsFound!="undefined"&&l.totalResultsFound!=null){s=Number(l.totalResultsFound)}if(z.length>0){if(I.getElementById("klevu-pt-rs-hover")){I.getElementById("klevu-pt-rs-hover").style.display="none"}}else{}this.showTotalResultsFoundText(p,-1,s);if(klevu_userOptions.fullpageLayoutEnabled){this.showSearchForTermText(klevu_searchedTerm)}else{if("undefined"!==typeof klevu_similarProductsFoundMsg&&klevu_similarProductsFoundMsg){klevu_commons.showSimilarProductsFoundMessage(klevu_searchedTerm,l,"klevu-results-for")}}if(s===0){if(klevu_cmsTabClicked===0){I.getElementById("klevu-product-content").style.display="block";I.getElementById("klevu-product-content-tab").className="klevu-tab-selected";I.getElementById("klevu-other-content-tab").className="";I.getElementById("klevu-other-content").style.display="none";klevu_zeroproducts++;if(klevu_zeroproducts<2){klevu_productTabEnabled=true;klevu_search.handleSearchQuery(klevu_activeSearchBox.value);return}}else{I.getElementById("klevu-product-content").style.display="none";I.getElementById("klevu-product-content-tab").className="";I.getElementById("klevu-other-content-tab").className="klevu-tab-selected";I.getElementById("klevu-other-content").style.display="block";I.getElementById("klevu-view").className="klevu-view disableKlevuFilter";if(klevu_showPrices){I.getElementById("klevu-sorting").className="klevu-sorting disableKlevuFilter"}F.innerHTML=''+klevu_uiLabels.noRecords+"
";F.style.display="block"}}else{I.getElementById("klevu-product-content").style.display="none";I.getElementById("klevu-product-content-tab").className="";I.getElementById("klevu-other-content-tab").className="klevu-tab-selected";I.getElementById("klevu-other-content").style.display="block";I.getElementById("klevu-view").className="klevu-view disableKlevuFilter";if(klevu_showPrices){I.getElementById("klevu-sorting").className="klevu-sorting disableKlevuFilter"}klevu_zeroproducts=0}if(I.getElementById("klevuSearchSuggestULCms")){o=false}if(o){y+=''}for(B=0;BA){C=C.replace(/^(.{100}[^\s]*).*/,"$1")+" ..."}v=C.lastIndexOf("");if(v>n){C=C.substring(0,v-1)}y+=klevu_layout.showCmsData({contentCode:a,contentUrl:j,contentTitle:H,contentDescription:C,contentPosition:d,contentItemGroupId:f});G.innerHTML=""}if(o){y+="
";F.innerHTML+=y}else{I.getElementById("klevuSearchSuggestULCms").innerHTML+=y}if(klevu_showPopuralTerms||(t&&t!=="ps")){klevu_layout.showPopularTerms(b.popularTerms,t)}if(klevu_userOptions.fetchFilters){klevu_filters.showCmsFilters(b.filters)}g=(Number(J)+e);klevu_pagination.totalCmsResultsFound=Number(s);klevu_pagination.startPositionCms=g;if(Number(s)>g){klevu_pagination.cmsRecordsPerPage=Number(e)}if(u){u.style.cssText+=";display : block !important;"}if(r){r.style.cssText+=";display : block !important;"}if("function"===typeof klevu_afterQuickSearchResultsLoaded&&z.length>0){klevu_afterQuickSearchResultsLoaded(z,"cms")}if(klevu_zeroproducts>=2){h.innerHTML=klevu_layout.displayNoResultData(klevu_commons.getNoResultsData(klevu_uiLabels.noRecords,w));h.style.cssText+=";display : block !important;";r.style.cssText+=";display : none !important;";if(D){D.style.display="none"}klevu_zeroproducts=0;klevu_commons.showBannerAdForGivenTerm("")}else{h.style.cssText+=";display : none !important;";r.style.cssText+=";display : block !important;";k.style.display="none";if(D){D.style.display="block"}klevu_commons.showBannerAdForGivenTerm(klevu_searchedTerm)}},showCmsData:function(b){var d="",a="",c="";if(klevu_userOptions.openProductClicksInNewWindow){a=' target="_blank"'}else{a=' onclick="klevu_analytics.stopClickDefault( event );" target="_self"'}c="{data: {code: '"+escape(b.contentCode)+"',url: '"+escape(b.contentUrl)+"',name: '"+escape(b.contentTitle)+"',position: "+b.contentPosition+",itemGroupId: '"+escape(b.contentItemGroupId)+"'},apiKey: '"+klevu_cmsApiKey+"',keywordsLP: null,forCms: true}";d+="";d+=''}else{d+=' onmousedown="return klevu_analytics.trackClickedProduct( event, '+c+' );" onkeydown="return klevu_eventHandler.handleElementKeydownEvent(event, '+c+', klevu_analytics.trackClickedProduct);" '+a+" >"}d+=''+b.contentTitle+'
'+b.contentDescription+"
";d+='';d+="";return d},showPricingSlider:function(r,l){var p=document,i=p.getElementById("klevu-price-range"),l=klevu_commons.replaceCurrencyWithItsSymbol(l,l),f=Math.floor(Number(r.min)),m=Math.ceil(Number(r.max)),a=r.start?Math.floor(Number(r.start)):f,d=r.end?Math.floor(Number(r.end)):m,h=p.getElementById("klevu-filters"),q=klevu_userOptions.priceSliderOption,k=p.getElementById("klevuSearchingArea"),n="",o="";if(klevu_userOptions.cmsEnabled){n=" klevu-searching-with-cms"}if(klevu_showPrices){if(i===null){p.getElementById("klevu-filters").innerHTML+=klevu_filters.displayPricingSlider();i=p.getElementById("klevu-price-range");if("undefined"!==typeof klevu_multiSelectFilters&&klevu_multiSelectFilters){o=" klevu-multi-check"}h.className="klevu-filters"+o;h.style.display="block";k.className="klevu-searching-area"+n}a=am?m:d;q.start=[a,d];q.range={min:f,max:m};q.format={to:function(t){var e=klevu_userOptions.priceFormatter,s=t.formatMoneyForKlevu(0,"",e.thousandSeparator,e.decimalSeparator);if(klevu_currenciesAppendedAtEnd.indexOf(l)!==-1){return s+" "+l}else{return l+" "+s}},from:function(e){return klevu_commons.removePriceFormatting(e,l)}};try{klevuPriceSlider.create(i,q)}catch(j){}var g=document.getElementById("klevu-from-price"),c=document.getElementById("klevu-to-price"),b="";try{i.klevuPriceSlider.on("update",function(e,s){e[0]=klevu_commons.removePriceFormatting(e[0],l);e[1]=klevu_commons.removePriceFormatting(e[1],l);selectedFilters=klevu_userOptions.selectedFilters;b="klevu_price:"+e[0]+" - "+e[1];if(!(e[0]==a&&e[1]==d)&&a>=f&&d<=m){clearTimeout(klevu_psTimer);klevu_psTimer=setTimeout(function(){if(selectedFilters===""){selectedFilters=b}else{if(selectedFilters.indexOf("klevu_price")!==-1){selectedFilters=selectedFilters.replace(/klevu_price:[0-9.\- ]*;*/,b)}else{selectedFilters+=";;"+b}}klevu_userOptions.selectedFilters=selectedFilters;if(klevu_addSelectedFiltersToUrl){klevu_commons.addSelectedFiltersToPageUrl(klevu_userOptions.selectedFilters,klevu_productFilterParam)}klevu_search.handleSearchQuery(klevu_activeSearchBox.value)},400)}})}catch(j){p.getElementById("klevu-filter-box_Price-Range").style.display="none"}}},displayNoResultData:function(n){var p="",m=33,l=n.products||[],k=klevu_userOptions.noResultsOptions,c=false,d,a=document.createElement("div");p+='';p+='
';p+='
'+n.msgToShow+"
";if(l&&l.length>0){p+='
"}if(n.banner&&n.banner.showOnQuickSearch){var o=n.banner.bannerImageUrl;if(klevu_commons.isMobileDevice()&&!!n.banner.mobileBannerImageUrl){o=n.banner.mobileBannerImageUrl}trackingParams="{id: '"+n.banner.bannerRef+"',name: '"+escape(n.banner.bannerName)+"',image: '"+escape(o)+"',redirectUrl: '"+escape(n.banner.redirectUrl)+"'}";if(klevu_commons.isMobileDevice()){trackingEvent=" onclick="}else{trackingEvent=' onclick="klevu_analytics.stopClickDefault( event );" onkeydown="return klevu_eventHandler.handleElementKeydownEvent(event, '+trackingParams+', klevu_analytics.trackClickedBannerAds);" onmousedown='}trackingEvent+='"return klevu_analytics.trackClickedBannerAds(event, '+trackingParams+');" target="_blank">';var g=klevu_commons.getBannerAltText(n.banner,o);if(klevu_commons.isMobileDevice()&&!!n.banner.mobileBannerImageUrl){g=n.banner.mobileBannerAltTag||""}p+='
'}if((k&&k.showPopularKeywords)||(klevu_userOptions.showPopularKeywordsForNoResult)){c=true}if("undefined"!==typeof klevu_webstorePopularTerms&&klevu_webstorePopularTerms&&c){var b=klevu_webstorePopularTerms,h=1;p+='
';p+=''+klevu_uiLabels.popularSearches+" ";if(b&&b.length>0){for(f=0;f'+decodeURIComponent(b[f])+""}catch(j){continue}if(h==5){break}h++}}p+="
"}p+="
";p+="
";return p}};var klevu_productElements={showPrices:function(c,b){var d="",a=c.additionalFlags;if(a&&a.is_price_hidden){d+=a.price_hidden_label?a.price_hidden_label:""}else{if(klevu_userOptions.showOnlyOriginalAndSalePrices){d+=klevu_commons.showOriginalAndSalePrices("BASIC",c,b,"klevu-saleprice klevu-special-price")}else{d+=klevu_commons.showProductPrices("BASIC",c,b,"klevu-saleprice klevu-special-price")}}return d},showRating:function(c,e){var d="",b=c.additionalFlags,a=0;if(c.rating.trim().length>0&&!isNaN(Number(c.rating))&&Number(c.rating)<=5&&Number(c.rating)>=0){a=20*Number(c.rating);d+='';if(e&&c.ratingCount){d+='
('+c.ratingCount+")"}else{if(b&&b.rating_count){d+="
("+b.rating_count+")"}}d+="
"}return d},showAddtocart:function(h){try{var c="",g=h.additionalFlags,b=klevu_userOptions.addToCartButton,d=h.totalProductVariants?+(h.totalProductVariants):0,a=false;if(g){if(g.preorder_only){a=true;b=klevu_userOptions.preorderButton}if(g.purchasing_disabled){if(!a){return""}}}var i=h.category||"";var j="{data: {code: '"+escape(h.productCode)+"',url: '"+escape(h.productUrl)+"',name: '"+klevu_commons.escapeHtml(h.productName)+"',salePrice: '"+escape(h.salePrice)+"',rating: '"+escape(h.rating)+"',position: "+h.productPosition+",category: '"+klevu_commons.escapeHtml(i)+"',sku: '"+escape(h.sku)+"',itemGroupId: '"+escape(h.productItemGroupId)+"'}}";if(!(h.isCustomOptionsAvailable&&h.isCustomOptionsAvailable==="yes")&&(d===0&&!a)){if(klevu_userOptions.fullpageLayoutEnabled){c+="'+b+""}else{c+='"}}else{if(klevu_userOptions.fullpageLayoutEnabled){c+=''+b+""}else{c+='"}}c+=''}catch(f){}return c}};var klevu_filters={filterHeight:"",showFilters:function(a){var l=document,g=l.getElementById("klevuSearchingArea"),d=l.getElementById("klevu-filters"),e,f,c=0,h="",b=new Array(),k="";if(klevu_userOptions.cmsEnabled){h=" klevu-searching-with-cms"}if(klevu_pagination.startPosition!=0){g.className="klevu-searching-area"+h;return}if(!d){return}klevu_landingFilterTxt="";d.innerHTML="";if("undefined"!==typeof klevu_multiSelectFilters&&klevu_multiSelectFilters){k=" klevu-multi-check"}if(a&&a.length>0){g.className="klevu-searching-area"+h;d.className="klevu-filters"+k;for(e=0,f=a.length;e0){g.className="klevu-searching-area klevu-searching-with-cms";d.className="klevu-filters klevu-cms-filters "+h;for(e=0,f=a.length;eb){e+=''}else{e+='
";if(a.length>b){if(q){e=e.replace('
','
')}else{e+='
'}}if(klevu_productTabEnabled){klevu_landingFilterTxt+=e}else{klevu_landingFilterCmsTxt+=e}if(a.length>0&&a.length<6){return"klevu-filter-box_"+u}}},displayPricingSlider:function(){var b=klevu_translateFilterLabel("PRICE RANGE").toUpperCase(),e="",d=1,k="Price-Range",h,f=0,g,c,m,n,l,a,j;if(d.length>4){e+='
'}else{e+='
";return e},sendQuery:function(g,e){var k=document,f=k.getElementById("klevu-filters"),b,j="",h="",c=0,d,a="";if(e){k.getElementById(g.split("~")[0]).className="klevu-filter-selected"}if("undefined"!==typeof klevu_userFilterResults){h=klevu_userFilterResults}b=getElementsByClassName("klevu-filter-selected","li");d="";for(c=0,len=b.length;c