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<addressBlocks.length;i++){if(typeof addressBlocks[i]!=="function"){if(addressBlocks[i].getAttribute("data-context")==context){if(addressBlocks[i].getAttribute("data-address")==addressId&&addressBlocks[i].className!="qAddressBlock active"){addressBlocks[i].className="qAddressBlock active";if(context=="Shipping")
window[this.MarketplaceId].Checkout.SelectShippingAddress(addressId);else if(context=="Billing")
window[this.MarketplaceId].Checkout.SelectBillingAddress(addressId);}
else if(addressBlocks[i].className=="qAddressBlock active"){addressBlocks[i].className="qAddressBlock";if(context=="Shipping")
window[this.MarketplaceId].Checkout.SelectShippingAddress(null);else if(context=="Billing")
window[this.MarketplaceId].Checkout.SelectBillingAddress(null);}
else
addressBlocks[i].className="qAddressBlock";}}}}
if($jquivers('.qAddressBlock.active').length==0&&document.getElementById("qNewAddressButton"))
window[this.MarketplaceId].Addresses.Details("New");},Delete:function(addressId){var elements=$jquivers("#q-address-"+addressId)[0];var context="";for(var i=0;i<elements.length;i++){if(typeof elements[i]!=="function"){if(elements[i].getAttribute("name")=="Context"){context=elements[i].value;}}}
var btns=$Quivers.Dom.Get('[data-delete-address="'+addressId+'"]');for(var i in btns){if(typeof btns[i]!=="function"){btns[i].setAttribute("working","true");btns[i].setAttribute("disabled","true");}}
window[this.MarketplaceId].Post("user/deleteAddress",{AddressId:addressId,Context:context},function(data){data=$Quivers.Utilities.FormatResult(data);if(data.ResponseCode<300){var element=document.getElementById('qAddresses-Panel');element.innerHTML=data.Result.Html;}
else{$Quivers.Dom.CreateAlert("qaddress-"+data.Result.Data.AddressId+"Alerts","danger",data.Result.Html);}
$Quivers.Dom.CloseDialog();for(var i in btns){if(typeof btns[i]!=="function"){btns[i].setAttribute("working","false");btns[i].removeAttribute("disabled");}}});}};$Quivers["/api/v1/user/createAddress"]={beforeSend:function(xhr,curl){if(typeof curl!="undefined")
var data=JSON.parse(curl.data);else
var data=xhr.Data;var btns=$Quivers.Dom.Get('[data-create-address]');for(var i in btns){if(typeof btns[i]!=="function"){btns[i].setAttribute("working","true");btns[i].setAttribute("disabled","true");}}
return true;},success:function(data){data=$Quivers.Utilities.FormatResult(data);$Quivers.Dom.CloseDialog();if(data.Result.Data.Context=="Shipping"){var element=document.getElementById('qAddresses-Panel');if(element){element.innerHTML=data.Result.Html;var btns=$Quivers.Dom.Get('[data-create-address]');for(var i in btns){if(typeof btns[i]!=="function"){btns[i].setAttribute("working","false");btns[i].removeAttribute("disabled");}}}
$Quivers.Dom.LevelElements("qHeightRow");}
if(data.Result.Data.Context=="Shipping")
window[data.Result.Marketplace].Addresses.Pick(data.Result.Data.AddressInfo.Id,data.Result.Data.Context);else if(data.Result.Data.Context=="Billing")
window[data.Result.Marketplace].Checkout.SelectBillingAddress(data.Result.Data.AddressInfo.Id);},error:function(xhr){data=$Quivers.Utilities.FormatResult(xhr);$Quivers.Dom.CloseDialog();var btns=$Quivers.Dom.Get('[data-create-address]');for(var i in btns){if(typeof btns[i]!=="function"){btns[i].setAttribute("working","false");btns[i].removeAttribute("disabled");}}
$Quivers.Dom.CreateAlert("qcreateAddressAlerts","danger",data.Result.Html);}}
$Quivers["/api/v1/user/updateAddress"]={beforeSend:function(xhr,curl){if(typeof curl!="undefined")
var data=JSON.parse(curl.data);else
var data=xhr.Data;var btns=$Quivers.Dom.Get('[data-update-address="'+data.Id+'"]');for(var i in btns){if(typeof btns[i]!=="function"){btns[i].setAttribute("working","true");btns[i].setAttribute("disabled","true");}}
return true;},success:function(data){data=$Quivers.Utilities.FormatResult(data);$Quivers.Dom.CloseDialog();if(data.Result.Data.Context=="Shipping"){var element=document.getElementById('qAddresses-Panel');if(element){element.innerHTML=data.Result.Html;}
$Quivers.Dom.LevelElements("qHeightRow");}
if(data.Result.Data.Context=="Shipping"){if(window[data.Result.Marketplace].Checkout.ShippingAddress==null||window[data.Result.Marketplace].Checkout.ShippingAddress.Id!=data.Result.Data.Id)
window[data.Result.Marketplace].Addresses.Pick(data.Result.Data.Id,data.Result.Data.Context);else
window[data.Result.Marketplace].Checkout.SelectShippingAddress(data.Result.Data.Id);}
else if(data.Result.Data.Context=="Billing")
window[data.Result.Marketplace].Checkout.SelectBillingAddress(data.Result.Data.Id);},error:function(xhr){data=$Quivers.Utilities.FormatResult(xhr);$Quivers.Dom.CloseDialog();var btns=$Quivers.Dom.Get('[data-update-address="'+data.Result.Data.Id+'"]');for(var i in btns){if(typeof btns[i]!=="function"){btns[i].setAttribute("working","false");btns[i].removeAttribute("disabled");}}
$Quivers.Dom.CreateAlert("qaddress-"+data.Result.Data.Id+"Alerts","danger",data.Result.Html);}}
$Quivers["/api/v1/user/setAddress"]={beforeSend:function(xhr,curl){if(typeof curl!="undefined")
var data=JSON.parse(curl.data);else
var data=xhr.Data;var btns=$Quivers.Dom.Get('[data-set-address]');for(var i in btns){if(typeof btns[i]!=="function"){btns[i].setAttribute("working","true");btns[i].setAttribute("disabled","true");}}
return true;},success:function(data){data=$Quivers.Utilities.FormatResult(data);var element=document.getElementById('qAddresses-Panel');if(element){element.innerHTML=data.Result.Data.SaveAddressOp.Html;}
if(data.Result.Data.SetAddressOp.Data!==null)
window[data.Result.Marketplace].Checkout.SetShippingAddress({Result:data.Result.Data.SetAddressOp});else{window[data.Result.Marketplace].Checkout.NextState();}},error:function(xhr){data=$Quivers.Utilities.FormatResult(xhr);var btns=$Quivers.Dom.Get('[data-set-address]');for(var i in btns){if(typeof btns[i]!=="function"){btns[i].setAttribute("working","false");btns[i].removeAttribute("disabled");}}
if(typeof data.Result.Data.SaveAddressOp.Error!=="undefined"){$Quivers.Dom.TriggerError("Invalid Postal Code",data.Result.Data.SaveAddressOp.Html);var inputs=$Quivers.Dom.Get('[data-inputs="setAddress-ZipPostalCode"]');for(var i=0;i<inputs.length;i++){inputs[i].className="form-group has-error";inputs[i].focus();}
return false;}
var op=data.Result.Data.SetAddressOp;if(op.Data.HasAvailableItems==false){window[data.Result.Marketplace].Checkout.ShippingAddress=null;}
if(op.Data.Address.StateProvince!="Other")
var msg=window[data.Result.Marketplace].$("CantShipToMessage1","checkout")+op.Data.Address.StateProvince+", "+op.Data.Address.Country+window[data.Result.Marketplace].$("CantShipToMessage2","checkout");else
var msg=window[data.Result.Marketplace].$("CantShipToMessage1","checkout")+op.Data.Address.Country+window[data.Result.Marketplace].$("CantShipToMessage2","checkout");$Quivers.Dom.TriggerError("Invalid Shipping Address",msg);document.getElementById("qAddressUI").setAttribute("data-validation","bad");}}
QuiversAddressForm=function(client,context,isDialog,addressId){this.Client=client;this.AutoComplete=null;this.GoogleLoaded=false;var self=this;if(typeof Quivers.AddressDialog=="undefined")
Quivers.AddressDialog=self;if(typeof isDialog=="undefined")
var isDialog=true;var createPicker=function(){this.GoogleLoaded=true;}
var initiateGoogle=function(){var isGooglePlacesLoaded=setInterval(function(){if(self.GoogleLoaded==true){clearInterval(isGooglePlacesLoaded);self.InputElement=document.getElementById("qGooglePlacesAddressPicker"+(isDialog==true?"Dialog":""));self.GooglePlaceSearch();}},300)}
if(isDialog==false){self.FormElement="setAddress"
initiateGoogle();}
else{if(typeof addressId!=="undefined"&&addressId!==null)
var url="module?Module=addressDialog&Context="+context+"&Address="+addressId;else
var url="module?Module=addressDialog&Context="+context;self.Client.Get(url,function(data){data=$Quivers.Utilities.FormatResult(data);$Quivers.Dom.TriggerDialog(data.Result.Data.Title,data.Result.Html,"large");self.FormElement=data.Result.Data.Form;initiateGoogle();});}
if(typeof google!="undefined"&&(typeof google.maps=="undefined"||typeof google.maps.places=="undefined")){$jquivers.getScript("https://www.google.com/jsapi",function(){try{google.load('maps','3',{other_params:['libraries=places&key='+self.Client.GooglePlaces],callback:function(){self.GoogleLoaded=true;}});}
catch(err){console.warn(err);}});}
else{try{if(typeof google.maps.places=="undefined")
$jquivers.getScript("https://maps.googleapis.com/maps/api/js?libraries=places&key="+self.Client.GooglePlaces,function(){self.GoogleLoaded=true;});else
self.GoogleLoaded=true;}
catch(err){$jquivers.getScript("https://maps.googleapis.com/maps/api/js?libraries=places&key="+self.Client.GooglePlaces,function(){self.GoogleLoaded=true;});}}}
QuiversAddressForm.prototype.GooglePlaceSearch=function(){var self=this;if(self.InputElement!==null){if(self.FormElement=="setAddress")
document.getElementById('qCheckoutShippingEmailAddress').focus();else
self.InputElement.focus();self.AutoComplete=new google.maps.places.Autocomplete(self.InputElement,{types:['geocode']});self.AutoComplete.addListener('place_changed',function(){var place=self.AutoComplete.getPlace();var inputs=$Quivers.Dom.Get('input[data-form="'+self.FormElement+'"]');var selects=$Quivers.Dom.Get('select[data-form="'+self.FormElement+'"]');if(typeof place.address_components!=="undefined"){for(var i=0;i<inputs.length;i++){try{switch(inputs[i].name){case"Address1":inputs[i].value=place.name.toUpperCase();break;case"Address2":inputs[i].value="";break;case"City":inputs[i].value=place.vicinity.toUpperCase();break;case"ZipPostalCode":{for(var c=0;c<place.address_components.length;c++){if(place.address_components[c].types.indexOf("postal_code")>-1)
inputs[i].value=place.address_components[c].long_name;}
break;}}}
catch(err){console.warn(err);}}
for(var s=0;s<selects.length;s++){switch(selects[s].name){case"CountryId":{try{for(var c=0;c<place.address_components.length;c++){if(place.address_components[c].types.indexOf("country")>-1){for(var o=0;o<selects[s].options.length;o++){if(selects[s].options[o].innerHTML==place.address_components[c].long_name||selects[s].options[o].getAttribute("data-abrv")==place.address_components[c].short_name){selects[s].selectedIndex=o;var countrySelect=selects[s];$Quivers.Dom.ToggleStates(selects[s].getAttribute("data-id"),{target:selects[s]});}}}}}
catch(err){console.warn(err);}
break;}
case"PhonePrefix":{try{for(var c=0;c<place.address_components.length;c++){if(place.address_components[c].types.indexOf("country")>-1){for(var o=0;o<selects[s].options.length;o++){var callingCodeCountries=selects[s].options[o].getAttribute("data-countries").split(",");if(callingCodeCountries.indexOf(place.address_components[c].short_name)>-1){selects[s].selectedIndex=o;}}}}}
catch(err){console.warn(err);}
break;}
case"StateProvinceId":{try{for(var c=0;c<place.address_components.length;c++){for(var t=0;t<place.address_components[c].types.length;t++){if(place.address_components[c].types[t].indexOf("administrative_area_level")>-1){for(var o=0;o<selects[s].options.length;o++){if(selects[s].options[o].innerHTML.indexOf(place.address_components[c].long_name)>-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;i<inputs.length;i++){inputs[i].addEventListener('change',function(){self.Validate(self.FormElement);});}
for(var s=0;s<selects.length;s++){selects[s].addEventListener('change',function(){self.Validate(self.FormElement);});}
var zipCodes=$Quivers.Dom.Get('input[name="ZipPostalCode"][data-form="'+self.FormElement+'"]');for(var i=0;i<zipCodes.length;i++){zipCodes[i].addEventListener("keypress",function(evt){var countrySelect=$Quivers.Dom.Get('select[name="CountryId"][data-form="'+evt.target.getAttribute("data-form")+'"]')[0];if(countrySelect.options[countrySelect.selectedIndex].value==1){var charCode=(evt.which)?evt.which:event.keyCode;if(charCode!=46&&charCode!=45&&charCode>31&&(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<inputs.length;i++){if(inputs[i].getAttribute('data-required')=="true"&&inputs[i].value==""||(inputs[i].type=="email"&&inputs[i].value.indexOf("@")==-1)||(inputs[i].name=="PhoneBody"&&inputs[i].value.length<7)||(inputs[i].type=="checkbox"&&inputs[i].checked==false)){var className="form-group has-error";if(focused==false){inputs[i].focus();focused=true;}
validated=false;}
else
var className="form-group has-success";for(var g=0;g<formGroups.length;g++){if(formGroups[g].getAttribute('data-inputs').indexOf(form+"-"+inputs[i].name)>-1){formGroups[g].className=className;}}}
for(var i=0;i<selects.length;i++){if(selects[i].getAttribute('data-required')=="true"&&selects[i].options[selects[i].selectedIndex].value=="RESELECT"){var className="form-group has-error";if(focused==false){selects[i].focus();focused=true;}
validated=false;}
else
var className="form-group has-success";for(var g=0;g<formGroups.length;g++){if(formGroups[g].getAttribute('data-inputs').indexOf(form+"-"+selects[i].name)>-1)
formGroups[g].className=className;}}
return validated;}
$Quivers.Analytics={AccountCodes:{},Trackers:[]};$Quivers.Analytics.Initialize=function(trackingCodes){var self=this;for(var i=0;i<trackingCodes.length;i++){if(typeof trackingCodes[i]!=="function"){self.AccountCodes["Account"+i]=trackingCodes[i];self.Trackers.push("Account"+i);}}
if(typeof ga=="undefined"){(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');}
if(typeof ga!=='undefined'){for(var i in self.AccountCodes){if(self.AccountCodes[i]!=null){$Quivers.Utilities.Debug("Adding GA Account '"+self.AccountCodes[i]+"'.");ga('create',self.AccountCodes[i],'auto',{name:i});ga(i+'.set','dimension1',self.MarketplaceId);ga(i+'.set','dimension2',(window[self.MarketplaceId].IsPublic?"Public":"Private"));ga(i+'.set','dimension3',window[self.MarketplaceId].MarketplaceOwnerRefId);ga(i+'.set','forceSSL',true);ga(i+'.set','hostname',location.host);ga(i+'.set','page',window.location.pathname+$Quivers.Utilities.RemoveEmailsFromString(window.location.search));ga(i+'.set','location',$Quivers.Utilities.RemoveEmailsFromString(window.location.href));ga(i+'.require','ec');ga(i+'.set','currencyCode',window[self.MarketplaceId].Currency);ga(i+'.send');}}}
else
$Quivers.Utilities.Debug("Error creating GA Tracker.");}
$Quivers.Analytics.Send=function(action,msg,extra){if(typeof ga!=='undefined'){for(var i=0;i<this.Trackers.length;i++){if(i==0){}
if(typeof extra=="undefined")
ga(this.Trackers[i]+"."+action,msg);else
ga(this.Trackers[i]+"."+action,msg,extra);}}
else
console.warn("Failed to commit page view; Google Analytics was not yet ready.");}
$Quivers.Analytics.SetPage=function(page,title,thenCommit){var titleName=title;var search=window.location.search;var href=window.location.href;search=$Quivers.Utilities.RemoveEmailsFromString(search);href=$Quivers.Utilities.RemoveEmailsFromString(href);window[this.MarketplaceId].Analytics.Send('set',{'page':window.location.pathname+search,'title':titleName,'location':href});if(typeof thenCommit!=="undefined"&&thenCommit===true)
window[this.MarketplaceId].Analytics.CommitPageView();}
$Quivers.Analytics.CommitPageView=function(){window[this.MarketplaceId].Analytics.Send("send","pageview")}
$Quivers.Analytics.ImpressionHit=function(data,type,thenCommit){for(var i=0;i<data.length;i++){window[this.MarketplaceId].Analytics.Send("ec:addImpression",{id:data.Products[i].Id,name:data.Products[i].Name,category:data.Container.Name,brand:data.Products[i].BrandName,list:type,position:i+1,});}
if(typeof thenCommit!=="undefined"&&thenCommit==true){window[this.MarketplaceId].Analytics.Send('ec:setAction','click',{list:type});}}
$Quivers.Analytics.ProductHit=function(data,viewType,commitType){switch(viewType){case"Standard":{if(typeof data.Product!=="undefined"&&data.Product!==false){var productHit={id:data.Product.Id,name:data.Product.Name,brand:data.Product.BrandName,variant:data.Product.SelectedVariant.Name,currency:window[this.MarketplaceId].Currency};}
break;}
case"CartItem":{if(typeof data.CartItem!=="undefined"&&data.CartItem!==false){var productHit={id:data.CartItem.ProductId,name:data.CartItem.ProductName,brand:data.BrandName,variant:data.CartItem.ProductVariantName,price:data.CartItem.UnitPrice,quantity:data.QuantityAdded,currency:window[this.MarketplaceId].Currency};}
break;}
case"OPV":{try{var productHit={id:data.ProductId,name:data.ProductName,sku:data.ProductVariantName,brand:data.ManufacturerName,price:data.UnitPrice.toString(),quantity:data.Quantity.toString(),currency:window[this.MarketplaceId].Currency};}
catch(err){console.warn(err);var productHit={};}
break;}}
window[this.MarketplaceId].Analytics.Send("ec:addProduct",productHit);if(typeof commitType!=="undefined"){window[this.MarketplaceId].Analytics.Send('ec:setAction',commitType,productHit);}}
$Quivers.Analytics.SearchEvent=function(query,numProducts){var self=this;self.Send("send",{hitType:'event',eventCategory:'Catalog',eventAction:'Search',eventLabel:query,eventValue:numProducts});}
$Quivers.Analytics.CheckoutStep=function(step,option){switch(step){case 1:var page="ShoppingCart";break;case 2:var page="CustomerInfo";break;case 3:var page="ShippingMethod";break;case 4:var page="PaymentMethod";break;}
this.SetPage("Checkout/"+page,"Checkout/"+page);var send={'step':step};if(typeof option!=="undefined")
send.option=option;this.Send('ec:setAction','checkout',{'step':step});if(typeof ga!=='undefined'){for(var i=0;i<this.Trackers.length;i++){ga(this.Trackers[i]+"."+'send','event','Checkout','Option');}
if(step!==1)
this.CommitPageView();$Quivers.Utilities.Debug("Submitted GA Checkout Step "+step+" => "+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<order.OrderProductVariants.length;i++){var match=false;for(var k=0;k<opvs;k++){if(btoa(order.OrderProductVariants[i].ProductVariantName+JSON.stringify(order.OrderProductVariants[i].SelectedProductOptions))==opvs[k].uniq){match=true;opvs[k].Quantity++;}}
if(match==false){order.OrderProductVariants[i].uniq=btoa(order.OrderProductVariants[i].ProductVariantName+JSON.stringify(order.OrderProductVariants[i].SelectedProductOptions));opvs.push(order.OrderProductVariants[i]);}}
for(var i=0;i<opvs.length;i++){this.ProductHit(opvs[i],"OPV");}
this.Send('ec:setAction','purchase',{id:order.OrderRefId,affiliation:order.BrandName,revenue:order.OrderTotal.toString(),tax:order.OrderTax.toString(),shipping:order.ShippingFee.toString(),currency:window[this.MarketplaceId].Currency});this.CommitPageView();try{if(window[this.MarketplaceId].Settings.Checkout.AdwordsConversionId&&window[this.MarketplaceId].Settings.Checkout.AdwordsConversionLabel){var google_conversion_id=window[this.MarketplaceId].Settings.Checkout.AdwordsConversionId;var google_conversion_language="en";var google_conversion_format="3";var google_conversion_color="ffffff";var google_conversion_label=window[this.MarketplaceId].Settings.Checkout.AdwordsConversionLabel;var google_remarketing_only=false;$jquivers.getScript('//www.googleadservices.com/pagead/conversion.js');var pixel=document.createElement('noscript');pixel.innerHTML='<div style="inline-block;"><img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/'+google_conversion_id+'/?label='+google_conversion_label+'&guid=ON&script=0"/></div>';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;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='<style type="text/css">';utf8fix+="#currentView .qProductsUI .qProductDetails .qProductOverview .qShortDescription:before, [quivers-view=\"true\"] .qProductsUI .qProductDetails .qProductOverview .qShortDescription:before {content: '\"';}";utf8fix+="#currentView .qProductsUI .qProductDetails .qProductOverview .qShortDescription:before, [quivers-view=\"true\"] .qProductsUI .qProductDetails .qProductOverview .qShortDescription:after {content: '\"';}";utf8fix+='</style>';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='<style type="text/css">body[data-quivers="true"] {width: inherit;}</style>';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();}},error:function(data){$Quivers.Utilities.Debug(data);}}
$Quivers["/api/v1/view"]={success:function(data){data=$Quivers.Utilities.FormatResult(data);var view=window[data.Result.Marketplace].Settings.Pages[data.Result.Data.Name];var element=document.getElementById(view.DisplayElement);if(!element||element==null)
element=document.getElementById(window[data.Result.Marketplace].Settings.General.DefaultDisplay);if(!element)
element=document.getElementById("currentView");if(element.id!="currentView")
element.setAttribute("quivers-view","true");element.setAttribute("quivers-bootstrap","true");element.setAttribute("data-view",view.NavButton);element.setAttribute("loading","false");window[data.Result.Marketplace].Dom.ReplaceHtml(element,data.Result.Html);if(element.className.indexOf(" translate")==-1)
element.className+=" translate";document.getElementById(window[data.Result.Marketplace].Settings.Ribbon.DisplayElement).setAttribute("data-view",view.NavButton);window[data.Result.Marketplace].CurrentView=view.Name;if(view.Name=="Cart"){window[data.Result.Marketplace].Analytics.CheckoutStep(1);}
else if(view.Name=="Checkout"){window[data.Result.Marketplace].Checkout=new QuiversCheckout(window[data.Result.Marketplace],data.Result.Data.UserAuthStatus,data.Result.Data.Cart);}
if(view.Name=="Cart"||view.Name=="Checkout"){window[data.Result.Marketplace].Criteo.ViewCart(data.Result.Data.Cart);}
if(view.Name!=="Checkout"){try{window[data.Result.Marketplace].Checkout.TeardownBraintree();delete window[data.Result.Marketplace].Checkout;}
catch(err){}
try{window[data.Result.Marketplace].Checkout.TeardownBluesnap();delete window[data.Result.Marketplace].Checkout;}
catch(err){}}
var email=$Quivers.Utilities.GetQuery("email");if(email!=false)
email="&Email="+email;else
email="";var select=window[data.Result.Marketplace].GetModuleQuery();var zooms=document.getElementsByClassName("zoomContainer");for(var i=0;i<zooms.length;i++){if(typeof zooms[i]!=="function")
zooms[i].parentNode.removeChild(zooms[i]);}
if($Quivers.Utilities.GetBrowser().name=="IE"||$Quivers.Utilities.GetBrowser().name=="Edge"){var ieScrollHeightBugFix=$Quivers.Dom.Get(".view-body");if(ieScrollHeightBugFix.length>0){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 modules=document.getElementsByClassName("qModule");if(modules.length==0)
window[data.Result.Marketplace].Analytics.CommitPageView();for(var i=0;i<modules.length;i++){if(typeof modules[i]!=="function"){if(modules[i].id=="productsView"&&document.getElementById(window[data.Result.Marketplace].Settings.Ribbon.DisplayElement).getAttribute("data-context")=="buyProduct"&&view.NavButton!="buyProduct")
$Quivers.Utilities.Debug("Not updating the Products View Module.");else{if(select==""||!modules[i].hasAttribute("data-select")){if(!modules[i].hasAttribute('data-select')||modules[i].getAttribute("data-select")!="false"){if(modules[i].id.indexOf("productPurchaseButtons-")>-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;window[data.Result.Marketplace].Get("module?Module="+mod+select+email);}}
else{window[data.Result.Marketplace].SelectViewFromUrl();}}}}
$Quivers.Dom.Listeners();},error:function(data){var navs=document.getElementsByClassName("qIcon");for(var i=0;i<navs.length;i++){if(typeof navs[i]!=="function")
navs[i].setAttribute("data-active","false");}
document.getElementById(window[data.responseJSON.Result.Marketplace].Settings.General.DefaultDisplay).innerHTML=data.responseJSON.Result.Html;}}
$Quivers["/api/v1/module"]={beforeSend:function(data,curl){if(typeof curl!="undefined")
var uri=curl.url;else
var uri=data.Resource;if(uri.indexOf("Element")>-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;i<additionalElements.length;i++)
window[data.Result.Marketplace].Dom.ReplaceHtml(additionalElements[i],data.Result.Html);}}
if($Quivers.Utilities.GetBrowser().name=="IE"||$Quivers.Utilities.GetBrowser().name=="Edge"){var ieScrollHeightBugFix=$Quivers.Dom.Get(".view-body");if(ieScrollHeightBugFix.length>0){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();},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<forms.length;f++){var button=document.getElementById(forms[f].getAttribute("data-form")+"-Submit");button.setAttribute("working","false");button.removeAttribute("disabled");$Quivers.Dom.CreateAlert($Quivers.Dom.Get('[data-form-alerts="'+forms[f].getAttribute("data-form")+'"]')[0].id,alertType,data.Result.Html);forms[f].reset();}},error:function(xhr){data=$Quivers.Utilities.FormatResult(xhr);var form=$Quivers.Dom.Get('[data-api="'+data.Result.Data.Form+'"]')[0];var button=document.getElementById(form.getAttribute("data-form")+"-Submit");button.setAttribute("working","false");button.removeAttribute("disabled");$Quivers.Dom.CreateAlert($Quivers.Dom.Get('[data-form-alerts="'+form.getAttribute("data-form")+'"]')[0].id,"danger",data.Result.Html);form.reset();}}
$Quivers['/api/v1/mailSupport']=$Quivers.SimpleFormCallback;$Quivers["/api/v1/user/login"]={beforeSend:function(xhr,curl){var form=$Quivers.Dom.Get('[data-api="user/login"]')[0];var button=document.getElementById(form.getAttribute("data-form")+"-Submit");button.setAttribute("disabled","true");button.setAttribute("working","true");return true;},success:function(data){data=$Quivers.Utilities.FormatResult(data);var form=$Quivers.Dom.Get('[data-api="user/login"]')[0];var button=document.getElementById(form.getAttribute("data-form")+"-Submit");button.setAttribute("working","false");$Quivers.Dom.CreateAlert($Quivers.Dom.Get('[data-form-alerts="'+form.getAttribute("data-form")+'"]')[0].id,"success",data.Result.Html);if(data.Result.Data.UseMarketplace!=data.Result.Marketplace){$Quivers.Utilities.CreateCookie("Marketplace",data.Result.Data.UseMarketplace,1);Quivers=new HoverCart(data.Result.Data.UseMarketplace,window[data.Result.Marketplace].Id,window[data.Result.Marketplace].PointOfSaleBusiness,window[data.Result.Marketplace].Environment);Quivers.Start();}
else{window[data.Result.Marketplace].Criteo.SetEmail(data.Result.Data.User.UserInfo.Email,data.Result.Data.Md5Email);window[data.Result.Marketplace].Get("ribbon",function(data){data=$Quivers.Utilities.FormatResult(data);window[data.Result.Marketplace].Catalog.Widgets();window[data.Result.Marketplace].Catalog.Assortments();if($Quivers.Utilities.GetQuery("ReturnUrl")!=="")
window.location=$Quivers.Utilities.GetQuery("ReturnUrl");else{if($Quivers.Utilities.GetQuery(window[data.Result.Marketplace].Settings.QueryTokens.Default).toLowerCase()!="login"){window[data.Result.Marketplace].SelectViewFromUrl();}
else{var url=Quivers.LastURI;if(url!=null&&url!=""&&typeof url!=="undefined"&&window.location.search!=url&&window[data.Result.Marketplace].GetUrlScheme("Default","Login")!=url){window.history.pushState(url,url,url);window[data.Result.Marketplace].SelectViewFromUrl();}
else{if(window[data.Result.Marketplace].Settings.General.LoginRedirectBehavior!=""&&window[data.Result.Marketplace].Settings.General.LoginRedirectBehavior!=null)
window[data.Result.Marketplace].View(window[data.Result.Marketplace].Settings.General.LoginRedirectBehavior);else if(window[data.Result.Marketplace].Settings.General.DefaultPage!=""&&window[data.Result.Marketplace].Settings.General.DefaultPage!=null)
window[data.Result.Marketplace].View(window[data.Result.Marketplace].Settings.General.DefaultPage);else if(window[data.Result.Marketplace].Settings.Pages.Products.Enabled==true)
window[data.Result.Marketplace].View("Products");}}}});}},error:function(xhr){data=$Quivers.Utilities.FormatResult(xhr);var form=$Quivers.Dom.Get('[data-api="user/login"]')[0];var button=document.getElementById(form.getAttribute("data-form")+"-Submit");button.setAttribute("working","false");button.removeAttribute("disabled");if(data.Result.Html=="Error: ")
data.Result.Html=window[data.Result.Marketplace].$("GenericError");$Quivers.Dom.CreateAlert($Quivers.Dom.Get('[data-form-alerts="'+form.getAttribute("data-form")+'"]')[0].id,"danger",data.Result.Html);}}
$Quivers["/api/v1/user/register"]={beforeSend:function(xhr,curl){var form=$Quivers.Dom.Get('[data-api="user/register"]')[0];var button=document.getElementById(form.getAttribute("data-form")+"-Submit");button.setAttribute("disabled","true");button.setAttribute("working","true");return true;},success:function(data){data=$Quivers.Utilities.FormatResult(data);var form=$Quivers.Dom.Get('[data-api="user/register"]')[0];var button=document.getElementById(form.getAttribute("data-form")+"-Submit");button.setAttribute("working","false");var alertType=data.Result.Data.RequiresVerification?"warning":"success";$Quivers.Dom.CreateAlert($Quivers.Dom.Get('[data-form-alerts="'+form.getAttribute("data-form")+'"]')[0].id,alertType,data.Result.Html);if(data.Result.Data.UseMarketplace!=data.Result.Marketplace){$Quivers.Utilities.CreateCookie("Marketplace",data.Result.Data.UseMarketplace,1);Quivers=new HoverCart(data.Result.Data.UseMarketplace,window[data.Result.Marketplace].Id,window[data.Result.Marketplace].PointOfSaleBusiness,window[data.Result.Marketplace].Environment);Quivers.Start();}
else{window[data.Result.Marketplace].Criteo.SetEmail(data.Result.Data.User.UserInfo.Email,data.Result.Data.Md5Email);window[data.Result.Marketplace].Get("ribbon",function(data){data=$Quivers.Utilities.FormatResult(data);window[data.Result.Marketplace].Catalog.Widgets();window[data.Result.Marketplace].Catalog.Assortments();if($Quivers.Utilities.GetQuery("ReturnUrl")!=="")
window.location=$Quivers.Utilities.GetQuery("ReturnUrl");else{if($Quivers.Utilities.GetQuery(window[data.Result.Marketplace].Settings.QueryTokens.Default).toLowerCase()!="login")
window[data.Result.Marketplace].SelectViewFromUrl();else{var url=Quivers.LastURI;if(url!=null&&url!=""&&typeof url!=="undefined"&&window.location.search!=url&&window[data.Result.Marketplace].GetUrlScheme("Default","Login")!=url){window.history.pushState(url,url,url);window[data.Result.Marketplace].SelectViewFromUrl();}
else{if(window[data.Result.Marketplace].Settings.General.LoginRedirectBehavior!=""&&window[data.Result.Marketplace].Settings.General.LoginRedirectBehavior!=null)
window[data.Result.Marketplace].View(window[data.Result.Marketplace].Settings.General.LoginRedirectBehavior);else if(window[data.Result.Marketplace].Settings.General.DefaultPage!=""&&window[data.Result.Marketplace].Settings.General.DefaultPage!=null)
window[data.Result.Marketplace].View(window[data.Result.Marketplace].Settings.General.DefaultPage);else if(window[data.Result.Marketplace].Settings.Pages.Products.Enabled==true)
window[data.Result.Marketplace].View("Products");}}}});}},error:function(xhr){data=$Quivers.Utilities.FormatResult(xhr);var form=$Quivers.Dom.Get('[data-api="user/register"]')[0];var button=document.getElementById(form.getAttribute("data-form")+"-Submit");button.setAttribute("working","false");button.removeAttribute("disabled");$Quivers.Dom.CreateAlert($Quivers.Dom.Get('[data-form-alerts="'+form.getAttribute("data-form")+'"]')[0].id,"danger",data.Result.Html);}}
$Quivers["/api/v1/user/forgotPassword"]=$Quivers.SimpleFormCallback;$Quivers["/api/v1/user/updatePassword"]=$Quivers.SimpleFormCallback;$Quivers["/api/v1/user/updateDetails"]=$Quivers.SimpleFormCallback;$Quivers["/api/v1/logout"]={beforeSend:function(data,curl){document.getElementById("qQuiversLogout").setAttribute("onclick","");document.getElementById("qQuiversLogout").setAttribute("working","true");document.getElementById("qQuiversLogoutIcon").className="glyphicon glyphicon-cog";return true;},success:function(data){data=$Quivers.Utilities.FormatResult(data);localStorage.clear();if(data.Result.Data.UseMarketplace!=data.Result.Marketplace){$Quivers.Utilities.CreateCookie("Marketplace",data.Result.Data.UseMarketplace,1);Quivers=new HoverCart(data.Result.Data.UseMarketplace,window[data.Result.Marketplace].Id,window[data.Result.Marketplace].PointOfSaleBusiness,window[data.Result.Marketplace].Environment);Quivers.Start();}
else{var access=data.Result.Data.MarketplaceAccess;if(data.Result.Data.Success==true&&access==false){var elements=$Quivers.Dom.Get('[quivers-view="true"');for(var i in elements){if(typeof elements[i]!=="function")
elements[i].innerHTML='<div class="alert alert-warning">'+window[data.Result.Marketplace].$("UnauthorizedViewMessage")+'</div>';}}
var zooms=document.getElementsByClassName("zoomContainer");for(var i=0;i<zooms.length;i++){if(typeof zooms[i]!=="function")
zooms[i].parentNode.removeChild(zooms[i])}
window[data.Result.Marketplace].Criteo.SetEmail(null);window[data.Result.Marketplace].Get("ribbon",function(data){data=$Quivers.Utilities.FormatResult(data);window[data.Result.Marketplace].Catalog.Widgets();window[data.Result.Marketplace].Catalog.Assortments();if(access==false&&window[data.Result.Marketplace].CurrentView!=null)
window[data.Result.Marketplace].View("Login",false);else
window[data.Result.Marketplace].SelectViewFromUrl();});try{window[data.Result.Marketplace].Checkout.TeardownBluesnap();}
catch(err){}}},error:function(data){$Quivers.Utilities.Debug(data);}}
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='<div id="qBoomerangReferral" class="qBoomerangReferral">';html+='<img src="https://'+window[this.MarketplaceId].CDNHost+'/img/money-image.png" class="qBoomerangMoneyImage img-responsive">';html+='<h5>Your Code</h5>';html+='<div class="qBoomerangReferralCode"><code>'+referralCode+'</code></div>';html+='<p>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. <a class="qBoomerangDetailsLink" onclick="$Quivers.Dom.CloseDialog(); $Quivers.Dom.ToggleDivs('+"'body-content', 'boomerang-details'"+');">Details</a></p>';html+='<div id="qSocialSharingButtons" class="addthis_inline_share_toolbox"'+"data-url=\""+window.location.href+"&ReferralCode="+referralCode+"\" data-title=\"Use code '"+referralCode+"' at checkout to save 2.5%!\"></div>";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<shareBtns.length;i++){shareBtns[i].setAttribute("onclick",'$Quivers.Dom.CloseDialog();');}}}}
$Quivers["/api/v1/applyBoomerangCreditDiscount"]={beforeSend:function(){document.getElementById("qApplyCreditBtn").setAttribute("working","true");document.getElementById("qApplyCreditBtn").setAttribute("disabled","true");document.getElementById("qApplyCreditBtn").setAttribute("style","pointer-events: none;");return true;},success:function(data){data=$Quivers.Utilities.FormatResult(data);window[data.Result.Marketplace].Checkout.UpdateTotals();var applyDiv=document.getElementById("qBoomerangApplyCredit");applyDiv.parentNode.removeChild(applyDiv);var html='<div class="alert alert-success">You will be using your current <span class="qBoomerangCreditTM">Quivers Credit</span> balance for this transaction.</div>';html+="<div class=\"qDialogButtonContainer\"><div class=\"qWidgetButton\" onclick=\"$Quivers.Dom.CloseDialog();\">"+window[data.Result.Marketplace].$("ReturnBtn","discounts")+"</div></div>";$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:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',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-f<u.top?"bottom":"right"==r&&p.right+c>u.width?"left":"left"==r&&p.left-c<u.left?"right":r,s.removeClass(d).addClass(r)}var g=this.getCalculatedOffset(r,p,c,f);this.applyPlacement(g,r);var v=function(){var t=n.hoverState;n.$element.trigger("shown.bs."+n.type),n.hoverState=null,"out"==t&&n.leave(n)};t.support.transition&&this.$tip.hasClass("fade")?s.one("bsTransitionEnd",v).emulateTransitionEnd(i.TRANSITION_DURATION):v()}},i.prototype.applyPlacement=function(e,i){var o=this.tip(),n=o[0].offsetWidth,s=o[0].offsetHeight,a=parseInt(o.css("margin-top"),10),r=parseInt(o.css("margin-left"),10);isNaN(a)&&(a=0),isNaN(r)&&(r=0),e.top+=a,e.left+=r,t.offset.setOffset(o[0],t.extend({using:function(t){o.css({top:Math.round(t.top),left:Math.round(t.left)})}},e),0),o.addClass("in");var l=o[0].offsetWidth,h=o[0].offsetHeight;"top"==i&&h!=s&&(e.top=e.top+s-h);var p=this.getViewportAdjustedDelta(i,e,l,h);p.left?e.left+=p.left:e.top+=p.top;var c=/top|bottom/.test(i),f=c?2*p.left-n+l:2*p.top-s+h,d=c?"offsetWidth":"offsetHeight";o.offset(e),this.replaceArrow(f,o[0][d],c)},i.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?"left":"top",50*(1-t/e)+"%").css(i?"top":"left","")},i.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e),t.removeClass("fade in top bottom left right")},i.prototype.hide=function(e){function o(){"in"!=n.hoverState&&s.detach(),n.$element&&n.$element.removeAttr("aria-describedby").trigger("hidden.bs."+n.type),e&&e()}var n=this,s=t(this.$tip),a=t.Event("hide.bs."+this.type);return this.$element.trigger(a),a.isDefaultPrevented()?void 0:(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",o).emulateTransitionEnd(i.TRANSITION_DURATION):o(),this.hoverState=null,this)},i.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},i.prototype.hasContent=function(){return this.getTitle()},i.prototype.getPosition=function(e){e=e||this.$element;var i=e[0],o="BODY"==i.tagName,n=i.getBoundingClientRect();null==n.width&&(n=t.extend({},n,{width:n.right-n.left,height:n.bottom-n.top}));var s=window.SVGElement&&i instanceof window.SVGElement,a=o?{top:0,left:0}:s?null:e.offset(),r={scroll:o?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop()},l=o?{width:t(window).width(),height:t(window).height()}:null;return t.extend({},n,r,l,a)},i.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},i.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(t)){var r=e.top-s-a.scroll,l=e.top+s-a.scroll+o;r<a.top?n.top=a.top-r:l>a.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,p=e.left+s+i;h<a.left?n.left=a.left-h:p>a.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:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),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[0])return this.activeTarget=null,this.clear();for(t=n.length;t--;)a!=s[t]&&e>=n[t]&&(void 0===n[t+1]||e<n[t+1])&&this.activate(s[t])},e.prototype.activate=function(e){this.activeTarget=e,this.clear();var i=this.selector+'[data-target="'+e+'"],'+this.selector+'[href="'+e+'"]',o=t(i).parents("li").addClass("active");o.parent(".dropdown-menu").length&&(o=o.closest("li.dropdown").addClass("active")),o.trigger("activate.bs.scrollspy")},e.prototype.clear=function(){t(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var o=t.fn.scrollspy;t.fn.scrollspy=i,t.fn.scrollspy.Constructor=e,t.fn.scrollspy.noConflict=function(){return t.fn.scrollspy=o,this},t(window).on("load.bs.scrollspy.data-api",function(){t('[data-spy="scroll"]').each(function(){var e=t(this);i.call(e,e.data())})})}($jquivers),+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,o=this;t(this).one("bsTransitionEnd",function(){i=!0});var n=function(){i||t(o).trigger(t.support.transition.end)};return setTimeout(n,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){return t(e.target).is(this)?e.handleObj.handler.apply(this,arguments):void 0}})})}($jquivers);}
$Quivers.Cart={AddDiscount:function(code){if(typeof code=="undefined")
var code=document.getElementById("qDiscountCodeInput").value;var buttons=$Quivers.Dom.Get('.qSubmitDiscountButton');for(var b in buttons){if(typeof buttons[b]!=="function"){if(buttons[b].hasAttribute("disabled"))
return false;buttons[b].setAttribute("working","true");buttons[b].setAttribute("disabled","true");}}
window[this.MarketplaceId].Post("user/cart/applyDiscount",{Discount:code},function(data){data=$Quivers.Utilities.FormatResult(data);if(data.ResponseCode<300){var contents=$Quivers.Dom.GenerateAlertHtml("success",window[data.Result.Marketplace].$("SuccessfullyAddedDiscount","discounts"));if(typeof data.Result.Data.UpsellOpportunity!=="undefined")
contents+=data.Result.Data.UpsellOpportunityHtml;contents+="<div class=\"qDialogButtonContainer\"><div class=\"qWidgetButton\" onclick=\"$Quivers.Dom.CloseDialog();\">"+window[data.Result.Marketplace].$("ReturnBtn","discounts")+"</div></div>";$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;b<buttons.length;b++){if(typeof buttons[b]!=="function"){if(buttons[b].hasAttribute("disabled"))
return false;buttons[b].setAttribute("working","true");buttons[b].setAttribute("disabled","true");}}
window[this.MarketplaceId].Post("user/cart/removeDiscount",{Discount:discount,CartRefId:business},function(data){data=$Quivers.Utilities.FormatResult(data);if(data.ResponseCode<300){window[data.Result.Marketplace].Checkout.UpdateTotals();}
else{$Quivers.Dom.CreateAlert("qDiscountsAlerts","danger",data.Result.Html);}
for(var b=0;b<buttons.length;b++){if(typeof buttons[b]!=="function"){buttons[b].setAttribute("working","false");buttons[b].removeAttribute("disabled");}}});},AddProduct:function(id,cartType,checkForOptions){if(!navigator.cookieEnabled||window[this.MarketplaceId].ThirdPartyCookiesEnabled==false){window[this.MarketplaceId].CookiesDialog(window[this.MarketplaceId]);return false;}
if(typeof dontAdd==="undefined")
var dontAdd=false;var quantityInputs=$Quivers.Dom.Get('#qVariantQuantity[data-productid="'+id+'"]');var quantity=1;if(quantityInputs.length>0)
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 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("qCartAlerts-"+id,"danger","You must select a Picture Attachment for this product!");return false;}
var pictureId=pictureInputs[0].value!=""?parseInt(pictureInputs[0].value):null;}
var buttons=$Quivers.Dom.Get('[data-'+cartType.toLowerCase()+"='"+id+"']");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="qCartAlerts-"+id;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;}
window[this.MarketplaceId].Post("user/cart/addItem",{Type:cartType,Product:id,Quantity:quantity,DontAdd:checkForOptions,CartDiscountId:cartDiscountId,PictureAttachmentId:pictureId,AddedFromUrl:window.location.href},function(data){data=$Quivers.Utilities.FormatResult(data);if(data.ResponseCode<300){var contents=$Quivers.Dom.GenerateAlertHtml("success",data.Result.Html);if(typeof data.Result.Data.UpsellOpportunity!=="undefined")
contents+=data.Result.Data.UpsellOpportunityHtml;if(typeof data.Result.Data.InstorePickupHtml!=="undefined")
contents+=data.Result.Data.InstorePickupHtml;contents+="<div class=\"qDialogButtonContainer\"><a class=\"qWidgetButton\" onclick=\"$Quivers.Dom.CloseDialog();\">"+window[data.Result.Marketplace].$("ContinueShoppingBtn","cart")+"</a>";if(cartType.toLowerCase()=="shopping")
contents+="<a class=\"qWidgetButton\" onclick=\"window['"+data.Result.Marketplace+"'].View('Checkout')\">"+window[data.Result.Marketplace].$("ProceedToCheckoutBtn","cart")+"</a>";else
contents+="<a class=\"qWidgetButton\" onclick=\"window['"+data.Result.Marketplace+"'].View('Wishlist')\">"+window[data.Result.Marketplace].$("ViewWishlistBtn","cart")+"</a>";contents+="</div>";if(cartType.toLowerCase()=="shopping")
var boxTitle=window[data.Result.Marketplace].$("DialogTitleCart","cart");else
var boxTitle=window[data.Result.Marketplace].$("DialogTitleWishlist","cart");$Quivers.Dom.TriggerDialog(boxTitle,contents);window[data.Result.Marketplace].InstorePickupData={MyCoords:data.Result.Data.ConsumerCoordinates,Locations:data.Result.Data.PickupLocations,ProductId:id}
if(typeof data.Result.Data.CartItem!="undefined")
window[data.Result.Marketplace].InstorePickupData.CartItemId=data.Result.Data.CartItem.Id;if(document.getElementById("qInstorePickupMap")&&document.getElementById("qInstorePickupMap").className=="visible"){window[data.Result.Marketplace].InstorePickupMap=new QuiversInstorePickupMap(data.Result.Marketplace,window[data.Result.Marketplace].InstorePickupData);}
document.getElementById("qCartCount-"+data.Result.Data.CartType).innerHTML=data.Result.Data.CartItemCount;var selectAsGifts=$Quivers.Dom.Get(".qProductPurchaseButtons");for(var s=0;s<selectAsGifts.length;s++){window[data.Result.Marketplace].Get("module?Module=productPurchaseButtons&ProductId="+selectAsGifts[s].id.split("-")[1]+"&Element=productPurchaseButtons-"+selectAsGifts[s].id.split("-")[1]);}
if(typeof window[data.Result.Marketplace].Checkout!=="undefined"){try{window[data.Result.Marketplace].Checkout.DeliveryMethod=data.Result.Data.DeliveryMethod;}
catch(err){console.warn(err);}}
window[data.Result.Marketplace].Analytics.ProductHit(data.Result.Data,"CartItem","add");window[data.Result.Marketplace].Analytics.Send("send",'event');}
else{if(typeof data.Result.Data.InStorePickupError!=="undefined"&&data.Result.Data.InStorePickupError==true){var contents=$Quivers.Dom.GenerateAlertHtml("danger",data.Result.Data.Error);contents+=data.Result.Html;$Quivers.Dom.TriggerDialog(window[data.Result.Marketplace].$("PickLocation","instorepickup"),contents);window[data.Result.Marketplace].InstorePickupMap=new QuiversInstorePickupMap(data.Result.Marketplace,{MyCoords:data.Result.Data.ConsumerCoordinates,Locations:data.Result.Data.PickupLocations,CartItemId:null,ProductId:id});}
else if(data.Result.Data.RedirectToDetailsPage==true&&window[data.Result.Marketplace].Settings.Pages.Products.Enabled==true){window[data.Result.Marketplace].Catalog.ProductDetails(id,function(){$Quivers.Dom.CreateAlert("qProductOptionsAlerts-"+id,"danger",data.Result.Html);});}
else
$Quivers.Dom.CreateAlert(alertsDiv,"danger",data.Result.Html);}
for(var b in buttons){if(typeof buttons[b]!=="function"){buttons[b].setAttribute("working","false");buttons[b].removeAttribute("disabled");if(buttons[b].parentNode!=null&&buttons[b].parentNode.className=="qActions")
buttons[b].parentNode.setAttribute("style","");}}});},RemoveProduct:function(id,cartType){var buttons=$Quivers.Dom.Get('[data-remove-item="'+id+'"]');for(var b in buttons){if(typeof buttons[b]!=="function"){if(buttons[b].hasAttribute("disabled"))
return false;buttons[b].setAttribute("working","true");buttons[b].setAttribute("disabled","true");}}
window[this.MarketplaceId].Post("user/cart/removeItem",{Type:cartType,Product:id},function(data){data=$Quivers.Utilities.FormatResult(data);if(data.ResponseCode<300){document.getElementById("qCartCount-"+data.Result.Data.Type).innerHTML=data.Result.Data.CartItemCount;if(data.Result.Data.RenderType=="Module")
document.getElementById("qCartDetails").innerHTML=data.Result.Html;else{var elem=window[data.Result.Marketplace].Settings.GetDisplayElement(window[data.Result.Marketplace].CurrentView);document.getElementById(elem).innerHTML=data.Result.Html;}
if(document.getElementById("productUpsellOpportunity"))
window[data.Result.Marketplace].Get("module?Module=productUpsellOpportunity");window[data.Result.Marketplace].Analytics.ProductHit(data.Result.Data,"CartItem","remove");window[data.Result.Marketplace].Analytics.Send("send",'event');}
else{$Quivers.Dom.CreateAlert("qCartAlerts","danger",data.Result.Html);}
for(var b in buttons){if(typeof buttons[b]!=="function"){buttons[b].setAttribute("working","false");buttons[b].removeAttribute("disabled");}}});},MoveProduct:function(id){var buttons=$Quivers.Dom.Get('[data-move-item="'+id+'"]');for(var b in buttons){if(typeof buttons[b]!=="function"){if(buttons[b].hasAttribute("disabled"))
return false;buttons[b].setAttribute("working","true");buttons[b].setAttribute("disabled","true");}}
window[this.MarketplaceId].Post("user/cart/moveToCart",{Item:id},function(data){data=$Quivers.Utilities.FormatResult(data);if(data.ResponseCode<300){document.getElementById("qCartCount-Shopping").innerHTML=data.Result.Data.ShoppingCount;document.getElementById("qCartCount-Wishlist").innerHTML=data.Result.Data.WishlistCount;document.getElementById("qCartDetails").innerHTML=data.Result.Html;}
else{$Quivers.Dom.CreateAlert("qCartAlerts","danger",data.Result.Html);}
for(var b in buttons){if(typeof buttons[b]!=="function"){buttons[b].setAttribute("working","false");buttons[b].removeAttribute("disabled");}}});},UpdateProduct:function(id,cartType){var fields=$Quivers.Dom.Get('[data-update-item="'+id+'"]');for(var b in fields){if(typeof fields[b]!=="function"){if(fields[b].hasAttribute("disabled"))
return false;fields[b].setAttribute("working","true");fields[b].setAttribute("disabled","true");}}
var quantity=$Quivers.Dom.Get('[data-update-item="'+id+'"]')[0].value;window[this.MarketplaceId].Post("user/cart/updateItem",{Type:cartType,Product:id,Quantity:quantity},function(data){data=$Quivers.Utilities.FormatResult(data);if(data.ResponseCode<300){document.getElementById("qCartCount-"+data.Result.Data.CartType).innerHTML=data.Result.Data.CartItemCount;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");if(typeof window[data.Result.Marketplace].Checkout!=="undefined"){try{window[data.Result.Marketplace].Checkout.DeliveryMethod=data.Result.Data.DeliveryMethod;}
catch(err){console.warn(err);}}}
else{$Quivers.Dom.CreateAlert("qCartAlerts","danger",data.Result.Html);}
for(var b in fields){if(typeof fields[b]!=="function"){fields[b].setAttribute("working","false");fields[b].removeAttribute("disabled");}}});},AdjustInstorePickup:function(cartItemId,productId){var contents='<div id="instorePickup" class="qModule" loading="true"></div>';contents+="<div class=\"qDialogButtonContainer\"><div class=\"qWidgetButton\" onclick=\"$Quivers.Dom.CloseDialog();\">"+window[this.MarketplaceId].$("ReturnBtn","instorepickup")+"</div></div>";$Quivers.Dom.TriggerDialog(window[this.MarketplaceId].$("AdjustLocation","instorepickup"),contents);window[this.MarketplaceId].Get("module?Module=instorePickup&CartItemId="+cartItemId+"&ProductId="+productId,function(data){window[data.Result.Marketplace].InstorePickupData={MyCoords:data.Result.Data.ConsumerCoordinates,Locations:data.Result.Data.PickupLocations,CartItemId:cartItemId,ProductId:productId};document.getElementById("instorePickup").innerHTML=data.Result.Html;if(typeof data.Result.Data.InitiallySelected!="undefined")
window[data.Result.Marketplace].InstorePickupData.InitiallySelected=data.Result.Data.InitiallySelected;window[data.Result.Marketplace].InstorePickupMap=new QuiversInstorePickupMap(data.Result.Marketplace,window[data.Result.Marketplace].InstorePickupData);})},RemoveInstorePickup:function(cartItemId){var link=document.getElementById('qRemovePickupLocation');if(link&&!link.hasAttribute("disabled")){link.setAttribute("working","true");link.setAttribute("disabled","true");}
window[this.MarketplaceId].Post("user/cart/updateItem",{Type:"Shopping",Product:cartItemId,InStorePickupLocation:{Address:null,RefId:null,Name:null}},function(data){if(data.ResponseCode<300){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(link){link.removeAttribute("working");link.removeAttribute("disabled");}});}}
$Quivers.Catalog={Category:function(id,page){var ribbon=document.getElementById(window[this.MarketplaceId].Settings.Ribbon.DisplayElement);if(ribbon){if(window[this.MarketplaceId].Settings.Pages.Products.DisplayElement==null)
var display=window[this.MarketplaceId].Settings.General.DefaultDisplay;else
var display=window[this.MarketplaceId].Settings.Pages.Products.DisplayElement;if(window[this.MarketplaceId].CurrentView!="Products"){url=window[this.MarketplaceId].GetUrlScheme("Category",id);if(window[this.MarketplaceId].Settings.Pages.Products.PageUrl!="")
location.href=window[this.MarketplaceId].Settings.Pages.Products.PageUrl+url;else{window.history.pushState(url,url,url);window[this.MarketplaceId].View("Products",false);}
return true;}}
var zooms=document.getElementsByClassName("zoomContainer");for(var i=0;i<zooms.length;i++){if(typeof zooms[i]!=="function")
zooms[i].parentNode.removeChild(zooms[i])}
var client=window[this.MarketplaceId];var waitUntil=setInterval(function(){if(document.getElementById("qCategoriesHaveLoaded")){clearInterval(waitUntil);if(document.getElementById("qCategory-"+id)){var cat=document.getElementById("qCategory-"+id);if(cat.className.indexOf("active")==-1)
document.getElementById("qCurrentPage").value=1;var categories=document.getElementsByClassName("qCategoryName");for(var i=0;i<categories.length;i++){if(typeof categories[i]!=="function")
categories[i].className="qCategoryName";}
if(cat)
cat.className="qCategoryName active";var parent=cat.getAttribute("data-parent");if(parent!="false")
client.Catalog.ToggleSubCategories(parent,true);var orderBy=document.getElementById("qOrderBy").options[document.getElementById("qOrderBy").selectedIndex].value;var pageSize=document.getElementById("qPageSize").options[document.getElementById("qPageSize").selectedIndex].value;var page=document.getElementById("qCurrentPage").value;var target="productsView";document.getElementById(target).setAttribute("loading","true");if(typeof seoName==='undefined'){if(cat)
var seoName=cat.getAttribute("data-seoname");else
var seoName="";}
client.Analytics.SetPage("Category/"+seoName,seoName);client.Get("module?Module="+target+"&Select=Category-"+id+"&OrderBy="+orderBy+"&PageSize="+pageSize+"&CurrentPage="+page,function(data){data=$Quivers.Utilities.FormatResult(data);var products=[];for(var i in data.Result.Data.Products){if(typeof data.Result.Data.Products!=="function"&&!isNaN(parseInt(i))){if(data.Result.Data.Products[i].RefId==""||data.Result.Data.Products[i].RefId==null)
data.Result.Data.Products[i].RefId="0";products.push(data.Result.Data.Products[i].RefId);}}
window[data.Result.Marketplace].Criteo.Push({event:"viewList",item:products});window[data.Result.Marketplace].Analytics.ImpressionHit(data.Result.Data,"Category",true);window[data.Result.Marketplace].Analytics.CommitPageView();})
if(client.GetModuleQueryId("Category")!=id){var url=id;if(seoName!="")
url=url+"/"+seoName;url=client.GetUrlScheme("Category",url);client.UpdateURL(url,"Category/"+id);}}
else{var target=document.getElementById("productsView");target.setAttribute("loading",false);target.innerHTML='<div class="alert alert-danger">'+client.$("CategoryDoesNotExistMessage","catalog")+'</div>';}}},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<subs.length;i++){if(typeof subs[i]!=="function"){if(subs[i].nodeType==1){if(subs[i].className=="qCategory"){if(!force){if(subs[i].getAttribute("data-filtered")=="true")
subs[i].setAttribute("data-filtered","false");else
subs[i].setAttribute("data-filtered","true");}
else
subs[i].setAttribute("data-filtered","false");}}}}},ProductDetails:function(id,seoName,discountId){$Quivers.Dom.CloseDialog();var ribbon=document.getElementById(window[this.MarketplaceId].Settings.Ribbon.DisplayElement);if(ribbon){ribbon.setAttribute("data-context","products");if(!window[this.MarketplaceId].Settings.Pages.Products.DisplayElement)
var display=window[this.MarketplaceId].Settings.General.DefaultDisplay;else
var display=window[this.MarketplaceId].Settings.Pages.Products.DisplayElement;if(!display)
display="currentView";if(document.getElementById(display).getAttribute("data-view")!="products"){var url=id;if(typeof seoName!="function"&&seoName!=""&&typeof seoname!="undefined")
url=url+"/"+seoName;url=window[this.MarketplaceId].GetUrlScheme("Product",url);if(location.search!==url){window[this.MarketplaceId].UpdateURL(url,"Product/"+id);}
window[this.MarketplaceId].View("Products",false);return true;}}
var target="productsView";window[this.MarketplaceId].Get("module?Module="+target+"&Select=Product-"+id,function(data){data=$Quivers.Utilities.FormatResult(data);window[data.Result.Marketplace].Analytics.SetPage("Product/"+data.Result.Data.Product.Name,""+data.Result.Data.Product.Name);if(typeof seoName=="function")
seoName();var url=id;if(typeof seoName!="function"&&seoName!=""&&typeof seoname!="undefined")
url=url+"/"+data.Result.Data.Product.Name;url=window[data.Result.Marketplace].GetUrlScheme("Product",url);if(window.location.search!=url){window[data.Result.Marketplace].UpdateURL(url,"Product/"+id);}
if(typeof discountId!="undefined"){var pDivs=$Quivers.Dom.Get('[data-quiversproduct="'+id+'"]');for(var i in pDivs){pDivs[i].setAttribute("data-discount-id",discountId);}}
if(document.getElementById("qProduct").getAttribute("data-reviews-enabled")=="1"){window[data.Result.Marketplace].Get("module?Module=productReviewsSummary&ProductId="+data.Result.Data.Product.Id+"&Element=qProductReviewsSummary");}
window[data.Result.Marketplace].Get("module?Module=productRelatedSummary&ProductId="+data.Result.Data.Product.Id+"&Element=qRelatedProductsSummary");if(document.getElementById("productPurchaseButtons-"+data.Result.Data.Product.Id))
window[data.Result.Marketplace].Get("module?Module=productPurchaseButtons&ProductId="+data.Result.Data.Product.Id+"&Element=productPurchaseButtons-"+data.Result.Data.Product.Id);var zooms=document.getElementsByClassName("zoomContainer");for(var i=0;i<zooms.length;i++){if(typeof zooms[i]!=="function")
zooms[i].parentNode.removeChild(zooms[i])}
$jquivers('img[data-zoomable]').elevateZoom({gallery:'qPicturesSlider'});window[data.Result.Marketplace].Criteo.Push({event:"viewItem",item:data.Result.Data.Product.RefId});window[data.Result.Marketplace].Analytics.ProductHit(data.Result.Data,"Standard","detail");window[data.Result.Marketplace].Analytics.CommitPageView();});},ProductShort:function(id){if(window[this.MarketplaceId].Settings.Pages.ProductShort.DisplayElement==null)
var display=window[this.MarketplaceId].Settings.General.DefaultDisplay;else
var display=window[this.MarketplaceId].Settings.Pages.ProductShort.DisplayElement;if(display==null)
display="currentView";var ribbon=document.getElementById(window[this.MarketplaceId].Settings.Ribbon.DisplayElement);if(ribbon){var url=window[this.MarketplaceId].GetUrlScheme("ProductShort",id);window[this.MarketplaceId].Analytics.SetPage("Product/"+id,"Product/"+id);window[this.MarketplaceId].UpdateURL(url,"Product/"+id);ribbon.setAttribute("data-context","buyProduct");if(document.getElementById(display).getAttribute("data-view")!="buyProduct"){window[this.MarketplaceId].View("ProductShort",false);}
else{if(display=="currentView"&&document.getElementById("QuiversContent").className=="hidden")
document.getElementById("QuiversContent").className="visible";var target="productsView";window[this.MarketplaceId].Get("module/?Module="+target+"&Select=ProductShort-"+id,function(data){data=$Quivers.Utilities.FormatResult(data);if(document.getElementById("productPurchaseButtons-"+data.Result.Data.Product.Id))
window[data.Result.Marketplace].Get("module?Module=productPurchaseButtons&ProductId="+data.Result.Data.Product.Id+"&Element=productPurchaseButtons-"+data.Result.Data.Product.Id);window[data.Result.Marketplace].Criteo.Push({event:"viewItem",item:data.Result.Data.Product.RefId});window[data.Result.Marketplace].Analytics.ProductHit(data.Result.Data,"Standard","detail");window[data.Result.Marketplace].Analytics.CommitPageView();});}}},SelectVariant:function(id,oId,vId){if(typeof vId==='object'){var e=vId.target;var vId=e.options[e.selectedIndex].value;}
var products=$jquivers('#qProduct[data-quiversproduct="'+id+'"]');for(var i=0;i<products.length;i++){if(typeof products[i]!=="function"){if(products[i].getAttribute('data-iswidget')=="true"){var widgets=$jquivers('[data-widget="'+id+'"]');for(var k=0;k<widgets.length;k++){window[this.MarketplaceId].Get("module?Module=widget"+"&Product="+id+"&Option="+oId+"&Value="+vId+"&Widget=true"+"&Element="+widgets[k].id+"&SelectVariant=true")}}
else{if(document.getElementById("QuiversRibbon").getAttribute("data-context")=="buyProduct")
var select="ProductShort";else
var select="Product";window[this.MarketplaceId].Get("module?Module=productsView"+"&Select="+select+"-"+id+"&Product="+id+"&Option="+oId+"&Value="+vId+"&SelectVariant=true",function(data){if(document.getElementById("qProduct").getAttribute("data-reviews-enabled")=="1"){window[data.Result.Marketplace].Get("module?Module=productReviewsSummary&ProductId="+id+"&Element=qProductReviewsSummary");}
window[data.Result.Marketplace].Get("module?Module=productRelatedSummary&ProductId="+id+"&Element=qRelatedProductsSummary");if(document.getElementById("productPurchaseButtons-"+id))
window[data.Result.Marketplace].Get("module?Module=productPurchaseButtons&ProductId="+id+"&Element=productPurchaseButtons-"+id);var zooms=document.getElementsByClassName("zoomContainer");for(var i=0;i<zooms.length;i++){if(typeof zooms[i]!=="function")
zooms[i].parentNode.removeChild(zooms[i])}
$jquivers('img[data-zoomable]').elevateZoom({gallery:'qPicturesSlider'});});}}}},UploadPicture:function(ev){var hc=window[this.MarketplaceId];var form=ev.currentTarget;var d=new FormData(form);var buttons=$Quivers.Dom.Get('[data-shopping="'+form.getAttribute("data-productid")+'"]');$jquivers.ajax({type:"POST",url:"https://"+hc.Host+"/api/v1/uploadImage/"+"?Marketplace="+hc.Marketplace+"&Light=true",headers:{Session:hc.SessionId,ServerCache:hc.Settings.Application.UseServerCache},data:d,beforeSend:function(){for(var b=0;b<buttons.length;b++){if(typeof buttons[b]!=="function"){buttons[b].setAttribute("disabled","true");}}},success:function(data){data=$Quivers.Utilities.FormatResult(data);console.log("SUCCESS");var pictureInputs=$Quivers.Dom.Get('input[data-productpicture][data-productid="'+form.getAttribute("data-productid")+'"]');for(var i=0;i<pictureInputs.length;i++){pictureInputs[i].value=data.Result.Data.pictureInfo.id;}},error:function(data){data=$Quivers.Utilities.FormatResult(data);console.log("ERROR");$Quivers.Dom.CreateAlert("qCartAlerts-"+form.getAttribute("data-productid"),"danger","File must be an image. Supported image types include 'PNG', 'JPG' or 'GIF' only.");},complete:function(){for(var b=0;b<buttons.length;b++){if(typeof buttons[b]!=="function"){buttons[b].removeAttribute("disabled");}}},cache:false,contentType:false,processData:false});},Products:function(page){if(typeof page=="undefined"){if(document.getElementById("qCurrentPage"))
var page=document.getElementById("qCurrentPage").value;else
var page=1;}
else{if(document.getElementById("qCurrentPage"))
document.getElementById("qCurrentPage").value=page;}
var zooms=document.getElementsByClassName("zoomContainer");for(var i=0;i<zooms.length;i++){if(typeof zooms[i]!=="function")
zooms[i].parentNode.removeChild(zooms[i])}
var orderBy=document.getElementById("qOrderBy").options[document.getElementById("qOrderBy").selectedIndex].value;var pageSize=document.getElementById("qPageSize").options[document.getElementById("qPageSize").selectedIndex].value;var target="productsView";window[this.MarketplaceId].Analytics.SetPage("Products","Products");window[this.MarketplaceId].Get("module?Module="+target+window[this.MarketplaceId].GetModuleQuery()+"&OrderBy="+orderBy+"&PageSize="+pageSize+"&CurrentPage="+page,function(data){var products=[];for(var i in data.Result.Data.Products){if(typeof data.Result.Data.Products!=="function"&&!isNaN(parseInt(i))){if(data.Result.Data.Products[i].RefId==""||data.Result.Data.Products[i].RefId==null)
data.Result.Data.Products[i].RefId="0";products.push(data.Result.Data.Products[i].RefId);}}
window[data.Result.Marketplace].Criteo.Push({event:"viewList",item:products});window[data.Result.Marketplace].Analytics.ImpressionHit(data.Result.Data,"Category",true);window[data.Result.Marketplace].Analytics.CommitPageView();});},ProductDialog:function(productId){if(productId){var elem='<div class="qWidget" data-widget="'+productId+'"></div>';$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<zooms.length;i++){if(typeof zooms[i]!=="function")
zooms[i].parentNode.removeChild(zooms[i])}
window[this.MarketplaceId].Analytics.SetPage("Search/"+query,"Search/"+query);timer=null;var target="productsView";if(query!=""&&query!=null&&typeof query!="undefined"){query=encodeURIComponent(query);window[this.MarketplaceId].Get("module?Module="+target+"&Select=Search-"+query+"&OrderBy="+orderBy+"&PageSize="+pageSize+"&CurrentPage="+page,function(data){var products=[];for(var i in data.Result.Data.Products){products.push(data.Result.Data.Products[i].RefId);}
window[data.Result.Marketplace].Criteo.Push({event:"viewList",item:products});window[data.Result.Marketplace].Analytics.ImpressionHit(data.Result.Data,"Search Results",true);window[data.Result.Marketplace].Analytics.CommitPageView();});var url=window[this.MarketplaceId].GetUrlScheme("Search",query);}
else{window[this.MarketplaceId].Get("module?Module="+target+"&OrderBy="+orderBy+"&PageSize="+pageSize+"&CurrentPage="+page,function(data){var products=[];for(var i in data.Result.Data.Products){if(typeof data.Result.Data.Products!=="function"&&!isNaN(parseInt(i))){if(data.Result.Data.Products[i].RefId==""||data.Result.Data.Products[i].RefId==null)
data.Result.Data.Products[i].RefId="0";products.push(data.Result.Data.Products[i].RefId);}}
window[data.Result.Marketplace].Criteo.Push({event:"viewList",item:products});window[data.Result.Marketplace].Analytics.ImpressionHit(data.Result.Data,"Landing Page",true);window[data.Result.Marketplace].Analytics.SearchEvent(query,products.length);window[data.Result.Marketplace].Analytics.CommitPageView();});var url=window[this.MarketplaceId].GetUrlScheme("Default","products");}
if(window[this.MarketplaceId].GetModuleQueryId("Search")!=query){window[this.MarketplaceId].UpdateURL(url,"Search/"+query);}},ProductReviews:function(id,dialog){if(typeof dialog=="undefined"||dialog==false){var target="productsView";var ribbon=document.getElementById(window[this.MarketplaceId].Settings.Ribbon.DisplayElement);if(ribbon){ribbon.setAttribute("data-context","products");if(window[this.MarketplaceId].Settings.Pages.Products.DisplayElement==null)
var display=window[this.MarketplaceId].Settings.General.DefaultDisplay;else
var display=window[this.MarketplaceId].Settings.Pages.Products.DisplayElement;if(document.getElementById(display).getAttribute("data-view")!="products"){window[this.MarketplaceId].View("Products",false);return true;}}
window[this.MarketplaceId].Get("module?Module="+target+"&Select=ProductReview-"+id);var url=window[this.MarketplaceId].GetUrlScheme("ProductReview",id);$Quivers.Utilities.Debug(window[this.MarketplaceId].GetUrlScheme("ProductReview",id));window[this.MarketplaceId].Analytics.SetPage("ProductReviews/"+id,"ProductReviews/"+id,true);window[this.MarketplaceId].UpdateURL(url,"ProductReviews/"+id);}
else{var contents='<div id="productReviewsDialog" class="qModule" loading="true"></div>';$Quivers.Dom.TriggerDialog(document.getElementById("qProductReviewsDialogTitle").innerHTML+window[this.MarketplaceId].$("DialogTitle","reviews"),contents);window[this.MarketplaceId].Get("module?Module=productReviewsDialog&ProductId="+id);}},WriteReview:function(){var btn=document.getElementById("qSubmitReview");window[this.MarketplaceId].Forms.Submit('writeReview',"qSubmitReview",function(data){if(data.ResponseCode<300)
var type="success";else
var type="danger";$Quivers.Dom.CreateAlert("qwriteReviewAlerts",type,data.Result.Html);btn.setAttribute("working","false");btn.removeAttribute("disabled");});},VoteReview:function(id,product,type){var target="qReviewOptions";window[this.MarketplaceId].Get("voteReview?Product="+product+"&Review="+id+"&Vote="+type,function(data){document.getElementById("qReviewOptions").innerHTML=data.Result.Html;});},Widgets:function(){var self=this;var widgets=$Quivers.Dom.Get('[data-widget]');var widgetsToLoad=[];for(var i=0;i<widgets.length;i++){if(typeof widgets[i]!=="function"){if(widgets[i].hasAttribute("loading")==false){widgets[i].setAttribute("data-quivers","true");widgets[i].setAttribute("quivers-view","true");widgets[i].setAttribute("quivers-bootstrap","true");widgets[i].setAttribute("loading","true");widgets[i].id="qWidget-"+widgets[i].getAttribute("data-widget");widgetsToLoad.push(widgets[i]);}}}
function loadWidget(widget){console.log(widget);status.widgetsInProgress++;if(!isNaN(widget.getAttribute("data-widget"))){window[self.MarketplaceId].Get("module?Module=widget"+"&Widget=true"+"&Product="+widget.getAttribute("data-widget")+"&Element="+widget.id,function(data){data=$Quivers.Utilities.FormatResult(data);if(data.Result.Data.Product){if(document.getElementById("productPurchaseButtons-"+data.Result.Data.Product.Id))
window[data.Result.Marketplace].Get("module?Module=productPurchaseButtons&ProductId="+data.Result.Data.Product.Id+"&Element=productPurchaseButtons-"+data.Result.Data.Product.Id);window[data.Result.Marketplace].Criteo.Push({event:"viewItem",item:data.Result.Data.Product.RefId});window[data.Result.Marketplace].Analytics.ProductHit(data.Result.Data,"Standard",'detail');}
status.widgetsInProgress--;status.widgetsLoadedSoFar++;});}
else{status.widgetsInProgress--;status.widgetsLoadedSoFar++;}}
var loadWidgets=function(){var nextWidget;while(nextWidget=widgetsToLoad.pop()){loadWidget(nextWidget);}};var widgetsInterval=setInterval(loadWidgets,3000);loadWidgets();},Assortments:function(){var assortments=$jquivers('[data-assortment]');var numAssortmentsLoaded=0;for(var i=0;i<assortments.length;i++){if(typeof assortments[i]!=="function"){if(assortments[i].hasAttribute("loading")==false){assortments[i].setAttribute("data-quivers","true");assortments[i].setAttribute("quivers-view","true");assortments[i].setAttribute("quivers-bootstrap","true");assortments[i].setAttribute("loading","true");assortments[i].id="qAssortment-"+assortments[i].getAttribute("data-assortment");var productsOnly=assortments[i].hasAttribute("data-products-only")?assortments[i].getAttribute("data-products-only"):"true";window[this.MarketplaceId].Get("module?Module=assortment"+"&Assortment="+assortments[i].getAttribute("data-assortment")+"&Element="+assortments[i].id+"&ProductsOnly="+productsOnly,function(data){data=$Quivers.Utilities.FormatResult(data);var products=[];for(var i in data.Result.Data.Products){if(typeof data.Result.Data.Products!=="function"&&!isNaN(parseInt(i))){if(data.Result.Data.Products[i].RefId==""||data.Result.Data.Products[i].RefId==null)
data.Result.Data.Products[i].RefId="0";products.push(data.Result.Data.Products[i].RefId);}}
window[data.Result.Marketplace].Criteo.Push({event:"viewList",item:products});window[data.Result.Marketplace].Analytics.ImpressionHit(data.Result.Data,"Assortment");numAssortmentsLoaded++;});}}}},ReviewWidgets:function(){var reviews=$jquivers('[data-reviews]');for(var i=0;i<reviews.length;i++){if(typeof reviews[i]!=="function"){if(reviews[i].hasAttribute("loading")==false){reviews[i].setAttribute("data-quivers","true");reviews[i].setAttribute("quivers-view","true");reviews[i].setAttribute("quivers-bootstrap","true");reviews[i].setAttribute("loading","true");reviews[i].id="qReviews-"+reviews[i].getAttribute("data-reviews");window[this.MarketplaceId].Get("module?Module=review"+"&ProductId="+reviews[i].getAttribute("data-reviews")+"&Element="+reviews[i].id);}}}},ResetPage:function(){var page=document.getElementById("qCurrentPage");if(page)
page.value=1;},PopulateSiteMap:function(){var productUrlScheme=window[this.MarketplaceId].GetUrlScheme("Product","");if(window[this.MarketplaceId].Settings.Pages.Products.PageUrl!==null&&window[this.MarketplaceId].Settings.Pages.Products.PageUrl!=""){productUrlScheme=window[this.MarketplaceId].Settings.Pages.Products.PageUrl+productUrlScheme;}
else if(window[this.MarketplaceId].Settings.General.HomeUrl!==null&&window[this.MarketplaceId].Settings.General.HomeUrl!=""){productUrlScheme=window[this.MarketplaceId].Settings.General.HomeUrl+productUrlScheme;}
else{productUrlScheme=location.protocol+"//"+location.hostname+location.pathname+productUrlScheme;}
var subdomainParts=location.host.split(".");try{if(subdomainParts.length-2>=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);});}}}
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(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.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},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(self.State==state)
return false;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);}
break;}
case"shipping":{if(self.ShippingAddress==null&&self.DeliveryMethod!="Instore Pickup"){var validation=self.Client.AddressDialog.Validate(self.Client.AddressDialog.FormElement);if(!validation){$Quivers.Dom.TriggerError(self.Client.$("InvalidShippingAddress","checkout"),self.Client.$("InvalidShippingAddressMessage","checkout"));document.getElementById("qAddressUI").setAttribute("data-validation","bad");return false;}
else{self.Client.Forms.Submit('setAddress','setAddress-Submit');return false;}}
self.State="Shipping";self.StatePosition=3;break;}
case"payment":{if(self.DeliveryMethod==null){$Quivers.Dom.TriggerError(self.Client.$("InvalidDeliveryMethod","checkout"),self.Client.$("InvalidDeliveryMethodMessage","checkout"));document.getElementById("qShippingOptionsPicker").setAttribute("data-validation","bad");return false;}
self.State="Payment";self.StatePosition=4;if(self.Client.Settings.Checkout.ShowDiscountPopup==true)
self.DiscountsDialog();self.PreparePayment();break;}}
self.Client.Analytics.CheckoutStep(self.StatePosition);if(self.StatePosition>self.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<states.length;i++){uis[i].className="hidden";if(parseInt(states[i].getAttribute("data-checkout-position"))==self.StatePosition){document.getElementById("qCheckoutProgression").setAttribute('data-state',states[i].getAttribute("data-checkout-position"));states[i].setAttribute("data-checkout-status","active");uis[i].className="visible";}
else if(parseInt(states[i].getAttribute("data-checkout-position"))==self.StatePosition+1)
states[i].setAttribute("data-checkout-status","clickable");else if(parseInt(states[i].getAttribute("data-checkout-position"))<self.StatePosition)
states[i].setAttribute("data-checkout-status","finished");else
states[i].setAttribute("data-checkout-status","disabled");}
$Quivers.Dom.LevelElements("qHeightRow");window.scrollTo(0,0);return true;}
catch(err){console.warn(err);}}
QuiversCheckout.prototype.DiscountsDialog=function(){var self=this;var message="Do you have a promotional code? Add it now:";message+="<input class=\"form-control\" id=\"qDiscountCodeInput\" data-marketplace=\""+self.Client.Marketplace+"\" placeholder=\""+self.Client.$("ApplyDiscountBtnPlaceholder","discounts")+"\" name=\"DiscountCode\">";message+="<div class=\"qSubmitArea\"><a class=\"qWidgetButton\" onclick=\"$Quivers.Dom.CloseDialog();\" id=\"qDiscountDialogSubmit\">I don't have a code.</a></div>";$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<btns.length;b++){if(typeof btns[b]!=="function"){btns[b].setAttribute('data-selected','false');btns[b].innerHTML=self.Client.$("ShipHereBtn","addresses");}}
$Quivers.Dom.TriggerError("Invalid Shipping Address",msg);document.getElementById("qAddressesPanel").setAttribute("data-validation","bad");}
$jquivers('.qAddressPickButton[data-address="'+addressId+'"]').each(function(){this.setAttribute("working","false");});document.getElementById("qShippingOptions").removeAttribute("refreshing");});}
QuiversCheckout.prototype.SetShippingAddress=function(data){var self=this;if(data.Result.Data!==null){self.ShippingAddress=data.Result.Data.Address;self.DeliveryMethod=data.Result.Data.DeliveryMethod;}
if(self.BillingAddress==null&&(typeof self.Client.Settings.Extensions.ShopEmployee=="undefined"||self.Client.Settings.Extensions.ShopEmployee.Enabled==false)){self.BillingAddress=data.Result.Data.Address;}
var btns=$Quivers.Dom.Get(".qAddressPickButton[data-context='Shipping']");for(var b=0;b<btns.length;b++){if(typeof btns[b]!=="function"){if(btns[b].getAttribute("data-address")==data.Result.Data.Address.Id){btns[b].setAttribute('data-selected','true');btns[b].innerHTML='<span class="glyphicon glyphicon-ok"></span> '+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;}
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;self.Client.Get("module?Module=cartReview&Element=qCartReviewPane",function(data){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);});}
QuiversCheckout.prototype.ChangeUser=function(){var self=this;self.Client.Get("logout",function(data){data=$Quivers.Utilities.FormatResult(data);self.Client.View("Login");})}
QuiversCheckout.prototype.PreparePayment=function(){var self=this;if(self.Payment.Settings==null){var dropinInterval=setInterval(function(){if(self.Payment.Settings!=null){clearInterval(dropinInterval);self.PrepareBluesnap("qConfirmPaymentBluesnap");self.PreparePayPal();}},100);}
else{self.PrepareBluesnap("qConfirmPaymentBluesnap");self.PreparePayPal();}}
QuiversCheckout.prototype.PreparePayPal=function(){var self=this;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);}},1000);}});}}
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","<strong>Credit Card Number</strong> is invalid. Please ensure you have entered a valid card number.",false);break;case"cvv":$Quivers.Dom.CreateAlert("qBluesnapValidation-cvv","danger","<strong>CVV/CVC Code</strong> 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","<strong>Expiration Date</strong> 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.FireConversionCodeBlocks=function(){try{var elementId="qQuiversCampaignConversionScripts";var scripts=document.getElementById(elementId);for(var i in scripts.children){if(scripts.children[i].tagName=="SCRIPT"){try{eval(scripts.children[i].innerText);}
catch(err){console.warn(err);}}}}
catch(err){console.warn(err);}}
QuiversCheckout.prototype.SubmitPayment=function(){var self=this;if(self.BillingAddress==null){$Quivers.Dom.TriggerError(self.Client.$("InvalidBillingAddress","checkout"),self.Client.$("InvalidBillingAddressMessage","checkout"));document.getElementById("qReviewBillingAddressSummary").setAttribute("data-validation","bad");return false;}
try{if(self.Client.Settings.Extensions.Affiliation&&self.Client.Settings.Extensions.Affiliation.Enabled==true){var she_checkbox=document.getElementById("qShopEmployeeCheckbox");if(she_checkbox&&she_checkbox.checked==false){$Quivers.Dom.TriggerError("Must Certify Association","You must accept the checkbox that reads '"+document.getElementById('qShopEmployeeLabel').innerText+"'");document.getElementById("qShopEmployeeSection").setAttribute("data-validation","bad");return false;}
var radios=$Quivers.Dom.Get('input[type="radio"][name="qAffiliationType"]');var hasOneChecked=false;for(var i=0;i<radios.length;i++){if(radios[i].checked==true)
hasOneChecked=true;}
if(hasOneChecked==false){$Quivers.Dom.TriggerError("Must specify Affiliation Type","You must select an affiliation type from the highlighted list.");document.getElementById("qShopEmployeeSection").setAttribute("data-validation","bad");return false;}
var affiliationTextBox=document.getElementById('qAffiliationAreaInput');if(!affiliationTextBox.value){affiliationTextBox.setAttribute("data-validation","bad");$Quivers.Dom.TriggerError("Must specify Affiliation Area","You must specify the area you are affiliated with.");document.getElementById("qShopEmployeeSection").setAttribute("data-validation","bad");return false;}
document.getElementById("qShopEmployeeSection").removeAttribute("data-validation");affiliationTextBox.removeAttribute("data-validation");}}catch(err){console.log(err);}
document.getElementById("qPaymentForm").removeAttribute("data-validation");document.getElementById("qPaymentForm").scrollIntoView();document.getElementById("qConfirmPaymentBluesnap").click();}
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");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);}
var loadingScreen=document.getElementById("qTransactionProcessingScreen");if(loadingScreen){loadingScreen.className="visible";loadingScreen.style="display: block !important; visibility: visible !important;";}
var fraudReviewStatus=null;try{var fraudReviewStatuses=$Quivers.Dom.Get('[name="qTestFraudReview"]');for(var i=0;i<fraudReviewStatuses.length;i++){if(fraudReviewStatuses[i].checked==true)
fraudReviewStatus=fraudReviewStatuses[i].value;}}
catch(err){}
var checkoutData={PaymentGateway:self.PaymentGateway,MarketplaceId:self.Client.Marketplace,EmailAddress:self.Payment.Settings.Result.User!=null?self.Payment.Settings.Result.User:self.ShippingAddress.Email,BillingAddressId:self.BillingAddress.Id,ShippingAddressId:self.ShippingAddress!==null?self.ShippingAddress.Id:null,CheckoutNote:document.getElementById("qOrderNote").value,TestFraudReviewStatus:fraudReviewStatus};if(self.IsPayPal){checkoutData.PaymentData={PaymentId:self.Payment.PayPal.Result.Parameters.paymentId,PayerId:self.Payment.PayPal.Result.Parameters.PayerID,SessionId:self.Payment.PayPal.Result.Parameters.SessionId,Token:self.Payment.PayPal.Result.Parameters.token,Type:"PayPal"}}
else{checkoutData.PaymentData={Token:self.Payment.Settings.Result.Data.Token,FraudSessionId:self.CartToken,Type:"Bluesnap"}}
try{if(self.Client.Settings.Extensions.Affiliation&&self.Client.Settings.Extensions.Affiliation.Enabled==true){checkoutData.Affiliation={Checkbox:document.getElementById("qShopEmployeeCheckbox").checked,Area:document.getElementById('qAffiliationAreaInput').value,Type:$Quivers.Dom.Get('input[type="radio"][name="qAffiliationType"]:checked')[0].value};}}catch(err){console.log(err);}
self.Client.Post("user/cart/checkout?checkout=true",checkoutData,function(data){data=$Quivers.Utilities.FormatResult(data);if(self.Client.Settings.Ribbon.Position=="right")
ribbon.setAttribute("style","right: 0px !important;");else
ribbon.setAttribute("style","top: 0px !important;");elem.setAttribute("style","pointer-events: all;");btn.removeAttribute("working");btn.removeAttribute("disabled");loadingScreen=document.getElementById("qTransactionProcessingScreen");if(loadingScreen){loadingScreen.className="hidden";loadingScreen.style="display: none !important; visibility: hidden !important;";}
if(data.ResponseCode<300){self.Client.CurrentView="Confirmation";var url=self.Client.GetUrlScheme("Default","Confirmation");url=self.Client.ConstructURL(url);window.history.pushState(url,url,url);elem.innerHTML=data.Result.Html;document.getElementById("qCartCount-Shopping").innerHTML="0";self.Client.Criteo.Transaction(data.Result.Data,self.Client.Currency);self.Client.Analytics.Purchase(data.Result.Data,self.Client.Currency);if(typeof data.Result.Data.RemainingBoomerangCredit!=="undefined")
document.getElementById("qBoomerangRibbonCreditAmount").innerHTML="Avail. Credit:<br>"+data.Result.Data.RemainingBoomerangCredit;try{self.FireConversionCodeBlocks();}
catch(err){console.warn(err);}}
else{$Quivers.Dom.TriggerError("Failed To Process Order",data.Result.Html);}});}}
HoverCart=function(marketplace,id,business,environment){this.Marketplace=marketplace;if(typeof business=="undefined"||business==null||business==""){var affiliate=$Quivers.Utilities.GetQuery("Affiliate");if(affiliate=="")
affiliate=$Quivers.Utilities.GetQuery("affiliate");if(affiliate==""){try{affiliate=sessionStorage.getItem("quivers_hovercart_affiliate");}catch(err){console.warn(err);}}
if(affiliate!=null&&affiliate!=""){this.PointOfSaleBusiness=affiliate;try{sessionStorage.setItem("quivers_hovercart_affiliate",affiliate);}catch(err){console.warn(err);}}
else
this.PointOfSaleBusiness=null;}
else
this.PointOfSaleBusiness=business;this.Id=id;if(typeof environment=="undefined")
this.Environment="Live";else
this.Environment=environment;$Quivers.DEBUG=true;switch(this.Environment.toLowerCase()){case"demo":this.Host="hovercart.quiversdemo.com";this.CDNHost="hovercart.quiversdemo.com";this.WebsocketHost="wss://hovercart-ws.quiversdemo.com:443/";break;case"test":this.Host="hovercart.quiverstest.com";this.CDNHost="hovercart.quiverstest.com";this.WebsocketHost="wss://hovercart-ws.quiverstest.com:443/";break;case"local":this.Host="localhost";this.CDNHost="localhost";this.WebsocketHost="wss://localhost:8443/";break;case"test_aws":this.Host="hovercart.quiverstest.com";this.CDNHost="hovercart.quiverstest.com";this.WebsocketHost="wss://hovercart-ws.quiverstest.com:443/";break;case"demo_aws":this.Host="hovercart.quiversdemo.com";this.CDNHost="hovercart.quiversdemo.com";this.WebsocketHost="wss://hovercart-ws.quiversdemo.com:443/";break;case"prod_aws":this.Host="hovercart.quivers.com";this.CDNHost="hovercart.quivers.com";this.WebsocketHost="wss://hovercart-ws.quivers.com:443/";if($Quivers.Utilities.GetQuery("Debug").toLowerCase()!="true")
$Quivers.DEBUG=false;break;default:this.Host="hovercart.quivers.com";this.CDNHost="hovercart.quivers.com";this.WebsocketHost="wss://hovercart-ws.quivers.com:443/";if($Quivers.Utilities.GetQuery("Debug").toLowerCase()!="true")
$Quivers.DEBUG=false;}
this.Api="/api/v1/";this.Version="2.13.37";this.GooglePlaces="AIzaSyBlDrnys64o8QpFJJCRoUJ6VEVC5Bk7DzU";this.ClientId=$Quivers.Utilities.CreateGuid();this.Origin=document.domain;this.CurrentUrl=window.location.href;this.Callbacks=[];try{var lastVersion=localStorage.getItem("HoverCart.Version");if(lastVersion!=null&&lastVersion!=this.Version){localStorage.clear();}}
catch(e){console.warn("Warning: Local Storage is either disabled, not available, or has run out of available space.");}
try{localStorage.setItem("HoverCart.Version",this.Version);}catch(e){console.warn("Warning: Local Storage is either disabled, not available, or has run out of available space. 'HoverCart.Version' will not be cached.");}
for(var key in $Quivers){this[key]=$Quivers[key];}
this.ThirdPartyCookiesEnabled=true;this.Addresses.MarketplaceId=this.Marketplace;this.Analytics.MarketplaceId=this.Marketplace;this.GA_TrackingCodes=[];this.Cart.MarketplaceId=this.Marketplace;this.Catalog.MarketplaceId=this.Marketplace;this.Criteo.MarketplaceId=this.Marketplace;this.DisplayElements.MarketplaceId=this.Marketplace;this.Dom.MarketplaceId=this.Marketplace;this.Forms.MarketplaceId=this.Marketplace;this.Languages={};this.Orders.MarketplaceId=this.Marketplace;this.Products.MarketplaceId=this.Marketplace;this.Settings=new $Quivers.Settings();this.Settings.MarketplaceId=this.Marketplace;this.Translation.MarketplaceId=this.Marketplace;this.Urls.Paths.MarketplaceId=this.Marketplace;this.Views.MarketplaceId=this.Marketplace;this.SessionStarted=null;this.MouseflowId="d5e81974-96f9-4088-a338-3e35f4cef3ab";if(this.Environment=="local")
this.Cloudhub=new Cloudhub(this.Marketplace,"test");else
this.Cloudhub=new Cloudhub(this.Marketplace,this.Environment);this.Cloudhub.cacheData=false;this.Connect=function(){var self=this;try{this.Socket=new WebSocket(this.WebsocketHost);this.Socket.Marketplace=this.Marketplace;this.Socket.onopen=function(msg){$Quivers.Utilities.Debug("Connection to WebSocket Server successful ("+this.readyState+")");};this.Socket.onmessage=function(msg){var data=JSON.parse(msg.data);$Quivers.Utilities.Debug(data);if(typeof data.Type!=="undefined"){if(typeof data.PayPal!=="undefined"&&typeof window[this.Marketplace].Checkout!=="undefined"){window[this.Marketplace].Checkout.CompletePayPal(data.PayPal);}
if(typeof data.PayPalStarted!=="undefined"){document.getElementById("qBlueSnapPayPalMethod").checked=true;window[this.Marketplace].Checkout.Payment.PayPal.Started=true;}
if(typeof data.Status!=="undefined"&&data.Status=="Connected"&&self.Checkout){clearInterval(self.Checkout.PayPalInterval);document.getElementById("qBluesnapPaymentTypePayPal").setAttribute('data-paypal',"Ready");}}
else{if(typeof window[data.Message+"-Length"]!="undefined"){$Quivers.Utilities.Debug(data.Resource+" took "+(new Date-window[data.Message+"-Length"]+" milliseconds"));delete window[data.Message+"-Length"];}
if(typeof data.Result!=="undefined"&&typeof data.Result.Error!="undefined"&&data.ResponseCode==503){for(var i in window[this.Marketplace].Callbacks){delete window[this.Marketplace].Callbacks[i];window[this.Marketplace].Socket.Reconnect=true;var resetDom=$Quivers.Dom.Get("[loading=true]")
for(var i in resetDom){resetDom[i].setAttribute("loading","false");}}}
if(typeof data.Result=="undefined")
console.warn(data);var d=new Date;if(window[this.Marketplace].Settings.Application.UseLocalCache==true){if(typeof data.Result!="undefined"){if(typeof data.Result.Cache!="undefined"&&data.Result.Cache!=false&&(d.getTime()/1000)<data.Result.Cache){try{localStorage.setItem(data.Resource+"*"+this.Marketplace,JSON.stringify(data));}catch(e){}}
else{try{localStorage.removeItem(data.Resource+"*"+this.Marketplace);}
catch(e){}}}}
if(typeof data.Resource!="object")
var resource=data.Resource.split("?")[0];if(typeof data.ResponseCode!="undefined"&&typeof resource!="undefined"&&resource!=null&&typeof window[this.Marketplace][resource]!="undefined"){if(data.ResponseCode<300){if(typeof window[this.Marketplace][resource].success=="function"){window[this.Marketplace][resource].success(data);}}
else{if(typeof window[this.Marketplace][resource].error=="function"){window[this.Marketplace][resource].error(data);}}
if(typeof window[this.Marketplace][resource].complete=="function"){window[this.Marketplace][resource].complete(data);}}
if(typeof window[this.Marketplace].Callbacks[data.Message]!="undefined")
window[this.Marketplace].Callbacks[data.Message](data);}};this.Socket.onclose=function(msg){$Quivers.Utilities.Debug("Disconnected from WebSocket Server ("+this.readyState+")");if(window[this.Marketplace].SessionStarted==false)
window[this.Marketplace].CreateSession();var reconnectInterval=setInterval(function(){if(self.Socket.readyState==WebSocket.CLOSED)
self.Reconnect();else
clearInterval(reconnectInterval);},500);};return true;}catch(ex){$Quivers.Utilities.Debug(ex);return false;}}
this.Disconnect=function(){if(this.Socket!=null){this.Socket.close();this.Socket=null;return true;}
return false;};this.Reconnect=function(){$Quivers.Utilities.Debug("HoverCart WebSocket closed. Attempting to reconnect...");this.Disconnect();this.Connect();};this.Send=function(resource,data,callback){var lang=$Quivers.Utilities.GetCookie("HoverCart-Language");if(lang==null)
lang=null;if(typeof this.Settings.General!=="undefined"){if(this.Settings.Pages.Products.PageUrl!="")
var scheme=this.Settings.Pages.Products.PageUrl+this.GetUrlScheme("Product","");else
var scheme=window.location.protocol+"//"+window.location.hostname+window.location.pathname+this.GetUrlScheme("Product","");}
else
var scheme=null;try{var timezone=Intl.DateTimeFormat().resolvedOptions().timeZone;}
catch(err){timezone=null;}
var message={Message:$Quivers.Utilities.CreateGuid(),Client:this.ClientId,Session:this.SessionId,Origin:window.location.hostname,Location:window.location.href,ProductUrlScheme:scheme,Environment:this.Environment,Marketplace:this.Marketplace,Resource:resource,Cache:this.Settings.Application.UseServerCache,Data:data,Language:lang,Timezone:timezone,Protocol:window.location.protocol.split(":")[0]};if(typeof callback!="undefined"&&typeof callback=="function")
this.Callbacks[message.Message]=callback;var uri=message.Resource.substring(message.Resource.indexOf("/"));$Quivers.Utilities.Debug("Requesting '"+resource+"'");if(this.Socket!=null&&this.Socket.readyState==this.Socket.OPEN){var proceed=true;if(typeof window[this.Marketplace][uri.split("?")[0]]!="undefined"&&typeof window[this.Marketplace][uri.split("?")[0]].beforeSend=="function"){proceed=window[this.Marketplace][uri.split("?")[0]].beforeSend(message);}
if(proceed==true){try{var cachedResult=localStorage.getItem(uri+"*"+this.Marketplace);}
catch(err){var cachedResult=null;}
if(this.Settings.Application.UseLocalCache==true&&cachedResult!=null){var c=JSON.parse(cachedResult);var d=new Date;if(typeof c.Result.Cache!="undefined"&&c.Result.Cache!=false&&(d.getTime()/1000)>=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;}
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);}
$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<window.ActiveHoverCarts.length;i++){if(window[window.ActiveHoverCarts[i]].Settings&&window[window.ActiveHoverCarts[i]].Settings.General)
window[window.ActiveHoverCarts[i]].SelectViewFromUrl();}
var zooms=document.getElementsByClassName("zoomContainer");for(var i=0;i<zooms.length;i++){if(typeof zooms[i]!=="function")
zooms[i].parentNode.removeChild(zooms[i]);}}
this.CookiesDialog=function(){var hc=this;var html='<div class="alert alert-danger">'+hc.$("CookiesNotEnabled")+'</div>';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+="<h3>"+hc.$("CookiesHelp")+' <a href="'+url+'">'+hc.$("CookiesHelp2")+"</a></h3>";$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(){this.Get("clearCache",function(result){sessionStorage.clear();localStorage.clear();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 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");}
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)<this.cacheTTL){if(typeof callback=="function"){if(returnXhr)
callback(xhr);else
callback(xhr.responseJSON);}
return true;}}}
return $jquivers.ajax({type:"GET",url:url,headers:{Authorization:auth,"Content-Type":"application/json"},complete:function(xhr){localStorage.setItem("quiversauth_hovercart",xhr.getResponseHeader("authorization"));document.cookie="quiversauth_hovercart="+xhr.getResponseHeader("authorization")+";path=/";xhr.timeOfRequest=new Date;xhr.timeOfRequest=xhr.timeOfRequest.toJSON();if(self.cacheData==true&&xhr.status<300)
localStorage.setItem(url,JSON.stringify(xhr));if(typeof callback=="function"){if(returnXhr)
callback(xhr);else{if(typeof xhr.responseJSON!=="undefined")
callback(xhr.responseJSON);else{try{callback(JSON.parse(xhr.responseText));}
catch(err){callback(null);}}}}}});}
this.post=function(endpoint,postData,callback){var returnXhr=this.returnXhr;if(this.apikey!=null)
var auth="ApiKey "+this.apiKey;else
var auth=localStorage.getItem("quiversauth_hovercart");return $.ajax({type:"POST",url:this.getEndpoint(endpoint),headers:{Authorization:auth,"Content-Type":"application/json"},complete:function(xhr){localStorage.setItem("quiversauth_hovercart",xhr.getResponseHeader("authorization"));document.cookie="quiversauth_hovercart="+xhr.getResponseHeader("authorization")+";path=/";xhr.timeOfRequest=new Date;xhr.timeOfRequest=xhr.timeOfRequest.toJSON();if(typeof callback=="function"){if(returnXhr)
callback(xhr);else{if(typeof xhr.responseJSON!=="undefined")
callback(xhr.responseJSON);else{try{callback(JSON.parse(xhr.responseText));}
catch(err){callback(null);}}}}},data:JSON.stringify(postData)});}
this.upload=function(file,callback){var returnXhr=this.returnXhr;if(this.apikey!=null)
var auth="ApiKey "+this.apiKey;else
var auth=localStorage.getItem("quiversauth_hovercart");return $.ajax({type:"POST",url:this.getEndpoint("Pictures/InsertWithFileUpload"),headers:{Authorization:auth},complete:function(xhr){localStorage.setItem("quiversauth_hovercart",xhr.getResponseHeader("authorization"));document.cookie="quiversauth_hovercart="+xhr.getResponseHeader("authorization")+";path=/";xhr.timeOfRequest=new Date;xhr.timeOfRequest=xhr.timeOfRequest.toJSON();if(typeof callback=="function"){if(returnXhr)
callback(xhr);else
callback(xhr.responseJSON);}},data:file});}
this.authenticate=function(credentials,callback){this.post("SignIn/SignIn",credentials,callback);}}
ColorPicker={slider:function(ev){ev.preventDefault();var slider=ev.target;switch(slider.getAttribute("name")){case"Red":var colors=[slider.value,0,0,1];break;case"Green":var colors=[0,slider.value,0,1];break;case"Blue":var colors=[0,0,slider.value,1];break;case"Alpha":var colors=[0,0,0,slider.value];break;}
slider.setAttribute("style","background: rgba("+colors.join()+");");var sliders=document.getElementsByClassName("qColorSlider");var color=[];for(var i=0;i<sliders.length;i++){if(sliders[i].getAttribute("data-picker")==slider.getAttribute("data-picker")){color.push(sliders[i].value);}}
var selections=document.getElementsByClassName("qColorSelection");for(var i=0;i<selections.length;i++){if(selections[i].getAttribute("data-picker")==slider.getAttribute("data-picker")){selections[i].setAttribute("style","background-color: rgba("+color.join()+"); background-image: url('"+selections[i].getAttribute("data-logo")+"')")}}
var inputs=document.getElementsByClassName("qColorInput");for(var i=0;i<inputs.length;i++){if(inputs[i].getAttribute("data-picker")==slider.getAttribute("data-picker")){inputs[i].value="rgba("+color.join()+")";inputs[i].form.onchange({target:$Quivers.Dom.Get('input[type="text"][data-picker="'+slider.getAttribute("data-picker")+'"]')[0],currentTarget:inputs[i].form})}}},selection:function(ev){var input=ev.target;var string=input.value;if(string.indexOf("#")===0){var rgb=ColorPicker.hexToRgb(string);var colors=[rgb.r,rgb.g,rgb.b,1];}
else{var colors=string.slice(5,string.indexOf(")")).split(",");for(var i=0;i<colors.length;i++){if(i<3)
colors[i]=parseInt(colors[i]);else{if(isNaN(parseInt(colors[i])))
colors[i]=parseFloat(colors[i]).toFixed(2);else
colors[i]=parseInt(colors[i]);}}
for(var i=0;i<colors.length;i++){if(i<3){if(colors[i]>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;i<sliders.length;i++){if(sliders[i].getAttribute("data-picker")==input.getAttribute("data-picker")){switch(sliders[i].getAttribute("name")){case"Red":var value=[colors[0],0,0,1];sliders[i].value=colors[0];break;case"Green":var value=[0,colors[1],0,1];sliders[i].value=colors[1];break;case"Blue":var value=[0,0,colors[2],1];sliders[i].value=colors[2];break;case"Alpha":var value=[0,0,0,colors[3]];sliders[i].value=colors[3];break;}
sliders[i].setAttribute("style","background: rgba("+value.join()+");");}}
var selections=document.getElementsByClassName("qColorSelection");for(var i=0;i<selections.length;i++){if(selections[i].getAttribute("data-picker")==input.getAttribute("data-picker")){selections[i].setAttribute("style","background-color: rgba("+colors.join()+"); background-image: url('"+selections[i].getAttribute("data-logo")+"')")}}},hexToRgb:function(hex){var shorthandRegex=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;hex=hex.replace(shorthandRegex,function(m,r,g,b){return r+r+g+g+b+b;});var result=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);return result?{r:parseInt(result[1],16),g:parseInt(result[2],16),b:parseInt(result[3],16)}:null;}}
$Quivers.Criteo={Activate:function(settings){for(var i in settings){if(typeof settings[i]!=="function")
this[i]=settings[i];}
if(typeof this.Enabled=="undefined")
this.Enabled=false;this.Ready=false;var criteo=this;if(this.Enabled==true){if(typeof window.criteo_q=="undefined"){$jquivers.getScript("//static.criteo.net/js/ld/ld.js",function(result){window.criteo_q.push({event:"setAccount",account:criteo.AccountId});criteo.Ready=true;});}
else{window.criteo_q.push({event:"setAccount",account:criteo.AccountId});criteo.Ready=true;}}},SetEmail:function(email,md5Email){if(this.Enabled==true){this.EmailAddress=email;if(this.HashConsumerEmailAddresses==true)
var emailAddress=md5Email;else
var emailAddress=email;if(emailAddress!==false||emailAddress===null){if(typeof emailAddress=="undefined")
emailAddress=null;if(window[this.MarketplaceId].Settings.Extensions.CriteoTracking.HashConsumerEmailAddresses==true){this.Push({event:"setHashedEmail",email:emailAddress});}
else{this.Push({event:"setEmail",email:emailAddress});}}}},ViewCart:function(cart){if(this.Enabled==true){var criteoEvent={event:"viewBasket",currency:window[this.MarketplaceId].Currency,item:[]};for(var i in cart.Items){if(cart.Items[i]!=="function"&&!isNaN(parseInt(i))){if(cart.Items[i].ProductRefId==""||cart.Items[i].ProductRefId==null)
cart.Items[i].ProductRefId="0";criteoEvent.item.push({id:cart.Items[i].ProductRefId,price:cart.Items[i].UnitPrice-cart.Items[i].Discount,quantity:cart.Items[i].Quantity});}}
this.Push(criteoEvent);}},Transaction:function(order){if(this.Enabled==true){var criteoEvent={event:"trackTransaction",id:order.OrderRefId,currency:window[this.MarketplaceId].Currency,item:[]};for(var i in order.OrderProductVariants){if(order.OrderProductVariants[i]!=="function"&&!isNaN(parseInt(i))){if(order.OrderProductVariants[i].ProductRefId==""||order.OrderProductVariants[i].ProductRefId==null)
order.OrderProductVariants[i].ProductRefId="0";var match=false;for(var k in criteoEvent.item){if(criteoEvent.item[k]!=="function"&&!isNaN(parseInt(k))){if(btoa(order.OrderProductVariants[i].ProductVariantName+JSON.stringify(order.OrderProductVariants[i].SelectedProductOptions))==criteoEvent.item[k].uniq&&parseFloat((order.OrderProductVariants[i].SubTotal-order.OrderProductVariants[i].Discount).toFixed(2))==criteoEvent.item[k].price){criteoEvent.item[k].quantity++;match=true;}}}
if(match==false){criteoEvent.item.push({uniq:btoa(order.OrderProductVariants[i].ProductVariantName+JSON.stringify(order.OrderProductVariants[i].SelectedProductOptions)),id:order.OrderProductVariants[i].ProductRefId,price:parseFloat((order.OrderProductVariants[i].SubTotal-order.OrderProductVariants[i].Discount).toFixed(2)),quantity:order.OrderProductVariants[i].Quantity});}}}
for(var k in criteoEvent.item){if(criteoEvent.item[k]!=="function"&&!isNaN(parseInt(k))){delete criteoEvent.item[k].uniq;}}
this.Push(criteoEvent);}},Push:function(ev){var doPush=function(ev){$Quivers.Utilities.Debug("Pushing Criteo Event");if(typeof ev.item!=="undefined"&&(ev.item==null||ev.item==""))
ev.item="0";try{window.criteo_q.push(ev);$Quivers.Utilities.Debug(ev);}
catch(err){console.warn(err);}};if(this.Enabled===true){var criteo=this;if(criteo.Ready==true)
doPush(ev);else{var quiversCriteoPushInterval=setInterval(function(){if(criteo.Ready==true){doPush(ev);clearInterval(quiversCriteoPushInterval);}},500);}}}}
$Quivers.Dom={Get:function(query){return Array.prototype.slice.call(document.querySelectorAll(query));},Traverse:function(node,func){if(typeof node.getAttribute=="undefined"||node.getAttribute('data-notermswap')===null){func(node);node=node.firstChild;while(node){$Quivers.Dom.Traverse(node,func);node=node.nextSibling;}}},ReplaceHtml:function(element,newHtml){if(element){if(typeof element.innerHTML!=="undefined")
element.innerHTML=newHtml;var hc=window[this.MarketplaceId];if(hc.Translation.GetCurrentLanguage()=="en")
hc.Translation.SwapCustomTerms(element);else{setTimeout(function(){hc.Translation.SwapCustomTerms(element);},1000);}}},CreateAlert:function(parent,alertType,message,persist){if(typeof persist==="undefined")
var persist=false;$Quivers.Utilities.Debug("Creating an Alert at "+parent);var parent=document.getElementById(parent);var alert=document.createElement("div");alert.className="alert alert-"+alertType+" alert-dismissable";alert.setAttribute("role","alert");alert.innerHTML='<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>';alert.innerHTML=alert.innerHTML+message;if(persist===false)
parent.innerHTML="";parent.appendChild(alert);},GenerateAlertHtml:function(alertType,message){var alert=document.createElement("div");alert.className="alert alert-"+alertType+" alert-dismissable";alert.setAttribute("role","alert");alert.innerHTML='<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>';alert.innerHTML=alert.innerHTML+message;return alert.outerHTML;},Listeners:function(){if($jquivers("#q-search").length){$jquivers("#q-search").submit(function(e){e.preventDefault();Quivers.Products.search();});}
try{var qtyFields=this.Get('[id="qVariantQuantity"]');if(qtyFields.length>0){for(var i=0;i<qtyFields.length;i++){qtyFields[i].onkeydown=function(e){if(!((e.keyCode>95&&e.keyCode<106)||(e.keyCode>47&&e.keyCode<58)||e.keyCode==8)){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;i<elements.length;i++){if(typeof elements[i]!=="function"){elements[i].style="";var height=elements[i].clientHeight;if(height>smallestHeight){smallestHeight=height;}}}
for(var i=0;i<elements.length;i++){if(typeof elements[i]!=="function"){elements[i].style="height: "+smallestHeight+"px;";}}
row++;}while(elements.length>0);},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<popovers.length;i++){popovers[i].setAttribute("data-open","false");}}});},AutofillStateProvince:function(t){var s=document.getElementById(t.getAttribute('data-state-autocomplete'));for(var i=0;i<s.options.length;i++){if(s.options[i].getAttribute("data-abrv")==t.value){s.selectedIndex=i;}}},ToggleStates:function(sel,ev){var stateSelect=document.getElementById('qSelectStates-'+sel);var country=ev.target.options[ev.target.selectedIndex].value;var options=new Array;for(var i=0;i<stateSelect.options.length;i++){if(stateSelect.options[i].getAttribute("data-country")==country){stateSelect.options[i].removeAttribute("hidden");stateSelect.options[i].removeAttribute("disabled");if(!stateSelect.options[i].hasAttribute("selected")&&stateSelect.options[stateSelect.selectedIndex].getAttribute("data-country")!=country)
stateSelect.selectedIndex=i;options.push(stateSelect.options[i]);}
else{stateSelect.options[i].setAttribute("hidden","");stateSelect.options[i].setAttribute("disabled","");}}
if(options.length==1&&options[0].text=="Other"){document.getElementById('qCity-'+sel).className="col-xs-12 col-md-6";document.getElementById('qState-'+sel).className="col-xs-12 hidden";document.getElementById('qZipCode-'+sel).className="col-xs-12 col-md-6";}
else{document.getElementById('qCity-'+sel).className="col-xs-12 col-md-4";document.getElementById('qState-'+sel).className="col-xs-12 col-md-4";document.getElementById('qZipCode-'+sel).className="col-xs-12 col-md-4";}
for(var i=options.length-1;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<tabs.length;i++){if(tabs[i].getAttribute("role")==tab.getAttribute("role")){if(tabs[i]==tab){tabs[i].className="tab active";document.getElementById(tab.getAttribute("data-target")).className="visible";if(tabs[i].getAttribute("role")!=="qDocuments"&&window[this.MarketplaceId].GetModuleQueryId("Default")!="Checkout"&&window[this.MarketplaceId].GetModuleQueryId("Default")!="Settings"&&window[this.MarketplaceId].GetModuleQueryId("Default")!="Documents"){var url=window[this.MarketplaceId].ConstructURL(window[this.MarketplaceId].GetUrlScheme("Default",tabs[i].getAttribute("data-name")));window.history.pushState(url,url,url);}}
else{tabs[i].className="tab";document.getElementById(tabs[i].getAttribute("data-target")).className="hidden";}}}},ToggleValidation:function(input,type){formGroup=input.parentNode;if(formGroup.className=="input-group")
formGroup=formGroup.parentNode;if(formGroup.className.indexOf("form-group")>-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-6 col-md-offset-3 col-lg-4 col-lg-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("QuiversDialogBox").className=className;document.getElementById("QuiversDialogTitle").innerHTML=title;document.getElementById("QuiversDialogBody").innerHTML=body;document.getElementById("QuiversOverlay").className="visible";document.getElementById("QuiversDialogBoxContainer").className="visible";document.body.setAttribute('data-mobile-allow-scroll','false');$Quivers.Dom.ResizeDialog();},TriggerError:function(title,message){var html='<div class="qDialogError">';html+='<div class="qDialogIcon"><span class="glyphicon glyphicon-exclamation-sign"></span></div>';html+='<div class="qMessage">'+message+'</div>';html+='</div>';$Quivers.Dom.TriggerDialog(title,html);},TriggerNotice:function(title,message){var html='<div class="qDialogNotice">';html+='<div class="qDialogIcon"><span class="glyphicon glyphicon-question-sign"></span></div>';html+='<div class="qMessage">'+message+'</div>';html+='</div>';$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='<a disabled>'+i+'</a>';pages[i-1].className="qUpsellProductsPage visible";}
else{$Quivers.Dom.Get('[data-pager-button="'+i+'"]')[0].innerHTML='<a onclick="$Quivers.Dom.DialogPager('+i+');">'+i+'</a>';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('<div style="height:'+self.nzHeight+'px;width:'+self.nzWidth+'px;" class="zoomWrapper" />');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<self.options.zoomWindowWidth/self.widthRatio){lensHeight=self.nzHeight;}
else{lensHeight=String((self.options.zoomWindowHeight/self.heightRatio))}
if(self.largeWidth<self.options.zoomWindowWidth){lensWidth=self.nzWidth;}
else{lensWidth=(self.options.zoomWindowWidth/self.widthRatio);}
self.lensStyle="background-position: 0px 0px;width: "+String((self.options.zoomWindowWidth)/self.widthRatio)+"px;height: "+String((self.options.zoomWindowHeight)/self.heightRatio)
+"px;float: right;display: none;"
+"overflow: hidden;"
+"z-index: 999;"
+"-webkit-transform: translateZ(0);"
+"opacity:"+(self.options.lensOpacity)+";filter: alpha(opacity = "+(self.options.lensOpacity*100)+"); zoom:1;"
+"width:"+lensWidth+"px;"
+"height:"+lensHeight+"px;"
+"background-color:"+(self.options.lensColour)+";"
+"cursor:"+(self.options.cursor)+";"
+"border: "+(self.options.lensBorderSize)+"px"+" solid "+(self.options.lensBorderColour)+";background-repeat: no-repeat;position: absolute;";}
self.tintStyle="display: block;"
+"position: absolute;"
+"background-color: "+self.options.tintColour+";"
+"filter:alpha(opacity=0);"
+"opacity: 0;"
+"width: "+self.nzWidth+"px;"
+"height: "+self.nzHeight+"px;";self.lensRound='';if(self.options.zoomType=="lens"){self.lensStyle="background-position: 0px 0px;"
+"float: left;display: none;"
+"border: "+String(self.options.borderSize)+"px solid "+self.options.borderColour+";"
+"width:"+String(self.options.lensSize)+"px;"
+"height:"+String(self.options.lensSize)+"px;"
+"background-repeat: no-repeat;position: absolute;";}
if(self.options.lensShape=="round"){self.lensRound="border-top-left-radius: "+String(self.options.lensSize/2+self.options.borderSize)+"px;"
+"border-top-right-radius: "+String(self.options.lensSize/2+self.options.borderSize)+"px;"
+"border-bottom-left-radius: "+String(self.options.lensSize/2+self.options.borderSize)+"px;"
+"border-bottom-right-radius: "+String(self.options.lensSize/2+self.options.borderSize)+"px;";}
self.zoomContainer=$jquivers('<div class="zoomContainer" style="-webkit-transform: translateZ(0);position:absolute;left:'+self.nzOffset.left+'px;top:'+self.nzOffset.top+'px;height:'+self.nzHeight+'px;width:'+self.nzWidth+'px;"></div>');$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("<div class='zoomLens' style='"+self.lensStyle+self.lensRound+"'>&nbsp;</div>").appendTo(self.zoomContainer).click(function(){self.$elem.trigger('click');});if(self.options.tint){self.tintContainer=$jquivers('<div/>').addClass('tintContainer');self.zoomTint=$jquivers("<div class='zoomTint' style='"+self.tintStyle+"'></div>");self.zoomLens.wrap(self.tintContainer);self.zoomTintcss=self.zoomLens.after(self.zoomTint);self.zoomTintImage=$jquivers('<img style="position: absolute; left: 0px; top: 0px; max-width: none; width: '+self.nzWidth+'px; height: '+self.nzHeight+'px;" src="'+self.imageSrc+'">').appendTo(self.zoomLens).click(function(){self.$elem.trigger('click');});}}
if(isNaN(self.options.zoomWindowPosition)){self.zoomWindow=$jquivers("<div style='z-index:999;left:"+(self.windowOffsetLeft)+"px;top:"+(self.windowOffsetTop)+"px;"+self.zoomWindowStyle+"' class='zoomWindow'>&nbsp;</div>").appendTo('body').click(function(){self.$elem.trigger('click');});}else{self.zoomWindow=$jquivers("<div style='z-index:999;left:"+(self.windowOffsetLeft)+"px;top:"+(self.windowOffsetTop)+"px;"+self.zoomWindowStyle+"' class='zoomWindow'>&nbsp;</div>").appendTo(self.zoomContainer).click(function(){self.$elem.trigger('click');});}
self.zoomWindowContainer=$jquivers('<div/>').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.nzHeight<self.options.zoomWindowWidth/self.widthRatio){lensHeight=self.nzHeight;}
else{lensHeight=String((self.options.zoomWindowHeight/self.heightRatio))}
if(self.largeWidth<self.options.zoomWindowWidth){lensWidth=self.nzWidth;}
else{lensWidth=(self.options.zoomWindowWidth/self.widthRatio);}
self.widthRatio=self.largeWidth/self.nzWidth;self.heightRatio=self.largeHeight/self.nzHeight;if(self.options.zoomType!="lens"){if(self.nzHeight<self.options.zoomWindowWidth/self.widthRatio){lensHeight=self.nzHeight;}
else{lensHeight=String((self.options.zoomWindowHeight/self.heightRatio))}
if(self.nzWidth<self.options.zoomWindowHeight/self.heightRatio){lensWidth=self.nzWidth;}
else{lensWidth=String((self.options.zoomWindowWidth/self.widthRatio));}
self.zoomLens.css('width',lensWidth);self.zoomLens.css('height',lensHeight);if(self.options.tint){self.zoomTintImage.css('width',self.nzWidth);self.zoomTintImage.css('height',self.nzHeight);}}
if(self.options.zoomType=="lens"){self.zoomLens.css({width:String(self.options.lensSize)+'px',height:String(self.options.lensSize)+'px'})}}}
self.zoomContainer.css({top:self.nzOffset.top});self.zoomContainer.css({left:self.nzOffset.left});self.mouseLeft=parseInt(e.pageX-self.nzOffset.left);self.mouseTop=parseInt(e.pageY-self.nzOffset.top);if(self.options.zoomType=="window"){self.Etoppos=(self.mouseTop<(self.zoomLens.height()/2));self.Eboppos=(self.mouseTop>self.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.largeHeight<self.options.zoomWindowHeight){self.windowTopPos=0;}
if(self.largeWidth<self.options.zoomWindowWidth){self.windowLeftPos=0;}}
if(self.options.easing){if(!self.xp){self.xp=0;}
if(!self.yp){self.yp=0;}
if(!self.loop){self.loop=setInterval(function(){self.xp+=(self.windowLeftPos-self.xp)/self.options.easingAmount;self.yp+=(self.windowTopPos-self.yp)/self.options.easingAmount;if(self.scrollingLock){clearInterval(self.loop);self.xp=self.windowLeftPos;self.yp=self.windowTopPos
self.xp=((e.pageX-self.nzOffset.left)*self.widthRatio-self.zoomWindow.width()/2)*(-1);self.yp=(((e.pageY-self.nzOffset.top)*self.heightRatio-self.zoomWindow.height()/2)*(-1));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.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.options.zoomWindowHeight){self.zoomWindow.css({"background-size":self.largeWidth/self.newvaluewidth+'px '+self.largeHeight/self.newvaluewidth+'px'});}
else{self.zoomWindow.css({"background-size":self.largeWidth/self.newvalueheight+'px '+self.largeHeight/self.newvalueheight+'px'});}}
self.changeBgSize=false;}
self.zoomWindow.css({backgroundPosition:self.windowLeftPos+'px '+self.windowTopPos+'px'});}}},setTintPosition:function(e){var self=this;self.nzOffset=self.$elem.offset();self.tintpos=String(((e.pageX-self.nzOffset.left)-(self.zoomLens.width()/2))*(-1));self.tintposy=String(((e.pageY-self.nzOffset.top)-self.zoomLens.height()/2)*(-1));if(self.Etoppos){self.tintposy=0;}
if(self.Eloppos){self.tintpos=0;}
if(self.Eboppos){self.tintposy=(self.nzHeight-self.zoomLens.height()-(self.options.lensBorderSize*2))*(-1);}
if(self.Eroppos){self.tintpos=((self.nzWidth-self.zoomLens.width()-(self.options.lensBorderSize*2))*(-1));}
if(self.options.tint){if(self.fullheight){self.tintposy=0;}
if(self.fullwidth){self.tintpos=0;}
self.zoomTintImage.css({'left':self.tintpos+'px'});self.zoomTintImage.css({'top':self.tintposy+'px'});}},swaptheimage:function(smallimage,largeimage){var self=this;var newImg=new Image();if(self.options.loadingIcon){self.spinner=$jquivers('<div style="background: url(\''+self.options.loadingIcon+'\') no-repeat center;height:'+self.nzHeight+'px;width:'+self.nzWidth+'px;z-index: 2000;position: absolute; background-position: center center;"></div>');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.nzHeight<self.options.zoomWindowWidth/self.widthRatio){lensHeight=self.nzHeight;}
else{lensHeight=String((self.options.zoomWindowHeight/self.heightRatio))}
if(self.options.zoomWindowWidth<self.options.zoomWindowWidth){lensWidth=self.nzWidth;}
else{lensWidth=(self.options.zoomWindowWidth/self.widthRatio);}
if(self.zoomLens){self.zoomLens.css('width',lensWidth);self.zoomLens.css('height',lensHeight);}}},getCurrentImage:function(){var self=this;return self.zoomImage;},getGalleryList:function(){var self=this;self.gallerylist=[];if(self.options.gallery){$jquivers('#'+self.options.gallery+' a').each(function(){var img_src='';if($jquivers(this).data("zoom-image")){img_src=$jquivers(this).data("zoom-image");}
else if($jquivers(this).data("image")){img_src=$jquivers(this).data("image");}
if(img_src==self.zoomImage){self.gallerylist.unshift({href:''+img_src+'',title:$jquivers(this).find('img').attr("title")});}
else{self.gallerylist.push({href:''+img_src+'',title:$jquivers(this).find('img').attr("title")});}});}
else{self.gallerylist.push({href:''+self.zoomImage+'',title:$jquivers(this).find('img').attr("title")});}
return self.gallerylist;},changeZoomLevel:function(value){var self=this;self.scrollingLock=true;self.newvalue=parseFloat(value).toFixed(2);newvalue=parseFloat(value).toFixed(2);maxheightnewvalue=self.largeHeight/((self.options.zoomWindowHeight/self.nzHeight)*self.nzHeight);maxwidthtnewvalue=self.largeWidth/((self.options.zoomWindowWidth/self.nzWidth)*self.nzWidth);if(self.options.zoomType!="inner")
{if(maxheightnewvalue<=newvalue){self.heightRatio=(self.largeHeight/maxheightnewvalue)/self.nzHeight;self.newvalueheight=maxheightnewvalue;self.fullheight=true;}
else{self.heightRatio=(self.largeHeight/newvalue)/self.nzHeight;self.newvalueheight=newvalue;self.fullheight=false;}
if(maxwidthtnewvalue<=newvalue){self.widthRatio=(self.largeWidth/maxwidthtnewvalue)/self.nzWidth;self.newvaluewidth=maxwidthtnewvalue;self.fullwidth=true;}
else{self.widthRatio=(self.largeWidth/newvalue)/self.nzWidth;self.newvaluewidth=newvalue;self.fullwidth=false;}
if(self.options.zoomType=="lens"){if(maxheightnewvalue<=newvalue){self.fullwidth=true;self.newvaluewidth=maxheightnewvalue;}else{self.widthRatio=(self.largeWidth/newvalue)/self.nzWidth;self.newvaluewidth=newvalue;self.fullwidth=false;}}}
if(self.options.zoomType=="inner")
{maxheightnewvalue=parseFloat(self.largeHeight/self.nzHeight).toFixed(2);maxwidthtnewvalue=parseFloat(self.largeWidth/self.nzWidth).toFixed(2);if(newvalue>maxheightnewvalue){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<alerts.length;k++){if(typeof alerts[k]!=="function")
alerts[k].innerHTML="";}
for(var i=0;i<inputs.length;i++){if(typeof inputs[i]!=="function"){if(inputs[i].getAttribute("data-form")==formName){if(inputs[i].getAttribute("data-required")=="true"&&inputs[i].value==""||(inputs[i].getAttribute("data-required")=="true"&&inputs[i].getAttribute("type")=="checkbox"&&inputs[i].checked===false)){proceed=false;if(useAlerts==true){for(var k=0;k<alerts.length;k++){$Quivers.Dom.CreateAlert(alerts[k].id,"danger",window[this.MarketplaceId].$("RequiredFieldMissingAlert","fields").replace("%s",inputs[i].getAttribute("placeholder")),true);}
$Quivers.Dom.ToggleValidation(inputs[i],"error");}}
else if(inputs[i].getAttribute("type")=="password"){if(inputs[i].value.length<7||inputs[i].value==inputs[i].value.toLowerCase()||inputs[i].value.match(/\d+/g)==null){proceed=false;if(useAlerts==true){for(var k=0;k<alerts.length;k++){$Quivers.Dom.CreateAlert(alerts[k].id,"danger",window[this.MarketplaceId].$("InvalidPasswordAlert","fields"),true);}
$Quivers.Dom.ToggleValidation(inputs[i],"error");}}
else if(useAlerts==true){$Quivers.Dom.ToggleValidation(inputs[i],"");}}
else if(useAlerts==true){$Quivers.Dom.ToggleValidation(inputs[i],"");}}}}
var selects=document.getElementsByTagName("select");for(var k=0;k<selects.length;k++){if(typeof selects[k]!=="function"){if(selects[k].getAttribute("data-form")==formName&&selects[k].getAttribute("data-required")=="true"&&selects[k].options[selects[k].selectedIndex].value=="RESELECT"){proceed=false;if(useAlerts==true)
$Quivers.Dom.ToggleValidation(selects[k],"error");for(var j=0;j<alerts.length;j++){$Quivers.Dom.CreateAlert(alerts[j].id,"danger",window[this.MarketplaceId].$("RequiredSelectMissingAlert","fields").replace("%s",selects[k].getAttribute("placeholder")),true);}}
else{if(useAlerts==true)
$Quivers.Dom.ToggleValidation(selects[k],"");}}}
return proceed;},Submit:function(formName,buttonId,callback){if(formName.indexOf("support")!==0&&(!navigator.cookieEnabled||window[this.MarketplaceId].ThirdPartyCookiesEnabled==false)){window[this.MarketplaceId].CookiesDialog(window[this.MarketplaceId]);return false;}
if(typeof buttonId.target!="undefined")
var button=buttonId.target;else
var button=document.getElementById(buttonId);var alerts=$Quivers.Dom.Get('[data-form-alerts="'+formName+'"]');var form=this.Serialize(formName);form.Data.ClientUrl=location.protocol+'//'+location.hostname+location.pathname;if(!button.hasAttribute("disabled")){if((formName.toLowerCase().indexOf("address")>-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<data.length;b++){for(var c=0;c<window[map.MarketplaceId].Countries.length;c++){if(window[map.MarketplaceId].Countries[c].CountryInfo.Id==data[b].Address.CountryId){data[b].Address.Country=window[map.MarketplaceId].Countries[c].CountryInfo.Name;for(var a=0;a<window[map.MarketplaceId].Countries[c].CountryInfo.StateProvinces.length;a++){if(window[map.MarketplaceId].Countries[c].CountryInfo.StateProvinces[a].Id==data[b].Address.StateId)
data[b].Address.StateAbbreviation=window[map.MarketplaceId].Countries[c].CountryInfo.StateProvinces[a].Abbreviation;}}}}
map.GenerateLocations(data);});}})});map.GenerateLocations(map.Locations);}
this.SetCenter=function(lat,lng){this.MyCoords.lat=lat;this.MyCoords.lng=lng;var map=this;if(typeof map.CurrentPosition!="undefined"){map.CurrentPosition.setMap(null);map.CurrentPosition.visible=false;delete map.CurrentPosition;}
this.CurrentPosition=new google.maps.Marker({position:{lat:lat,lng:lng},map:map.Map,title:window[map.MarketplaceId].$("MyLocation","instorepickup"),icon:"https://"+window[map.MarketplaceId].CDNHost+"/img/you-pin.png"});this.CurrentPosition.addListener('click',function(){new google.maps.InfoWindow({content:window[map.MarketplaceId].$("MyLocation","instorepickup")}).open(map.Map,map.CurrentPosition);});}
this.GenerateLocations=function(locations){var map=this;for(var i=0;i<map.Locations.length;i++){try{if(typeof map.Locations[i].Marker!="undefined")
map.Locations[i].Marker.setMap(null);}
catch(err){}}
map.Locations=locations;if(typeof this.InitiallySelected!="undefined"){this.MarkSelectedLocation(this.InitiallySelected);delete this.InitiallySelected;}
if(typeof map.SelectedLocation!="undefined"&&map.SelectedLocation!=null){for(var i=0;i<map.Locations.length;i++){try{if(map.Locations[i].Address.Latitude==map.SelectedLocation.Address.Latitude&&map.Locations[i].Address.Longitude==map.SelectedLocation.Address.Longitude){delete map.Locations[i];}}catch(err){}}}
if(typeof locations.length!="undefined"){for(var k=0;k<map.Locations.length;k++){try{map.Locations[k].Marker=new google.maps.Marker({position:{lat:map.Locations[k].Address.Latitude,lng:map.Locations[k].Address.Longitude},label:map.Labels[k],map:map.Map,title:map.Locations[k].Name,});map.Locations[k].Marker.Parent=map.Locations[k];map.Locations[k].Id=k;var string="<h5>"+map.Locations[k].Name+"</h5>"+
map.Locations[k].Address.AddressLine1+"<br>";if(map.Locations[k].Address.AddressLine2!=null&&map.Locations[k].Address.AddressLine2!="")
string+=map.Locations[k].Address.AddressLine2+"<br>";string+=map.Locations[k].Address.City+", "+map.Locations[k].Address.StateAbbreviation+", "+map.Locations[k].Address.PostCode+"<br>"+
map.Locations[k].Address.Country+"<br>"+"<a id='qPickupLocation-"+map.Locations[k].Id+"' class='qPickupButton' onclick='window[\""+map.MarketplaceId+"\"].InstorePickupMap.SelectLocation("+map.Locations[k].Id+");'>"+window[map.MarketplaceId].$("PickupHereBtn","instorepickup")+"</a>";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<map.Locations.length;i++){try{if(typeof map.Locations[i].Address!="undefined"){if(map.Locations[i].Address.Latitude==location.Address.Latitude&&map.Locations[i].Address.Longitude==location.Address.Longitude){if(typeof map.Locations[i].Marker!="undefined")
map.Locations[i].Marker.setMap(null);delete map.Locations[i];}}}
catch(err){}}
location.Marker=new google.maps.Marker({position:{lat:location.Address.Latitude,lng:location.Address.Longitude},map:this.Map,title:window[map.MarketplaceId].$("SelectedLocationTitle","instorepickup").replace("%s",location.Name),icon:"https://"+window[map.MarketplaceId].CDNHost+"/img/store-pin-small.png"});location.Marker.Parent=location;var string="<h5>"+location.Name+"</h5>"+
location.Address.AddressLine1+"<br>";if(location.Address.AddressLine2!=null&&location.Address.AddressLine2!="")
string+=location.Address.AddressLine2+"<br>";string+=location.Address.City+", "+location.Address.StateAbbreviation+", "+location.Address.PostCode+"<br>"+
location.Address.Country+"<br>"+"<h5 class='text-center'>"+window[map.MarketplaceId].$("SelectedLocationLabel","instorepickup")+"</h5>";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<map.Locations.length;i++){try{map.Locations[i].InfoWindow.close();}
catch(err){}}
$Quivers.Dom.ResizeDialog();});}}
var map=this;var createTheMap=function(){if("geolocation"in navigator){navigator.geolocation.getCurrentPosition(function(position){map.MyCoords.lat=position.coords.latitude;map.MyCoords.lng=position.coords.longitude;map.PopulateMap(position.coords.latitude,position.coords.longitude);},function(error){map.PopulateMap(map.MyCoords.lat,map.MyCoords.lng);});}}
if(typeof google=="undefined"||typeof google.maps=="undefined")
$jquivers.getScript("https://maps.googleapis.com/maps/api/js",createTheMap);else
createTheMap();}
$Quivers.Orders={Details:function(orderId){if(window[this.MarketplaceId].CurrentView!="Account"){var url=Quivers.GetUrlScheme("Orders",orderId);window.history.pushState(url,url,url);window[this.MarketplaceId].View("Orders",false);return true;}
var orderCards=document.getElementsByClassName("qOrderCard");for(var i=0;i<orderCards.length;i++){if(orderCards[i].getAttribute("data-order")==orderId)
orderCards[i].className="qOrderCard active";else
orderCards[i].className="qOrderCard";}
var orderDetails=document.getElementsByClassName("qOrderDetails");for(var i=0;i<orderDetails.length;i++){if(orderDetails[i].getAttribute("data-order")==orderId)
orderDetails[i].className="qOrderDetails visible";else
orderDetails[i].className="qOrderDetails hidden";}
if(window[this.MarketplaceId].GetModuleQuery("Orders")!=orderId){var url=Quivers.GetUrlScheme("Orders",orderId);window[this.MarketplaceId].UpdateURL(url,"Order/"+orderId);window[this.MarketplaceId].Analytics.SetPage("Order/"+orderId,"OrderId "+orderId,true);}},GuestDetails:function(orderGuid,email){var url=window[this.MarketplaceId].GetUrlScheme("Order",orderGuid+"&email="+email);window[this.MarketplaceId].UpdateURL(url,"Order/"+orderGuid+"&email="+email);window[this.MarketplaceId].Analytics.SetPage("Order/"+orderGuid,"Guest OrderId "+orderGuid,true);if(window[this.MarketplaceId].CurrentView!="order"){window[this.MarketplaceId].View("Order",false);}
else
window[this.MarketplaceId].Get("module?Module=userOrders"+"&Email="+email+"&Select=Order-"+orderGuid);},ShipmentDetails:function(opvId){var details=document.getElementById("qOpvShipmentStatus-"+opvId);if(details.getAttribute("data-open")=="true")
details.setAttribute("data-open","false");else
details.setAttribute("data-open","true");},ReturnDetails:function(opvId){var details=document.getElementById("qOpvReturnStatus-"+opvId);if(details.getAttribute("data-open")=="true")
details.setAttribute("data-open","false");else
details.setAttribute("data-open","true");},Address:function(orderId,type){var div=document.getElementById("qOrder"+type+"Address-"+orderId);if(div){if(div.className=="hidden"){div.className="visible";div.children[0].className="qAddressDetails visible";}
else
div.className="hidden";if(type=="Billing")
document.getElementById("qOrderShippingAddress-"+orderId).className="hidden";else
document.getElementById("qOrderBillingAddress-"+orderId).className="hidden";}},ReturnOpv:function(opvId,ev){var form=window[this.MarketplaceId].Forms.Serialize(document.getElementById("qOpvReturn-"+opvId));$Quivers.Utilities.Debug(form);var reason=document.getElementById("qReturnReasonId-"+opvId);var action=document.getElementById("qRequestedActionId-"+opvId);$Quivers.Utilities.Debug(reason.options[reason.selectedIndex].value);$Quivers.Utilities.Debug(action.options[action.selectedIndex].value);if(reason.options[reason.selectedIndex].value!=-1&&action.options[action.selectedIndex].value!=-1){var btns=$Quivers.Dom.Get('[data-opv-return="'+opvId+'"]');for(var i=0;i<btns.length;i++){if(typeof btns[i]!=="function"&&btns[i].hasAttribute('disabled'))
return false;}
for(var i=0;i<btns.length;i++){if(typeof btns[i]!=="function"){btns[i].setAttribute("working","true");btns[i].setAttribute("disabled","true");}}
window[this.MarketplaceId].Post("user/returnOpv",form.Data,function(data){data=$Quivers.Utilities.FormatResult(data);if(data.ResponseCode<300){var element=document.getElementById("userOrders");element.innerHTML=data.Result.Html;}
else{for(var i=0;i<btns.length;i++){if(typeof btns[i]!=="function"){btns[i].setAttribute("working","false");btns[i].removeAttribute("disabled");}}
window[data.Result.Marketplace].Dom.CreateAlert("qOpvReturnAlerts-"+opvId,"danger",data.Result.Html);}})}
else
window[this.MarketplaceId].Dom.CreateAlert("qOpvReturnAlerts-"+opvId,"danger",window[this.MarketplaceId].$("InvalidReturnReasonAlert","orders"));},Print:function(orderId){printOrderWindow=window.open();printOrderWindow.document.write($('#qPrintOrder-'+orderId).html());printOrderWindow.print();printOrderWindow.close();},InstorePickupLocation:function(opvId){var location=JSON.parse(document.getElementById("qOpvInstorePickupLocation-"+opvId).innerHTML);var contents='<div class="qInstorePickupSection">';contents+='<h3 class="qInStoreTitle" style="margin-top: 0px;">This is your In-Store Pickup Location</h3>';contents+='<div id="qInstorePickupMap"></div>';contents+="<div class=\"qDialogButtonContainer\"><div class=\"qWidgetButton\" onclick=\"$Quivers.Dom.CloseDialog();\">Return</div></div></div>";$Quivers.Dom.TriggerDialog("In-Store Pickup Location",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="<h5>"+location.Name+"</h5>"+
location.Address.AddressLine1+"<br>";if(location.Address.AddressLine2!=null&&location.Address.AddressLine2!="")
string+=location.Address.AddressLine2+"<br>";string+=location.Address.City+", "+location.Address.StateProvinceName+", "+location.Address.ZipPostalCode+"<br>"+
location.Address.CountryName+"<br>"+"<h5 class='text-center'>"+hc.$("SelectedLocationLabel","instorepickup")+"</h5>";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='<div class="alert alert-warning">'+hc.$("GoogleMapError","instorepickup")+'</div>';map.innerHTML+='<div id="qOpvPickupLocation" style="margin-top: 50px;"></div>';document.getElementById("qOpvPickupLocation").innerHTML+="<h4>"+location.Name+"</h4>"+location.Address.AddressLine1+"<br>";if(location.Address.AddressLine2!=null&&location.Address.AddressLine2!="")
document.getElementById("qOpvPickupLocation").innerHTML+=location.Address.AddressLine2+"<br>";document.getElementById("qOpvPickupLocation").innerHTML+=location.Address.City+", "+location.Address.StateProvinceName+", "+location.Address.ZipPostalCode+"<br>"+
location.Address.CountryName+"<br>"+"<h4>"+hc.$("SelectedLocationLabel","instorepickup")+"</h4>";}}};$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;i<this.Parent.children.length;i++){if(this.Parent.children[i].getAttribute("data-page")!=null){this.Parent.children[i].setAttribute("data-page",Math.ceil(i/this.PageSize));}}}
this.ApplyPaging();this.Length=function(){return this.Data.Length;var count=0;for(var i=0;i<this.Parent.children.length;i++){if(this.Parent.children[i].getAttribute("data-page")!=null)
count=count+1;}
return count;}
this.NumberOfPages=function(){var length=this.Length();return Math.ceil(length/this.PageSize);}
this.LastPageLength=function(){if(this.CurrentPage<this.NumberOfPages())
return this.CurrentPage*this.PageSize;else{return this.Length();}}
this.SelectPage=function(page,callback){this.CurrentPage=page;this.RenderPager();if(page<=this.NumberOfPages()){var p=this;p.Parent.setAttribute('loading','true');window[this.MarketplaceId].Get(this.Data.Resource+"?Page="+this.CurrentPage+"&PageSize="+this.PageSize+"&ConsumerGroup="+this.Data.ConsumerGroup,function(data){p.Parent.innerHTML='';var header=document.createElement("tr");header.innerHTML='<th>Code</th><th>ConsumerGroup</th><th>Times Used</th><th>Used By...</th><th></th>';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='<td>'+data.Result.Data[i].Code+'</td>';row.innerHTML+='<td>'+data.Result.Data[i].ConsumerGroupName+'</td>';row.innerHTML+='<td>'+data.Result.Data[i].TimesUsed+'</td><td data-code-used-by>'+data.Result.Data[i].UsedBy+'</td><td><a class="qWidgetButton" data-code="'+data.Result.Data[i]._id+'" onclick="window['+"'"+p.MarketplaceId+"'"+'].Settings.DeleteCodes(event);">Delete</a></td>';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<pager.children.length;k++){if(pager.children[k].getAttribute("data-page")!=null){if(pager.children[k].getAttribute("data-page")==page){pager.children[k].children[0].setAttribute("current-page","");}
else{pager.children[k].children[0].removeAttribute("current-page");}}}
document.getElementById(this.Pager.id+"-PagerStart").innerHTML=this.PageSize*page-this.PageSize+1;document.getElementById(this.Pager.id+"-PagerEnd").innerHTML=this.LastPageLength();document.getElementById(this.Pager.id+"-PagerLength").innerHTML=this.Length();}}
this.RenderPager=function(){var html='<nav><ul class="pagination" id="'+this.Pager.id+'-Pager'+'">';if(this.NumberOfPages()>5){if(this.CurrentPage!=1)
html+='<li data-page="1"><a onclick="window.Pagers['+"'"+this.Pager.id+"'"+'].SelectPage(1)">First</a></li>';if(this.CurrentPage>5)
html+="<li><a>...</a></li>";for(var i=1;i<=this.NumberOfPages();i++){if(i>this.CurrentPage-4&&i<this.CurrentPage+4)
html+='<li data-page="'+i+'"><a onclick="window.Pagers['+"'"+this.Pager.id+"'"+'].SelectPage('+i+')">'+i+'</a></li>';}
if((this.NumberOfPages()-this.CurrentPage)>5)
html+="<li><a>...</a></li>";if(this.CurrentPage!=this.NumberOfPages())
html+='<li data-page="'+this.NumberOfPages()+'"><a onclick="window.Pagers['+"'"+this.Pager.id+"'"+'].SelectPage('+this.NumberOfPages()+')">Last</a></li>';}
else{for(var i=1;i<=this.NumberOfPages();i++){html+='<li data-page="'+i+'"><a onclick="window.Pagers['+"'"+this.Pager.id+"'"+'].SelectPage('+i+')">'+i+'</a></li>';}}
if(this.Length()==0)
var start=0;else
var start=1;html+='</ul><span id="qCodesPagerRange">Currently viewing <span id="'+this.Pager.id+'-PagerStart">'+start+'</span> - <span id="'+this.Pager.id+'-PagerEnd">'+this.LastPageLength()+'</span> out of <span id="'+this.Pager.id+'-PagerLength">'+this.Length()+'</span> results</span></nav>';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];}}
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<selects.length;i++){selects[i].value=selects[i].options[ev.target.selectedIndex].value;}
$Quivers.Dom.ToggleDivs('qBasicDashboard','qProDashboard');}
this.ToggleDashboardDiv=function(setting){var views=$Quivers.Dom.Get("[data-dashboard]");for(var v=0;v<views.length;v++){if(views[v].id=="qDashboard"+setting)
views[v].className="visible";else
views[v].className="hidden";}
var buttons=$Quivers.Dom.Get("[data-dashboard-button");for(var b=0;b<buttons.length;b++){if(buttons[b].getAttribute("data-dashboard-button")==setting)
buttons[b].className="qSettingNavButton active";else
buttons[b].className="qSettingNavButton";}}
this.ApplyTemplate=function(template,ev){if(!ev.target.hasAttribute('disabled')){ev.target.setAttribute("working","true");ev.target.setAttribute('disabled','true');var form=document.getElementById("qTemplateForm-"+template);var post={Template:template};for(var i in form.elements){post[form.elements[i].name]=form.elements[i].value;}
console.log(post);window[this.MarketplaceId].Post("applyTemplate",post,function(data){data=$Quivers.Utilities.FormatResult(data);if(data.ResponseCode<300){$Quivers.Dom.CreateAlert("qTemplateAlerts","success",data.Result.Html);setTimeout(function(){window[data.Result.Marketplace].Start();},1000)}
else{$Quivers.Dom.CreateAlert("qTemplateAlerts","danger",data.Result.Html);}
ev.target.setAttribute("working","false");ev.target.removeAttribute('disabled');});}}
this.SaveOnChange=function(ev){var form=ev.currentTarget;if(form.id=="")
form=ev.target.form;if(form.id.indexOf("Page")>-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)
localStorage.clear();});},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)
localStorage.clear();});}}}
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="<tr><th>Code</th><th>ConsumerGroup</th><th>Times Used</th><th>Used By...</th><th></th></tr>";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='<th>Code</th><th>ConsumerGroup</th><th>Times Used</th><th>Used By...</th><th></th>';p.Parent.appendChild(header);for(var i=0;i<data.Result.Data.length;i++){var row=document.createElement("tr");row.setAttribute("data-page",p.CurrentPage);row.innerHTML='<td>'+data.Result.Data[i].Code+'</td>';row.innerHTML+='<td>'+data.Result.Data[i].ConsumerGroupName+'</td>';row.innerHTML+='<td>'+data.Result.Data[i].TimesUsed+'</td><td data-code-used-by>'+data.Result.Data[i].UsedBy+'</td><td><a class="qWidgetButton" data-code="'+data.Result.Data[i]._id+'" onclick="window['+"'"+p.MarketplaceId+"'"+'].Settings.DeleteCodes(event);">Delete</a></td>';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='<div class="alert alert-warning">No matching retailers found.</div>';})},DeleteAddress:function(id){var rows=$Quivers.Dom.Get('[data-address-id="'+id+'"]');for(var i=0;i<rows.length;i++){if(rows[i].className=="danger"){rows[i].className="";document.getElementById('qAddressDeleteInput-'+id).value="false";}
else{rows[i].className="danger";document.getElementById('qAddressDeleteInput-'+id).value="true";}}},CreateAddress:function(ev){var row=document.getElementById("qShopEmployeeRetailerCreateAddress");if(row.className=="hidden"){row.className="info";document.getElementById('qAddressCreateInput').value="true";ev.target.className="qWidgetButton hidden";}
else{row.className="hidden";document.getElementById('qAddressCreateInput').value="false";ev.target.className="qWidgetButton visible";}},CreateRetailer:function(){window[this.MarketplaceId].Get("module?Module=createShopEmployeeRetailer",function(data){$Quivers.Dom.TriggerDialog("Create Retailer",data.Result.Html);});}};$Quivers["/api/v1/createShopEmployeeRetailer"]={success:function(data){data=$Quivers.Utilities.FormatResult(data);$Quivers.Dom.CloseDialog();document.getElementById("qShopEmployeeRetailer").innerHTML=data.Result.Html;},error:function(xhr){data=$Quivers.Utilities.FormatResult(xhr);$Quivers.Dom.CloseDialog();document.getElementById("qShopEmployeeRetailer").innerHTML='<div class="alert alert-warning">'+data.Result.Html+'</div>';}}
$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 '<b>"+data.Result.Data.Retailer.Name+"</b>' ('<b>"+data.Result.Data.Retailer._id+"</b>')!");},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 currentLang=hc.Translation.GetCurrentLanguage();if(currentLang==null)
hc.Translation.SetLanguage(hc.Settings.Translation.DefaultLanguage,false);else
hc.Translation.SetLanguage(currentLang,false);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<s.options.length;i++){if(s.options[i].value==language){s.selectedIndex=i;if($jquivers('.goog-te-menu-frame:first').size()){var fullLang=s.options[i].getAttribute('data-lang');console.log(fullLang);var langs=$jquivers('.goog-te-menu-frame:first').contents().find('a span.text');for(var k=0;k<langs.length;k++){console.log("is "+langs[k].innerText+" == "+fullLang+"? -> "+(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/",""));}
hc.Get("user/setLanguage?Language="+language,function(data){$Quivers.Utilities.Debug(data.Result.Html);});},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;i<rows.length;i++){if(rows[i].className=="danger"){rows[i].className="";document.getElementById('qDeleteRule-'+id+"-"+language).value="false";}
else{rows[i].className="danger";document.getElementById('qDeleteRule-'+id+"-"+language).value="true";}}},CreateLanguageRuleset:function(language){window[this.MarketplaceId].Post("updateCustomTerms",{Language:language},function(){var select=document.getElementById("qAddLanguageSelect");for(var i=0;i<select.children.length;i++){if(select.children[i].value==language)
select.children[i].parentNode.removeChild(select.children[i]);}});},SwapCustomTerms:function(node,isWidgetsContext){var hc=window[this.MarketplaceId];var language=hc.Translation.GetCurrentLanguage();if(typeof hc.Settings.CustomTerms!=="undefined"&&typeof hc.Settings.CustomTerms[language]!=="undefined"){var rules=hc.Settings.CustomTerms[language];for(var i=0;i<rules.length;i++){if(rules[i].Enabled==true&&rules[i].OriginalText!=null&&rules[i].OriginalText.length>3&&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;j<quiversElements.length;j++){$Quivers.Dom.Traverse(quiversElements[j],function(node){if(node.parentNode==null||typeof node.parentNode.getAttribute=="undefined"||node.parentNode.getAttribute("data-termswapped")===null){if(node.nodeType===3){if(node.data.length>0){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<this.SwappedTerms.length;i++){if(this.SwappedTerms[i].Node.Type=="data")
this.SwappedTerms[i].Node.data=this.SwappedTerms[i].Node.data.replace(this.SwappedTerms[i].ReplacementText,this.SwappedTerms[i].OriginalText);if(this.SwappedTerms[i].Node.Type=="title"){var titleText=this.SwappedTerms[i].Node.getAttribute("title");titleText.replace(this.SwappedTerms[i].ReplacementText,this.SwappedTerms[i].OriginalText);this.SwappedTerms[i].Node.setAttribute("title",titleText);}}
this.SwappedTerms=[];var swapped=$Quivers.Dom.Get('[data-termswapped');for(var i=0;i<swapped.length;i++){swapped[i].removeAttribute("data-termswapped");}
return true;},SwappedTerms:[]}
$Quivers["/api/v1/updateCustomTerms"]={success:function(data){data=$Quivers.Utilities.FormatResult(data);if(!document.getElementById("q-LanguageCustomTerms-"+data.Result.Data.Language)){var tab=document.createElement("li");tab.setAttribute('role','CustomTermsLanguage');tab.setAttribute("data-target","qLanguageForm-"+data.Result.Data.Language);tab.className="tab";tab.innerHTML="<a onclick=\"window['"+data.Result.Marketplace+"'].Dom.ToggleTab(event);\">"+data.Result.Data.LanguageFullname+'</a>';document.getElementById("qLanguageTabs").appendChild(tab);var tabs=$Quivers.Dom.Get('.tab[role="CustomTermsLanguage"]');for(var i=0;i<tabs.length;i++)
tabs[i].className="tab";tab.className="tab active";var content=document.createElement("div");content.id="qLanguageForm-"+data.Result.Data.Language;content.className="visible";content.innerHTML=data.Result.Html;var container=document.getElementById("qLanguageRulesContainer");for(var c in container.children){container.children[c].className="hidden";}
container.appendChild(content);$Quivers.Dom.CreateAlert("qLanguageCustomTerms-"+data.Result.Data.Language+"Alerts","success","Successfully added the language '<strong>"+data.Result.Data.LanguageFullname+"</strong>'!");}
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;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;},DestroyCookie:function(name){document.cookie=name+'=""; Max-Age=0;';return true;},GetBrowser:function(){var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];if(/trident/i.test(M[1])){tem=/\brv[ :]+(\d+)/g.exec(ua)||[];return{name:'IE',version:(tem[1]||'')};}
if(M[1]==='Chrome'){tem=ua.match(/\bOPR\/(\d+)/)
if(tem!=null){return{name:'Opera',version:tem[1]};}}
M=M[2]?[M[1],M[2]]:[navigator.appName,navigator.appVersion,'-?'];if((tem=ua.match(/version\/(\d+)/i))!=null){M.splice(1,1,tem[1]);}
return{name:M[0],version:M[1]};},GetAllQueries:function(){var a=window.location.search.substr(1).split('&');if(a=="")return{};var b={};for(var i=0;i<a.length;++i)
{var p=a[i].split('=',2);if(p.length==1)
b[p[0]]="";else
b[p[0]]=decodeURIComponent(p[1].replace(/\+/g," "));}
return b;},GetQuery:function(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"=([^&#]*)"),results=regex.exec(location.search);return results===null?"":decodeURIComponent(results[1].replace(/\+/g," "));},GetLocalStorageSize:function(){var allStrings='';for(var key in window.localStorage){if(window.localStorage.hasOwnProperty(key)){allStrings+=window.localStorage[key];}}
return allStrings?3+((allStrings.length*16)/(8*1024))+' KB':'Empty (0 KB)';},IsMobileDevice:function(){var check=false;(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check=true;})(navigator.userAgent||navigator.vendor||window.opera);return check;},FormatResult:function(response){if(typeof response.responseText!="undefined"){var data={ResponseCode:response.status,Result:JSON.parse(response.responseText)};$Quivers.Utilities.Debug(data);}
else
var data=response;if(typeof data.Result=="undefined"){data={Result:data}
$Quivers.Utilities.Debug(data);}
return data;},SelectDropdownValue:function(dropdown,value){var selectedValue=null;for(var i in dropdown.options){if(dropdown.options[i].value!="undefined"&&dropdown.options[i].value==value){dropdown.options[i].selected=true;dropdown.selectedIndex=i;dropdown.trigger("change");selectedValue=value;}
else
dropdown.options[i].selected=false;}
return(selectedValue!=null);},RemoveEmailsFromString:function(str){do{var sliced="";var emailStartsAtIndex=str.indexOf("email=");if(emailStartsAtIndex!==-1){var end=str.substring(emailStartsAtIndex).indexOf("&");if(end==-1)
end=str.length;sliced=str.slice(emailStartsAtIndex+6,end);str=str.replace(sliced,'');}}while(sliced.length>0);return str;},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<zooms.length;i++){if(typeof zooms[i]!=="function")
zooms[i].parentNode.removeChild(zooms[i])}
if(typeof page=="undefined")
return false;else{if(this.Settings.General.HomeUrl!==null&&this.Settings.General.HomeUrl!=""&&this.Settings.General.HomeUrl!=window.location.protocol+"//"+window.location.hostname+window.location.pathname){if(view=="Login")
var uri="Login&ReturnUrl="+encodeURIComponent(window.location.href);else
var uri=view;if(this.Settings.General.RenderViewOnPageUrlRedirect==true)
var goTo=this.Settings.General.HomeUrl+this.GetUrlScheme("Default",view);else
var goTo=this.Settings.General.HomeUrl;window.location=goTo;}
else if(page.PageUrl==null||page.PageUrl==""||(page.PageUrl!=""&&page.PageUrl==window.location.protocol+"//"+window.location.hostname+window.location.pathname)){if(updateUrl){var url=this.GetUrlScheme("Default",view);var cView=view.charAt(0).toUpperCase()+view.slice(1);this.UpdateURL(url,view,updateUrl);this.Analytics.SetPage(page.Name,view);}
var viewExists=false;if(page.Enabled){var navs=document.getElementsByClassName("qIcon");for(var i=0;i<navs.length;i++){if(page.NavButton==navs[i].children[0].getAttribute("data-nav")){viewExists=true;navs[i].setAttribute("data-active","true");var element=document.getElementById(page.DisplayElement);if(!element||element==null)
element=document.getElementById(this.Settings.General.DefaultDisplay);if(!element)
element=document.getElementById("currentView");if(element.id=="currentView"){document.getElementById("QuiversContent").className="visible";if(page.NavButton=="login"||page.NavButton=="buyProduct")
element.className="col-xs-12 col-md-4 col-md-offset-8";else
element.className="col-xs-12";}
if(element.id!="currentView"&&document.getElementById("QuiversContent").className=="visible")
document.getElementById("QuiversContent").className="hidden";element.setAttribute("loading","true");var add="";var additionalQueries=['Firstname','Lastname','Email','Code'];var v=null;for(var k in additionalQueries){if(typeof additionalQueries[k]!="function"){v=$Quivers.Utilities.GetQuery(additionalQueries[k]);if(v!="")
add+="&"+additionalQueries[k]+"="+v;}}
if($Quivers.Utilities.GetQuery("Token")!="")
add+="&Token="+encodeURIComponent($Quivers.Utilities.GetQuery("Token"));this.Get("view?View="+view+module+add);}
else
navs[i].setAttribute("data-active","false");}
if(viewExists==false){if(page.Name.toLowerCase()=="login"){if(this.Settings.General.DefaultPage&&this.Settings.General.DefaultPage.toLowerCase()!="login"&&this.Settings.General.DefaultPage.toLowerCase()!="register"){this.View(this.Settings.General.DefaultPage);}}
else if(page.Enabled==true&&this.Settings.Pages.Login.Enabled==true){if(page.Name=="ProductShort"){var hc=this;setTimeout(function(){hc.View("ProductShort",false);},50)}
else
this.View("Login",false);}
else{var elem=this.Settings.General.DefaultDisplay;document.getElementById(elem).innerHTML="";document.getElementById(elem).setAttribute("quivers-view","true");document.getElementById(elem).setAttribute("quivers-bootstrap","true");$Quivers.Dom.CreateAlert(elem,"warning",this.$("PageDoesNotExist"));}}}
else{if(typeof request!="undefined")
request.abort();return false;}}
else{if(view=="Login")
var uri="Login&ReturnUrl="+encodeURIComponent(window.location.href);else
var uri=view;if(this.Settings.General.RenderViewOnPageUrlRedirect==true)
var goTo=page.PageUrl+this.GetUrlScheme("Default",view);else
var goTo=page.PageUrl;window.location=goTo;}}}
$Quivers.HideView=function(){document.getElementById("QuiversContent").className="hidden";document.getElementById('currentView').setAttribute("data-view","");var navs=document.getElementsByClassName("qIcon");for(var i=0;i<navs.length;i++){navs[i].setAttribute("data-active","false");}}
$Quivers.SelectViewFromUrl=function(){for(var key in this.Settings.QueryTokens){var load=this.GetModuleQueryId(key);if(load!=""){switch(key){case"Default":this.View(load,false);return true;case"Search":if(this.CurrentView!="Products")
this.View("Products",false);else
this.Catalog.Search(load);return true;case"Category":if(this.CurrentView!="Products")
this.View("Products",false);else
this.Catalog.Category(load);return true;case"Product":if(this.CurrentView!="Products")
this.View("Products",false);else
this.Catalog.ProductDetails(load);return true;case"ProductReview":if(this.CurrentView!="Products")
this.View("Products",false);else
this.Catalog.ProductReviews(load);return true;case"ProductShort":if(this.CurrentView!="ProductShort")
this.View("ProductShort",false);else
this.Catalog.ProductShort(load);return true;case"Order":if(this.CurrentView!="Order")
this.View("Order",false);return true;case"Orders":if(this.CurrentView!="Account")
this.View("Orders",false);else
this.Orders.Details(load);return true;}}}
if(this.Settings.General&&this.Settings.General.DefaultPage!=null)
this.View(this.Settings.General.DefaultPage);return true;}
$Quivers.GetModuleQuery=function(){for(var key in this.Settings.QueryTokens){if(key!="Default"){var load=$Quivers.Utilities.GetQuery(this.Settings.QueryTokens[key]);if(load!=""){if(load.indexOf("/")!==-1)
load=load.slice(0,load.indexOf("/"));return"&Select="+key+"-"+load;}}}
return"";}
$Quivers.GetModuleQueryId=function(key){if(this.Settings.General.UrlScheme=="QueryParameters"){var load=$Quivers.Utilities.GetQuery(this.Settings.QueryTokens[key]);if(key!="Default"){if(load.indexOf("/")!==-1)
load=load.slice(0,load.indexOf("/"));}
return load;}}
$Quivers.GetUrlScheme=function(type,value){switch(this.Settings.General.UrlScheme){case"QueryParameters":return"?"+this.Settings.QueryTokens[type]+"="+value;case"Path":if(type=="Default")
return value+"/";else
return this.Settings.QueryTokens[type]+"/"+value+"/";}}
$Quivers.ConstructURL=function(str){var queries=$Quivers.Utilities.GetAllQueries();for(var i in queries){for(var k in this.Settings.QueryTokens){if(i==this.Settings.QueryTokens[k])
delete queries[i];}}
var url=str;for(var j in queries){url+="&"+j+"="+encodeURIComponent(queries[j].replace(" ","+"));}
return url;}
$Quivers.UpdateURL=function(url,title,pushState){var url=this.ConstructURL(url);var hc=this;url=window.location.protocol+"//"+window.location.hostname+window.location.pathname+url;if(url!==false){if(typeof this.LastURI=="undefined"){hc.LastURI=window.location.search;if(pushState===true||typeof pushState=="undefined"){$Quivers.Utilities.Debug("window.history.replaceState() -> "+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<articles.length;i++){if(articles[i].id==article){articles[i].className="visible";found=true;}
else
articles[i].className="hidden";}
if(found==false)
document.getElementById("qSupportQuestions").className="visible";else
document.getElementById("qSupportQuestions").className="hidden";}
else{document.getElementById("qSupportQuestions").className="visible";for(var i=0;i<articles.length;i++){articles[i].className="hidden";}}}
$Quivers.Documents=function(){var hc=this;hc.Get("module?Module=documents",function(data){data=$Quivers.Utilities.FormatResult(data);$Quivers.Dom.TriggerDialog(hc.$("DocumentsPageTitle"),data.Result.Html);});};window.$Quivers=$Quivers;
window.Quivers = new HoverCart('690f6dc4-f82b-485d-be19-b36c006cfac4', '', '', 'prod_aws'); Quivers.Start();});})();