var $Quivers = $Quivers || {}; (function(){if(window.jQuery&&typeof window.jQuery=="function"&&window.jQuery()!==null){var vernums=window.jQuery().jquery.split('.');var currentVersion=window.jQuery().jquery;} var rossiCustomization=false;if(window.location.host=="www.rossignol.com") rossiCustomization=true;if(typeof vernums!=="undefined"&&typeof currentVersion!=="undefined"&&rossiCustomization===false&&window.jQuery&&(currentVersion=="1.9.1"||(parseInt(vernums[0])>=1&&(parseInt(vernums[0])>1||parseInt(vernums[1])>=9)&&(parseInt(vernums[0])>1||(parseInt(vernums[0])==1&&parseInt(vernums[1])>9)||parseInt(vernums[2])>1)))){console.log('Quivers will use '+window.jQuery().jquery);$jquivers=window.jQuery;if(typeof $=="function"&&typeof $()!=="undefined"&&$()!==null&&typeof $().jquery!=="undefined") $=window.jQuery;qCheckReady=function(callback){callback(window.jQuery);}} else{var script=document.createElement("SCRIPT");script.src='https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js';script.type='text/javascript';document.getElementsByTagName("head")[0].appendChild(script);qCheckReady=function(callback){if(window.jQuery&&window.jQuery().jquery=='1.9.1'){console.log('Encapsulating jQuery 1.9.1');if(rossiCustomization===true) $jquivers=$;else{if($.noConflict){$jquivers=$.noConflict(true);} if(typeof jQuery=="undefined"&&typeof $=="undefined"){$=$jquivers;window.jQuery=$;} else window.jQuery=$jquivers;} callback($);} else{window.setTimeout(function(){qCheckReady(callback);},10);}};}qCheckReady(function($){$Quivers.Addresses={Details:function(addressId){if(window[this.MarketplaceId].CurrentView=="Checkout"){if(window[this.MarketplaceId].Checkout.StatePosition==3) var context="Shipping";else if(window[this.MarketplaceId].Checkout.StatePosition==4) var context="Billing";} else context="Account";new QuiversAddressForm(window[this.MarketplaceId],typeof context!="undefined"||context==null?context:"Account",true,addressId);},Pick:function(addressId,context){var addressBlocks=$Quivers.Dom.Get('.qAddressBlock[data-picker="true"]');var btn=$Quivers.Dom.Get('.qAddressPickButton[data-address="'+addressId+'"][data-context="'+context+'"]')[0];if(btn.getAttribute('data-selected')=="false"){for(var i=0;i-1) inputs[i].value=place.address_components[c].long_name;} break;}}} catch(err){console.warn(err);}} for(var s=0;s-1){for(var o=0;o-1){for(var o=0;o-1){selects[s].selectedIndex=o;}}}}} catch(err){console.warn(err);} break;} case"StateProvinceId":{try{for(var c=0;c-1){for(var o=0;o-1){selects[s].selectedIndex=o;}}}}}} catch(err){console.warn(err);} break;}}} self.Validate(self.FormElement);}});} var inputs=$Quivers.Dom.Get('input[data-form="'+self.FormElement+'"]');var selects=$Quivers.Dom.Get('select[data-form="'+self.FormElement+'"]');for(var i=0;i31&&(charCode<48||charCode>57)){evt.preventDefault();return false;}} return true;});}} QuiversAddressForm.prototype.Validate=function(form){try{var inputs=$Quivers.Dom.Get('input[data-form="'+form+'"]');var selects=$Quivers.Dom.Get('select[data-form="'+form+'"]');var formGroups=$Quivers.Dom.Get('div[data-inputs]');} catch(err){console.warn(err);var inputs=[];var selects=[];var formGroups=[]} var validated=true;var focused=false;for(var i=0;i-1){formGroups[g].className=className;}}} for(var i=0;i-1) formGroups[g].className=className;}} return validated;} $Quivers.Analytics={AccountCodes:{},Trackers:[]};$Quivers.Analytics.Initialize=function(trackingCodes){var self=this;for(var i=0;i "+page+"!");} else console.warn("Failed to commit page view; Google Analytics was not yet ready.");} $Quivers.Analytics.Purchase=function(order,currency){this.SetPage("Confirmation","Confirmation");var hc=window[this.MarketplaceId];var opvs=[];for(var i=0;i';var body=$Quivers.Dom.Get("body")[0];body.appendChild(pixel);}} catch(err){console.warn(err);}} $Quivers["/api/v1/app"]={success:function(data){data=$Quivers.Utilities.FormatResult(data);window[data.Result.Marketplace].CloudHub=data.Result.Data.CloudHub;window[data.Result.Marketplace].Currency=data.Result.Data.Currency;window[data.Result.Marketplace].Settings.Apply(data.Result.Data.Settings);window[data.Result.Marketplace].Languages[data.Result.Data.Language._id]=data.Result.Data.Language;window[data.Result.Marketplace].GA_TrackingCodes=data.Result.Data.GA_TrackingCodes;window[data.Result.Marketplace].IsPublic=data.Result.Data.IsPublic;window[data.Result.Marketplace].MarketplaceOwnerRefId=data.Result.Data.BusinessRefId;window[data.Result.Marketplace].Countries=data.Result.Data.Countries;window[data.Result.Marketplace].RetailerFulfillmentPossible=data.Result.Data.RetailerFulfillmentPossible;var checkCssHasLoaded=setInterval(function(){if(typeof window[data.Result.Marketplace].CssLoaded!=="undefined"&&window[data.Result.Marketplace].CssLoaded==true){clearInterval(checkCssHasLoaded);if(document.getElementById("QuiversHoverCart")==null){var quivers=document.createElement("div");quivers.id="QuiversHoverCart";quivers.setAttribute("style","display: none;");} else var quivers=document.getElementById("QuiversHoverCart");quivers.setAttribute("quivers-bootstrap","true");quivers.innerHTML=data.Result.Html;if(document.getElementById("QuiversHoverCart")==null) document.body.appendChild(quivers);quivers.setAttribute("style","");$jquivers(window).resize(function(){$Quivers.Dom.ResizeDialog();});if(window[data.Result.Marketplace].Settings.Ribbon.Automatic===true||typeof window[data.Result.Marketplace].IgnoreRibbonAutomatic!=="undefined"){window[data.Result.Marketplace].Get("ribbon");} var iframe=document.getElementById("PhpSess");if(iframe) iframe=null;if(document.characterSet!="UTF-8"){var utf8fix='';quivers.innerHTML+=utf8fix;}}});if(typeof window[data.Result.Marketplace].Settings.Extensions.CriteoTracking!=="undefined"){window[data.Result.Marketplace].Criteo.Activate(window[data.Result.Marketplace].Settings.Extensions.CriteoTracking);if(data.Result.Data.Md5Email!==null) window[data.Result.Marketplace].Criteo.SetEmail(data.Result.Data.UserEmail,data.Result.Data.Md5Email);} else window[data.Result.Marketplace].Criteo.Enabled=false;if(typeof window[data.Result.Marketplace].Settings.Extensions.ShopEmployee!=="undefined"&&window[data.Result.Marketplace].Settings.Extensions.ShopEmployee.Enabled==true){window[data.Result.Marketplace].ShopEmployee=ShopEmployeeExtension;window[data.Result.Marketplace].ShopEmployee.MarketplaceId=data.Result.Marketplace;} if(typeof window[data.Result.Marketplace].Settings.Extensions.Boomerang!=="undefined"&&window[data.Result.Marketplace].Settings.Extensions.Boomerang.Enabled==true){window[data.Result.Marketplace].Boomerang=BoomerangExtension;window[data.Result.Marketplace].Boomerang.MarketplaceId=data.Result.Marketplace;}},error:function(data){data=$Quivers.Utilities.FormatResult(data);throw"Error: The HoverCart could not be loaded; "+data.Result.Data.Error;if(data.Result.Data.Error=="Could not unpackage HoverCart application."){var settings=window[data.Result.Data.Marketplace].Settings;settings.Origin=document.domain;settings.CurrentUrl=window.location.href;settings.PointOfSaleBusiness=window[data.Result.Data.Marketplace].PointOfSaleBusiness;settings.HoverCartId=window[data.Result.Data.Marketplace].Id;window[data.Result.Data.Marketplace].Post("app",settings);} else{if(typeof window[data.Result.Data.Marketplace].OnStart=="function") window[data.Result.Data.Marketplace].OnStart({Error:data});}}} $Quivers["/api/v1/ribbon"]={success:function(data){data=$Quivers.Utilities.FormatResult(data);var ribbonId=window[data.Result.Marketplace].Settings.Ribbon.DisplayElement;if(typeof window[data.Result.Marketplace].OnStart=="function") window[data.Result.Marketplace].OnStart();var ribbon=document.getElementById(ribbonId);if(!ribbon){window[data.Result.Marketplace].Settings.Ribbon.DisplayElement="QuiversRibbon";ribbonId="QuiversRibbon";var ribbon=document.getElementById("QuiversRibbon");} window[data.Result.Marketplace].Analytics.Initialize(window[data.Result.Marketplace].GA_TrackingCodes);window[data.Result.Marketplace].Catalog.Widgets();window[data.Result.Marketplace].Catalog.Assortments();window[data.Result.Marketplace].Catalog.ReviewWidgets();window[data.Result.Marketplace].CheckForWidgets=setInterval(function(){if(document.getElementById(ribbonId)){window[data.Result.Marketplace].Catalog.Assortments();window[data.Result.Marketplace].Catalog.Widgets();window[data.Result.Marketplace].Catalog.ReviewWidgets();} else{clearInterval(window[data.Result.Marketplace].CheckForWidgets);delete this;}},1000);if(ribbonId=="QuiversRibbon"){window[data.Result.Marketplace].Dom.ReplaceHtml(ribbon,data.Result.Html);ribbon.setAttribute("data-position",window[data.Result.Marketplace].Settings.Ribbon.Position);ribbon.setAttribute("data-style",window[data.Result.Marketplace].Settings.Ribbon.Style);if(window[data.Result.Marketplace].Settings.Ribbon.Position=="top"){ribbon.setAttribute("style","top: 0px !important");document.body.setAttribute("data-quivers","true");window[data.Result.Marketplace].SelectViewFromUrl();} else{ribbon.setAttribute("style","right: 0px !important");window[data.Result.Marketplace].SelectViewFromUrl();setTimeout(function(){document.body.setAttribute("data-quivers","true");},300);}} else{ribbon.innerHTML='';ribbon.innerHTML+=data.Result.Html;if(!ribbon.hasAttribute("data-active")) window[data.Result.Marketplace].SelectViewFromUrl();ribbon.setAttribute("data-active","true");document.body.setAttribute("data-quivers","true");} if(window[data.Result.Marketplace].Settings.Translation.Enabled==true){window[data.Result.Marketplace].Translation.Start();} try{var cartCounts=$Quivers.Dom.Get("#qCartCount-Shopping");for(var c=0;c0){for(var i in ieScrollHeightBugFix){if(ieScrollHeightBugFix[i].parentNode.parentNode.id=="currentView"){if(ieScrollHeightBugFix[i].hasAttribute("style")) ieScrollHeightBugFix[i].removeAttribute("style");ieScrollHeightBugFix[i].setAttribute("style","height: auto;");}}}} var eInputs=$Quivers.Dom.Get('input[name="Email"][data-form="Register"]');if(eInputs.length>0){for(var i=0;i"+eInputs[i].value+" already exists. To continue, use the same password for this user, or try resetting your password before registering.");}}}))})}} var modules=document.getElementsByClassName("qModule");if(modules.length==0) window[data.Result.Marketplace].Analytics.CommitPageView();for(var i=0;i-1) var mod="productPurchaseButtons&Element="+modules[i].id+"&ProductId="+modules[i].id.split("-")[1];else if(modules[i].hasAttribute('data-module')) var mod=modules[i].getAttribute('data-module')+"&Element="+modules[i].id;else var mod=modules[i].id;if($Quivers.Utilities.GetQuery("RetailerRefId")) mod+="&RetailerRefId="+$Quivers.Utilities.GetQuery("RetailerRefId");window[data.Result.Marketplace].Get("module?Module="+mod+select+email);}} else{window[data.Result.Marketplace].SelectViewFromUrl();}}}} $Quivers.Dom.Listeners();try{setTimeout(function(){if(element){let e=document.getElementById(element.id);if(e) e.setAttribute('data-force-retranslate','');}},100) setTimeout(function(){let e=document.getElementById("qQuiversPrimaryInlineView");if(e) e.setAttribute('data-force-retranslate','');},200)}catch(err){}},error:function(data){var navs=document.getElementsByClassName("qIcon");for(var i=0;i-1) var element=uri.split("Element=")[1];else var element=uri.split("Module=")[1];if(element.indexOf("&")>-1) element=element.split("&")[0];if(document.getElementById(element)) document.getElementById(element).setAttribute("loading","true");return true;},success:function(data){data=$Quivers.Utilities.FormatResult(data);if(typeof data.Result.Data!="undefined"){var element=document.getElementById(data.Result.Data.Module);if(element){element.setAttribute("loading","false");window[data.Result.Marketplace].Dom.ReplaceHtml(element,data.Result.Html);if(typeof data.Result.Data.Pager!="undefined") new $Pager(data.Result.Marketplace,data.Result.Data.Pager.Name,data.Result.Data.Pager.ToPage,data.Result.Data.PagerData);if(data.Result.Data.Module=="userDetails") $Quivers.Dom.LevelElements("qHeightRow");var additionalElements=$Quivers.Dom.Get('[data-module="'+element.id+'"]');for(var i=0;i0){for(var i in ieScrollHeightBugFix){if(ieScrollHeightBugFix[i].parentNode.parentNode.id=="currentView"){if(ieScrollHeightBugFix[i].hasAttribute("style")) ieScrollHeightBugFix[i].removeAttribute("style");ieScrollHeightBugFix[i].setAttribute("style","height: auto;");}}}} $Quivers.Dom.ResizeDialog();$Quivers.Dom.Listeners();try{setTimeout(function(){if(element){let e=document.getElementById(element.id);if(e) e.setAttribute('data-force-retranslate','');}},100) setTimeout(function(){let e=document.getElementById("qQuiversPrimaryInlineView");if(e) e.setAttribute('data-force-retranslate','');},200)}catch(err){}},error:function(data){$Quivers.Utilities.Debug(data);}} $Quivers.SimpleFormCallback={success:function(data){data=$Quivers.Utilities.FormatResult(data);var forms=$Quivers.Dom.Get('[data-api="'+data.Result.Data.Form+'"]');if(typeof data.Result.Data.AlertType!="undefined") var alertType=data.Result.Data.AlertType;else var alertType="success";for(var f=0;f';}} var zooms=document.getElementsByClassName("zoomContainer");for(var i=0;i{var businesses=bus.result;var parent=document.getElementById('store_location_container');var select=document.getElementById(`store-locations`);if(parent&&select){if(businesses.length>1){select.setAttribute('data-required','true');parent.className='visible';} else{select.removeAttribute('data-required');parent.className="hidden";} var html=``;for(var business of businesses){html+=``;} select.innerHTML=html;return;}}));}} BoomerangExtension={ApplyCredit:function(){window[this.MarketplaceId].Get('applyBoomerangCreditDiscount');},ReferFriend:function(referralCode,type){if(referralCode==""||referralCode==null){window[this.MarketplaceId].View("Login");} else{switch(type.toLowerCase()){case"cart":{var html='
';html+='';html+='
Your Code
';html+='
'+referralCode+'
';html+='

Share this special code with friends. When they use Quivers Marketplace for the first time, they’ll get 2.5% of their order and you’ll get the same. Details

';html+='
";break;}} $Quivers.Dom.TriggerDialog("Refer a Friend",html);if(typeof addthis!=="undefined"){addthis.init();addthis.layers.refresh();} var shareBtns=$Quivers.Dom.Get(".at-icon-wrapper");for(var i=0;i
"+window[data.Result.Marketplace].$("ReturnBtn","discounts")+"
";$Quivers.Dom.TriggerDialog("Using Quivers Credit",html);},error:function(xhr){data=$Quivers.Utilities.FormatResult(xhr);},complete:function(){document.getElementById("qApplyCreditBtn").setAttribute("working","false");document.getElementById("qApplyCreditBtn").removeAttribute("disabled");document.getElementById("qApplyCreditBtn").setAttribute("style","");}} /*! * Bootstrap v3.3.1 (http://getbootstrap.com) * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ if(typeof $jquivers.fn.popover==='undefined'){if("undefined"==typeof $jquivers)throw new Error("Bootstrap's JavaScript requires $jquivers");+function(t){"use strict";var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||e[0]>3)throw new Error("Bootstrap's JavaScript requires $jquivers version 1.9.1 or higher, but lower than version 4")}($jquivers),+function(t){"use strict";function e(e){return this.each(function(){var i=t(this),n=i.data("bs.alert");n||i.data("bs.alert",n=new o(this)),"string"==typeof e&&n[e].call(i)})}var i='[data-dismiss="alert"]',o=function(e){t(e).on("click",i,this.close)};o.VERSION="3.3.7",o.TRANSITION_DURATION=150,o.prototype.close=function(e){function i(){a.detach().trigger("closed.bs.alert").remove()}var n=t(this),s=n.attr("data-target");s||(s=n.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,""));var a=t("#"===s?[]:s);e&&e.preventDefault(),a.length||(a=n.closest(".alert")),a.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(a.removeClass("in"),t.support.transition&&a.hasClass("fade")?a.one("bsTransitionEnd",i).emulateTransitionEnd(o.TRANSITION_DURATION):i())};var n=t.fn.alert;t.fn.alert=e,t.fn.alert.Constructor=o,t.fn.alert.noConflict=function(){return t.fn.alert=n,this},t(document).on("click.bs.alert.data-api",i,o.prototype.close)}($jquivers),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.button"),s="object"==typeof e&&e;n||o.data("bs.button",n=new i(this,s)),"toggle"==e?n.toggle():e&&n.setState(e)})}var i=function(e,o){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,o),this.isLoading=!1};i.VERSION="3.3.7",i.DEFAULTS={loadingText:"loading..."},i.prototype.setState=function(e){var i="disabled",o=this.$element,n=o.is("input")?"val":"html",s=o.data();e+="Text",null==s.resetText&&o.data("resetText",o[n]()),setTimeout(t.proxy(function(){o[n](null==s[e]?this.options[e]:s[e]),"loadingText"==e?(this.isLoading=!0,o.addClass(i).attr(i,i).prop(i,!0)):this.isLoading&&(this.isLoading=!1,o.removeClass(i).removeAttr(i).prop(i,!1))},this),0)},i.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var o=t.fn.button;t.fn.button=e,t.fn.button.Constructor=i,t.fn.button.noConflict=function(){return t.fn.button=o,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(i){var o=t(i.target).closest(".btn");e.call(o,"toggle"),t(i.target).is('input[type="radio"], input[type="checkbox"]')||(i.preventDefault(),o.is("input,button")?o.trigger("focus"):o.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(e){t(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))})}($jquivers),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.carousel"),s=t.extend({},i.DEFAULTS,o.data(),"object"==typeof e&&e),a="string"==typeof e?e:s.slide;n||o.data("bs.carousel",n=new i(this,s)),"number"==typeof e?n.to(e):a?n[a]():s.interval&&n.pause().cycle()})}var i=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",t.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",t.proxy(this.pause,this)).on("mouseleave.bs.carousel",t.proxy(this.cycle,this))};i.VERSION="3.3.7",i.TRANSITION_DURATION=600,i.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},i.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},i.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},i.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},i.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e),o="prev"==t&&0===i||"next"==t&&i==this.$items.length-1;if(o&&!this.options.wrap)return e;var n="prev"==t?-1:1,s=(i+n)%this.$items.length;return this.$items.eq(s)},i.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));return t>this.$items.length-1||0>t?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",this.$items.eq(t))},i.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},i.prototype.next=function(){return this.sliding?void 0:this.slide("next")},i.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},i.prototype.slide=function(e,o){var n=this.$element.find(".item.active"),s=o||this.getItemForDirection(e,n),a=this.interval,r="next"==e?"left":"right",l=this;if(s.hasClass("active"))return this.sliding=!1;var h=s[0],p=t.Event("slide.bs.carousel",{relatedTarget:h,direction:r});if(this.$element.trigger(p),!p.isDefaultPrevented()){if(this.sliding=!0,a&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var c=t(this.$indicators.children()[this.getItemIndex(s)]);c&&c.addClass("active")}var f=t.Event("slid.bs.carousel",{relatedTarget:h,direction:r});return t.support.transition&&this.$element.hasClass("slide")?(s.addClass(e),s[0].offsetWidth,n.addClass(r),s.addClass(r),n.one("bsTransitionEnd",function(){s.removeClass([e,r].join(" ")).addClass("active"),n.removeClass(["active",r].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(f)},0)}).emulateTransitionEnd(i.TRANSITION_DURATION)):(n.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(f)),a&&this.cycle(),this}};var o=t.fn.carousel;t.fn.carousel=e,t.fn.carousel.Constructor=i,t.fn.carousel.noConflict=function(){return t.fn.carousel=o,this};var n=function(i){var o,n=t(this),s=t(n.attr("data-target")||(o=n.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var a=t.extend({},s.data(),n.data()),r=n.attr("data-slide-to");r&&(a.interval=!1),e.call(s,a),r&&s.data("bs.carousel").to(r),i.preventDefault()}};t(document).on("click.bs.carousel.data-api","[data-slide]",n).on("click.bs.carousel.data-api","[data-slide-to]",n),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var i=t(this);e.call(i,i.data())})})}($jquivers),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.tooltip"),s="object"==typeof e&&e;!n&&/destroy|hide/.test(e)||(n||o.data("bs.tooltip",n=new i(this,s)),"string"==typeof e&&n[e]())})}var i=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",t,e)};i.VERSION="3.3.7",i.TRANSITION_DURATION=150,i.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},i.prototype.init=function(e,i,o){if(this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(o),this.$viewport=this.options.viewport&&t(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var n=this.options.trigger.split(" "),s=n.length;s--;){var a=n[s];if("click"==a)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=a){var r="hover"==a?"mouseenter":"focusin",l="hover"==a?"mouseleave":"focusout";this.$element.on(r+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},i.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,o){i[t]!=o&&(e[t]=o)}),e},i.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusin"==e.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState?void(i.hoverState="in"):(clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show())},i.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},i.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusout"==e.type?"focus":"hover"]=!1),i.isInStateTrue()?void 0:(clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide())},i.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var o=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!o)return;var n=this,s=this.tip(),a=this.getUID(this.type);this.setContent(),s.attr("id",a),this.$element.attr("aria-describedby",a),this.options.animation&&s.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,h=l.test(r);h&&(r=r.replace(l,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var p=this.getPosition(),c=s[0].offsetWidth,f=s[0].offsetHeight;if(h){var d=r,u=this.getPosition(this.$viewport);r="bottom"==r&&p.bottom+f>u.bottom?"top":"top"==r&&p.top-fu.width?"left":"left"==r&&p.left-ca.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,p=e.left+s+i;ha.right&&(n.left=a.left+a.width-p)}return n},i.prototype.getTitle=function(){var t,e=this.$element,i=this.options;return t=e.attr("data-original-title")||("function"==typeof i.title?i.title.call(e[0]):i.title)},i.prototype.getUID=function(t){do t+=~~(1e6*Math.random());while(document.getElementById(t));return t},i.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},i.prototype.enable=function(){this.enabled=!0},i.prototype.disable=function(){this.enabled=!1},i.prototype.toggleEnabled=function(){this.enabled=!this.enabled},i.prototype.toggle=function(e){var i=this;e&&(i=t(e.currentTarget).data("bs."+this.type),i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i))),e?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)},i.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null})};var o=t.fn.tooltip;t.fn.tooltip=e,t.fn.tooltip.Constructor=i,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=o,this}}($jquivers),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.popover"),s="object"==typeof e&&e;!n&&/destroy|hide/.test(e)||(n||o.data("bs.popover",n=new i(this,s)),"string"==typeof e&&n[e]())})}var i=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");i.VERSION="3.3.7",i.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),i.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),i.prototype.constructor=i,i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](e),t.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof i?"html":"append":"text"](i),t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},i.prototype.hasContent=function(){return this.getTitle()||this.getContent()},i.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var o=t.fn.popover;t.fn.popover=e,t.fn.popover.Constructor=i,t.fn.popover.noConflict=function(){return t.fn.popover=o,this}}($jquivers),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.tab");n||o.data("bs.tab",n=new i(this)),"string"==typeof e&&n[e]()})}var i=function(e){this.element=t(e)};i.VERSION="3.3.7",i.TRANSITION_DURATION=150,i.prototype.show=function(){var e=this.element,i=e.closest("ul:not(.dropdown-menu)"),o=e.data("target");if(o||(o=e.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,"")),!e.parent("li").hasClass("active")){var n=i.find(".active:last a"),s=t.Event("hide.bs.tab",{relatedTarget:e[0]}),a=t.Event("show.bs.tab",{relatedTarget:n[0]});if(n.trigger(s),e.trigger(a),!a.isDefaultPrevented()&&!s.isDefaultPrevented()){var r=t(o);this.activate(e.closest("li"),i),this.activate(r,r.parent(),function(){n.trigger({type:"hidden.bs.tab",relatedTarget:e[0]}),e.trigger({type:"shown.bs.tab",relatedTarget:n[0]})})}}},i.prototype.activate=function(e,o,n){function s(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),e.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),r?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu").length&&e.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),n&&n()}var a=o.find("> .active"),r=n&&t.support.transition&&(a.length&&a.hasClass("fade")||!!o.find("> .fade").length);a.length&&r?a.one("bsTransitionEnd",s).emulateTransitionEnd(i.TRANSITION_DURATION):s(),a.removeClass("in")};var o=t.fn.tab;t.fn.tab=e,t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=o,this};var n=function(i){i.preventDefault(),e.call(t(this),"show")};t(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',n).on("click.bs.tab.data-api",'[data-toggle="pill"]',n)}($jquivers),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.affix"),s="object"==typeof e&&e;n||o.data("bs.affix",n=new i(this,s)),"string"==typeof e&&n[e]()})}var i=function(e,o){this.options=t.extend({},i.DEFAULTS,o),this.$target=t(this.options.target).on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(e),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};i.VERSION="3.3.7",i.RESET="affix affix-top affix-bottom",i.DEFAULTS={offset:0,target:window},i.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return i>n?"top":!1;if("bottom"==this.affixed)return null!=i?n+this.unpin<=s.top?!1:"bottom":t-o>=n+a?!1:"bottom";var r=null==this.affixed,l=r?n:s.top,h=r?a:e;return null!=i&&i>=n?"top":null!=o&&l+h>=t-o?"bottom":!1},i.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(i.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},i.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},i.prototype.checkPosition=function(){if(this.$element.is(":visible")){var e=this.$element.height(),o=this.options.offset,n=o.top,s=o.bottom,a=Math.max(t(document).height(),t(document.body).height());"object"!=typeof o&&(s=n=o),"function"==typeof n&&(n=o.top(this.$element)),"function"==typeof s&&(s=o.bottom(this.$element));var r=this.getState(a,e,n,s);if(this.affixed!=r){null!=this.unpin&&this.$element.css("top","");var l="affix"+(r?"-"+r:""),h=t.Event(l+".bs.affix");if(this.$element.trigger(h),h.isDefaultPrevented())return;this.affixed=r,this.unpin="bottom"==r?this.getPinnedOffset():null,this.$element.removeClass(i.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==r&&this.$element.offset({top:a-e-s})}};var o=t.fn.affix;t.fn.affix=e,t.fn.affix.Constructor=i,t.fn.affix.noConflict=function(){return t.fn.affix=o,this},t(window).on("load",function(){t('[data-spy="affix"]').each(function(){var i=t(this),o=i.data();o.offset=o.offset||{},null!=o.offsetBottom&&(o.offset.bottom=o.offsetBottom),null!=o.offsetTop&&(o.offset.top=o.offsetTop),e.call(i,o)})})}($jquivers),+function(t){"use strict";function e(e){var i,o=e.attr("data-target")||(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return t(o)}function i(e){return this.each(function(){var i=t(this),n=i.data("bs.collapse"),s=t.extend({},o.DEFAULTS,i.data(),"object"==typeof e&&e);!n&&s.toggle&&/show|hide/.test(e)&&(s.toggle=!1),n||i.data("bs.collapse",n=new o(this,s)),"string"==typeof e&&n[e]()})}var o=function(e,i){this.$element=t(e),this.options=t.extend({},o.DEFAULTS,i),this.$trigger=t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};o.VERSION="3.3.7",o.TRANSITION_DURATION=350,o.DEFAULTS={toggle:!0},o.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},o.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e,n=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(n&&n.length&&(e=n.data("bs.collapse"),e&&e.transitioning))){var s=t.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){n&&n.length&&(i.call(n,"hide"),e||n.data("bs.collapse",null));var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var r=function(){this.$element.removeClass("collapsing").addClass("collapse in")[a](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return r.call(this);var l=t.camelCase(["scroll",a].join("-"));this.$element.one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(o.TRANSITION_DURATION)[a](this.$element[0][l])}}}},o.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var n=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return t.support.transition?void this.$element[i](0).one("bsTransitionEnd",t.proxy(n,this)).emulateTransitionEnd(o.TRANSITION_DURATION):n.call(this)}}},o.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},o.prototype.getParent=function(){return t(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy(function(i,o){var n=t(o);this.addAriaAndCollapsedClass(e(n),n)},this)).end()},o.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var n=t.fn.collapse;t.fn.collapse=i,t.fn.collapse.Constructor=o,t.fn.collapse.noConflict=function(){return t.fn.collapse=n,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(o){var n=t(this);n.attr("data-target")||o.preventDefault();var s=e(n),a=s.data("bs.collapse"),r=a?"toggle":n.data();i.call(s,r)})}($jquivers),+function(t){"use strict";function e(i,o){this.$body=t(document.body),this.$scrollElement=t(t(i).is(document.body)?window:i),this.options=t.extend({},e.DEFAULTS,o),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",t.proxy(this.process,this)),this.refresh(),this.process()}function i(i){return this.each(function(){var o=t(this),n=o.data("bs.scrollspy"),s="object"==typeof i&&i;n||o.data("bs.scrollspy",n=new e(this,s)),"string"==typeof i&&n[i]()})}e.VERSION="3.3.7",e.DEFAULTS={offset:10},e.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},e.prototype.refresh=function(){var e=this,i="offset",o=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),t.isWindow(this.$scrollElement[0])||(i="position",o=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var e=t(this),n=e.data("target")||e.attr("href"),s=/^#./.test(n)&&t(n);return s&&s.length&&s.is(":visible")&&[[s[i]().top+o,n]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){e.offsets.push(this[0]),e.targets.push(this[1])})},e.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),e>=o)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e=n[t]&&(void 0===n[t+1]||e
"+window[data.Result.Marketplace].$("ReturnBtn","discounts")+"
";$Quivers.Dom.TriggerDialog(window[data.Result.Marketplace].$("SuccessDialogTitle","discounts"),contents);var input=document.getElementById("qDiscountCodeInput");if(input) input.value="";if(typeof window[data.Result.Marketplace].Checkout!=="undefined"){window[data.Result.Marketplace].Checkout.UpdateTotals();}} else{$Quivers.Dom.CreateAlert("qDiscountsAlerts","danger",data.Result.Html);} for(var b in buttons){if(typeof buttons[b]!=="function"){buttons[b].setAttribute("working","false");buttons[b].removeAttribute("disabled");}}});},RemoveDiscount:function(business,discount){var buttons=$Quivers.Dom.Get('[data-remove-discount="'+discount+'"][data-refid="'+business+'"]');for(var b=0;b0) quantity=quantityInputs[0].value;else{var fallback=document.getElementById('qVariantQuantity');if(fallback) quantity=fallback.value;} if(quantity<1){$Quivers.Dom.CreateAlert("qCartAlerts-"+id,"danger","You cannot add "+quantity+" of this item to your cart. Please try a quantity greater than 0.");return false;} var alertId=typeof ispu=="string"?"qCartISPUAlerts-"+id:"qCartAlerts-"+id;var pictureInputs=$Quivers.Dom.Get('input[data-productpicture][data-productid="'+id+'"]');if(pictureInputs.length>0){if(pictureInputs[0].getAttribute('data-required')=="true"&&pictureInputs[0].value==""){$Quivers.Dom.CreateAlert(alertId,"danger","You must select a Picture Attachment for this product!");return false;} var pictureId=pictureInputs[0].value!=""?parseInt(pictureInputs[0].value):null;} var buttonFind='[data-'+cartType.toLowerCase()+"='"+id+"']";var buttons=$Quivers.Dom.Get(buttonFind);for(var b in buttons){if(typeof buttons[b]!=="function"){if(buttons[b].hasAttribute=="function"&&buttons[b].hasAttribute("disabled")) return false;buttons[b].setAttribute("working","true");buttons[b].setAttribute("disabled","true");if(buttons[b].parentNode.className=="qActions") buttons[b].parentNode.setAttribute("style","opacity: 1;");}} if(document.getElementById("qCartAlerts-"+id)) var alertsDiv=alertId;else var alertsDiv="qCartAlerts";if(typeof cartDiscountId=="undefined") var cartDiscountId=null;if(cartType=="FreeGift"){cartType="Shopping";var selectDiscount=document.getElementById('qSelectAsGift-'+id);var cartDiscountId=selectDiscount.options[selectDiscount.selectedIndex].value;} var inStorePickupLocation=null;if(ispu!==false&&ispu!==true) inStorePickupLocation=ispu;let api=(ispu!==true||$Quivers.Dom.Get("#instorePickup").length>0)?"user/cart/addItem":"user/cart/ispu";let execute=(ispu!==true)?function(s){s()}:function(s,e){if(!navigator.geolocation){s();}else{navigator.geolocation.getCurrentPosition(s,s,{timeout:1000});}};var self=this;execute(function(success){var postData={Type:cartType,Product:id,Quantity:quantity,DontAdd:checkForOptions,CartDiscountId:cartDiscountId,PictureAttachmentId:pictureId,AddedFromUrl:window.location.href,CustomerPickedFulfillerRefId:inStorePickupLocation,CurbsidePickup:fulfillmentMethod==30,FulfillmentMethod:fulfillmentMethod,AffiliateId:window[self.MarketplaceId].AffiliateId,IsShipToStore:isShipToStore||false};if($Quivers.Utilities.GetQuery("Cart")) postData.CartToken=$Quivers.Utilities.GetQuery("Cart");if(window[self.MarketplaceId].InstorePickupData){console.log(window[self.MarketplaceId].InstorePickupData.MyCoords) postData.Latitude=window[self.MarketplaceId].InstorePickupData.MyCoords.Latitude;postData.Longitude=window[self.MarketplaceId].InstorePickupData.MyCoords.Longitude;} else if(typeof success!="undefined"&&success.coords){postData.Latitude=success.coords.latitude;postData.Longitude=success.coords.longitude;} window[self.MarketplaceId].Post(api,postData,function(data){data=$Quivers.Utilities.FormatResult(data);if(data.ResponseCode<300){try{window[self.MarketplaceId].IgnoreCartToken=(data.Result.Data.CartData[cartType].Token!=$Quivers.Utilities.GetQuery("Cart"));} catch(err){} if(api=="user/cart/ispu"){$Quivers.Dom.TriggerDialog(window[data.Result.Marketplace].$("DialogChoosePickupLocation","cart"),data.Result.Html);window[data.Result.Marketplace].InstorePickupData={MyCoords:data.Result.Data.ConsumerCoordinates,Locations:data.Result.Data.PickupLocations,CartItemId:null,ProductId:id} var element=document.getElementById('qISPU-GooglePlacesAddressPicker') var places_auto_complete=new google.maps.places.Autocomplete(element,{types:['geocode']});places_auto_complete.addListener('place_changed',function(){var place=places_auto_complete.getPlace();console.log(place) var coords={lat:place.geometry.location.lat(),lng:place.geometry.location.lng()};window[data.Result.Marketplace].InstorePickupData.MyCoords={Latitude:coords.lat,Longitude:coords.lng};window[data.Result.Marketplace].Cart.ReloadInstorePickupResults(id,null,coords);});var distance=document.getElementById('qISPU-Distance');if(distance){distance.addEventListener('change',function(ev){window[data.Result.Marketplace].Cart.ReloadInstorePickupResults(id,null,data.Result.Data.ConsumerCoordinates,ev.target.value);});}} else{var contents=$Quivers.Dom.GenerateAlertHtml("success",data.Result.Html);var redirectToCart=true;if(typeof data.Result.Data.UpsellOpportunity!=="undefined"){contents+=data.Result.Data.UpsellOpportunityHtml;redirectToCart=false;} if(typeof data.Result.Data.InstorePickupHtml!=="undefined"){contents+=data.Result.Data.InstorePickupHtml;redirectToCart=false;} if(cartType.toLowerCase()!="shopping") redirectToCart=false;contents+="";if(cartType.toLowerCase()=="shopping") var boxTitle=window[data.Result.Marketplace].$("DialogTitleCart","cart");else var boxTitle=window[data.Result.Marketplace].$("DialogTitleWishlist","cart");if(redirectToCart==false) $Quivers.Dom.TriggerDialog(boxTitle,contents);var cartCounts=$Quivers.Dom.Get("#qCartCount-"+cartType);for(var c=0;c0)?quantity_inputs[0].value:null;var postData={Type:cartType,Product:id,Quantity:quantity,CustomerPickedFulfillerRefId:ispu,CurbsidePickup:fulfillmentMethodId==30,FulfillmentMethod:fulfillmentMethodId};if($Quivers.Utilities.GetQuery("Cart")) postData.CartToken=$Quivers.Utilities.GetQuery("Cart");window[this.MarketplaceId].Post("user/cart/updateItem",postData,function(data){data=$Quivers.Utilities.FormatResult(data);if(data.ResponseCode<300){var cartCounts=$Quivers.Dom.Get("#qCartCount-"+cartType);for(var c=0;c'+client.$("CategoryDoesNotExistMessage","catalog")+'';}}},100);},ToggleSubCategories:function(id,force){if(typeof force=="undefined") force=false;var toggle=document.getElementById("qToggle-"+id);if(!force){if(toggle.className=="glyphicon glyphicon-chevron-right") toggle.className="glyphicon glyphicon-chevron-down";else toggle.className="glyphicon glyphicon-chevron-right";} else toggle.className="glyphicon glyphicon-chevron-down";var parent=toggle.parentNode.parentNode;var subs=parent.childNodes;for(var i=0;i';$Quivers.Dom.TriggerDialog("Add to Cart",elem);window[this.MarketplaceId].Catalog.Widgets();}},TriggerSearch:function(){timer=null;clearTimeout(timer);var hc=window[this.MarketplaceId];timer=setTimeout(function(){if(timer!=null){hc.Catalog.Search(document.getElementById("qSearchInput").value);}},2000);},Search:function(query){if(typeof query==="undefined") query=document.getElementById("qSearchInput").value;var orderBy=document.getElementById("qOrderBy").options[document.getElementById("qOrderBy").selectedIndex].value;var pageSize=document.getElementById("qPageSize").options[document.getElementById("qPageSize").selectedIndex].value;window[this.MarketplaceId].Catalog.ResetPage();var page=document.getElementById("qCurrentPage").value;var zooms=document.getElementsByClassName("zoomContainer");for(var i=0;i=0) var subdomain=subdomainParts[subdomainParts.length-2];else var subdomain=subdomainParts[0];} catch(err){try{var subdomain=location.host.split(".")[1];} catch(err){var subdomain=location.host;}} if(typeof subdomain=="object"&&subdomain instanceof Array) subdomain=subdomain[0];try{while(subdomain.indexOf(".")>-1){subdomain.replace(".","");}} catch(err){} if(isNaN(parseInt(subdomain))&&subdomain.indexOf(".")===-1&&subdomain.indexOf("localhost")===-1&&subdomain.indexOf(":")===-1){window[this.MarketplaceId].Post("sitemap",{UrlScheme:productUrlScheme,Subdomain:subdomain},function(data){data=$Quivers.Utilities.FormatResult(data);});}}} $Quivers["/api/v1/user/cart/subscribeForBackInStock"]={success:function(data){data=$Quivers.Utilities.FormatResult(data);var btns=$Quivers.Dom.Get('#SubscribeForBackInStock-Submit');for(var i in btns){if(typeof btns[i]!=="function"){btns[i].setAttribute("working","false");btns[i].removeAttribute("disabled");}} $Quivers.Dom.CreateAlert("qSubscribeForBackInStockAlerts","success",data.Result.Html);},error:function(xhr){data=$Quivers.Utilities.FormatResult(xhr);var btns=$Quivers.Dom.Get('#SubscribeForBackInStock-Submit');for(var i in btns){if(typeof btns[i]!=="function"){btns[i].setAttribute("working","false");btns[i].removeAttribute("disabled");}} $Quivers.Dom.CreateAlert("qSubscribeForBackInStockAlerts","danger",data.Result.Html);}} QuiversCheckout=function(client,authStatus,cart){var self=this;self.Client=client;self.AuthStatus=authStatus;self.States=['Cart','Customer','Shipping','Payment'];self.FurthestStateReached=null;self.CartToken=typeof cart!=="undefined"?cart.Token:null;self.ShippingAddress=typeof cart!=="undefined"?cart.ShippingAddress:null;self.BillingAddress=typeof cart!=="undefined"?cart.BillingAddress:null;self.DeliveryMethod=typeof cart!=="undefined"&&cart.DeliveryMethod!=null?cart.DeliveryMethod:null;self.PaymentGateway=cart.PaymentGateway;self.IsPayPal=false;if(window.location.protocol=="http:"&&location.hostname.indexOf("localhost")===-1){let httpsURL=window.location.href.replace("http://","https://");if(window.location.href!=httpsURL) window.location.href=httpsURL;} if(self.ShippingAddress!=null||self.DeliveryMethod=="Instore Pickup"){self.Client.Get('user/cart/preparePayment',function(settings){settings=$Quivers.Utilities.FormatResult(settings);self.Payment.Settings=$Quivers.Utilities.FormatResult(settings);if($Quivers.Utilities.GetQuery("PayPal")!==""){var d=$Quivers.Utilities.GetQuery("PayPal").split("?")[0];var parameters={PayerID:$Quivers.Utilities.GetQuery("PayerID"),paymentId:$Quivers.Utilities.GetQuery("paymentId"),token:$Quivers.Utilities.GetQuery("token")};history.replaceState(null,null,window.location.search.split("&PayPal")[0]);self.CompletePayPal({Success:(d.toLowerCase()=="success"),Parameters:parameters});}});} self.MountedElements=[];self.Payment={Bluesnap:{Instance:null,Device:null,Payment:null},PayPal:{IframeBase:null,Total:typeof cart!=="undefined"?cart.Total:0.00,Result:null,Settings:typeof cart.PayPalOrderId!=="undefined"?{OrderId:cart.PayPalOrderId}:null,Started:false},Stripe:{Payment:null},Settings:null};switch(self.Client.Environment.toLowerCase()){case"live":self.Payment.PayPal.IframeBase="https://hovercart.quivers.com/iframes/";break;case"demo":self.Payment.PayPal.IframeBase="https://hovercart.quiversdemo.com/iframes/";break;case"test":self.Payment.PayPal.IframeBase="https://hovercart.quiverstest.com/iframes/";break;case"prod_aws":self.Payment.PayPal.IframeBase="https://hovercart.quivers.com/iframes/";break;case"demo_aws":self.Payment.PayPal.IframeBase="https://hovercart.quiversdemo.com/iframes/";break;case"test_aws":self.Payment.PayPal.IframeBase="https://hovercart.quiverstest.com/iframes/";break;case"local":self.Payment.PayPal.IframeBase="https://localhost/iframes/";break;} if((self.ShippingAddress!=null&&cart.HasUnshippableItems==false)){if(self.DeliveryMethod==null) self.ToggleState("Shipping");else self.ToggleState("Payment");} else self.ToggleState("Customer");try{window._mfq=window._mfq||[];$jquivers.getScript("//cdn.mouseflow.com/projects/"+self.Client.MouseflowId+".js");} catch(err){console.warn(err);}} QuiversCheckout.prototype.NextState=function(){var self=this;var tryIndex=self.States.indexOf(self.State)+1;var state=self.FurthestStateReached-2>tryIndex?self.States[self.FurthestStateReached-2]:self.States[tryIndex];if(typeof state!=="undefined") this.ToggleState(state);} QuiversCheckout.prototype.PreviousState=function(){this.ToggleState(this.States[this.States.indexOf(this.State)-1]);} QuiversCheckout.prototype.ToggleState=function(state){var self=this;try{if(state.toLowerCase()!="payment"&&self.Payment.PayPal.Started==true){try{self.Client.Socket.send(JSON.stringify({Type:"Client",Command:"cancelPayPal",Session:self.Client.SessionId}));} catch(err){console.warn(err);}} switch(typeof state!="undefined"?state.toLowerCase():null){case"customer":{self.State="Customer";self.StatePosition=2;var shippingAddressId=self.ShippingAddress!==null?self.ShippingAddress.Id:null;if(typeof self.Client.Settings.Extensions.ShopEmployee=="undefined"||self.Client.Settings.Extensions.ShopEmployee.Enabled==false){var s=new QuiversAddressForm(self.Client,"Shipping",false,shippingAddressId);} try{var countryPicker=document.getElementById('qAddressCountry');countryPicker.addEventListener("click",function(evt){var country=countryPicker.options[countryPicker.selectedIndex].getAttribute("data-abrv");var callingCode=$Quivers.Dom.Get('[name="PhonePrefix"]')[0];var newCode=null;for(var i=0;iself.FurthestStateReached) self.FurthestStateReached=self.StatePosition;var states=$Quivers.Dom.Get('[data-checkout-state]');var uis=$Quivers.Dom.Get('[data-checkout-ui]');for(var i=0;i";message+="";$Quivers.Dom.TriggerNotice("Promotional Code",message);} QuiversCheckout.prototype.SelectShippingAddress=function(addressId){var self=this;if(addressId==null){self.ShippingAddress=null;return false;} $jquivers('.qAddressPickButton[data-address="'+addressId+'"]').each(function(){this.setAttribute("working","true");});document.getElementById("qShippingOptions").setAttribute("refreshing","true");self.Client.Post("user/cart/setShippingAddress",{AddressId:addressId},function(data){data=$Quivers.Utilities.FormatResult(data);if(data.ResponseCode<300){self.SetShippingAddress(data);} else{if(data.Result.Data.HasAvailableItems==false){self.ShippingAddress=null;} if(data.Result.Data.Address.StateProvince!="Other") var msg=self.Client.$("CantShipToMessage1","checkout")+data.Result.Data.Address.StateProvince+", "+data.Result.Data.Address.Country+self.Client.$("CantShipToMessage2","checkout");else var msg=self.Client.$("CantShipToMessage1","checkout")+data.Result.Data.Address.Country+self.Client.$("CantShipToMessage2","checkout");var btns=$Quivers.Dom.Get(".qAddressPickButton[data-context='Shipping']");for(var b=0;b '+self.Client.$("ShippingHereLabel","addresses");} else{btns[b].setAttribute('data-selected','false');btns[b].innerHTML=self.Client.$("ShipHereBtn","addresses");}}} if(document.getElementById("qAddressesPanel")) document.getElementById("qAddressesPanel").removeAttribute("data-validation");if(document.getElementById("qShippingOptionsPicker")) document.getElementById("qShippingOptionsPicker").removeAttribute("data-validation");if(data.Result.Data.HasOnlyInstorePickupItems==true){document.getElementById("qShippingOptionsContainer").className="col-xs-12 col-lg-6 col-lg-offset-3";document.getElementById("qShippingAddressPickerContainer").parentNode.removeChild(document.getElementById("qShippingAddressPickerContainer"));} document.getElementById("qShippingOptions").innerHTML=data.Result.Html;self.UpdateTotals();self.Client.Get("module?Module=addressSummary&Context=Shipping&AllowChanges=false&Element=qReviewShippingAddressSummary",function(a){a=$Quivers.Utilities.FormatResult(a);var elem=document.getElementById('qDeliveryShippingAddressSummary');if(elem) $Quivers.Dom.ReplaceHtml(elem,a.Result.Html);});self.Client.Get("module?Module=addressSummary&Context=Billing&AllowChanges=false&Element=qReviewBillingAddressSummary");self.Client.Get("module?Module=cartShippingSummary&Element=qShippingSummary");self.Client.Get('user/cart/preparePayment',function(settings){settings=$Quivers.Utilities.FormatResult(settings);self.Payment.Settings=$Quivers.Utilities.FormatResult(settings);});self.NextState();} QuiversCheckout.prototype.BillingAddressPicker=function(){var self=this;if(self.AuthStatus=="LoggedIn"){self.Client.Get("module?Module=addresses&Context=Billing",function(data){data=$Quivers.Utilities.FormatResult(data);$Quivers.Dom.TriggerDialog("Pick Billing Address",data.Result.Html,"large");$Quivers.Dom.LevelElements("qHeightRow");});} else{new QuiversAddressForm(self.Client,'Billing',true);$Quivers.Dom.LevelElements("qHeightRow");}} QuiversCheckout.prototype.SelectBillingAddress=function(addressId){var self=this;if(addressId==null){self.BillingAddress=null;return false;} $jquivers('.qAddressPickButton[data-address="'+addressId+'"]').each(function(){this.setAttribute("working","true");});self.Client.Post("user/cart/setBillingAddress",{AddressId:addressId},function(data){data=$Quivers.Utilities.FormatResult(data);if(data.ResponseCode<300){self.BillingAddress=data.Result.Data.Address;if(document.getElementById("qReviewBillingAddressSummary")) document.getElementById("qReviewBillingAddressSummary").removeAttribute("data-validation");document.getElementById("qReviewBillingAddressSummary").innerHTML=data.Result.Html;} else{$Quivers.Dom.TriggerError("Invalid Billing Address","Error setting Billing Address! Please try again.");} $Quivers.Dom.CloseDialog();$jquivers('.qAddressPickButton[data-address="'+addressId+'"]').each(function(){this.setAttribute("working","false");});});} QuiversCheckout.prototype.SelectDeliveryMethod=function(method){var self=this;if(typeof method=="undefined") var method=$Quivers.Dom.Get('input[name="qDeliveryMethod"]:checked')[0].value;switch(method.toLowerCase()){case"standard":{try{document.getElementById("qStandardShippingMethod").checked=true;}catch(err){} self.DeliveryMethod="Standard";break;} case"expedited":{try{document.getElementById("qExpeditedShippingMethod").checked=true;}catch(err){} self.DeliveryMethod="Expedited";break;} case"instore pickup":{document.getElementById("qInstorePickupShippingMethod").checked=true;self.DeliveryMethod="Instore Pickup";break;} case"whiteglove":{try{document.getElementById("qWhitegloveShippingMethod").checked=true;}catch(err){} self.DeliveryMethod="Whiteglove";break;} default:{try{document.getElementById("qStandardShippingMethod").checked=false;document.getElementById("qExpeditedShippingMethod").checked=false;}catch(err){} try{document.getElementById("qInstorePickupShippingMethod").checked=false;}catch(err){} self.DeliveryMethod=null;break;}} document.getElementById("qShippingOptions").setAttribute("refreshing","true");this.Client.Post("user/cart/setDeliveryMethod",{DeliveryMethod:self.DeliveryMethod},function(data){data=$Quivers.Utilities.FormatResult(data);if(data.ResponseCode<300){document.getElementById("qShippingOptions").innerHTML=data.Result.Html;self.Client.Get("module?Module=cartShippingSummary&Element=qShippingSummary");self.UpdateTotals();} else{console.warn(data);} document.getElementById("qShippingOptions").removeAttribute("refreshing");})} QuiversCheckout.prototype.UpdateTotals=function(cart){var self=this;try{self.TeardownStripe();} catch(err){console.warn(err);} self.Client.Get("module?Module=cartReview&Element=qCartReviewPane",function(data){self.Client.Get("module?Module=cartPayment&Element=qCheckoutPaymentModule",function(d){self.Payment.PayPal.Total=data.Result.Data.PayPalTotal;self.UpdatePayPalToken();document.getElementById("qOrderTotals").setAttribute("data-validation","info");setTimeout(function(){document.getElementById("qOrderTotals").removeAttribute("data-validation");},300);try{var symbol=$Quivers.Dom.Get("#qPayLaterAmount .qMoneyAmount .qCurrencySymbol");var symbol=symbol[0].innerHTML[0];var currencyCode=$Quivers.Dom.Get("#qPayLaterAmount .qCurrency")[0].innerHTML;document.getElementById("qPayLaterAmount").innerHTML=''+symbol+'';} catch(err){console.warn(err);} try{self.SelectPaymentMethod('CreditCard');document.getElementById('qBlueSnapCreditCardMethod').checked=true;document.getElementById('qBankPayMethod').checked=false;document.getElementById('qPayLaterMethod').checked=false;document.getElementById("qPayLaterMount").innerHTML='';} catch(err){console.warn(err);} try{self.PrepareStripe();} catch(err){console.warn(err);}});});} QuiversCheckout.prototype.ChangeUser=function(){var self=this;self.Client.Get("logout",function(data){data=$Quivers.Utilities.FormatResult(data);self.Client.View("Login");})} QuiversCheckout.prototype.PrepareGateways=function(){var self=this;if(self.PaymentGateway=="Stripe") self.PrepareStripe();else self.PrepareBluesnap('qConfirmPaymentBluesnap');self.PreparePayPal();} QuiversCheckout.prototype.PreparePayment=function(){var self=this;if(self.Payment.Settings==null){var dropinInterval=setInterval(function(){if(self.Payment.Settings!=null){clearInterval(dropinInterval);self.PrepareGateways();}},100);} else{self.PrepareGateways();}} QuiversCheckout.prototype.PrepareCertegy=function(method){var self=this;var settings=self.Payment.Settings.Result.Data.Certegy;if(settings){self.certegy=new BankPay.Sdk(settings);if(method=="PayLater"){self.Client.Get('user/cart/prepareTransaction?type=certegy',function(intent){intent=$Quivers.Utilities.FormatResult(intent);var html=intent.Result.Html;self.Payment.Certegy=intent.Result.Data.result;document.getElementById('qPayLaterMount').innerHTML=html;return;});} if(method=="BankPay"){self.BlockScreen(false);self.Client.Get('user/cart/prepareTransaction?type=certegy',function(intent){intent=$Quivers.Utilities.FormatResult(intent);intent=intent.Result.Data.result;self.SetupCertegyWebviews(intent.id);});}}} QuiversCheckout.prototype.PayLaterProceed=function(){var self=this;self.BlockScreen(false);self.SetupCertegyWebviews(self.Payment.Certegy.id);} QuiversCheckout.prototype.SetupCertegyWebviews=function(intentId){var self=this;var webview=self.certegy.createEnrollment(intentId);webview.open();webview.events.addEventListener(BankPay.EventName.Cancel,({data})=>{self.SelectPaymentMethod('CreditCard');document.getElementById('qBlueSnapCreditCardMethod').checked=true;document.getElementById('qBankPayMethod').checked=false;document.getElementById('qPayLaterMethod').checked=false;document.getElementById("qPayLaterMount").innerHTML='';self.ReleaseScreen();});webview.events.addEventListener(BankPay.EventName.Failure,({data})=>{self.SelectPaymentMethod('CreditCard');document.getElementById('qBlueSnapCreditCardMethod').checked=true;document.getElementById('qBankPayMethod').checked=false;document.getElementById('qPayLaterMethod').checked=false;self.ReleaseScreen();});webview.events.addEventListener(BankPay.EventName.Close,({data})=>{if(typeof self.Payment.Certegy=="undefined") self.Payment.Certegy={};if(self.Payment.Certegy.WaitingForIntent==true) self.BlockScreen(true);});webview.events.addEventListener(BankPay.EventName.ReadyForAuthorization,({data})=>{var type=(document.getElementById('qPayLaterMethod').checked)?"PayLater":"BankPay";if(typeof self.Payment.Certegy=="undefined") self.Payment.Certegy={};self.Payment.Certegy.WaitingForIntent=true;self.Client.Get('user/cart/prepareTransaction?type='+type+'&intentId='+data.intentId,function(intent){var result=$Quivers.Utilities.FormatResult(intent);result=intent.Result.Data.result;self.Payment.Certegy=result;self.Payment.Certegy.WaitingForIntent=false;});});webview.events.addEventListener(BankPay.EventName.Success,({data})=>{self.BlockScreen();var waitForPayment=setInterval(()=>{if(self.Payment.Certegy&&self.Payment.Certegy.id.indexOf("transaction_intent")===0){clearInterval(waitForPayment);self.PlaceOrder();}},100)});} QuiversCheckout.prototype.PreparePayPal=function(){var self=this;var paypal=document.getElementById("qPayPalIframeContainer");if(paypal){if($Quivers.Utilities.IsMobileDevice()==false){var frame=document.createElement("iframe");frame.id="qPayPalIFrame";frame.src=self.Payment.PayPal.IframeBase+"paypal.php?SessionId="+self.Client.SessionId;frame.setAttribute('scrolling','no');document.getElementById("qPayPalIframeContainer").innerHTML="";document.getElementById("qPayPalIframeContainer").appendChild(frame);var oncePaymentSettingsAreReceived=setInterval(function(){if(self.Payment.Settings!==null&&typeof self.Payment.Settings.Result!=="undefined"){clearInterval(oncePaymentSettingsAreReceived);self.UpdatePayPalToken();}},250);} else{var url="CartLight/PayPalPaymentSetup?Amount="+self.Payment.PayPal.Total+"&Currency="+self.Client.Currency+"&BusinessName="+self.Payment.Settings.Result.Data.PayPal.BusinessName;url+="&CancelUrl="+encodeURIComponent(window.location.href+"&PayPal=Failed");url+="&ReturnUrl="+encodeURIComponent(window.location.href+"&PayPal=Success");self.Client.Cloudhub.get(url,function(paypalToken){if(paypalToken!==null&&typeof paypalToken!=="undefined"&&typeof paypalToken.RedirectUrl!=="undefined"){self.Payment.PayPal.Settings=paypalToken;var elem=document.getElementById("qBluesnapPaymentTypePayPal");elem.addEventListener("click",function(evt){document.getElementById("qBlueSnapPayPalMethod").checked=true;self.Client.Post("user/cart/paypalOrderId",{PayPalOrderId:self.Payment.PayPal.Settings.OrderId},function(data){data=$Quivers.Utilities.FormatResult(data);paypal.checkout.setup(self.Payment.Settings.Result.Data.PayPal.Account,{environment:self.Payment.Settings.Result.Data.PayPal.Environment});paypal.checkout.initXO();paypal.checkout.startFlow(paypalToken.RedirectUrl);});});elem.setAttribute('data-paypal',"Ready");}});}}} QuiversCheckout.prototype.UpdatePayPalToken=function(){var self=this;if(document.getElementById("qPayPalIFrame")){var frame=document.getElementById("qPayPalIFrame").src;var url="CartLight/PayPalPaymentSetup?Amount="+self.Payment.PayPal.Total+"&Currency="+self.Client.Currency+"&BusinessName="+self.Payment.Settings.Result.Data.PayPal.BusinessName;url+="&CancelUrl="+encodeURIComponent(self.Payment.PayPal.IframeBase+"paypal_cancel.php?SessionId="+self.Client.SessionId);url+="&ReturnUrl="+encodeURIComponent(self.Payment.PayPal.IframeBase+"paypal_success.php?SessionId="+self.Client.SessionId);self.Client.Cloudhub.get(url,function(paypalToken){if(paypalToken===null||typeof paypalToken=="undefined"||typeof paypalToken.RedirectUrl=="undefined"){if(document.getElementById("qBluesnapPaymentTypePayPal")){document.getElementById("qBluesnapPaymentTypePayPal").setAttribute('data-paypal',"NotReady");}} else{self.Payment.PayPal.Settings=paypalToken;self.PayPalInterval=setInterval(function(){try{if(self.Client.Socket.readyState==1){var msg={Type:"Client",Command:"PayPalToken",PayPal:{Url:self.Payment.PayPal.Settings.RedirectUrl,Account:self.Payment.Settings.Result.Data.PayPal.Account,Environment:self.Client.Environment=="live"||self.Client.Environment=="prod_aws"?"production":"sandbox"},Session:self.Client.SessionId};self.Client.Get("ping");self.Client.Socket.send(JSON.stringify(msg));}} catch(err){console.warn(err);}},2000);}});}} QuiversCheckout.prototype.CompletePayPal=function(paypalData){var self=this;clearInterval(self.PayPalInterval);if(self.BillingAddress==null){$Quivers.Dom.TriggerError(self.Client.$("InvalidBillingAddress","checkout"),self.Client.$("InvalidBillingAddressMessage","checkout"));document.getElementById("qReviewBillingAddressSummary").setAttribute("data-validation","bad");return false;} if(paypalData.Success===true){self.Payment.PayPal.Result=paypalData;self.IsPayPal=true;self.PlaceOrder();} else{document.getElementById("qBlueSnapCreditCardMethod").checked=true;document.getElementById("qBluesnapPaymentTypePayPal").setAttribute('data-paypal',"NotReady");self.UpdatePayPalToken();}} QuiversCheckout.prototype.PrepareBluesnap=function(div_id){var self=this;self.Payment.Bluesnap.Instance={hostedPaymentFields:{ccn:"ccn",cvv:"cvv",exp:"exp"},onFieldEventHandler:{onFocus:function(tagId){var frame=$Quivers.Dom.Get('iframe[type="'+tagId+'"]')[0];if(frame) frame.setAttribute("data-validation","info");},onBlur:function(tagId){var frame=$Quivers.Dom.Get('iframe[type="'+tagId+'"]')[0];if(frame) frame.removeAttribute("data-validation");},onError:function(tagId,errorCode){var frame=$Quivers.Dom.Get('iframe[type="'+tagId+'"]')[0];if(frame) frame.setAttribute("data-validation","bad");switch(tagId){case"ccn":$Quivers.Dom.CreateAlert("qBluesnapValidation-ccn","danger","Credit Card Number is invalid. Please ensure you have entered a valid card number.",false);break;case"cvv":$Quivers.Dom.CreateAlert("qBluesnapValidation-cvv","danger","CVV/CVC Code is invalid. Please ensure you have entered the security code found on the back of your credit card.",false);break;case"exp":$Quivers.Dom.CreateAlert("qBluesnapValidation-exp","danger","Expiration Date is invalid. Please ensure you have entered a future expiration date, in the MM/YYYY format.",false);break;}},onEmpty:function(tagId,errorCode){var frame=$Quivers.Dom.Get('iframe[type="'+tagId+'"]')[0];if(frame) frame.setAttribute("data-validation","bad");},onType:function(tagId,cardType){var cardIcon=document.getElementById("qBluesnapCardType");switch(cardType){case"AmericanExpress":var card="amex";break;case"DinersClub":var card="diners";break;case"Discover":var card="discover";break;case"JCB":var card="jcb";break;case"MaestroUK":var card="maestro";break;case"MasterCard":var card="mastercard";break;case"Visa":var card="visa";break;case"Solo":var card="solo";break;case"CarteBleue":var card="cb";break;case"ChinaUnionPay":var card="cup";break;default:var card=cardType;} if(cardType){cardIcon.src="https://ws.bluesnap.com/services/hosted-payment-fields/cc-types/"+card.toLowerCase()+".png";cardIcon.title=cardType;cardIcon.className="visible";} else{cardIcon.src="";cardIcon.title="";cardIcon.className="hidden";}},onValid:function(tagId){document.getElementById('qBluesnapValidation-'+tagId).innerHTML="";var frame=$Quivers.Dom.Get('iframe[type="'+tagId+'"]')[0];if(frame) frame.setAttribute("data-validation","good");},},style:{"input":{"font-family":"consolas, courier","font-size":"18px","font-weight":"bold"}},ccnPlaceHolder:self.Client.$("PaymentFieldPlaceholderCCN","checkout"),cvvPlaceHolder:self.Client.$("PaymentFieldPlaceholderCVV","checkout"),expPlaceHolder:self.Client.$("PaymentFieldPlaceholderEXP","checkout")};bluesnap.hostedPaymentFieldsCreation(self.Payment.Settings.Result.Data.Token,self.Payment.Bluesnap.Instance);if(self.Payment.Settings.Result.Data.PayPal.Enabled===false){document.getElementById("qBluesnapPaymentTypePayPal").className="hidden";}} QuiversCheckout.prototype.ValidateBluesnap=function(){var self=this;bluesnap.submitCredentials(function(cardData){self.Payment.Bluesnap.Payment=cardData;self.PlaceOrder();});return false;} QuiversCheckout.prototype.TeardownBluesnap=function(){var self=this;console.log("Tearing down Bluesnap.");try{self.Payment.Bluesnap={Instance:null,Device:null,Payment:null};self.Payment.Settings=null;try{self.Client.Socket.send(JSON.stringify({Type:"Client",Command:"cancelPayPal",Session:self.Client.SessionId}));} catch(err){console.warn(err);}} catch(err){console.log(err);}} QuiversCheckout.prototype.PrepareStripeWallets=function(){var self=this;var stripe=Stripe(this.Client.StripePublicKey);var elements=stripe.elements();var disableWalletOption=function(){let walletMethodElement=document.getElementById('qPaymentMethod-StripeWallet');walletMethodElement.setAttribute("data-wallet","NotAvailable");walletMethodElement.setAttribute('title','You do not have any GooglePay or ApplePay wallets available to use.') document.getElementById('qStripeWalletMount').innerHTML='
To use this payment method you must be signed into either your Google or Apple account. To continue, please login or save your payment method via your browser.
';} try{var supported=document.getElementById('qStripeWalletMount');if(!supported) return;var request=stripe.paymentRequest({country:'US',currency:self.Client.Currency.toLowerCase(),total:{label:'Order Total',amount:Math.ceil(self.Payment.PayPal.Total*100),},requestPayerName:true,requestPayerEmail:true,});var walletButton=elements.create('paymentRequestButton',{paymentRequest:request}) request.canMakePayment().then(function(result){if(result){walletButton.mount('#qStripeWalletMount');} else disableWalletOption();}).catch(function(err){disableWalletOption();});request.on('paymentmethod',function(ev){self.Client.Get('user/cart/prepareTransaction?type=stripe',function(intent){intent=$Quivers.Utilities.FormatResult(intent);intent=intent.Result.Data.result;stripe.confirmCardPayment(intent.client_secret,{payment_method:ev.paymentMethod.id},{handleActions:false}).then(function(result){if(result.error){console.error(result.error);$Quivers.Dom.CreateAlert("qStripeWalletErrors","danger",result.error.message,false);ev.complete('fail') return false;} ev.complete('success');document.getElementById("qStripeWalletErrors").innerHTML="";self.PaymentGateway="StripeWallet";self.Payment.Stripe.Payment=result.paymentIntent;self.PlaceOrder();})});})} catch(err){console.error(err);disableWalletOption();}} QuiversCheckout.prototype.PrepareStripe=function(){console.log("PrepareStripe called") var self=this;var stripe=Stripe(this.Client.StripePublicKey);var form=document.getElementById('qPaymentForm');if(!form) return true;if(form.hasAttribute('data-setup')) return true;form.setAttribute('data-setup','in-progress') var mount=document.getElementById('qStripeCardMount');mount.innerHTML='';form.replaceWith(form.cloneNode(true));form=document.getElementById('qPaymentForm');form.addEventListener('submit',function checkout_submit(ev){ev.preventDefault();return false;});var meta="";try{var details=self.Client.Utilities.GetBrowserAndOS();meta+="&os="+details.os+"&browser="+details.browser+"&firstname="+self.ShippingAddress.FirstName+"&lastname="+self.ShippingAddress.LastName+"&email="+self.ShippingAddress.Email;} catch(err){console.warn(err);} self.Client.Get('user/cart/prepareTransaction?type=stripe'+meta,function checkout_submit(intent){intent=$Quivers.Utilities.FormatResult(intent);if(intent.Result.Data.statusCode==500){console.error(intent.Result.Data.result.message) self.ToggleState("customer");} intent=intent.Result.Data.result;var elements=stripe.elements({clientSecret:intent.client_secret,appearance:{theme:'minimal',colorDanger:'#f22'}}) var card=elements.create('payment',{});card.mount('#qStripeCardMount');self.MountedElements.push(card);form.setAttribute('data-setup','true');form.addEventListener('submit',function(ev){ev.preventDefault();var selectedPayment=document.getElementById("qBlueSnapCreditCardMethod");if(selectedPayment.checked==false){return false;} window.onbeforeunload=function(){return"Your credit card is currently being charged. Please do not leave this page until the checkout process is complete.";} var paymentSuccess=function(response,error){var intent=response.setupIntent;if(intent){self.stripe_intent=intent;try{document.getElementById("qStripeCardErrors").innerHTML="";var pis=$Quivers.Dom.Get('[name="qSelectedPaymentMethod"]');for(var i=0;i';for(var i=0;i0){self.PaymentGateway="BillLater";return this.PlaceOrder();} else{$Quivers.Dom.TriggerError("No Payment Selected","You must specify a valid payment method to use.");}}} catch(err){console.warn(err)} document.getElementById("qPaymentForm").removeAttribute("data-validation");document.getElementById("qPaymentForm").scrollIntoView();if(this.PaymentGateway=="Stripe") document.getElementById("qConfirmPaymentStripe").click();else document.getElementById("qConfirmPaymentBluesnap").click();} else self.PlaceOrder();} QuiversCheckout.prototype.BlockScreen=function(showProcessing=false){var self=this;window.onbeforeunload=function(){return"Your credit card is currently being charged. Please do not leave this page until the checkout process is complete.";} if(self.Client.Settings.Pages.Checkout.DisplayElement!=null&&self.Client.Settings.Pages.Checkout.DisplayElement!="") var elem=self.Client.Settings.Pages.Checkout.DisplayElement;else if(self.Client.Settings.General.DefaultDisplay!=null&&self.Client.Settings.General.DefaultDisplay!="") var elem=self.Client.Settings.General.DefaultDisplay;var elem=document.getElementById(elem);if(elem==null) var elem=document.getElementById("currentView");try{var ribbon=document.getElementById(self.Client.Settings.Ribbon.DisplayElement);elem.setAttribute("style","pointer-events: none; cursor: not-allowed;");if(self.Client.Settings.Ribbon.Position=="right") ribbon.setAttribute("style","right: 0px !important; pointer-events: none; opacity: .9; cursor: not-allowed;");else ribbon.setAttribute("style","top: 0px !important; pointer-events: none; opacity: .9; cursor: not-allowed;");} catch(err){console.warn(err);} if(showProcessing==true){var loadingScreen=document.getElementById("qTransactionProcessingScreen");if(loadingScreen){loadingScreen.className="visible";loadingScreen.style="display: block !important; visibility: visible !important;";}} try{document.getElementById('closeView').style="pointer-events: none !important;";} catch(err){console.warn(err);}} QuiversCheckout.prototype.ReleaseScreen=function(){var self=this;window.onbeforeunload=function(){} if(self.Client.Settings.Pages.Checkout.DisplayElement!=null&&self.Client.Settings.Pages.Checkout.DisplayElement!="") var elem=self.Client.Settings.Pages.Checkout.DisplayElement;else if(self.Client.Settings.General.DefaultDisplay!=null&&self.Client.Settings.General.DefaultDisplay!="") var elem=self.Client.Settings.General.DefaultDisplay;var elem=document.getElementById(elem);if(elem==null) var elem=document.getElementById("currentView");loadingScreen=document.getElementById("qTransactionProcessingScreen");if(loadingScreen){loadingScreen.className="hidden";loadingScreen.style="display: none !important; visibility: hidden !important;";} try{var ribbon=document.getElementById(self.Client.Settings.Ribbon.DisplayElement);if(self.Client.Settings.Ribbon.Position=="right") ribbon.setAttribute("style","right: 0px !important;");else ribbon.setAttribute("style","top: 0px !important;");} catch(err){console.warn(err);} if(elem.id!="currentView") elem.setAttribute("style","pointer-events: all;");else elem.setAttribute('style','');try{document.getElementById('closeView').style="";} catch(err){console.warn(err);}} QuiversCheckout.prototype.PlaceOrder=function(){var self=this;var btn=document.getElementById('qSubmitPaymentBtn');if(btn.getAttribute("disabled")==null){btn.setAttribute('working','true');btn.setAttribute('disabled','true');if(self.Client.Settings.Pages.Checkout.DisplayElement!=null&&self.Client.Settings.Pages.Checkout.DisplayElement!="") var elem=self.Client.Settings.Pages.Checkout.DisplayElement;else if(self.Client.Settings.General.DefaultDisplay!=null&&self.Client.Settings.General.DefaultDisplay!="") var elem=self.Client.Settings.General.DefaultDisplay;var elem=document.getElementById(elem);if(elem==null) var elem=document.getElementById("currentView");self.BlockScreen(true);var fraudReviewStatus=null;try{var fraudReviewStatuses=$Quivers.Dom.Get('[name="qTestFraudReview"]');for(var i=0;i=c.Result.Cache&&c.Result.Language==$Quivers.Utilities.GetCookie("HoverCart-Language")){try{localStorage.removeItem(uri+"*"+this.Marketplace);} catch(err){} window[message.Message+"-Length"]=new Date();this.Socket.send(JSON.stringify(message));} else{c.Message=message.Message;cachedResult=JSON.stringify(c);window[message.Message+"-Length"]=new Date();this.Socket.onmessage({data:cachedResult});}} else{window[message.Message+"-Length"]=new Date();this.Socket.send(JSON.stringify(message));}}} else{if(uri.indexOf("?")>-1) var marketplace="&Marketplace="+this.Marketplace;else var marketplace="?Marketplace="+this.Marketplace;if(uri.split("?").length>1) var add="?"+uri.split("?")[1];else var add="";var curl={type:message.Resource.split("/")[0],url:"https://"+this.Host+uri.split("?")[0]+"/"+add+marketplace,headers:{Session:this.SessionId,ServerCache:this.Settings.Application.UseServerCache,'HTTP_ACCEPT_LANGUAGE':lang,Timezone:timezone},data:JSON.stringify(data),};var callbacks=['beforeSend','success','error','complete'];for(var c in callbacks){if(typeof window[this.Marketplace][uri.split("?")[0]]!="undefined"&&typeof window[this.Marketplace][uri.split("?")[0]][callbacks[c]]=="function") curl[callbacks[c]]=window[this.Marketplace][uri.split("?")[0]][callbacks[c]];} if(typeof callback!="undefined"&&typeof callback=="function") curl.complete=callback;$jquivers.ajax(curl);}} this.Get=function(uri,callback){this.Send("GET"+this.Api+uri,null,callback);} this.Delete=function(uri,callback){this.Send("DELETE"+this.Api+uri,null,callback);} this.Put=function(uri,data,callback){this.Send("PUT"+this.Api+uri,data,callback);} this.Post=function(uri,data,callback){this.Send("POST"+this.Api+uri,data,callback);} this.Start=function(func){$Quivers.Utilities.Debug("Start function");var hc=this;var checkForDocumentReady=setInterval(function(){if(typeof document.body!=="undefined"&&document.body!==null){if(typeof OnHoverCartLoad=="function") hc.OnStart=OnHoverCartLoad;if(typeof func=="function") hc.OnStart=func;var sessionId=sessionStorage.getItem("QuiversSession")||$Quivers.Utilities.GetCookie("QuiversSession");if(sessionId===null){sessionId=$Quivers.Utilities.CreateGuid();$Quivers.Utilities.CreateCookie("QuiversSession",sessionId);sessionStorage.setItem("QuiversSession",sessionId);} hc.SessionId=sessionId;hc.SessionStarted=true;hc.ThirdPartyCookiesEnabled=true;hc.Post("app",{Origin:document.domain,CurrentUrl:window.location.href,PointOfSaleBusiness:hc.PointOfSaleBusiness,HoverCartId:hc.Id});var css=document.createElement("link");css.type="text/css";css.rel="stylesheet";css.id="qStylesheet";css.href="https://"+hc.CDNHost+"/css/styles.css?v="+hc.Version;document.getElementsByTagName("head")[0].appendChild(css);css.onload=function(){hc.CssLoaded=true;} var fontawesome=document.createElement('link');fontawesome.type="text/css";fontawesome.rel="stylesheet";fontawesome.id="fontawesome-css";fontawesome.href="https://use.fontawesome.com/releases/v5.8.1/css/all.css";document.getElementsByTagName('head')[0].appendChild(fontawesome);if($jquivers('meta[name="viewport"][content="width=device-width, initial-scale=1"]').length===0){var viewport=document.createElement("meta");viewport.setAttribute("name","viewport");viewport.setAttribute("content","width=device-width, initial-scale=1");document.getElementsByTagName("head")[0].appendChild(viewport);} try{var google_shopping_meta=document.createElement('meta');google_shopping_meta.setAttribute('name','google-site-verification');google_shopping_meta.setAttribute('content','sLbHQz8Ph_tudgNg0n4LP1QcWhiZd_vtR3UXAmujy3Q');document.getElementsByTagName("head")[0].appendChild(google_shopping_meta);} catch(err){console.warn(err);} $Quivers.Utilities.Debug("Clearing Start Interval");clearInterval(checkForDocumentReady);} else{$Quivers.Utilities.Debug("Document Not Ready Yet ("+document.body+")");}},10);} this.$=function(label,context){if(typeof context=="undefined") var context="global";if($Quivers.Utilities.GetCookie("HoverCart-Language")==null) var lang=this.Settings.Wording.Language;else var lang=$Quivers.Utilities.GetCookie("HoverCart-Language") if(typeof this.Languages[lang][context.toLowerCase()]!=="undefined"){if(typeof this.Languages[lang][context.toLowerCase()][label]!=="undefined") return this.Languages[lang][context.toLowerCase()][label];else return null;} else return null;} this.OnPopState=function(){if(typeof oldOnpopstate==='function') window.oldOnpopstate();for(var i=0;i';switch($Quivers.Utilities.GetBrowser().name.toLowerCase()){case"chrome":var url="https://support.google.com/accounts/answer/61416?hl=en";break;case"safari":var url="https://support.apple.com/kb/ph19214";break;case"firefox":var url="https://support.mozilla.org/en-US/kb/enable-and-disable-cookies-website-preferences";break;case"edge":var url="http://www.windows10update.com/2015/07/windows-10-tutorials-128-allow-or-block-cookies-in-microsoft-edge/";break;case"ie":var url="https://support.microsoft.com/en-us/help/17442/windows-internet-explorer-delete-manage-cookies";break;case"internet explorer":var url="https://support.microsoft.com/en-us/help/17442/windows-internet-explorer-delete-manage-cookies";break;} if(typeof url!=="undefined") html+="

"+hc.$("CookiesHelp")+' '+hc.$("CookiesHelp2")+"

";$Quivers.Dom.TriggerDialog(hc.$("CookiesNotEnabledTitle"),html);} this.LiveChatSupport=function(){var fc_CSS=document.createElement('link');fc_CSS.setAttribute('rel','stylesheet');var fc_isSecured=(window.location&&window.location.protocol=='https:');var fc_lang=document.getElementsByTagName('html')[0].getAttribute('lang');var fc_rtlLanguages=['ar','he'];var fc_rtlSuffix=(fc_rtlLanguages.indexOf(fc_lang)>=0)?'-rtl':'';fc_CSS.setAttribute('type','text/css');fc_CSS.setAttribute('href',((fc_isSecured)?'https://d36mpcpuzc4ztk.cloudfront.net':'http://assets1.chat.freshdesk.com')+'/css/visitor'+fc_rtlSuffix+'.css');document.getElementsByTagName('head')[0].appendChild(fc_CSS);var fc_JS=document.createElement('script');fc_JS.type='text/javascript';fc_JS.defer=true;fc_JS.src=((fc_isSecured)?'https://d36mpcpuzc4ztk.cloudfront.net':'http://assets.chat.freshdesk.com')+'/js/visitor.js';(document.body?document.body:document.getElementsByTagName('head')[0]).appendChild(fc_JS);window.livechat_setting='eyJ3aWRnZXRfc2l0ZV91cmwiOiJxdWl2ZXJzLmZyZXNoZGVzay5jb20iLCJwcm9kdWN0X2lkIjpudWxsLCJuYW1lIjoiUXVpdmVycyIsIndpZGdldF9leHRlcm5hbF9pZCI6bnVsbCwid2lkZ2V0X2lkIjoiMGMxYWMxM2YtYzY4NS00Y2M4LThmYzMtNjdlZDQyMTNmZDJhIiwic2hvd19vbl9wb3J0YWwiOnRydWUsInBvcnRhbF9sb2dpbl9yZXF1aXJlZCI6ZmFsc2UsImxhbmd1YWdlIjpudWxsLCJ0aW1lem9uZSI6bnVsbCwiaWQiOjEwMDAwMTE0MjYsIm1haW5fd2lkZ2V0IjoxLCJmY19pZCI6IjhjOGEyNzUzNjA0ZDliY2ZmNzAwZWE4N2Y5OGFmNGExIiwic2hvdyI6MSwicmVxdWlyZWQiOjIsImhlbHBkZXNrbmFtZSI6IlF1aXZlcnMiLCJuYW1lX2xhYmVsIjoiTmFtZSIsIm1lc3NhZ2VfbGFiZWwiOiJNZXNzYWdlIiwicGhvbmVfbGFiZWwiOiJQaG9uZSIsInRleHRmaWVsZF9sYWJlbCI6IlRleHRmaWVsZCIsImRyb3Bkb3duX2xhYmVsIjoiRHJvcGRvd24iLCJ3ZWJ1cmwiOiJxdWl2ZXJzLmZyZXNoZGVzay5jb20iLCJub2RldXJsIjoiY2hhdC5mcmVzaGRlc2suY29tIiwiZGVidWciOjEsIm1lIjoiTWUiLCJleHBpcnkiOjAsImVudmlyb25tZW50IjoicHJvZHVjdGlvbiIsImVuZF9jaGF0X3RoYW5rX21zZyI6IlRoYW5rIHlvdSEhISIsImVuZF9jaGF0X2VuZF90aXRsZSI6IkVuZCIsImVuZF9jaGF0X2NhbmNlbF90aXRsZSI6IkNhbmNlbCIsInNpdGVfaWQiOiI4YzhhMjc1MzYwNGQ5YmNmZjcwMGVhODdmOThhZjRhMSIsImFjdGl2ZSI6MSwicm91dGluZyI6eyJjaG9pY2VzIjp7IlByb2R1Y3QgUXVlc3Rpb24iOlsiMCJdLCJQcmljaW5nIjpbIjAiXSwiR2VuZXJhbCBRdWVzdGlvbiI6WyIwIl0sImRlZmF1bHQiOlsiMCJdfSwiZHJvcGRvd25fYmFzZWQiOiJmYWxzZSJ9LCJwcmVjaGF0X2Zvcm0iOjEsImJ1c2luZXNzX2NhbGVuZGFyIjpudWxsLCJwcm9hY3RpdmVfY2hhdCI6MCwicHJvYWN0aXZlX3RpbWUiOjE4MCwic2l0ZV91cmwiOiJxdWl2ZXJzLmZyZXNoZGVzay5jb20iLCJleHRlcm5hbF9pZCI6bnVsbCwiZGVsZXRlZCI6MCwibW9iaWxlIjoxLCJhY2NvdW50X2lkIjpudWxsLCJjcmVhdGVkX2F0IjoiMjAxNC0wOS0xMVQwNzoxMDoxOS4wMDBaIiwidXBkYXRlZF9hdCI6IjIwMTctMTEtMDZUMjI6MTI6MjEuMDAwWiIsImNiRGVmYXVsdE1lc3NhZ2VzIjp7ImNvYnJvd3Npbmdfc3RhcnRfbXNnIjoiWW91ciBzY3JlZW5zaGFyZSBzZXNzaW9uIGhhcyBzdGFydGVkIiwiY29icm93c2luZ19zdG9wX21zZyI6IllvdXIgc2NyZWVuc2hhcmluZyBzZXNzaW9uIGhhcyBlbmRlZCIsImNvYnJvd3NpbmdfZGVueV9tc2ciOiJZb3VyIHJlcXVlc3Qgd2FzIGRlY2xpbmVkIiwiY29icm93c2luZ19hZ2VudF9idXN5IjoiQWdlbnQgaXMgaW4gc2NyZWVuIHNoYXJlIHNlc3Npb24gd2l0aCBjdXN0b21lciIsImNvYnJvd3Npbmdfdmlld2luZ19zY3JlZW4iOiJZb3UgYXJlIHZpZXdpbmcgdGhlIHZpc2l0b3LigJlzIHNjcmVlbiAiLCJjb2Jyb3dzaW5nX2NvbnRyb2xsaW5nX3NjcmVlbiI6IllvdSBoYXZlIGFjY2VzcyB0byB2aXNpdG9y4oCZcyBzY3JlZW4gIiwiY29icm93c2luZ19yZXF1ZXN0X2NvbnRyb2wiOiJSZXF1ZXN0IHZpc2l0b3IgZm9yIHNjcmVlbiBhY2Nlc3MgIiwiY29icm93c2luZ19naXZlX3Zpc2l0b3JfY29udHJvbCI6IkdpdmUgYWNjZXNzIGJhY2sgdG8gdmlzaXRvciAiLCJjb2Jyb3dzaW5nX3N0b3BfcmVxdWVzdCI6IkVuZCB5b3VyIHNjcmVlbnNoYXJpbmcgc2Vzc2lvbiIsImNvYnJvd3NpbmdfcmVxdWVzdF9jb250cm9sX3JlamVjdGVkIjoiWW91ciByZXF1ZXN0IHdhcyBkZWNsaW5lZCIsImNvYnJvd3NpbmdfY2FuY2VsX3Zpc2l0b3JfbXNnIjoiU2NyZWVuc2hhcmluZyBpcyBjdXJyZW50bHkgdW5hdmFpbGFibGUiLCJjb2Jyb3dzaW5nX2FnZW50X3JlcXVlc3RfY29udHJvbCI6IkFnZW50IGlzIHJlcXVlc3RpbmcgYWNjZXNzIHRvIHlvdXIgc2NyZWVuIiwiY2Jfdmlld2luZ19zY3JlZW5fdmkiOiJBZ2VudCBjYW4gdmlldyB5b3VyIHNjcmVlbiAiLCJjYl9jb250cm9sbGluZ19zY3JlZW5fdmkiOiJBZ2VudCBoYXMgYWNjZXNzIHRvIHlvdXIgc2NyZWVuICIsImNiX3ZpZXdfbW9kZV9zdWJ0ZXh0IjoiWW91ciBhY2Nlc3MgdG8gdGhlIHNjcmVlbiBoYXMgYmVlbiB3aXRoZHJhd24gIiwiY2JfZ2l2ZV9jb250cm9sX3ZpIjoiQWxsb3cgYWdlbnQgdG8gYWNjZXNzIHlvdXIgc2NyZWVuICIsImNiX3Zpc2l0b3Jfc2Vzc2lvbl9yZXF1ZXN0IjoiQWdlbnQgc2Vla3MgYWNjZXNzIHRvIHlvdXIgc2NyZWVuICJ9fQ==';} this.ClearCache=function(){var self=this;this.Get("clearCache",function(result){self.ClearWindowStorage();window.location.reload();});} window.oldOnpopstate=window.onpopstate;window.onpopstate=this.OnPopState;window[this.Marketplace]=this;if(typeof window.ActiveHoverCarts=="undefined") window.ActiveHoverCarts=[this.Marketplace];else window.ActiveHoverCarts.push(this.Marketplace);this.Connect();var self=this;try{var zenith_env=this.Environment.toLowerCase().replace("_aws","");switch(zenith_env){case"live":zenith_env="prod";break;case"demo":zenith_env="demo";break;case"test":zenith_env="test";break;case"local":zenith_env="dev";break;} self.Zenith=new Zenith({environment:zenith_env,clearAuthOn401:false});} catch(err){console.error(err);} var bluesnap=(this.Environment=="Live"?"https://ws.bluesnap.com":"https://sandbox.bluesnap.com")+"/services/hosted-payment-fields/v1.0/bluesnap.hpf.mini.js";$jquivers.getScript(bluesnap);$jquivers.getScript("https://www.paypalobjects.com/api/checkout.js");$jquivers.getScript("https://js.stripe.com/v3/",function(){});$jquivers.getScript("https://js.bankpay.certegy.com/v3",function(){});if(typeof google=="undefined"||typeof google.maps=="undefined"||typeof google.maps.places=="undefined"){$jquivers.getScript("https://maps.googleapis.com/maps/api/js?key="+this.GooglePlaces+"&v=weekly&libraries=places,maps",function(){});} else if(typeof google!="undefined"&&(typeof google.maps=="undefined"||typeof google.maps.places=="undefined")){console.log(google) google.load("maps","3.exp",{key:this.GooglePlaces,libraries:"places"})}} Cloudhub=function(marketplace,environment,version){if(typeof version!="undefined") this.version=version;else this.version=1;if(typeof environment!="undefined"){switch(environment.toLowerCase()){case"internal":this.endpoint="https://cloudhub-internal.quivers.com/";break;case"live":this.endpoint="https://cloudhub.quivers.com/";break;case"demo":this.endpoint="https://cloudhub.quiversdemo.com/";break;case"test":this.endpoint="https://cloudhub.quiverstest.com/";break;case"prod_aws":this.endpoint="https://cloudhub.quivers.com/";break;case"demo_aws":this.endpoint="https://cloudhub.quiversdemo.com/";break;case"test_aws":this.endpoint="https://cloudhub.quiverstest.com/";break;}} else this.endpoint="https://cloudhub.quivers.com/";this.marketplace=marketplace;this.apiKey=null;this.business=null;this.cacheData=true;this.cacheTTL=90000;this.returnXhr=false;this.getEndpoint=function(endpoint){if(endpoint.toLowerCase().indexOf("light")>-1||endpoint.toLowerCase()=="signin/signin") var url=this.endpoint+"api/v"+this.version+"/"+endpoint;else var url=this.endpoint+"api/v"+this.version+"/private/"+endpoint;if(this.marketplace!=null){if(url.indexOf("?")==-1) url+="?MarketplaceId="+this.marketplace;else url+="&MarketplaceId="+this.marketplace;} if(this.business!=null) url+="&refId="+this.business+"&brandRefId="+this.business;return url;} this.get=function(endpoint,callback,cache){var self=this;var returnXhr=this.returnXhr;if(this.apikey!=null) var auth="ApiKey "+this.apiKey;else var auth=localStorage.getItem("quiversauth_hovercart");var url=this.getEndpoint(endpoint);if(typeof cache=="undefined"||(typeof cache!="undefined"&&cache==true)){var cached=localStorage.getItem(url);if(this.cacheData==true&&cached!=null){var xhr=JSON.parse(cached);if(new Date-new Date(xhr.timeOfRequest)255) colors[i]=255;if(colors[i]<1) colors[i]=1;} else{if(colors[i]>1) colors[i]=1;if(colors[i]<0) colors[i]=0;}}} input.value="rgba("+colors.join()+")";var sliders=document.getElementsByClassName("qColorSlider");for(var i=0;i0){for(var i=0;i95&&e.keyCode<106)||(e.keyCode>47&&e.keyCode<58)||e.keyCode==8||e.keyCode==9||e.keyCode==38||e.keyCode==40)){return false;}}}}} catch(err){console.warn(err);}},LevelElements:function(rootClassName){var row=1;do{var elements=document.getElementsByClassName(rootClassName+"-"+row);var smallestHeight=0;for(var i=0;ismallestHeight){smallestHeight=height;}}} for(var i=0;i0);},ToggleDivs:function(div1,div2){var div1=document.getElementById(div1);var div2=document.getElementById(div2);if(div1.className=="visible"){div1.className="hidden";div2.className="visible";} else{div1.className="visible";div2.className="hidden";}},ToggleDiv:function(div){var div=document.getElementById(div);if(div){if(div.className=="hidden") div.className="visible";else if(div.className=="visible") div.className="hidden";}},TogglePopover:function(div){var div=document.getElementById(div);if(div){if(div.getAttribute("data-open")=="false"){div.setAttribute("data-open","true");} else if(div.getAttribute("data-open")=="true"){div.setAttribute("data-open","false");}} $jquivers('body').on('click',function(ev){if(ev.target.attributes.hasOwnProperty("dqp")==false){var popovers=$jquivers('[data-qpopover]');for(var i=0;i-1;i--){var option=options[i];stateSelect.removeChild(option);stateSelect.insertBefore(option,stateSelect.children[0]);}},ToggleTab:function(ev){var tab=ev.target.parentNode;if(tab.tagName=="FONT") tab=tab.parentNode;if(tab.tagName=="FONT") tab=tab.parentNode;if(tab.tagName=="A") tab=tab.parentNode;var tabs=document.getElementsByClassName("tab");for(var i=0;i-1) formGroup.className="form-group has-"+type;},TriggerDialog:function(title,body,size){if(typeof size=="undefined")var size="small";switch(size.toLowerCase()){case"small":var className="translate col-xs-12 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-4 col-xl-4 col-xl-offset-4";break;case"large":var className="translate col-xs-12 col-md-8 col-md-offset-2 col-lg-8 col-lg-offset-2 col-xl-6 col-xl-offset-3";break;} document.getElementById("QuiversOverlay").className="visible";document.getElementById("QuiversDialogBoxContainer").className="visible";document.getElementById("QuiversDialogBox").className=className;document.getElementById("QuiversDialogBox").setAttribute('title',title);document.getElementById("QuiversDialogBox").setAttribute('role',title);document.getElementById("QuiversDialogTitle").innerHTML=title;document.getElementById("QuiversDialogTitle").setAttribute('tabindex','0');try{$("#QuiversDialogBody").html(body);} catch(err){document.getElementById("QuiversDialogBody").innerHTML=body;} try{document.body.setAttribute('data-mobile-allow-scroll','false');} catch(err){} $Quivers.Dom.ResizeDialog();try{document.getElementById("QuiversDialogBox").focus();}catch(err){} setTimeout(function(){try{let f=$("#QuiversDialogBody");if(f.length>0) f[0].setAttribute('data-force-retranslate','');} catch(err){}},100) try{document.getElementById("QuiversDialogBox").focus();} catch(err){console.warn(err);}},TriggerError:function(title,message){var html='
';html+='
';html+='
'+message+'
';html+='
';$Quivers.Dom.TriggerDialog(title,html);},TriggerNotice:function(title,message){var html='
';html+='
';html+='
'+message+'
';html+='
';$Quivers.Dom.TriggerDialog(title,html);},CloseDialog:function(){document.getElementById("QuiversOverlay").className="hidden";document.getElementById("QuiversDialogBoxContainer").className="hidden";document.getElementById("QuiversDialogTitle").innerHTML="";document.getElementById("QuiversDialogBody").innerHTML="";document.body.removeAttribute('data-mobile-allow-scroll','false');$Quivers.Dom.ResizeDialog();},ResizeDialog:function(){if(document.body.clientHeight>=900) document.getElementById("QuiversDialogBox").removeAttribute("style");if(document.body.clientHeight<900) document.getElementById("QuiversDialogBox").setAttribute("style","top: 8%; max-height: 86%;");if(document.body.clientHeight<700) document.getElementById("QuiversDialogBox").setAttribute("style","top: 4%; max-height: 92%;");if(document.body.clientHeight<500) document.getElementById("QuiversDialogBox").setAttribute("style","top: 0%; max-height: 100%;");document.getElementById("QuiversDialogBody").removeAttribute("style");document.getElementById("QuiversDialogBody").setAttribute("style","max-height: "+(document.getElementById("QuiversDialogBox").clientHeight-40)+"px;");},DialogPager:function(page){var pages=document.getElementsByClassName("qUpsellProductsPage");for(var i=1;i<=pages.length;i++){if(pages[i-1].getAttribute("data-page")==page){console.log('[data-pager-button="'+i+'"]');$Quivers.Dom.Get('[data-pager-button="'+i+'"]')[0].innerHTML=''+i+'';pages[i-1].className="qUpsellProductsPage visible";} else{$Quivers.Dom.Get('[data-pager-button="'+i+'"]')[0].innerHTML=''+i+'';pages[i-1].className="qUpsellProductsPage hidden";}} $Quivers.Dom.ResizeDialog();}};if(typeof Object.create!=='function'){Object.create=function(obj){function F(){};F.prototype=obj;return new F();};} (function($,window,document,undefined){var ElevateZoom={init:function(options,elem){var self=this;self.elem=elem;self.$elem=$jquivers(elem);self.imageSrc=self.$elem.data("zoom-image")?self.$elem.data("zoom-image"):self.$elem.attr("src");self.options=$jquivers.extend({},$jquivers.fn.elevateZoom.options,options);if(self.options.tint){self.options.lensColour="none",self.options.lensOpacity="1"} if(self.options.zoomType=="inner"){self.options.showLens=false;} self.$elem.parent().removeAttr('title').removeAttr('alt');self.zoomImage=self.imageSrc;self.refresh(1);$jquivers('#'+self.options.gallery+' a').click(function(e){if(self.options.galleryActiveClass){$jquivers('#'+self.options.gallery+' a').removeClass(self.options.galleryActiveClass);$jquivers(this).addClass(self.options.galleryActiveClass);} e.preventDefault();if($jquivers(this).data("zoom-image")){self.zoomImagePre=$jquivers(this).data("zoom-image")} else{self.zoomImagePre=$jquivers(this).data("image");} self.swaptheimage($jquivers(this).data("image"),self.zoomImagePre);return false;});},refresh:function(length){var self=this;setTimeout(function(){self.fetch(self.imageSrc);},length||self.options.refresh);},fetch:function(imgsrc){var self=this;var newImg=new Image();newImg.onload=function(){self.largeWidth=newImg.width;self.largeHeight=newImg.height;self.startZoom();self.currentImage=self.imageSrc;self.options.onZoomedImageLoaded(self.$elem);} newImg.src=imgsrc;return;},startZoom:function(){var self=this;self.nzWidth=self.$elem.width();self.nzHeight=self.$elem.height();self.isWindowActive=false;self.isLensActive=false;self.isTintActive=false;self.overWindow=false;if(self.options.imageCrossfade){self.zoomWrap=self.$elem.wrap('
');self.$elem.css('position','absolute');} self.zoomLock=1;self.scrollingLock=false;self.changeBgSize=false;self.currentZoomLevel=self.options.zoomLevel;self.nzOffset=self.$elem.offset();self.widthRatio=(self.largeWidth/self.currentZoomLevel)/self.nzWidth;self.heightRatio=(self.largeHeight/self.currentZoomLevel)/self.nzHeight;if(self.options.zoomType=="window"){self.zoomWindowStyle="overflow: hidden;" +"background-position: 0px 0px;text-align:center;" +"background-color: "+String(self.options.zoomWindowBgColour) +";width: "+String(self.options.zoomWindowWidth)+"px;" +"height: "+String(self.options.zoomWindowHeight) +"px;float: left;" +"background-size: "+self.largeWidth/self.currentZoomLevel+"px "+self.largeHeight/self.currentZoomLevel+"px;" +"display: none;z-index:100;" +"border: "+String(self.options.borderSize) +"px solid "+self.options.borderColour +";background-repeat: no-repeat;" +"position: absolute;";} if(self.options.zoomType=="inner"){var borderWidth=self.$elem.css("border-left-width");self.zoomWindowStyle="overflow: hidden;" +"margin-left: "+String(borderWidth)+";" +"margin-top: "+String(borderWidth)+";" +"background-position: 0px 0px;" +"width: "+String(self.nzWidth)+"px;" +"height: "+String(self.nzHeight)+"px;" +"px;float: left;" +"display: none;" +"cursor:"+(self.options.cursor)+";" +"px solid "+self.options.borderColour +";background-repeat: no-repeat;" +"position: absolute;";} if(self.options.zoomType=="window"){if(self.nzHeight
');$jquivers('body').append(self.zoomContainer);if(self.options.containLensZoom&&self.options.zoomType=="lens"){self.zoomContainer.css("overflow","hidden");} if(self.options.zoomType!="inner"){self.zoomLens=$jquivers("
 
").appendTo(self.zoomContainer).click(function(){self.$elem.trigger('click');});if(self.options.tint){self.tintContainer=$jquivers('
').addClass('tintContainer');self.zoomTint=$jquivers("
");self.zoomLens.wrap(self.tintContainer);self.zoomTintcss=self.zoomLens.after(self.zoomTint);self.zoomTintImage=$jquivers('').appendTo(self.zoomLens).click(function(){self.$elem.trigger('click');});}} if(isNaN(self.options.zoomWindowPosition)){self.zoomWindow=$jquivers("
 
").appendTo('body').click(function(){self.$elem.trigger('click');});}else{self.zoomWindow=$jquivers("
 
").appendTo(self.zoomContainer).click(function(){self.$elem.trigger('click');});} self.zoomWindowContainer=$jquivers('
').addClass('zoomWindowContainer').css("width",self.options.zoomWindowWidth);self.zoomWindow.wrap(self.zoomWindowContainer);if(self.options.zoomType=="lens"){self.zoomLens.css({backgroundImage:'url("'+encodeURI(self.imageSrc)+'")'});} if(self.options.zoomType=="window"){self.zoomWindow.css({backgroundImage:'url("'+encodeURI(self.imageSrc)+'")'});} if(self.options.zoomType=="inner"){self.zoomWindow.css({backgroundImage:'url("'+encodeURI(self.imageSrc)+'")'});} self.$elem.bind('touchmove',function(e){e.preventDefault();var touch=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0];self.setPosition(touch);});self.zoomContainer.bind('touchmove',function(e){if(self.options.zoomType=="inner"){self.showHideWindow("show");} e.preventDefault();var touch=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0];self.setPosition(touch);});self.zoomContainer.bind('touchend',function(e){self.showHideWindow("hide");if(self.options.showLens){self.showHideLens("hide");} if(self.options.tint&&self.options.zoomType!="inner"){self.showHideTint("hide");}});self.$elem.bind('touchend',function(e){self.showHideWindow("hide");if(self.options.showLens){self.showHideLens("hide");} if(self.options.tint&&self.options.zoomType!="inner"){self.showHideTint("hide");}});if(self.options.showLens){self.zoomLens.bind('touchmove',function(e){e.preventDefault();var touch=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0];self.setPosition(touch);});self.zoomLens.bind('touchend',function(e){self.showHideWindow("hide");if(self.options.showLens){self.showHideLens("hide");} if(self.options.tint&&self.options.zoomType!="inner"){self.showHideTint("hide");}});} self.$elem.bind('mousemove',function(e){if(self.overWindow==false){self.setElements("show");} if(self.lastX!==e.clientX||self.lastY!==e.clientY){self.setPosition(e);self.currentLoc=e;} self.lastX=e.clientX;self.lastY=e.clientY;});self.zoomContainer.bind('mousemove',function(e){if(self.overWindow==false){self.setElements("show");} if(self.lastX!==e.clientX||self.lastY!==e.clientY){self.setPosition(e);self.currentLoc=e;} self.lastX=e.clientX;self.lastY=e.clientY;});if(self.options.zoomType!="inner"){self.zoomLens.bind('mousemove',function(e){if(self.lastX!==e.clientX||self.lastY!==e.clientY){self.setPosition(e);self.currentLoc=e;} self.lastX=e.clientX;self.lastY=e.clientY;});} if(self.options.tint&&self.options.zoomType!="inner"){self.zoomTint.bind('mousemove',function(e){if(self.lastX!==e.clientX||self.lastY!==e.clientY){self.setPosition(e);self.currentLoc=e;} self.lastX=e.clientX;self.lastY=e.clientY;});} if(self.options.zoomType=="inner"){self.zoomWindow.bind('mousemove',function(e){if(self.lastX!==e.clientX||self.lastY!==e.clientY){self.setPosition(e);self.currentLoc=e;} self.lastX=e.clientX;self.lastY=e.clientY;});} self.zoomContainer.add(self.$elem).mouseenter(function(){if(self.overWindow==false){self.setElements("show");}}).mouseleave(function(){if(!self.scrollLock){self.setElements("hide");self.options.onDestroy(self.$elem);}});if(self.options.zoomType!="inner"){self.zoomWindow.mouseenter(function(){self.overWindow=true;self.setElements("hide");}).mouseleave(function(){self.overWindow=false;});} if(self.options.zoomLevel!=1){} if(self.options.minZoomLevel){self.minZoomLevel=self.options.minZoomLevel;} else{self.minZoomLevel=self.options.scrollZoomIncrement*2;} if(self.options.scrollZoom){self.zoomContainer.add(self.$elem).bind('mousewheel DOMMouseScroll MozMousePixelScroll',function(e){self.scrollLock=true;clearTimeout($jquivers.data(this,'timer'));$jquivers.data(this,'timer',setTimeout(function(){self.scrollLock=false;},250));var theEvent=e.originalEvent.wheelDelta||e.originalEvent.detail*-1 e.stopImmediatePropagation();e.stopPropagation();e.preventDefault();if(theEvent/120>0){if(self.currentZoomLevel>=self.minZoomLevel){self.changeZoomLevel(self.currentZoomLevel-self.options.scrollZoomIncrement);}} else{if(self.options.maxZoomLevel){if(self.currentZoomLevel<=self.options.maxZoomLevel){self.changeZoomLevel(parseFloat(self.currentZoomLevel)+self.options.scrollZoomIncrement);}} else{self.changeZoomLevel(parseFloat(self.currentZoomLevel)+self.options.scrollZoomIncrement);}} return false;});}},setElements:function(type){var self=this;if(!self.options.zoomEnabled){return false;} if(type=="show"){if(self.isWindowSet){if(self.options.zoomType=="inner"){self.showHideWindow("show");} if(self.options.zoomType=="window"){self.showHideWindow("show");} if(self.options.showLens){self.showHideLens("show");} if(self.options.tint&&self.options.zoomType!="inner"){self.showHideTint("show");}}} if(type=="hide"){if(self.options.zoomType=="window"){self.showHideWindow("hide");} if(!self.options.tint){self.showHideWindow("hide");} if(self.options.showLens){self.showHideLens("hide");} if(self.options.tint){self.showHideTint("hide");}}},setPosition:function(e){var self=this;if(!self.options.zoomEnabled){return false;} self.nzHeight=self.$elem.height();self.nzWidth=self.$elem.width();self.nzOffset=self.$elem.offset();if(self.options.tint&&self.options.zoomType!="inner"){self.zoomTint.css({top:0});self.zoomTint.css({left:0});} if(self.options.responsive&&!self.options.scrollZoom){if(self.options.showLens){if(self.nzHeightself.nzHeight-(self.zoomLens.height()/2)-(self.options.lensBorderSize*2));self.Eloppos=(self.mouseLeft<0+((self.zoomLens.width()/2)));self.Eroppos=(self.mouseLeft>(self.nzWidth-(self.zoomLens.width()/2)-(self.options.lensBorderSize*2)));} if(self.options.zoomType=="inner"){self.Etoppos=(self.mouseTop<((self.nzHeight/2)/self.heightRatio));self.Eboppos=(self.mouseTop>(self.nzHeight-((self.nzHeight/2)/self.heightRatio)));self.Eloppos=(self.mouseLeft<0+(((self.nzWidth/2)/self.widthRatio)));self.Eroppos=(self.mouseLeft>(self.nzWidth-(self.nzWidth/2)/self.widthRatio-(self.options.lensBorderSize*2)));} if(self.mouseLeft<0||self.mouseTop<0||self.mouseLeft>self.nzWidth||self.mouseTop>self.nzHeight){self.setElements("hide");return;} else{if(self.options.showLens){self.lensLeftPos=String(Math.floor(self.mouseLeft-self.zoomLens.width()/2));self.lensTopPos=String(Math.floor(self.mouseTop-self.zoomLens.height()/2));} if(self.Etoppos){self.lensTopPos=0;} if(self.Eloppos){self.windowLeftPos=0;self.lensLeftPos=0;self.tintpos=0;} if(self.options.zoomType=="window"){if(self.Eboppos){self.lensTopPos=Math.max((self.nzHeight)-self.zoomLens.height()-(self.options.lensBorderSize*2),0);} if(self.Eroppos){self.lensLeftPos=(self.nzWidth-(self.zoomLens.width())-(self.options.lensBorderSize*2));}} if(self.options.zoomType=="inner"){if(self.Eboppos){self.lensTopPos=Math.max(((self.nzHeight)-(self.options.lensBorderSize*2)),0);} if(self.Eroppos){self.lensLeftPos=(self.nzWidth-(self.nzWidth)-(self.options.lensBorderSize*2));}} if(self.options.zoomType=="lens"){self.windowLeftPos=String(((e.pageX-self.nzOffset.left)*self.widthRatio-self.zoomLens.width()/2)*(-1));self.windowTopPos=String(((e.pageY-self.nzOffset.top)*self.heightRatio-self.zoomLens.height()/2)*(-1));self.zoomLens.css({backgroundPosition:self.windowLeftPos+'px '+self.windowTopPos+'px'});if(self.changeBgSize){if(self.nzHeight>self.nzWidth){if(self.options.zoomType=="lens"){self.zoomLens.css({"background-size":self.largeWidth/self.newvalueheight+'px '+self.largeHeight/self.newvalueheight+'px'});} self.zoomWindow.css({"background-size":self.largeWidth/self.newvalueheight+'px '+self.largeHeight/self.newvalueheight+'px'});} else{if(self.options.zoomType=="lens"){self.zoomLens.css({"background-size":self.largeWidth/self.newvaluewidth+'px '+self.largeHeight/self.newvaluewidth+'px'});} self.zoomWindow.css({"background-size":self.largeWidth/self.newvaluewidth+'px '+self.largeHeight/self.newvaluewidth+'px'});} self.changeBgSize=false;} self.setWindowPostition(e);} if(self.options.tint&&self.options.zoomType!="inner"){self.setTintPosition(e);} if(self.options.zoomType=="window"){self.setWindowPostition(e);} if(self.options.zoomType=="inner"){self.setWindowPostition(e);} if(self.options.showLens){if(self.fullwidth&&self.options.zoomType!="lens"){self.lensLeftPos=0;} self.zoomLens.css({left:self.lensLeftPos+'px',top:self.lensTopPos+'px'})}}},showHideWindow:function(change){var self=this;if(change=="show"){if(!self.isWindowActive){if(self.options.zoomWindowFadeIn){self.zoomWindow.stop(true,true,false).fadeIn(self.options.zoomWindowFadeIn);} else{self.zoomWindow.show();} self.isWindowActive=true;}} if(change=="hide"){if(self.isWindowActive){if(self.options.zoomWindowFadeOut){self.zoomWindow.stop(true,true).fadeOut(self.options.zoomWindowFadeOut,function(){if(self.loop){clearInterval(self.loop);self.loop=false;}});} else{self.zoomWindow.hide();} self.isWindowActive=false;}}},showHideLens:function(change){var self=this;if(change=="show"){if(!self.isLensActive){if(self.options.lensFadeIn){self.zoomLens.stop(true,true,false).fadeIn(self.options.lensFadeIn);} else{self.zoomLens.show();} self.isLensActive=true;}} if(change=="hide"){if(self.isLensActive){if(self.options.lensFadeOut){self.zoomLens.stop(true,true).fadeOut(self.options.lensFadeOut);} else{self.zoomLens.hide();} self.isLensActive=false;}}},showHideTint:function(change){var self=this;if(change=="show"){if(!self.isTintActive){if(self.options.zoomTintFadeIn){self.zoomTint.css({opacity:self.options.tintOpacity}).animate().stop(true,true).fadeIn("slow");} else{self.zoomTint.css({opacity:self.options.tintOpacity}).animate();self.zoomTint.show();} self.isTintActive=true;}} if(change=="hide"){if(self.isTintActive){if(self.options.zoomTintFadeOut){self.zoomTint.stop(true,true).fadeOut(self.options.zoomTintFadeOut);} else{self.zoomTint.hide();} self.isTintActive=false;}}},setLensPostition:function(e){},setWindowPostition:function(e){var self=this;if(!isNaN(self.options.zoomWindowPosition)){switch(self.options.zoomWindowPosition){case 1:self.windowOffsetTop=(self.options.zoomWindowOffety);self.windowOffsetLeft=(+self.nzWidth);break;case 2:if(self.options.zoomWindowHeight>self.nzHeight){self.windowOffsetTop=((self.options.zoomWindowHeight/2)-(self.nzHeight/2))*(-1);self.windowOffsetLeft=(self.nzWidth);} else{} break;case 3:self.windowOffsetTop=(self.nzHeight-self.zoomWindow.height()-(self.options.borderSize*2));self.windowOffsetLeft=(self.nzWidth);break;case 4:self.windowOffsetTop=(self.nzHeight);self.windowOffsetLeft=(self.nzWidth);break;case 5:self.windowOffsetTop=(self.nzHeight);self.windowOffsetLeft=(self.nzWidth-self.zoomWindow.width()-(self.options.borderSize*2));break;case 6:if(self.options.zoomWindowHeight>self.nzHeight){self.windowOffsetTop=(self.nzHeight);self.windowOffsetLeft=((self.options.zoomWindowWidth/2)-(self.nzWidth/2)+(self.options.borderSize*2))*(-1);} else{} break;case 7:self.windowOffsetTop=(self.nzHeight);self.windowOffsetLeft=0;break;case 8:self.windowOffsetTop=(self.nzHeight);self.windowOffsetLeft=(self.zoomWindow.width()+(self.options.borderSize*2))*(-1);break;case 9:self.windowOffsetTop=(self.nzHeight-self.zoomWindow.height()-(self.options.borderSize*2));self.windowOffsetLeft=(self.zoomWindow.width()+(self.options.borderSize*2))*(-1);break;case 10:if(self.options.zoomWindowHeight>self.nzHeight){self.windowOffsetTop=((self.options.zoomWindowHeight/2)-(self.nzHeight/2))*(-1);self.windowOffsetLeft=(self.zoomWindow.width()+(self.options.borderSize*2))*(-1);} else{} break;case 11:self.windowOffsetTop=(self.options.zoomWindowOffety);self.windowOffsetLeft=(self.zoomWindow.width()+(self.options.borderSize*2))*(-1);break;case 12:self.windowOffsetTop=(self.zoomWindow.height()+(self.options.borderSize*2))*(-1);self.windowOffsetLeft=(self.zoomWindow.width()+(self.options.borderSize*2))*(-1);break;case 13:self.windowOffsetTop=(self.zoomWindow.height()+(self.options.borderSize*2))*(-1);self.windowOffsetLeft=(0);break;case 14:if(self.options.zoomWindowHeight>self.nzHeight){self.windowOffsetTop=(self.zoomWindow.height()+(self.options.borderSize*2))*(-1);self.windowOffsetLeft=((self.options.zoomWindowWidth/2)-(self.nzWidth/2)+(self.options.borderSize*2))*(-1);} else{} break;case 15:self.windowOffsetTop=(self.zoomWindow.height()+(self.options.borderSize*2))*(-1);self.windowOffsetLeft=(self.nzWidth-self.zoomWindow.width()-(self.options.borderSize*2));break;case 16:self.windowOffsetTop=(self.zoomWindow.height()+(self.options.borderSize*2))*(-1);self.windowOffsetLeft=(self.nzWidth);break;default:self.windowOffsetTop=(self.options.zoomWindowOffety);self.windowOffsetLeft=(self.nzWidth);}} else{self.externalContainer=$jquivers('#'+self.options.zoomWindowPosition);self.externalContainerWidth=self.externalContainer.width();self.externalContainerHeight=self.externalContainer.height();self.externalContainerOffset=self.externalContainer.offset();self.windowOffsetTop=self.externalContainerOffset.top;self.windowOffsetLeft=self.externalContainerOffset.left;} self.isWindowSet=true;self.windowOffsetTop=self.windowOffsetTop+self.options.zoomWindowOffety;self.windowOffsetLeft=self.windowOffsetLeft+self.options.zoomWindowOffetx;self.zoomWindow.css({top:self.windowOffsetTop});self.zoomWindow.css({left:self.windowOffsetLeft});if(self.options.zoomType=="inner"){self.zoomWindow.css({top:0});self.zoomWindow.css({left:0});} self.windowLeftPos=String(((e.pageX-self.nzOffset.left)*self.widthRatio-self.zoomWindow.width()/2)*(-1));self.windowTopPos=String(((e.pageY-self.nzOffset.top)*self.heightRatio-self.zoomWindow.height()/2)*(-1));if(self.Etoppos){self.windowTopPos=0;} if(self.Eloppos){self.windowLeftPos=0;} if(self.Eboppos){self.windowTopPos=(self.largeHeight/self.currentZoomLevel-self.zoomWindow.height())*(-1);} if(self.Eroppos){self.windowLeftPos=((self.largeWidth/self.currentZoomLevel-self.zoomWindow.width())*(-1));} if(self.fullheight){self.windowTopPos=0;} if(self.fullwidth){self.windowLeftPos=0;} if(self.options.zoomType=="window"||self.options.zoomType=="inner"){if(self.zoomLock==1){if(self.widthRatio<=1){self.windowLeftPos=0;} if(self.heightRatio<=1){self.windowTopPos=0;}} if(self.options.zoomType=="window"){if(self.largeHeightself.nzWidth){if(self.options.zoomType=="lens"){self.zoomLens.css({"background-size":self.largeWidth/self.newvalueheight+'px '+self.largeHeight/self.newvalueheight+'px'});} self.zoomWindow.css({"background-size":self.largeWidth/self.newvalueheight+'px '+self.largeHeight/self.newvalueheight+'px'});} else{if(self.options.zoomType!="lens"){self.zoomLens.css({"background-size":self.largeWidth/self.newvaluewidth+'px '+self.largeHeight/self.newvalueheight+'px'});} self.zoomWindow.css({"background-size":self.largeWidth/self.newvaluewidth+'px '+self.largeHeight/self.newvaluewidth+'px'});} self.changeBgSize=false;} self.zoomWindow.css({backgroundPosition:self.windowLeftPos+'px '+self.windowTopPos+'px'});self.scrollingLock=false;self.loop=false;} else if(Math.round(Math.abs(self.xp-self.windowLeftPos)+Math.abs(self.yp-self.windowTopPos))<1){clearInterval(self.loop);self.zoomWindow.css({backgroundPosition:self.windowLeftPos+'px '+self.windowTopPos+'px'});self.loop=false;} else{if(self.changeBgSize){if(self.nzHeight>self.nzWidth){if(self.options.zoomType=="lens"){self.zoomLens.css({"background-size":self.largeWidth/self.newvalueheight+'px '+self.largeHeight/self.newvalueheight+'px'});} self.zoomWindow.css({"background-size":self.largeWidth/self.newvalueheight+'px '+self.largeHeight/self.newvalueheight+'px'});} else{if(self.options.zoomType!="lens"){self.zoomLens.css({"background-size":self.largeWidth/self.newvaluewidth+'px '+self.largeHeight/self.newvaluewidth+'px'});} self.zoomWindow.css({"background-size":self.largeWidth/self.newvaluewidth+'px '+self.largeHeight/self.newvaluewidth+'px'});} self.changeBgSize=false;} self.zoomWindow.css({backgroundPosition:self.xp+'px '+self.yp+'px'});}},16);}} else{if(self.changeBgSize){if(self.nzHeight>self.nzWidth){if(self.options.zoomType=="lens"){self.zoomLens.css({"background-size":self.largeWidth/self.newvalueheight+'px '+self.largeHeight/self.newvalueheight+'px'});} self.zoomWindow.css({"background-size":self.largeWidth/self.newvalueheight+'px '+self.largeHeight/self.newvalueheight+'px'});} else{if(self.options.zoomType=="lens"){self.zoomLens.css({"background-size":self.largeWidth/self.newvaluewidth+'px '+self.largeHeight/self.newvaluewidth+'px'});} if((self.largeHeight/self.newvaluewidth)
');self.$elem.after(self.spinner);} self.options.onImageSwap(self.$elem);newImg.onload=function(){self.largeWidth=newImg.width;self.largeHeight=newImg.height;self.zoomImage=largeimage;self.zoomWindow.css({"background-size":self.largeWidth+'px '+self.largeHeight+'px'});self.swapAction(smallimage,largeimage);return;} newImg.src=largeimage;},swapAction:function(smallimage,largeimage){var self=this;var newImg2=new Image();newImg2.onload=function(){self.nzHeight=newImg2.height;self.nzWidth=newImg2.width;self.options.onImageSwapComplete(self.$elem);self.doneCallback();return;} newImg2.src=smallimage;self.currentZoomLevel=self.options.zoomLevel;self.options.maxZoomLevel=false;if(self.options.zoomType=="lens"){self.zoomLens.css({backgroundImage:'url("'+encodeURI(largeimage)+'")'});} if(self.options.zoomType=="window"){self.zoomWindow.css({backgroundImage:'url("'+encodeURI(largeimage)+'")'});} if(self.options.zoomType=="inner"){self.zoomWindow.css({backgroundImage:'url("'+encodeURI(largeimage)+'")'});} self.currentImage=largeimage;if(self.options.imageCrossfade){var oldImg=self.$elem;var newImg=oldImg.clone();self.$elem.attr("src",smallimage) self.$elem.after(newImg);newImg.stop(true).fadeOut(self.options.imageCrossfade,function(){$jquivers(this).remove();});self.$elem.width("auto").removeAttr("width");self.$elem.height("auto").removeAttr("height");oldImg.fadeIn(self.options.imageCrossfade);if(self.options.tint&&self.options.zoomType!="inner"){var oldImgTint=self.zoomTintImage;var newImgTint=oldImgTint.clone();self.zoomTintImage.attr("src",largeimage) self.zoomTintImage.after(newImgTint);newImgTint.stop(true).fadeOut(self.options.imageCrossfade,function(){$jquivers(this).remove();});oldImgTint.fadeIn(self.options.imageCrossfade);self.zoomTint.css({height:self.$elem.height()});self.zoomTint.css({width:self.$elem.width()});} self.zoomContainer.css("height",self.$elem.height());self.zoomContainer.css("width",self.$elem.width());if(self.options.zoomType=="inner"){if(!self.options.constrainType){self.zoomWrap.parent().css("height",self.$elem.height());self.zoomWrap.parent().css("width",self.$elem.width());self.zoomWindow.css("height",self.$elem.height());self.zoomWindow.css("width",self.$elem.width());}} if(self.options.imageCrossfade){self.zoomWrap.css("height",self.$elem.height());self.zoomWrap.css("width",self.$elem.width());}} else{self.$elem.attr("src",smallimage);if(self.options.tint){self.zoomTintImage.attr("src",largeimage);self.zoomTintImage.attr("height",self.$elem.height());self.zoomTintImage.css({height:self.$elem.height()});self.zoomTint.css({height:self.$elem.height()});} self.zoomContainer.css("height",self.$elem.height());self.zoomContainer.css("width",self.$elem.width());if(self.options.imageCrossfade){self.zoomWrap.css("height",self.$elem.height());self.zoomWrap.css("width",self.$elem.width());}} if(self.options.constrainType){if(self.options.constrainType=="height"){self.zoomContainer.css("height",self.options.constrainSize);self.zoomContainer.css("width","auto");if(self.options.imageCrossfade){self.zoomWrap.css("height",self.options.constrainSize);self.zoomWrap.css("width","auto");self.constwidth=self.zoomWrap.width();} else{self.$elem.css("height",self.options.constrainSize);self.$elem.css("width","auto");self.constwidth=self.$elem.width();} if(self.options.zoomType=="inner"){self.zoomWrap.parent().css("height",self.options.constrainSize);self.zoomWrap.parent().css("width",self.constwidth);self.zoomWindow.css("height",self.options.constrainSize);self.zoomWindow.css("width",self.constwidth);} if(self.options.tint){self.tintContainer.css("height",self.options.constrainSize);self.tintContainer.css("width",self.constwidth);self.zoomTint.css("height",self.options.constrainSize);self.zoomTint.css("width",self.constwidth);self.zoomTintImage.css("height",self.options.constrainSize);self.zoomTintImage.css("width",self.constwidth);}} if(self.options.constrainType=="width"){self.zoomContainer.css("height","auto");self.zoomContainer.css("width",self.options.constrainSize);if(self.options.imageCrossfade){self.zoomWrap.css("height","auto");self.zoomWrap.css("width",self.options.constrainSize);self.constheight=self.zoomWrap.height();} else{self.$elem.css("height","auto");self.$elem.css("width",self.options.constrainSize);self.constheight=self.$elem.height();} if(self.options.zoomType=="inner"){self.zoomWrap.parent().css("height",self.constheight);self.zoomWrap.parent().css("width",self.options.constrainSize);self.zoomWindow.css("height",self.constheight);self.zoomWindow.css("width",self.options.constrainSize);} if(self.options.tint){self.tintContainer.css("height",self.constheight);self.tintContainer.css("width",self.options.constrainSize);self.zoomTint.css("height",self.constheight);self.zoomTint.css("width",self.options.constrainSize);self.zoomTintImage.css("height",self.constheight);self.zoomTintImage.css("width",self.options.constrainSize);}}}},doneCallback:function(){var self=this;if(self.options.loadingIcon){self.spinner.hide();} self.nzOffset=self.$elem.offset();self.nzWidth=self.$elem.width();self.nzHeight=self.$elem.height();self.currentZoomLevel=self.options.zoomLevel;self.widthRatio=self.largeWidth/self.nzWidth;self.heightRatio=self.largeHeight/self.nzHeight;if(self.options.zoomType=="window"){if(self.nzHeightmaxheightnewvalue){newvalue=maxheightnewvalue;} if(newvalue>maxwidthtnewvalue){newvalue=maxwidthtnewvalue;} if(maxheightnewvalue<=newvalue){self.heightRatio=(self.largeHeight/newvalue)/self.nzHeight;if(newvalue>maxheightnewvalue){self.newvalueheight=maxheightnewvalue;}else{self.newvalueheight=newvalue;} self.fullheight=true;} else{self.heightRatio=(self.largeHeight/newvalue)/self.nzHeight;if(newvalue>maxheightnewvalue){self.newvalueheight=maxheightnewvalue;}else{self.newvalueheight=newvalue;} self.fullheight=false;} if(maxwidthtnewvalue<=newvalue){self.widthRatio=(self.largeWidth/newvalue)/self.nzWidth;if(newvalue>maxwidthtnewvalue){self.newvaluewidth=maxwidthtnewvalue;}else{self.newvaluewidth=newvalue;} self.fullwidth=true;} else{self.widthRatio=(self.largeWidth/newvalue)/self.nzWidth;self.newvaluewidth=newvalue;self.fullwidth=false;}} scrcontinue=false;if(self.options.zoomType=="inner"){if(self.nzWidth>=self.nzHeight){if(self.newvaluewidth<=maxwidthtnewvalue){scrcontinue=true;} else{scrcontinue=false;self.fullheight=true;self.fullwidth=true;}} if(self.nzHeight>self.nzWidth){if(self.newvaluewidth<=maxwidthtnewvalue){scrcontinue=true;} else{scrcontinue=false;self.fullheight=true;self.fullwidth=true;}}} if(self.options.zoomType!="inner"){scrcontinue=true;} if(scrcontinue){self.zoomLock=0;self.changeZoom=true;if(((self.options.zoomWindowHeight)/self.heightRatio)<=self.nzHeight){self.currentZoomLevel=self.newvalueheight;if(self.options.zoomType!="lens"&&self.options.zoomType!="inner"){self.changeBgSize=true;self.zoomLens.css({height:String((self.options.zoomWindowHeight)/self.heightRatio)+'px'})} if(self.options.zoomType=="lens"||self.options.zoomType=="inner"){self.changeBgSize=true;}} if((self.options.zoomWindowWidth/self.widthRatio)<=self.nzWidth){if(self.options.zoomType!="inner"){if(self.newvaluewidth>self.newvalueheight){self.currentZoomLevel=self.newvaluewidth;}} if(self.options.zoomType!="lens"&&self.options.zoomType!="inner"){self.changeBgSize=true;self.zoomLens.css({width:String((self.options.zoomWindowWidth)/self.widthRatio)+'px'})} if(self.options.zoomType=="lens"||self.options.zoomType=="inner"){self.changeBgSize=true;}} if(self.options.zoomType=="inner"){self.changeBgSize=true;if(self.nzWidth>self.nzHeight){self.currentZoomLevel=self.newvaluewidth;} if(self.nzHeight>self.nzWidth){self.currentZoomLevel=self.newvaluewidth;}}} self.setPosition(self.currentLoc);},closeAll:function(){if(self.zoomWindow){self.zoomWindow.hide();} if(self.zoomLens){self.zoomLens.hide();} if(self.zoomTint){self.zoomTint.hide();}},changeState:function(value){var self=this;if(value=='enable'){self.options.zoomEnabled=true;} if(value=='disable'){self.options.zoomEnabled=false;}}};$jquivers.fn.elevateZoom=function(options){return this.each(function(){var elevate=Object.create(ElevateZoom);elevate.init(options,this);$jquivers.data(this,'elevateZoom',elevate);});};$jquivers.fn.elevateZoom.options={zoomActivation:"hover",zoomEnabled:true,preloading:1,zoomLevel:1,scrollZoom:false,scrollZoomIncrement:0.1,minZoomLevel:false,maxZoomLevel:false,easing:false,easingAmount:12,lensSize:200,zoomWindowWidth:400,zoomWindowHeight:400,zoomWindowOffetx:0,zoomWindowOffety:0,zoomWindowPosition:1,zoomWindowBgColour:"#fff",lensFadeIn:false,lensFadeOut:false,debug:false,zoomWindowFadeIn:false,zoomWindowFadeOut:false,zoomWindowAlwaysShow:false,zoomTintFadeIn:false,zoomTintFadeOut:false,borderSize:4,showLens:true,borderColour:"#888",lensBorderSize:1,lensBorderColour:"#000",lensShape:"square",zoomType:"window",containLensZoom:false,lensColour:"white",lensOpacity:0.4,lenszoom:false,tint:false,tintColour:"#333",tintOpacity:0.4,gallery:false,galleryActiveClass:"zoomGalleryActive",imageCrossfade:false,constrainType:false,constrainSize:false,loadingIcon:false,cursor:"default",responsive:true,onComplete:$jquivers.noop,onDestroy:function(){},onZoomedImageLoaded:function(){},onImageSwap:$jquivers.noop,onImageSwapComplete:$jquivers.noop};})($jquivers,window,document);$Quivers.Forms={Serialize:function(formName){if(typeof formName=="string") var form=document.getElementById("q-"+formName);else var form=formName;var data=$jquivers("#"+form.id).serializeArray();var post={};for(var i in data){post[data[i].name]=data[i].value;} return{Form:form,Data:post};},Validate:function(formName,useAlerts){var form=document.getElementById("q-"+formName);var inputs=document.getElementsByTagName("input");var proceed=true;var alerts=$Quivers.Dom.Get('[data-form-alerts="'+formName+'"]');for(var k=0;k-1&&QuiversAddressForm.prototype.Validate(formName)===true)||(formName.toLowerCase().indexOf("address")==-1&&this.Validate(formName,true)===true)){button.setAttribute('disabled','true');button.setAttribute('working','true');for(var k in alerts){if(typeof alerts[k]!=="function") alerts[k].innerHTML=null;} if(typeof callback=="function") window[this.MarketplaceId].Post(form.Form.getAttribute('data-api'),form.Data,callback);else window[this.MarketplaceId].Post(form.Form.getAttribute('data-api'),form.Data);}}},Send:function(action,data){if(typeof data=="string"){var form=document.getElementById(data);var post=new FormData(form);} else var post=data;window[this.MarketplaceId].Post(action,post);}} $jquivers(document).on("keyup","input",function(ev){if(ev.keyCode==13){var r=$Quivers.Dom.Get('form[data-form="'+ev.target.getAttribute("data-form")+'"]');if(r.length>0) var marketplace=r[0].getAttribute("data-marketplace");if(typeof marketplace!="undefined") window[marketplace].Forms.Submit(ev.target.getAttribute("data-form"),ev.target.getAttribute("data-form")+"-Submit");}});$Quivers.Products={loadCategory:$Quivers.Catalog.Category,toggleSubCategories:$Quivers.Catalog.ToggleSubCategories,loadProducts:$Quivers.Catalog.Products,resetPage:$Quivers.Catalog.ResetPage,triggerSearch:$Quivers.Catalog.TriggerSearch,search:$Quivers.Catalog.Search,productDetails:$Quivers.Catalog.ProductDetails,productShort:$Quivers.Catalog.ProductShort,widgets:$Quivers.Catalog.Widgets,assortments:$Quivers.Catalog.Assortments,getVariant:$Quivers.Catalog.SelectVariant,productReviews:$Quivers.Catalog.ProductReviews,voteReview:$Quivers.Catalog.VoteReview} $Quivers.Views={login:"",register:"",forgotPassword:"",newPassword:"",account:"",orders:"",order:"",products:"",buyProduct:"",checkout:"",confirmation:"",cart:"",wishlist:"",settings:"",contact:"",safari:""} if(typeof Object.prototype.__defineSetter__!="undefined"){$Quivers.Views.__defineSetter__('login',function(val){window[this.MarketplaceId].Settings.Pages.Login.PageUrl=val;});$Quivers.Views.__defineSetter__('register',function(val){window[this.MarketplaceId].Settings.Pages.Login.PageUrl=val;});$Quivers.Views.__defineSetter__('forgotPassword',function(val){window[this.MarketplaceId].Settings.Pages.Login.PageUrl=val;});$Quivers.Views.__defineSetter__('newPassword',function(val){window[this.MarketplaceId].Settings.Pages.Login.PageUrl=val;});$Quivers.Views.__defineSetter__('account',function(val){window[this.MarketplaceId].Settings.Pages.Account.PageUrl=val;});$Quivers.Views.__defineSetter__('orders',function(val){window[this.MarketplaceId].Settings.Pages.Account.PageUrl=val;});$Quivers.Views.__defineSetter__('order',function(val){window[this.MarketplaceId].Settings.Pages.Order.PageUrl=val;});$Quivers.Views.__defineSetter__('products',function(val){window[this.MarketplaceId].Settings.Pages.Products.PageUrl=val;});$Quivers.Views.__defineSetter__('buyProduct',function(val){window[this.MarketplaceId].Settings.Pages.ProductShort.PageUrl=val;});$Quivers.Views.__defineSetter__('checkout',function(val){window[this.MarketplaceId].Settings.Pages.Checkout.PageUrl=val;});$Quivers.Views.__defineSetter__('cart',function(val){window[this.MarketplaceId].Settings.Pages.Cart.PageUrl=val;});$Quivers.Views.__defineSetter__('wishlist',function(val){window[this.MarketplaceId].Settings.Pages.Wishlist.PageUrl=val;});$Quivers.Views.__defineSetter__('settings',function(val){window[this.MarketplaceId].Settings.Pages.Settings.PageUrl=val;});$Quivers.Views.__defineSetter__('contact',function(val){window[this.MarketplaceId].Settings.Pages.Contact.PageUrl=val;});} $Quivers.DisplayElements={login:null,register:null,forgotPassword:null,newPassword:null,account:null,orders:null,order:null,products:null,buyProduct:null,checkout:null,confirmation:null,cart:null,wishlist:null,safari:null,settings:null,contact:null,ribbon:null} if(typeof Object.prototype.__defineSetter__!="undefined"){$Quivers.DisplayElements.__defineSetter__('login',function(val){window[this.MarketplaceId].Settings.Pages.Login.DisplayElement=val;});$Quivers.DisplayElements.__defineSetter__('register',function(val){window[this.MarketplaceId].Settings.Pages.Login.DisplayElement=val;});$Quivers.DisplayElements.__defineSetter__('forgotPassword',function(val){window[this.MarketplaceId].Settings.Pages.Login.DisplayElement=val;});$Quivers.DisplayElements.__defineSetter__('newPassword',function(val){window[this.MarketplaceId].Settings.Pages.Login.DisplayElement=val;});$Quivers.DisplayElements.__defineSetter__('account',function(val){window[this.MarketplaceId].Settings.Pages.Account.DisplayElement=val;});$Quivers.DisplayElements.__defineSetter__('orders',function(val){window[this.MarketplaceId].Settings.Pages.Account.DisplayElement=val;});$Quivers.DisplayElements.__defineSetter__('order',function(val){window[this.MarketplaceId].Settings.Pages.Order.DisplayElement=val;});$Quivers.DisplayElements.__defineSetter__('products',function(val){window[this.MarketplaceId].Settings.Pages.Products.DisplayElement=val;});$Quivers.DisplayElements.__defineSetter__('buyProduct',function(val){window[this.MarketplaceId].Settings.Pages.ProductShort.DisplayElement=val;});$Quivers.DisplayElements.__defineSetter__('checkout',function(val){window[this.MarketplaceId].Settings.Pages.Checkout.DisplayElement=val;});$Quivers.DisplayElements.__defineSetter__('cart',function(val){window[this.MarketplaceId].Settings.Pages.Cart.DisplayElement=val;});$Quivers.DisplayElements.__defineSetter__('wishlist',function(val){window[this.MarketplaceId].Settings.Pages.Wishlist.DisplayElement=val;});$Quivers.DisplayElements.__defineSetter__('settings',function(val){window[this.MarketplaceId].Settings.Pages.Settings.DisplayElement=val;});$Quivers.DisplayElements.__defineSetter__('contact',function(val){window[this.MarketplaceId].Settings.Pages.Contact.DisplayElement=val;});$Quivers.DisplayElements.__defineSetter__('ribbon',function(val){window[this.MarketplaceId].Settings.Ribbon.DisplayElement=val;});} $Quivers.Urls={Paths:{Default:"v",Search:"q",Category:"c",Product:"p",ProductShort:"b",ProductReview:"r",Orders:"o",Order:"order"}} if(typeof Object.prototype.__defineSetter__!="undefined"){$Quivers.Urls.Paths.__defineSetter__('Default',function(val){window[this.MarketplaceId].Settings.QueryTokens.Default=val;});$Quivers.Urls.Paths.__defineSetter__('Search',function(val){window[this.MarketplaceId].Settings.QueryTokens.Search=val;});$Quivers.Urls.Paths.__defineSetter__('Category',function(val){window[this.MarketplaceId].Settings.QueryTokens.Category=val;});$Quivers.Urls.Paths.__defineSetter__('Product',function(val){window[this.MarketplaceId].Settings.QueryTokens.Product=val;});$Quivers.Urls.Paths.__defineSetter__('ProductShort',function(val){window[this.MarketplaceId].Settings.QueryTokens.ProductShort=val;});$Quivers.Urls.Paths.__defineSetter__('ProductReview',function(val){window[this.MarketplaceId].Settings.QueryTokens.ProductReview=val;});$Quivers.Urls.Paths.__defineSetter__('Orders',function(val){window[this.MarketplaceId].Settings.QueryTokens.Orders=val;});$Quivers.Urls.Paths.__defineSetter__('Order',function(val){window[this.MarketplaceId].Settings.QueryTokens.Order=val;});$Quivers.__defineSetter__('AutoInit',function(val){window[this.MarketplaceId].Settings.Ribbon.DisplayElement=val;});$Quivers.__defineSetter__('HomeUrl',function(val){window[this.MarketplaceId].Settings.General.HomeUrl=val;});$Quivers.__defineSetter__('Logo',function(val){window[this.MarketplaceId].Settings.Ribbon.DisplayElement=val;});$Quivers.__defineSetter__('DisplayElement',function(val){window[this.MarketplaceId].Settings.General.DefaultDisplay=val;});$Quivers.__defineSetter__('ThemeColor',function(val){window[this.MarketplaceId].Settings.General.PrimaryColor=val;});$Quivers.__defineSetter__('AltColor',function(val){window[this.MarketplaceId].Settings.General.AlternateColor=val;});$Quivers.__defineSetter__('FontColor',function(val){window[this.MarketplaceId].Settings.General.FontColor=val;});$Quivers.__defineSetter__('PriceRange',function(val){window[this.MarketplaceId].Settings.Catalog.PriceRanges=val;});$Quivers.__defineSetter__('DefaultView',function(val){window[this.MarketplaceId].Settings.General.DefaultPage=val;});$Quivers.__defineSetter__('CustomRegister',function(val){window[this.MarketplaceId].Settings.Registration.LegacyUrl=val;});$Quivers.__defineSetter__('PaymentVerbiage',function(val){window[this.MarketplaceId].Settings.Checkout.PaymentVerbiage=val;});} $Quivers.requestWidget=function(){this.Settings.Ribbon.Automatic=true;this.IgnoreRibbonAutomatic=true;this.Start();} QuiversInstorePickupMap=function(marketplace,instorePickupData){this.Labels='ABCDEFGHIJKLMNOPQRSTUVWXYZ';this.MarketplaceId=marketplace;this.ParentElement=document.getElementById("qInstorePickupMap");var mapSection=document.getElementById('qAvailableInstoreSection');if(mapSection&&mapSection.className=="visible"){mapSection.className="hidden";this.ParentElement.className="visible";document.getElementById('qCurrentSelection').className="visible";} if(typeof instorePickupData=="undefined"){var instorePickupData=window[this.MarketplaceId].InstorePickupData;} for(var i in instorePickupData) this[i]=instorePickupData[i];this.PopulateMap=function(lat,lng){console.log(this.ParentElement);console.log(lat);console.log(lng);this.Map=new google.maps.Map(this.ParentElement,{center:{lat:lat,lng:lng},zoom:9});$Quivers.Dom.ResizeDialog();var map=this;this.SetCenter(lat,lng);map.Map.addListener('bounds_changed',function(e){var lat=map.Map.center.lat();var lng=map.Map.center.lng();var updatePosition=false;map.SetCenter(lat,lng);});map.Map.addListener('dragend',function(e){$Quivers.Utilities.Debug("Fetching locations for Instore Pickup...");var pageSize=5;$jquivers.ajax({url:"https://maps.googleapis.com/maps/api/geocode/json?latlng="+lat+","+lng+"&sensor=false",success:function(geo){console.log(geo);var stateAbbreviation=geo.results[geo.results.length-3].address_components[1].short_name;console.log("BusinessesLight/ClosestRetailers?ProductId="+map.ProductId+"&StateAbb="+stateAbbreviation+"&Latitude="+map.Map.center.lat()+"&Longitude="+map.Map.center.lng());window[map.MarketplaceId].Cloudhub.get("BusinessesLight/ClosestRetailers?ProductId="+map.ProductId+"&StateAbb="+stateAbbreviation+"&Latitude="+map.Map.center.lat()+"&Longitude="+map.Map.center.lng()+"&PageSize="+pageSize,function(data){console.log(data);for(var b=0;b"+ map.Locations[k].Address.AddressLine1+"
";if(map.Locations[k].Address.AddressLine2!=null&&map.Locations[k].Address.AddressLine2!="") string+=map.Locations[k].Address.AddressLine2+"
";string+=map.Locations[k].Address.City+", "+map.Locations[k].Address.StateAbbreviation+", "+map.Locations[k].Address.PostCode+"
"+ map.Locations[k].Address.Country+"
"+""+window[map.MarketplaceId].$("PickupHereBtn","instorepickup")+"";map.Locations[k].InfoWindow=new google.maps.InfoWindow({content:string});map.Locations[k].Marker.addListener('click',function(){this.Parent.InfoWindow.open(map.Map,this.Parent.Marker);});} catch(err){}}}} this.MarkSelectedLocation=function(location){var map=this;if(typeof this.SelectedLocation!="undefined"&&typeof this.SelectedLocation.Marker!="undefined"){this.SelectedLocation.Marker.setMap(null);var index=map.Locations.push(this.SelectedLocation)-1;map.Locations[index].Marker=new google.maps.Marker({position:{lat:map.Locations[index].Address.Latitude,lng:map.Locations[index].Address.Longitude},label:map.Labels[index],map:map.Map,title:map.Locations[index].Name,});} this.SelectedLocation=location;for(var i=0;i"+ location.Address.AddressLine1+"
";if(location.Address.AddressLine2!=null&&location.Address.AddressLine2!="") string+=location.Address.AddressLine2+"
";string+=location.Address.City+", "+location.Address.StateAbbreviation+", "+location.Address.PostCode+"
"+ location.Address.Country+"
"+"
"+window[map.MarketplaceId].$("SelectedLocationLabel","instorepickup")+"
";location.InfoWindow=new google.maps.InfoWindow({content:string});location.Marker.addListener('click',function(){this.Parent.InfoWindow.open(map.Map,this.Parent.Marker);});} this.SelectLocation=function(id){var map=this;if(id!==null){var location=map.Locations[id];var link=document.getElementById("qPickupLocation-"+id);} else{var location={Address:null,RefId:null,Name:null};var link=document.getElementById('qRemovePickupLocation');} if(!link.hasAttribute("disabled")){link.setAttribute("working","true");link.setAttribute("disabled","true");if(location.RefId!==null&&(typeof location.Address.Company=="undefined"||location.Address.Company==null)) location.Address.Company=location.Name;console.log({Type:"Shopping",Product:map.CartItemId,InStorePickupLocation:{Address:location.Address,RefId:location.RefId,Name:location.Name}});window[this.MarketplaceId].Post("user/cart/updateItem",{Type:"Shopping",Product:map.CartItemId,InStorePickupLocation:{Address:location.Address,RefId:location.RefId,Name:location.Name}},function(data){var message=document.getElementById("qInstorePickupMessage");var currentSelection=document.getElementById("qCurrentSelection");if(data.ResponseCode<300){if(typeof data.Result.Data.CartItem!="undefined"&&data.Result.Data.CartItem!=null) map.CartItemId=data.Result.Data.CartItem.Id;if(location.RefId!=null) map.MarkSelectedLocation(location);else map.SelectedLocation.Marker.setMap(null);if(typeof data.Result.Data.LocationCard!="undefined"){try{if(message) message.className="text-center hidden";if(message.parentNode==currentSelection) currentSelection.parentNode.appendChild(message);}catch(err){} currentSelection.innerHTML=data.Result.Data.LocationCard;currentSelection.className="visible";console.log(window[data.Result.Marketplace].Checkout);if(typeof window[data.Result.Marketplace].Checkout!=="undefined"){window[data.Result.Marketplace].Checkout.UpdateTotals();$Quivers.Dom.CloseDialog();} else{if(document.getElementById("qCartDetails")){if(data.Result.Data.RenderType=="Module") document.getElementById("qCartDetails").innerHTML=data.Result.Html;else{var elem=window[data.Result.Marketplace].Settings.GetDisplayElement("Checkout");document.getElementById(elem).innerHTML=data.Result.Html;} if(document.getElementById("productUpsellOpportunity")) window[data.Result.Marketplace].Get("module?Module=productUpsellOpportunity");}}} else{if(message) message.className="text-center visible";}} else{if(message) message.className="text-center visible";currentSelection.innerHTML="";currentSelection.className="hidden";} link.removeAttribute("working");link.removeAttribute("disabled");for(var i=0;i';contents+='
';contents+="
"+window[this.MarketplaceId].$("ReturnBtn","instorepickup")+"
";$Quivers.Dom.TriggerDialog(window[this.MarketplaceId].$("SelectedPickupLocationTitle","instorepickup"),contents);var host=window[this.MarketplaceId].CDNHost;var hc=window[this.MarketplaceId];var createTheMap=function(){$Quivers.Utilities.Debug(location);var map=new google.maps.Map(document.getElementById("qInstorePickupMap"),{center:{lat:location.Address.Latitude,lng:location.Address.Longitude},zoom:9});$Quivers.Dom.ResizeDialog();var marker=new google.maps.Marker({position:{lat:location.Address.Latitude,lng:location.Address.Longitude},map:map,title:hc.$("MyLocation","instorepickup"),icon:"https://"+host+"/img/store-pin-small.png"});var string="
"+location.Name+"
"+ location.Address.AddressLine1+"
";if(location.Address.AddressLine2!=null&&location.Address.AddressLine2!="") string+=location.Address.AddressLine2+"
";string+=location.Address.City+", "+location.Address.StateProvinceName+", "+location.Address.ZipPostalCode+"
"+ location.Address.CountryName+"
"+"
"+hc.$("SelectedLocationLabel","instorepickup")+"
";marker.infoWindow=new google.maps.InfoWindow({content:string});marker.addListener('click',function(){marker.infoWindow.open(map,marker);});setTimeout(function(){marker.infoWindow.open(map,marker);},1000);} if(location.Address.Latitude!=null){if(typeof google=="undefined"||typeof google.maps=="undefined") $jquivers.getScript("https://maps.googleapis.com/maps/api/js",createTheMap);else createTheMap();} else{var map=document.getElementById("qInstorePickupMap");map.setAttribute("style","text-align: center;");map.innerHTML='
'+hc.$("GoogleMapError","instorepickup")+'
';map.innerHTML+='
';document.getElementById("qOpvPickupLocation").innerHTML+="

"+location.Name+"

"+location.Address.AddressLine1+"
";if(location.Address.AddressLine2!=null&&location.Address.AddressLine2!="") document.getElementById("qOpvPickupLocation").innerHTML+=location.Address.AddressLine2+"
";document.getElementById("qOpvPickupLocation").innerHTML+=location.Address.City+", "+location.Address.StateProvinceName+", "+location.Address.ZipPostalCode+"
"+ location.Address.CountryName+"
"+"

"+hc.$("SelectedLocationLabel","instorepickup")+"

";}}};$Pager=function(marketplace,pagerParentElement,itemsParentId,data,pagesize){this.MarketplaceId=marketplace;this.Pager=document.getElementById(pagerParentElement);this.Parent=document.getElementById(itemsParentId);this.Data=data;if(typeof pagesize!="undefined") this.PageSize=pagesize;else this.PageSize=20;this.CurrentPage=1;this.ApplyPaging=function(){for(var i=0;iCodeConsumerGroupTimes UsedUsed By...';p.Parent.appendChild(header);for(var i in data.Result.Data){var row=document.createElement("tr");row.id=data.Result.Data[i]._id;row.setAttribute("data-page",p.CurrentPage);row.innerHTML=''+data.Result.Data[i].Code+'';row.innerHTML+=''+data.Result.Data[i].ConsumerGroupName+'';row.innerHTML+=''+data.Result.Data[i].TimesUsed+''+data.Result.Data[i].UsedBy+'Delete';p.Parent.appendChild(row);} p.Parent.setAttribute('loading','false');if(typeof callback!="undefined") callback();}) var pager=document.getElementById(this.Pager.id+'-Pager');for(var k=0;k';if(this.NumberOfPages()>5){if(this.CurrentPage!=1) html+='
  • First
  • ';if(this.CurrentPage>5) html+="
  • ...
  • ";for(var i=1;i<=this.NumberOfPages();i++){if(i>this.CurrentPage-4&&i'+i+'';} if((this.NumberOfPages()-this.CurrentPage)>5) html+="
  • ...
  • ";if(this.CurrentPage!=this.NumberOfPages()) html+='
  • Last
  • ';} else{for(var i=1;i<=this.NumberOfPages();i++){html+='
  • '+i+'
  • ';}} if(this.Length()==0) var start=0;else var start=1;html+='Currently viewing '+start+' - '+this.LastPageLength()+' out of '+this.Length()+' results';this.Pager.innerHTML=html;} this.ResetPager=function(start){if(start==true){this.ApplyPaging();this.RenderPager();this.SelectPage(1);} else{this.CurrentPage=0;this.Pager.innerHTML="";}} if(typeof window.Pagers=="undefined") window.Pagers={};window.Pagers[this.Pager.id]=this;this.ResetPager(true);} $Quivers.Settings=function(){this.Application={UseServerCache:true,UseLocalCache:true};this.Apply=function(settings){$Quivers.Utilities.Debug("Applying Settings...");for(var s in settings){this[s]=settings[s];} if(typeof this.Extensions=="undefined") this.Extensions={};} this.GetDisplayElement=function(page){var elem=this.Pages[page].DisplayElement;if(elem==null||!document.getElementById(elem)){elem=this.General.DefaultDisplay;if(elem==null||!document.getElementById(elem)) elem="currentView";} return elem;} this.GetTemplateDialog=function(template){window[this.MarketplaceId].Get("module?Module=applyTemplate&Template="+template,function(data){data=$Quivers.Utilities.FormatResult(data);$Quivers.Dom.TriggerDialog("Apply Template",data.Result.Html);})} this.ToggleDashboardType=function(ev){var selects=$Quivers.Dom.Get('[name="ProDashboard"]');for(var i=0;i-1){var set=form.getAttribute("Type")+"."+form.id.split("qPage")[1]+"."+ev.target.name;} else if(form.id.indexOf("Extension")>-1){var set=form.getAttribute("Type")+"."+form.id.split("qExtension")[1]+"."+ev.target.name;} else{var set=form.getAttribute("Type")+"."+ev.target.name;} if(ev.target.id=="qRegistrationConsumerGroup"){window[this.MarketplaceId].Get("getRegistrationCodes?ConsumerGroup="+ev.target.options[ev.target.selectedIndex].value,function(data){if(data.ResponseCode<300){window.Pagers['qPagerParent'].Data.Length=Object.keys(data.Result.Data).length;window.Pagers['qPagerParent'].Data.ConsumerGroup=ev.target.options[ev.target.selectedIndex].value;console.log(window.Pagers['qPagerParent']);window.Pagers['qPagerParent'].SelectPage(1);}})} if(ev.target.getAttribute("type")!="range"){var s={};if(ev.target.tagName.toLowerCase()=="select"){if(ev.target.options[ev.target.selectedIndex].value=="true") s[set]=true;else if(ev.target.options[ev.target.selectedIndex].value=="false") s[set]=false;else s[set]=ev.target.options[ev.target.selectedIndex].value;} else s[set]=ev.target.value;if(ev.target.name=="PageSizeOptions"){s[set]=s[set].replace(" ","").split(',');for(var j in s[set]) s[set][j]=parseInt(s[set][j]);s["Catalog.DefaultPageSize"]=parseInt(s[set][0]);} $Quivers.Utilities.Debug(s);if(ev.target.getAttribute("type")=="file"){var hc=window[this.MarketplaceId];var d=new FormData($jquivers('#'+form.id)[0]);$jquivers.ajax({type:"POST",url:"https://"+hc.Host+"/api/v1/uploadImage/"+"?Marketplace="+hc.Marketplace,headers:{Session:hc.SessionId,ServerCache:hc.Settings.Application.UseServerCache},data:d,success:function(data){$Quivers.Utilities.Debug(data);hc.Post("updateSettings",{"Ribbon.Logo":data.Data.pictureInfo.urls['70']},function(r){var fields=$Quivers.Dom.Get("input[name='Logo'][type='text']");for(var k in fields){fields[k].value=data.Data.pictureInfo.urls['70'];} var a=document.createElement("div");a.innerHTML=data.Html;a.className="alert alert-success";document.getElementById("qSettingsNotifications").appendChild(a);setTimeout(function(){a.setAttribute("style","opacity: 0;");setTimeout(function(){a.parentNode.removeChild(a);},600);},1000) hc.ClearWindowStorage();});},error:function(data){var a=document.createElement("div");a.innerHTML="Failed to upload image!";a.className="alert alert-danger";document.getElementById("qSettingsNotifications").appendChild(a);setTimeout(function(){a.setAttribute("style","opacity: 0;");setTimeout(function(){a.parentNode.removeChild(a);},600);},1000)},cache:false,contentType:false,processData:false});} else{window[this.MarketplaceId].Post("updateSettings",s,function(data){data=$Quivers.Utilities.FormatResult(data);if(data.ResponseCode<300) var alert="success";else var alert="danger";var a=document.createElement("div");a.innerHTML=data.Result.Html;a.className="alert alert-"+alert;document.getElementById("qSettingsNotifications").appendChild(a);setTimeout(function(){a.setAttribute("style","opacity: 0;");setTimeout(function(){a.parentNode.removeChild(a);},600);},1000) window[data.Result.Marketplace].ClearWindowStorage();});}}} this.AddCodes=function(ev){if(!ev.target.hasAttribute('disabled')){ev.target.setAttribute("working","true");ev.target.setAttribute('disabled','true');var consumerGroupSelect=document.getElementById("qRegistrationConsumerGroup");var post={Codes:document.getElementById("qBulkAddRegistrationCodes").value,ConsumerGroup:consumerGroupSelect.options[consumerGroupSelect.selectedIndex].value} if(post.ConsumerGroup==""){var a=document.createElement("div");a.innerHTML="Error! You must select a Consumer Group first!";a.className="alert alert-danger";document.getElementById("qSettingsNotifications").appendChild(a);setTimeout(function(){a.setAttribute("style","opacity: 0;");setTimeout(function(){a.parentNode.removeChild(a);},600);},1000);ev.target.setAttribute("working","false");ev.target.removeAttribute('disabled');} else{window[this.MarketplaceId].Post("addRegistrationCodes",post,function(data){data=$Quivers.Utilities.FormatResult(data);if(data.ResponseCode<300){window.Pagers['qPagerParent'].Data.Length+=data.Result.Data.length;window.Pagers['qPagerParent'].RenderPager();window.Pagers['qPagerParent'].SelectPage(window.Pagers['qPagerParent'].NumberOfPages());document.getElementById("qBulkAddRegistrationCodes").value="";var alert="success";} else{var alert="danger";} var a=document.createElement("div");a.innerHTML=data.Result.Html;a.className="alert alert-"+alert;document.getElementById("qSettingsNotifications").appendChild(a);setTimeout(function(){a.setAttribute("style","opacity: 0;");setTimeout(function(){a.parentNode.removeChild(a);},600);},1000) ev.target.setAttribute("working","false");ev.target.removeAttribute('disabled');});}}} this.DeleteCodes=function(ev){if(!ev.target.hasAttribute('disabled')){ev.target.setAttribute("working","true");ev.target.setAttribute('disabled','true');var consumerGroupSelect=document.getElementById("qRegistrationConsumerGroup");if(ev.target.hasAttribute("data-code")) var post="deleteRegistrationCodes?Code="+ev.target.getAttribute("data-code")+"&ConsumerGroup="+consumerGroupSelect.options[consumerGroupSelect.selectedIndex].value;else var post="deleteRegistrationCodes?ConsumerGroup="+consumerGroupSelect.options[consumerGroupSelect.selectedIndex].value window[this.MarketplaceId].Post(post,null,function(data){data=$Quivers.Utilities.FormatResult(data);if(data.ResponseCode<300){if(data.Result.Data.Deleted=="All"){document.getElementById("qRegistrationCodesTable").innerHTML="CodeConsumerGroupTimes UsedUsed By...";window.Pagers['qPagerParent'].Data.Length=0;} else{var remove=document.getElementById(data.Result.Data.Deleted);remove.parentNode.removeChild(remove);window.Pagers['qPagerParent'].Data.Length--;} window.Pagers['qPagerParent'].RenderPager();var alert="success";} else{var alert="danger";} window.Pagers['qPagerParent'].ResetPager(true);var a=document.createElement("div");a.innerHTML=data.Result.Html;a.className="alert alert-"+alert;document.getElementById("qSettingsNotifications").appendChild(a);setTimeout(function(){a.setAttribute("style","opacity: 0;");setTimeout(function(){a.parentNode.removeChild(a);},600);},1000) ev.target.setAttribute("working","false");ev.target.removeAttribute('disabled');});}} this.SearchCodes=function(ev){var searchTerm=ev.target.value;var consumerGroupSelect=document.getElementById("qRegistrationConsumerGroup");var p=window.Pagers['qPagerParent'];if(searchTerm==""||searchTerm==null){window.Pagers['qPagerParent'].ResetPager(true);} else{window.Pagers['qPagerParent'].ResetPager(false);window[this.MarketplaceId].Get(p.Data.Resource+"?ConsumerGroup="+consumerGroupSelect.options[consumerGroupSelect.selectedIndex].value+"&Query="+searchTerm,function(data){data=$Quivers.Utilities.FormatResult(data);p.Parent.innerHTML='';var header=document.createElement("tr");header.innerHTML='CodeConsumerGroupTimes UsedUsed By...';p.Parent.appendChild(header);for(var i=0;i'+data.Result.Data[i].Code+'';row.innerHTML+=''+data.Result.Data[i].ConsumerGroupName+'';row.innerHTML+=''+data.Result.Data[i].TimesUsed+''+data.Result.Data[i].UsedBy+'Delete';p.Parent.appendChild(row);} p.Parent.setAttribute('loading','false');})}} this.ExportCodes=function(ev){var consumerGroupSelect=document.getElementById("qRegistrationConsumerGroup");window[this.MarketplaceId].Get("exportRegistrationCodes?ConsumerGroup="+consumerGroupSelect.options[consumerGroupSelect.selectedIndex].value);}} $Quivers["/api/v1/exportRegistrationCodes"]={beforeSend:function(){document.getElementById("qExportRegistrationCodes").setAttribute("working","true");document.getElementById("qExportRegistrationCodes").setAttribute("disabled","true");document.getElementById("qExportRegistrationCodes").setAttribute("style","pointer-events: none;");return true;},success:function(data){data=$Quivers.Utilities.FormatResult(data);window.location.replace("https://"+window[data.Result.Marketplace].Host+"/"+data.Result.Data.Filepath);},error:function(xhr){data=$Quivers.Utilities.FormatResult(xhr);},complete:function(){document.getElementById("qExportRegistrationCodes").setAttribute("working","false");document.getElementById("qExportRegistrationCodes").removeAttribute("disabled");document.getElementById("qExportRegistrationCodes").setAttribute("style","");}} ShopEmployeeExtension={Search:function(ev){if(typeof ev=="undefined") var query=document.getElementById('qShopEmployeeRetailerSearchInput').value;else var query=ev.target.value;document.getElementById("qShopEmployeeRetailer").setAttribute('loading','true');window[this.MarketplaceId].Get("SearchShopEmployeeRetailers?Query="+query,function(data){document.getElementById("qShopEmployeeRetailer").setAttribute('loading','false');if(data.Result.Data.Retailer!=null) document.getElementById("qShopEmployeeRetailer").innerHTML=data.Result.Html;else document.getElementById("qShopEmployeeRetailer").innerHTML='
    No matching retailers found.
    ';})},DeleteAddress:function(id){var rows=$Quivers.Dom.Get('[data-address-id="'+id+'"]');for(var i=0;i'+data.Result.Html+'';}} $Quivers["/api/v1/editShopEmployeeRetailer"]={success:function(data){data=$Quivers.Utilities.FormatResult(data);var button=document.getElementById("EditRetailer-Submit");button.setAttribute("working","false");button.removeAttribute("disabled");document.getElementById("qShopEmployeeRetailer").innerHTML=data.Result.Html;$Quivers.Dom.CreateAlert($Quivers.Dom.Get('[data-form-alerts="EditRetailer"]')[0].id,"success","Successfully updated retailer '"+data.Result.Data.Retailer.Name+"' ('"+data.Result.Data.Retailer._id+"')!");},error:function(xhr){data=$Quivers.Utilities.FormatResult(xhr);var button=document.getElementById("EditRetailer-Submit");button.setAttribute("working","false");button.removeAttribute("disabled");$Quivers.Dom.CreateAlert($Quivers.Dom.Get('[data-form-alerts="EditRetailer"]')[0].id,"danger",data.Result.Html);}} $Quivers["/api/v1/exportShopEmployeeRetailers"]={beforeSend:function(){document.getElementById("qExportRetailers").setAttribute("working","true");document.getElementById("qExportRetailers").setAttribute("disabled","true");document.getElementById("qExportRetailers").setAttribute("style","pointer-events: none;");return true;},success:function(data){data=$Quivers.Utilities.FormatResult(data);window.location.replace("https://"+window[data.Result.Marketplace].Host+"/"+data.Result.Data.Filepath);},error:function(xhr){data=$Quivers.Utilities.FormatResult(xhr);},complete:function(){document.getElementById("qExportRetailers").setAttribute("working","false");document.getElementById("qExportRetailers").removeAttribute("disabled");document.getElementById("qExportRetailers").setAttribute("style","");}} $Quivers["/api/v1/exportShopEmployeeRetailerAddresses"]={beforeSend:function(){document.getElementById("qExportAddresses").setAttribute("working","true");document.getElementById("qExportAddresses").setAttribute("disabled","true");document.getElementById("qExportAddresses").setAttribute("style","pointer-events: none;");return true;},success:function(data){data=$Quivers.Utilities.FormatResult(data);window.location.replace("https://"+window[data.Result.Marketplace].Host+"/"+data.Result.Data.Filepath);},error:function(xhr){data=$Quivers.Utilities.FormatResult(xhr);},complete:function(){document.getElementById("qExportAddresses").setAttribute("working","false");document.getElementById("qExportAddresses").removeAttribute("disabled");document.getElementById("qExportAddresses").setAttribute("style","");}} $Quivers.Translation={Start:function(){var hc=window[this.MarketplaceId];var setupGoogTransEventListener=function(){if($jquivers('.goog-te-combo').length>0){$jquivers('.goog-te-combo').on("change",function(){$Quivers.Utilities.Debug("Detecting a change in Language...");var language=this.options[this.selectedIndex].value;if(language!="") hc.Translation.SetLanguage(language,false);});} if($jquivers('#qHoverCartLanguageSelector').length>0){$jquivers('#qHoverCartLanguageSelector').on("change",function(){$Quivers.Utilities.Debug("Detecting a change in Language...");var language=this.options[this.selectedIndex].value;if(language!="") hc.Translation.SetLanguage(language);});}} if(typeof google==="undefined"||typeof google.translate==='undefined'){$jquivers.getScript("//translate.google.com/translate_a/element.js",function(){if(typeof hc.Settings.Translation.DisplayElement=="undefined"||hc.Settings.Translation.DisplayElement=="") var displayElement="google_translate_element";else var displayElement=hc.Settings.Translation.DisplayElement;if(!document.getElementById(displayElement)){var gt=document.createElement("div");gt.id=displayElement;if(hc.Settings.Translation.DisplayType!="Widget"){gt.setAttribute("style","display: none !important;");gt.className="hidden";} document.body.appendChild(gt);} if(hc.Settings.Translation.TranslateEverything==false){document.body.className+=" notranslate";} var googTransCheck=setInterval(function(){if(typeof google.translate.TranslateElement=="function"){$Quivers.Utilities.Debug("Initiating HC Google Translate.");var options={includedLanguages:hc.Settings.Translation.SupportedLanguages,layout:1,};if(hc.Settings.Translation.DisplayType=="HoverCart") options.autoDisplay=false;new google.translate.TranslateElement(options,displayElement);setupGoogTransEventListener();clearInterval(googTransCheck);setTimeout(function(){hc.Translation.SwapCustomTerms();},1000);}},100);})} else{console.warn("Translation is enabled on this HoverCart, however this website already uses Google Translate. HoverCart specific Google Translate settings will not take effect.");setupGoogTransEventListener();}},GetCurrentLanguage:function(){var hc=window[this.MarketplaceId];if(hc.Settings.Translation.Enabled==false){return"en";} else{var googtrans=$Quivers.Utilities.GetCookie("googtrans");if(googtrans!=null) googtrans=googtrans.replace("/en/","").replace("/auto/","");if(typeof hc.Settings.Translation.LanguageCookie=="undefined"||hc.Settings.Translation.LanguageCookie==null||hc.Settings.Translation.LanguageCookie=="") var currentLang=googtrans;else var currentLang=$Quivers.Utilities.GetCookie(hc.Settings.Translation.LanguageCookie);if(currentLang==null) return googtrans;else return currentLang;}},SetLanguage:function(language,changeSelector){$Quivers.Utilities.Debug("Attempting to set language to '"+language+"'!");var hc=window[this.MarketplaceId];try{hc.Translation.ReverseSwappedTerms();} catch(err){} if(typeof changeSelector=="undefined"||changeSelector==true){var selectors=$jquivers('.goog-te-combo');if(selectors.length>0){if(selectors[0].selectedIndex==-1||selectors[0].options[selectors[0].selectedIndex].value!==language){for(var k=0;selectors[0].options.length;k++){if(typeof selectors[0].options[k]!=="undefined"&&language==selectors[0].options[k].value){selectors[0].selectedIndex=k;selectors[0].click();selectors[0].options[k].click();$Quivers.Utilities.CreateCookie("googtrans","/en/"+language.replace("/en/","").replace("/auto/",""));break;}}}} setTimeout(function(){hc.Translation.SwapCustomTerms();},500);} var s=document.getElementById("qHoverCartLanguageSelector");if(s){for(var i=0;i "+(langs[k].innerText==fullLang));if(langs[k].innerText==fullLang){langs[k].click();break;}}} break;}}} $Quivers.Utilities.CreateCookie("googtrans","/en/"+language.replace("/en/","").replace("/auto/",""));if(typeof hc.Settings.Translation.LanguageCookie!=="undefined"&&hc.Settings.Translation.LanguageCookie!="googtrans"&&hc.Settings.Translation.LanguageCookie!=null){$Quivers.Utilities.CreateCookie(hc.Settings.Translation.LanguageCookie,language.replace("/en/","").replace("/auto/",""));} window.location.reload();},ToggleAddRule:function(language){var row=document.getElementById("qCustomTermsCreateRule-"+language);var button=document.getElementById("qAddRule-"+language);var numberOfRows=document.getElementById("qRules-"+language).children.length;if(row){if(row.className=="hidden"){row.className="info";button.className="qWidgetButton hidden";document.getElementById("qRulesTable-"+language).className="table table-responsive";document.getElementById("qSubmitArea-"+language).className="qSubmitArea visible";document.getElementById("qCreateRule-"+language).value="true";} else{row.className="hidden";button.className="qWidgetButton visible";if(numberOfRows==2){document.getElementById("qRulesTable-"+language).className="table table-responsive hidden";document.getElementById("qSubmitArea-"+language).className="qSubmitArea hidden";} document.getElementById("qCreateRule-"+language).value="false";}} var alert=document.getElementById('qNoRulesAlert-'+language);if(alert){if(alert.className=="qNoRulesAlert alert alert-warning visible") alert.className="qNoRulesAlert alert alert-warning hidden";else if(numberOfRows==2) alert.className="qNoRulesAlert alert alert-warning visible";}},DeleteRule:function(id,language){var rows=$Quivers.Dom.Get('[data-language="'+language+'"][data-rule="'+id+'"]');for(var i=0;i3&&rules[i].OriginalText!=" "){if(rules[i].Context=="Global"||rules[i].Context==hc.CurrentView){if(typeof node==="undefined") var quiversElements=$Quivers.Dom.Get('[quivers-bootstrap="true"]');else var quiversElements=[node];for(var j=0;j0){if(node.data.indexOf(rules[i].OriginalText)!==-1){node.data=node.data.replace(rules[i].OriginalText,rules[i].ReplacementText);node.parentNode.setAttribute('data-termswapped','true');hc.Translation.SwappedTerms.push({Node:node,Type:"data",Language:language,OriginalText:rules[i].OriginalText,ReplacementText:rules[i].ReplacementText});}}}} if(typeof node.hasAttribute!=="undefined"&&node.hasAttribute("title")==true){if(node.getAttribute("title").indexOf(rules[i].OriginalText)!==-1){var titleText=node.getAttribute("title");titleText=titleText.replace(rules[i].OriginalText,rules[i].ReplacementText);node.setAttribute("title",titleText);node.setAttribute("data-termswapped","true");hc.Translation.SwappedTerms.push({Node:node,Type:"title",Language:language,OriginalText:rules[i].OriginalText,ReplacementText:rules[i].ReplacementText});}}});}}}}} if(typeof text!=="undefined") return text;else return true;},ReverseSwappedTerms:function(){var hc=window[this.MarketplaceId];for(var i=0;i"+data.Result.Data.LanguageFullname+'';document.getElementById("qLanguageTabs").appendChild(tab);var tabs=$Quivers.Dom.Get('.tab[role="CustomTermsLanguage"]');for(var i=0;i"+data.Result.Data.LanguageFullname+"'!");} else{var button=document.getElementById("qSubmitArea-"+data.Result.Data.Language).children[0];button.setAttribute("working","false");button.removeAttribute("disabled");document.getElementById("qLanguageForm-"+data.Result.Data.Language).innerHTML=data.Result.Html;$Quivers.Dom.CreateAlert("qLanguageCustomTerms-"+data.Result.Data.Language+"Alerts","success","Successfully updated Custom Term Rules!");$Quivers.Dom.CreateAlert("qCustomTermsAlerts","warning","Notice: You will need to refresh your browser page in order to see the latest changes.");}},error:function(xhr){data=$Quivers.Utilities.FormatResult(xhr);var button=document.getElementById("qSubmitArea-"+data.Result.Data.Language).children[0];button.setAttribute("working","false");button.removeAttribute("disabled");$Quivers.Dom.CreateAlert("qLanguageCustomTerms-"+data.Result.Data.Language+"Alerts","danger",data.Result.Html);}} $Quivers.Utilities={CreateGuid:function(){var d=new Date().getTime();var guid='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(c){var r=(d+Math.random()*16)%16|0;d=Math.floor(d/16);return(c=='x'?r:(r&0x3|0x8)).toString(16);});return guid;},CreateCookie:function(cookie,value,expiresInDays){if(typeof expiresInDays=="undefined") var expiresInDays="Fri, 31 Dec 9999 23:59:59 GMT";else{var d=new Date();d.setTime(d.getTime()+(expiresInDays*24*60*60*1000));expiresInDays=d.toGMTString();} document.cookie=cookie+"="+value+"; expires="+expiresInDays+"; path=/";return value;},GetCookie:function(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i0);return str;},PrintElement:function(element,title=null){if(typeof element=="string") element=document.getElementById(element);var content=element.innerHTML;var print_window=window.open('','','height=600, width=800');print_window.document.write(''+content+'');if(title) print_window.document.title=title;print_window.addEventListener("afterprint",function(event){print_window.close();});print_window.document.close();print_window.print();},Debug:function(thing){if($Quivers.DEBUG===true){console.log(thing);} return null;}} $Quivers.View=function(view,updateUrl){var view=view.charAt(0).toUpperCase()+view.slice(1);var whitelist=['ForgotPassword',"UpdatePassword","Register","Guest"];if(whitelist.indexOf(view)>-1){var module="&Module="+view;view="Login";updateUrl=false;} else if(view=="Orders"){var module="&Module="+view;view="Account";updateUrl=false;} else var module="";var page=this.Settings.Pages[view];if(typeof updateUrl=="undefined") updateUrl=true;$Quivers.Dom.CloseDialog();var zooms=document.getElementsByClassName("zoomContainer");for(var i=0;i "+url);window.history.replaceState(url,title,url);}} else{hc.LastURI=window.location.search;if(url.indexOf("?"+hc.Settings.QueryTokens["ProductShort"]+"=")>-1||(hc.GetModuleQuery()===""&&$Quivers.Utilities.GetQuery(hc.Settings.QueryTokens["Default"])==="")){if(pushState===true||typeof pushState=="undefined"){$Quivers.Utilities.Debug("window.history.replaceState() -> "+url+" ("+title+")");window.history.replaceState(url,title,url);}} else if(pushState===true||typeof pushState=="undefined"){$Quivers.Utilities.Debug("window.history.pushState() -> "+url+" ("+title+")");window.history.pushState(url,title,url);}}}} $Quivers.SupportArticle=function(article){var articles=$Quivers.Dom.Get("[data-qSupportArticle]");if(typeof article!="undefined"){var found=false;for(var i=0;i