
/* 
 * CARTLOOM 
 *
 * COPYRIGHT INFORMATION - DO NOT REMOVE
 *
 * This file is part of the Cartloom(TM) Project and is
 * Copyright (c) Yabdab Inc. 2020 All Rights Reserved
 *
 * This file contains Original Code as created by Yabdab Inc.
 *
 * The Original Code is distributed on an 'AS IS' basis,
 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND YABDAB
 * HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Do NOT download, distribute, use or alter this software or file in any
 * way without express written permission from Yabdab Inc.
 *
 *
 * MODIFIED:  {{TIMESTAMP}}
 *
 */
 

/* VARS */

var PREFS = {
    "cart_title": "Backwater Reptiles Shopping Cart",
    "quantity_title": "Quantity",
    "price_title": "Price",
    "item_title": "Your Selected Item(s)",
    "line_total_title": "Total",
    "subtotal_title": "Subtotal",
    "checkout_title": "I\\'m Ready to Checkout",
    "delete_attr": "Delete",
    "update_attr": "Refresh",
    "resize_attr": "Resize",
    "delete_prompt": "Are you sure you want to do this?",
    "ok_string": "OK",
    "yes_string": "OK",
    "no_string": "Cancel",
    "msg_order_timeout": "Process has Timed Out.",
    "checkout_string": "I\\'m Ready to Checkout",
    "cartloom_url": "https:\/\/backwaterreptiles.cartloom.com\/",
    "shopping_cart": "Shopping Cart",
    "close_cart": "Close Cart",
    "processing": "Processing...",
    "continue_shopping": "Keep Shopping",
    "paypal_express_button": "Checkout with PayPal",
    "overlay_color_class": "black70",
    "swatch_color_class": "green",
    "return_url": "https:\/\/www.backwaterreptiles.com\/orders\/order-thank-you.html",
    "lbco": 0,
    "paypal": 1,
    "stripe": 0,
    "gaid": "UA-24961428",
    "gaec": 0,
    "currency": "USD",
    "load_json_ld": "true"
};

/* BRAINS */


!function(){if(!window.cartloomisloaded){window.cartloomisloaded=1;var initloaded=0,scriptSrc=(document.getElementsByTagName("script"),PREFS.cartloom_url);if(window.jQuery){var vernums=jQuery.fn.jquery.split(".");if(parseFloat(vernums[0]+vernums[1])>16)return void cartloom(jQuery)}var script=document.createElement("script"),head=document.getElementsByTagName("head")[0]||document.documentElement;script.async="async",script.src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js",script.onload=script.onreadystatechange=function(_,isAbort){script.readyState&&!/loaded|complete/.test(script.readyState)||(script.onload=script.onreadystatechange=null,head&&script.parentNode&&head.removeChild(script),script=0,isAbort||(jQuery.noConflict(),cartloom(jQuery)))},head.insertBefore(script,head.firstChild)}function cartloom($){var isIframedContent,isSlugMatch;jQuery.fn.hasScrollBar=function(){return this.get(0).scrollHeight>this.height()};var initialized,isStorefront=!1,jsonpIndex=0;$.getJSONP=function(s){if(s.jsonpCallback="Cartloom_"+ ++jsonpIndex,s.dataType="jsonp",$.ajax(s),s.timeout&&/callback/.test(s.url)){var t=0,cb=s.url.match(/callback=(\w+)/)[1],cbFn=window[cb];window[cb]=function(json){clearTimeout(t),cbFn(json),cbFn=null},t=setTimeout((function(){cbFn&&(window[cb]=function(){},s.onTimeout(s.url),$("head script[src$="+s.url+"]").remove())}),s.timeout)}};var mobile=/iPhone|iPod|Android|Blackberry.*WebKit/i.test(navigator.userAgent),Util={domain:(scriptSrc.match(/\/\/([^\/]+)/)||[])[1]+"_",realDomain:/^www\./.test(location.hostname)?location.hostname.substring(4):location.hostname,debug:function(s){window.console&&window.console.log&&window.console.log("[embed] "+s)},addParam:function(url,key,value){return key&&value?url+(/\?/.test(url)?"&":"?")+key+"="+value:url},setCookie:function(name,value){name=Util.domain+name,document.cookie=name+"="+value+"; path=/; domain="+Util.realDomain},getCookie:function(name){if(name=Util.domain+name,document.cookie&&""!==document.cookie)for(var cookies=document.cookie.split(";"),i=0,max=cookies.length;i<max;i++){var cookie=$.trim(cookies[i]);if(cookie.substring(0,name.length+1)==name+"=")return cookie.substring(name.length+1)}return null},calculateTotal:function(option){var $dl=option.closest("form"),start=parseFloat($dl.data("price")),add=parseFloat(0),amt=parseFloat(0);isNaN(start)&&(start=0),$dl.find(":input[name^=oc]").each((function(i){var va,vn,$this=$(this),name=this.name||"",v=$this.val(),temp=[];v&&v.indexOf(";")>-1&&(vn=(temp=v.split(";"))[0],va=temp[1]||v),"select-one"==this.type||"radio"==this.type&&this.checked||"checkbox"==this.type&&this.checked?amt=parseFloat(va):"text"==this.type&&(amt=0),isNaN(amt)?console.log("NaN amount for input: "+vn||name):(add=amt+add,amt=0)}));var tempTotal=start+add;tempTotal<0&&(tempTotal=0);tempTotal.toFixed(2);var newFormattedTotal=Util.currencyFormat(tempTotal);$dl.find(".base-price").html(newFormattedTotal)},currencyFormat:function(floatVal){var val=floatVal.toFixed(2),hash={AUD:{dec:".",grp:",",sym:"$"},BRL:{dec:".",grp:".",sym:"R"},CAD:{dec:".",grp:",",sym:"$"},CHF:{dec:".",grp:"'",sym:"CHF "},CZK:{dec:",",grp:".",sym:" CZK"},DKK:{dec:".",grp:".",sym:" kr"},EUR:{dec:",",grp:".",sym:" &euro;"},GBP:{dec:".",grp:",",sym:"&pound;"},HKD:{dec:".",grp:",",sym:"HK$"},HUF:{dec:".",grp:",",sym:"HK$"},ILS:{dec:".",grp:",",sym:"$"},JPY:{dec:"",grp:",",sym:"&yen;",noDecimals:1},MYR:{dec:".",grp:".",sym:"R"},MXN:{dec:".",grp:",",sym:"$"},NOK:{dec:",",grp:".",sym:" kr"},NZD:{dec:".",grp:",",sym:"$"},PHP:{dec:".",grp:",",sym:"PhP "},PLN:{dec:".",grp:",",sym:" z&#322;"},SEK:{dec:".",grp:" ",sym:" SEK"},SGD:{dec:".",grp:",",sym:"SGD $"},TWD:{dec:".",grp:",",sym:"NT$ ",noDecimals:1},THB:{dec:".",grp:",",sym:"&#3647; "},TRY:{dec:",",grp:".",sym:" TL"}}[PREFS.currency]||{dec:".",grp:",",sym:"$"};return hash.noDecimals&&(val=val.replace(/\..*/,"")),val=(val=val.replace(/\,/g,hash.grp)).replace(/\.([\d]{0,2})$/,hash.dec+"$1"),/^ /.test(hash.sym)?val+=hash.sym:val=hash.sym+val,val},guid:function(){for(var result="",i=0;i<32;i++)result+=Math.floor(16*Math.random()).toString(16).toUpperCase();return result},getCacheBust:function(url){return url+"/"+Date.now()+location.search}},APP={ajaxTimeout:1e4,urls:{stylesheet:PREFS.cartloom_url+"assets/css/cl4loader.css",getCart:PREFS.cartloom_url+"cl4/cart/get/",viewCart:PREFS.cartloom_url+"cl4/cart/get/",directCheckout:PREFS.cartloom_url+"checkout/direct/",addToCart:PREFS.cartloom_url+"cl4/cart/add/",addToCartMobile:PREFS.cartloom_url+"cl4/cart/mobile/add/",snippet:PREFS.cartloom_url+"cl4/products/embed/",buy:PREFS.cartloom_url+"cl4/buy/embed/",store:PREFS.cartloom_url+"cl4/store/embed/",getCounts:PREFS.cartloom_url+"cl4/cart/counts/",view:PREFS.cartloom_url+"cl4/cart/view/embed/",lookup:PREFS.cartloom_url+"cl4/order/lookup/embed/",getLookup:PREFS.cartloom_url+"cl4/order/lookup",subscribe:PREFS.cartloom_url+"subscribe/embed/",getSubscribe:PREFS.cartloom_url+"subscribe/get/",manageSubscribe:PREFS.cartloom_url+"subscribe/embed/manage/",getManageSubscribe:PREFS.cartloom_url+"subscribe/manage",jsonld:PREFS.cartloom_url+"embed/jsonld/",checkoutStorefront:"storefront/checkout/",giftcardLookup:PREFS.cartloom_url+"giftcard/lookup/embed/",getGiftcardLookup:PREFS.cartloom_url+"giftcard/get"},preInitialize:function(){this.cid=this.calculateSellerCid(),this.updateUrlsWithCid(this.cid),this.loadStylesheet(),this.buildDOM(),this.fetchSnippets(this.initialize,this),this.getStoreCounts()},initialize:function(){initloaded||(initloaded=1,this.bindSellerForms(),this.initializePostMessageHandler(),this.enableAllCartloomForms(),this.sendSizetoParentiFrame(),PREFS.lbco&&PREFS.paypal&&this.addPaypalScriptToHead())},addPaypalScriptToHead:function(){var ppscript=document.createElement("script"),head=document.getElementsByTagName("head")[0]||document.documentElement;ppscript.async="async",ppscript.setAttribute("data-version-4",""),ppscript.setAttribute("data-log-level","warn"),ppscript.setAttribute("defer","defer"),ppscript.src="https://www.paypalobjects.com/api/checkout.min.js",head.appendChild(ppscript)},calculateSellerCid:function(){var cid=Util.getCookie("cid");return cid||(cid=Util.guid(),Util.setCookie("cid",cid),Util.debug("cid="+cid)),cid},fetchSnippets:function(callback,scope){var xhrcount=0,cid=this.calculateSellerCid(),placeholders=$("[data-cartloom-pid]"),buyplaceholders=$("[data-cartloom-buy]"),storeplaceholder=$("[data-cartloom-store]"),viewplaceholder=$("[data-cartloom-view]"),lookupplaceholder=$("[data-cartloom-lookup]"),subscribeplaceholder=$("[data-cartloom-subscribe]"),submanageplaceholder=$("[data-cartloom-submanage]"),gclookupplaceholder=$("[data-cartloom-gc-lookup]");if(viewplaceholder.length&&viewplaceholder.each((function(){var $el=$(this),type=$.trim($el.attr("data-cartloom-type")),url=APP.urls.view+"/"+type;if("styled"===type){var iframe_code='<iframe class="cartloom-iframe cartloom-viewcart" allowtransparency=true frameBorder=0 src="'+PREFS.cartloom_url+'cart/embed/viewcart" scrolling="no" width=100%></iframe>';$el.replaceWith(iframe_code)}else xhrcount++,$.ajax({url:url}).always((function(result,status){"success"==status?$el.replaceWith(result):console.log("Error loading buy button snippet for: ",pid),0==--xhrcount&&callback.apply(scope)}))})),lookupplaceholder.length&&lookupplaceholder.each((function(){var $el=$(this),type=$.trim($el.attr("data-cartloom-type")),url=APP.urls.lookup+type;if("styled"===type){var iframe_code='<iframe class="cartloom-iframe cartloom-lookup" allowtransparency=true frameBorder=0 src="'+PREFS.cartloom_url+'order/embed/lookup" scrolling="no" width=100%></iframe>';$el.replaceWith(iframe_code)}else xhrcount++,$.ajax({url:url}).always((function(result,status){"success"==status?$el.replaceWith(result):console.log("Error loading buy button snippet for: ",pid),0==--xhrcount&&callback.apply(scope)}))})),subscribeplaceholder.length&&subscribeplaceholder.each((function(){var $el=$(this),sub_id=$.trim($el.attr("data-cartloom-subscribe")),type=$.trim($el.attr("data-cartloom-type")),url=APP.urls.subscribe+type+"/"+sub_id;if("styled"===type){var iframe_code='<iframe class="cartloom-iframe cartloom-subscribe" allowtransparency=true frameBorder=0 src="'+PREFS.cartloom_url+"subscribe/embed/styled/"+sub_id+'" scrolling="no" width=100%></iframe>';$el.replaceWith(iframe_code)}else xhrcount++,$.ajax({url:url}).always((function(result,status){"success"==status?$el.replaceWith(result):console.log("Error loading buy button snippet for: ",pid),0==--xhrcount&&callback.apply(scope)}))})),submanageplaceholder.length&&submanageplaceholder.each((function(){var $el=$(this),type=$.trim($el.attr("data-cartloom-type"));if("styled"===type){var iframe_code='<iframe class="cartloom-iframe cartloom-submanage" allowtransparency=true frameBorder=0 src="'+PREFS.cartloom_url+'subscribe/embed/manage/styled" scrolling="no" width=100%></iframe>';$el.replaceWith(iframe_code)}else if("inline"===type){iframe_code='<iframe class="cartloom-iframe cartloom-submanage" allowtransparency=true frameBorder=0 src="'+PREFS.cartloom_url+'subscribe/embed/manage/inline" scrolling="no" width=100%></iframe>';$el.replaceWith(iframe_code)}else xhrcount++,$.ajax({url:PREFS.cartloom_url+"subscribe/embed/manage/plain"}).always((function(result,status){"success"==status?$el.replaceWith(result):console.log("Error loading buy button snippet for: ",pid),0==--xhrcount&&callback.apply(scope)}))})),gclookupplaceholder.length&&gclookupplaceholder.each((function(){var $el=$(this),type=$.trim($el.attr("data-cartloom-type"));APP.urls.lookup;if("styled"===type){var iframe_code='<iframe class="cartloom-iframe cartloom-giftcard" allowtransparency=true frameBorder=0 src="'+PREFS.cartloom_url+'giftcard/embed/styled" scrolling="no" width=100%></iframe>';$el.replaceWith(iframe_code)}else xhrcount++,$.ajax({url:PREFS.cartloom_url+"giftcard/embed/plain"}).always((function(result,status){"success"==status&&$el.replaceWith(result),0==--xhrcount&&callback.apply(scope)}))})),placeholders.each((function(){var $el=$(this),pid=$.trim($el.attr("data-cartloom-pid")),type=$.trim($el.attr("data-cartloom-type"));if(0!==pid.length){APP.urls.snippet;"true"==PREFS.load_json_ld&&APP.loadJsonLD("product",pid);var iframe_code='<iframe class="cartloom-iframe cartloom-product-'+pid+'" allowtransparency=true frameBorder=0 src="'+PREFS.cartloom_url+"product/embed/styled/"+pid+"/?parent="+encodeURI(window.location)+'" scrolling="no" width=100%></iframe>';$el.replaceWith(iframe_code)}})),buyplaceholders.each((function(){var $el=$(this),pid=$.trim($el.attr("data-cartloom-buy")),type=$.trim($el.attr("data-cartloom-type"));if(0!==pid.length){var url=APP.urls.buy+pid+"/"+type;if("true"==PREFS.load_json_ld&&APP.loadJsonLD("product",pid),"styled"===type){var iframe_code='<iframe class="cartloom-iframe cartloom-buy-'+pid+'" allowtransparency=true frameBorder=0 src="'+PREFS.cartloom_url+"buy/frame/styled/"+pid+'" scrolling="no" width=100%></iframe>';$el.replaceWith(iframe_code)}else xhrcount++,$.ajax({url:url}).always((function(result,status){"success"==status?$el.replaceWith(result):console.log("Error loading buy button snippet for: ",pid),0==--xhrcount&&callback.apply(scope)}))}})),storeplaceholder.length){var groupcount=0;storeplaceholder.each((function(){if(!(groupcount>=1)){groupcount++;var $el=$(this),store_id=$.trim($el.attr("data-cartloom-store")),hashtag=window.location.hash?"/"+window.location.hash.substring(1):"";if(0!==store_id.length){APP.urls.store;"true"==PREFS.load_json_ld&&APP.loadJsonLD("store",store_id);var iframe_code='<iframe class="cartloom-iframe cartloom-store cartloom-store-'+store_id+'" allowtransparency=true frameBorder=0 src="'+PREFS.cartloom_url+"store/"+store_id+"/"+cid+hashtag+"/?parent="+encodeURI(window.location)+'" scrolling="no" width=100%></iframe>';$el.replaceWith(iframe_code)}}}))}0===xhrcount&&callback.apply(scope)},enableAllCartloomForms:function(){$("form.ydcl-addtocart :submit, form.cartloom-addtocart :submit").removeAttr("disabled"),$.fn.prop&&$("form.ydcl-addtocart :submit, form.cartloom-addtocart :submit").prop("disabled",!1),$(document).on("focus","form.cartloom-addtocart",(function(){$("form.cartloom-addtocart :submit").removeAttr("disabled")})),$(document).on("keypress","input.cl-number",(function(e){if(8!=e.which&&0!=e.which&&46!=e.which&&44!=e.which&&13!=e.which&&(e.which<48||e.which>57))return!1}))},initializePostMessageHandler:function(){window.addEventListener("message",(function onMessage(e){e.origin||e.originalEvent.origin;try{var data=JSON.parse(e.data);"close"==data.command?APP.showCart(0):"showCart"==data.command?(APP.showSpinner(),APP.showCart(1)):"showLookup"==data.command?(APP.showSpinner(),APP.showLookup(1)):"showGiftcardLookup"==data.command?(APP.showSpinner(),APP.showGiftcardLookup(1)):"showSubscribe"==data.command?(APP.showSpinner(),APP.showSubscribe(1,data.id)):"showSubscribeManage"==data.command?(APP.showSpinner(),APP.showSubscribeManage(1)):"addProduct"==data.command?APP.addProduct(data.product,data.quickadd):"updateCartQty"==data.command?APP.updateCartQty(data.qty,data.amount):"resizeParentiFrame"==data.command?APP.resizeParentiFrame(data.height,data.selector):"scrollTopParentiFrame"==data.command&&APP.scrollTopParentiFrame(data.selector)}catch(e){}}),!1)},updateUrlsWithCid:function(cid){var randomh=Math.random(),qstring=location.search;APP.urls.addToCart=APP.urls.addToCart+cid,APP.urls.addToCartMobile=APP.urls.addToCartMobile,APP.urls.viewCart=APP.urls.viewCart+cid,APP.urls.getCart=APP.urls.getCart+cid,APP.urls.getCounts=APP.urls.getCounts+cid,APP.urls.checkoutStorefront=APP.urls.checkoutStorefront+cid,APP.urls.directCheckout=APP.urls.directCheckout+cid+"/"+randomh+"/qb"+qstring},loadJsonLD:function(type,id){$.ajax({timeout:APP.ajaxTimeout,url:APP.urls.jsonld+type+"/"+id,success:function(json){APP.insertJsonLD(json)},onTimeout:function(){Util.debug("loadJsonLD timed out.")}})},insertJsonLD:function(json){var head=document.getElementsByTagName("head")[0],de=document.documentElement;document.body;if(!head){head=document.createElement("head");var docEl=document.getElementsByTagName("html")[0]||de;docEl.insertBefore(head,docEl.firstChild)}var jsonld=$(document.createElement("script")).attr({type:"application/ld+json"}).text(json)[0];head.appendChild(jsonld)},loadStylesheet:function(){var head=document.getElementsByTagName("head")[0],de=document.documentElement;document.body;if(!head){head=document.createElement("head");var docEl=document.getElementsByTagName("html")[0]||de;docEl.insertBefore(head,docEl.firstChild)}var link=$(document.createElement("link")).attr({type:"text/css",href:APP.urls.stylesheet+"?_="+(new Date).getTime(),rel:"stylesheet"})[0];$("#cartloom-custom-css").length>0?$("#cartloom-custom-css").before(link):head.appendChild(link)},buildDOM:function(){if(APP.$frame=$('<iframe border=0 src="about:blank"></iframe>'),APP.$frame.css({top:0,left:0,position:"fixed","z-index":"10000000000",width:"100%",height:"100%",border:"none",display:"none"}).appendTo(document.body),window.addEventListener?window.addEventListener("resize",APP.sendSizetoParentiFrame,!1):window.attachEvent("onresize",APP.sendSizetoParentiFrame),$(window).on("load",(function(){APP.sendSizetoParentiFrame(),searchPlaceholder=$("#cl4-search-input").attr("placeholder")})),$("#cl4-em-sort").on("mouseenter",(function(){TweenMax.to($("#cl4-em-sort-select"),.2,{autoAlpha:1,y:0})})).on("click",(function(){TweenMax.to($("#cl4-em-sort-select"),.2,{autoAlpha:1,y:0})})).on("mouseleave",(function(){TweenMax.to($("#cl4-em-sort-select"),.2,{autoAlpha:0,y:-3})})),$("#cl4-em-sort-select select").on("change",(function(){var $thisVal=$(this).val();$("#cl4-search-input").removeAttr("placeholder").val($thisVal).trigger("enterKey")})),$("#cl4-em-container a.cartloom-viewcart").on("mouseenter",(function(){TweenMax.to($(".cartloom-cart-amount"),.2,{autoAlpha:1,x:0})})).on("mouseleave",(function(){TweenMax.to($(".cartloom-cart-amount"),.2,{autoAlpha:0,x:3})})),$("input.gc-image").on("click",(function(){var img=$(this).data("url");$(".gc-images li").removeClass("selected"),$(this).closest("li").addClass("selected"),$("#gc-image").animate({opacity:0},100,(function(){$("#gc-image").css("background-image","url("+img+")").promise().done((function(){$("#gc-image").animate({opacity:1},600)}))}))})),$(".cl-spin-off").bind("change blur",(function(){var $dl=$(this).closest("form"),newPrice=0;newPrice="input"===this.tagName.toLowerCase()?$(this).attr("data-price"):$(this).find(":selected").attr("data-price"),$dl.data("price",newPrice),Util.calculateTotal($(this))})),$(".cl-option").bind("change blur",(function(){Util.calculateTotal($(this))})),1==$(".cl4-em-wrap-outer.iso").length){var rightDesc=(productPID=$(".cl4-em-wrap-outer.iso")).find(".cl4-em-long-desc").attr("style","");setTimeout((function(){rightDesc.height()>300&&rightDesc.addClass("limit-more")}),100),$(".readmore").on("click",(function(){var el=productPID.find(".cl4-em-long-desc"),curHeight=el.height(),autoHeight=el.css("height","auto").height();rightDesc.removeClass("limit-more"),productPID.css("padding-bottom",curHeight),APP.sendSizetoParentiFrame(),el.height(curHeight).animate({height:autoHeight},300,(function(){productPID.css("padding-bottom","0")})),$(".readless").show()})),$(".readless").on("click",(function(){var el=productPID.find(".cl4-em-long-desc"),curHeight=el.height();rightDesc.addClass("limit-more"),productPID.css("padding-bottom",curHeight),APP.sendSizetoParentiFrame(),el.height(curHeight).animate({height:280},280,(function(){productPID.css("padding-bottom","0")})),$(this).hide()}));var productPID,thumbnails=(productPID=$(".cl4-em-wrap-outer.iso")).find(".cl4-em-images li").removeClass("selected");firstImage=thumbnails.first().addClass("selected first").children(),imageS=firstImage.attr("data-full"),imageW=firstImage.data("width"),imageH=firstImage.data("height"),imageG=thumbnails.parent().parent(),showcaseImage=productPID.find(".cl4-em-showcase img"),thumbnails.last().addClass("last"),showcaseImage.attr("src",imageS).parent().attr("data-width",imageW).attr("data-height",imageH),$.isFunction($.fn.swipe)&&showcaseImage.parent().parent().swipe({swipeRight:function(event,direction,distance,duration,fingerCount){var selected=productPID.find(".cl4-em-images li.selected");selected.hasClass("first")||selected.prev().trigger("click")},swipeLeft:function(event,direction,distance,duration,fingerCount){var selected=productPID.find(".cl4-em-images li.selected");selected.hasClass("last")||selected.next().trigger("click")}}),thumbnails.on("mouseover",(function(){var $this=$(this),imageS=$this.children().attr("data-full"),imageW=$this.children().data("width"),imageH=$this.children().data("height");showcaseImage.attr("src",imageS).parent().attr("data-width",imageW).attr("data-height",imageH),thumbnails.removeClass("selected"),$this.addClass("selected"),APP.sendSizetoParentiFrame()})),1==thumbnails.length&&imageG.addClass("single-image")}var zoomStatus="out";$("#cl4-em-products-gen .cl4-em-showcase").on("click",(function(e){var $thisShowcase=$(this),imageWidth=($(this).children(),$thisShowcase.attr("data-width")),imageHeight=$thisShowcase.attr("data-height"),$thisImgGroup=$(this).parent();$(this).next();function initZoomOut(){$thisImgGroup.hide(),function endZoomOut(){$thisShowcase.add($thisImgGroup).removeClass("zoom").css("max-height","none"),$thisImgGroup.show(),zoomStatus="out"}(),$thisImgGroup.off("mouseleave")}if("out"==zoomStatus){$thisImgGroup.hide(),function initZoomIn(){$thisShowcase.css("max-height","none").outerHeight();zoomStatus="in",$thisShowcase.add($thisImgGroup).addClass("zoom"),$thisImgGroup.on("mousemove",(function(e){var baseFrame=$thisImgGroup,offset=baseFrame.offset(),zoomW=baseFrame.width(),zoomH=baseFrame.height(),x=e.pageX-offset.left;x=x*(imageWidth-zoomW)/zoomW;var y=e.pageY-offset.top;y=y*(imageHeight-zoomH)/zoomH,$thisShowcase.scrollTop(1*y).scrollLeft(1*x),e.preventDefault()})),$thisImgGroup.show(),$thisImgGroup.one("mouseleave",(function(e){initZoomOut(),e.preventDefault()}))}()}else initZoomOut();e.preventDefault()}))},bindSellerForms:function(){this.bindAddToCartEvents(),this.bindViewCartEvents(),this.bindStoreEvents(),this.bindLookupEvents(),this.bindGiftcardLookupEvents(),this.bindSubscribeEvents(),this.bindSubscribeManageEvents(),this.bindResizeEvents(),this.bindCheckoutEvents()},bindResizeEvents:function(){$(document).on("#cl4-em-store-gen .cl4-em-wrap-outer","click",(function(){APP.sendSizetoParentiFrame}))},bindAddToCartEvents:function(){window.addEventListener("pagehide",(function(){APP.hideSpinner(),$("#cl4-load-wrap").removeClass("show"),$("#cl4-load-wrap").remove(),Util.debug("clean up overlay and spinner on unload.")})),$(document).on("click","a.ydcl-addtocart, a.cartloom-addtocart",(function(e){var href=$(this).prop("href"),pid=href.substr(href.lastIndexOf("/")+1),quicky=0;if($(this).hasClass("quick-add")&&(quicky=1,Util.debug("has quicky"),$(this).append(' <span class="add-done">✔</span>'),$(this).find("span.add-done").delay(3e3).fadeOut("fast",(function(){$(this).remove()}))),pid.match(/[\?&]?pid=[a-zA-Z0-9]+/i)){var params=pid.split("=");pid=params[1]}if(!mobile||isIframedContent||quicky){e.preventDefault();var data=this.search.substring(1);return data.match(/[\?&]?pid=[a-zA-Z0-9]+/i)||(data+="pid="+pid),APP.addProduct(data,quicky),Util.debug("quickadd to cart"),!1}return $(this).prop("href",APP.urls.addToCartMobile+pid+"/"+APP.cid),!0})),$(document).on("submit","form.ydcl-addtocart, form.cartloom-addtocart",(function(e){if(APP.quickadd=$(this).data("quickadd"),$(this).hasClass("quick-add")&&(APP.quickadd&&$(this).find("button").addClass("processing-add").append('<svg class="circular" viewBox="25 25 50 50"><circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="3" stroke-miterlimit="10"></circle></svg><span class="cart-added"></span>'),$(".processing-add .cart-added").css({opacity:"0",transform:"translateY(4px)"})),!mobile||isIframedContent||APP.quickadd){e.preventDefault();var data=$(this).serialize();return APP.addProduct(data,APP.quickadd),!1}var action=$(this).prop("action"),pid=action.substr(action.lastIndexOf("/")+1);return $(this).prop("target","_self"),$(this).prop("action",APP.urls.addToCartMobile+pid+"/"+APP.cid),!0}))},bindViewCartEvents:function(){function handler(e){location.search;return!mobile||isIframedContent?(e.preventDefault(),!isIframedContent&&APP.showSpinner(),APP.showCart(1),!1):(APP.showSpinner(),document.location=APP.urls.directCheckout,!1)}$(document).on("click","a.ydcl-viewcart, button.ydcl-viewcart, a.cartloom-viewcart, button.cartloom-viewcart, .alt-viewcart, li.cartloom-viewcart",handler),$("form.ydcl-viewcart, form.cartloom-viewcart").submit(handler)},bindLookupEvents:function(){$(document).on("click","a.cartloom-lookup, button.cartloom-lookup, li.cartloom-lookup",(function handler(e){return!mobile||isIframedContent?(e.preventDefault(),!isIframedContent&&APP.showSpinner(),APP.showLookup(1),!1):(APP.showSpinner(),document.location=Util.getCacheBust(APP.urls.getLookup),!1)}))},bindGiftcardLookupEvents:function(){$(document).on("click","a.cartloom-gc-lookup, button.cartloom-gc-lookup, li.cartloom-gc-lookup",(function handler(e){return!mobile||isIframedContent?(e.preventDefault(),!isIframedContent&&APP.showSpinner(),APP.showGiftcardLookup(1),!1):(APP.showSpinner(),document.location=Util.getCacheBust(APP.urls.getGiftcardLookup),!1)}))},bindSubscribeEvents:function(){$(document).on("click","a.cartloom-subscribe, button.cartloom-subscribe",(function handler(e){var id=$(this).data("id");return!mobile||isIframedContent?(e.preventDefault(),!isIframedContent&&APP.showSpinner(),APP.showSubscribe(1,id),!1):($(this).prop("href",APP.urls.getSubscribe+id),!0)}))},bindSubscribeManageEvents:function(){$(document).on("click","a.cartloom-submanage, button.cartloom-submanage",(function handler(e){$(this).data("id");return!mobile||isIframedContent?(e.preventDefault(),!isIframedContent&&APP.showSpinner(),APP.showSubscribeManage(1),!1):($(this).prop("href",APP.urls.getManageSubscribe),!0)}))},bindCheckoutEvents:function(){if(!isStorefront)return!1;$(document).on("click","a.cartloom-checkout, button.cartloom-checkout",(function handler(e){return APP.showSpinner(),document.location=APP.urls.checkoutStorefront,!1}));Math.random()},bindStoreEvents:function(){$('.external-link[href=""]').removeAttr("href").addClass("int_page_link"),$(".cl4-em-long-desc:empty").remove();$("#cl4-em-store-gen").find(".cl4-em-wrap-outer");var int_page=$(".int_page_link");$("#cl4-search-input").keyup((function(e){13==e.keyCode&&$(this).trigger("enterKey")})),$(document).on("click","#cl4-em-search span.clear",(function(){APP.searchClear()})),$(document).on("enterKey","#cl4-search-input",(function(e){var query=$(this).val().toLowerCase();APP.searchStore(query),e.preventDefault()})),int_page.on("click",(function(){var uid=$(this).closest(".cl4-em-wrap-outer").data("uid");APP.storeSelect(uid)})),$(".cl4-em-close").on("click",(function(e){APP.storeViewAll(),e.stopPropagation()}))},addProduct:function(data,quickadd){if(isIframedContent){var msg={command:"addProduct",product:data,quickadd:quickadd};window.parent.postMessage(JSON.stringify(msg),"*")}else APP.quickadd=quickadd,quickadd||APP.showSpinner(),$.getJSONP({data:data,timeout:APP.ajaxTimeout,url:APP.urls.addToCart,success:APP.onAddProductSuccess,onTimeout:APP.onAddProductTimeout})},onAddProductTimeout:function(){APP.hideSpinner(),alert("timeout")},updateCartQty:function(qty,amount){if($(".cartloom-cart-count").html(qty),$(".cartloom-cart-amount").html(amount),isIframedContent)APP.quickadd?APP.processQuickAdd(qty,amount):($(".cartloom-cart-count").html(qty),$(".cartloom-cart-amount").html(amount));else{var msg={command:"updateCartQty",qty:qty,amount:amount},iframe=$("iframe.cartloom-store")[0];iframe&&iframe.contentWindow.postMessage(JSON.stringify(msg),"*")}},processQuickAdd:function(qty,amount){var proc=$(".processing-add"),loader=proc.children("svg"),success=proc.children(".cart-added"),thisCount=proc.closest("#cl4-em-container").find(".cartloom-cart-count"),thisAmt=thisCount.next();"undefined"!=typeof TweenMax&&(TweenMax.to(thisCount,.2,{autoAlpha:0,scale:.2}),setTimeout((function(){TweenMax.to(loader,.3,{autoAlpha:0}),TweenMax.to(success,.5,{delay:.4,autoAlpha:1,y:0})}),500),setTimeout((function(){thisCount.html(qty),thisAmt.html(amount),"none"==$(".alt-viewcart").css("display")&&$(".alt-viewcart").fadeOut().slideDown("slow",(function(){APP.sendSizetoParentiFrame()})),TweenMax.set(thisCount,{autoAlpha:0,scale:1,y:-7}),TweenMax.to(thisCount,.8,{autoAlpha:1,y:0,ease:Power2.easeOut}),TweenMax.to(thisAmt,.2,{autoAlpha:1,x:0}),TweenMax.to(success,1,{delay:2,autoAlpha:0}),TweenMax.to(thisAmt,.2,{delay:2,autoAlpha:0,x:3}),TweenMax.set(proc,{delay:2,className:"-=processing-add"})}),1e3))},onAddProductSuccess:function(json){if(json.success){if(!isIframedContent){var msg={command:"updateCartQty",qty:json.qty,amount:json.total},iframe=$("iframe.cartloom-store")[0];iframe&&iframe.contentWindow.postMessage(JSON.stringify(msg),"*")}if($(".cartloom-cart-count").html(json.qty),$(".cartloom-cart-amount").html(json.total),mobile&&!APP.quickadd)return document.location=APP.urls.directCheckout,!1;APP.quickadd?APP.processQuickAdd(json.qty,json.total):APP.showCart(!0,!0)}else alert(json.message)},showCart:function(show,forceRefresh){if(show&&isIframedContent){window.parent.postMessage(JSON.stringify({command:"showCart"}),"*")}else mobile?document.location=APP.urls.directCheckout:show?APP.$frame.attr("src",Util.getCacheBust(APP.urls.getCart)).on("load",(function(){APP.hideSpinner(),APP.$frame.delay(400).fadeIn(200)})):(APP.$frame.fadeOut(200),$("html").removeClass("cl4-fixed"),$("#cl4-load-wrap").removeClass("show"),APP.$frame.promise().done((function(){$("#cl4-load-wrap").remove()})))},showLookup:function(show,forceRefresh){if(show&&isIframedContent){window.parent.postMessage(JSON.stringify({command:"showLookup"}),"*")}else mobile?document.location=Util.getCacheBust(APP.urls.getLookup):show?APP.$frame.attr("src",Util.getCacheBust(APP.urls.getLookup)).on("load",(function(){APP.hideSpinner(),APP.$frame.delay(400).fadeIn(200)})):(APP.$frame.fadeOut(200),$("#cl4-load-wrap").removeClass("show"),APP.$frame.promise().done((function(){$("#cl4-load-wrap").remove()})))},showGiftcardLookup:function(show,forceRefresh){if(show&&isIframedContent){window.parent.postMessage(JSON.stringify({command:"showGiftcardLookup"}),"*")}else mobile?document.location=Util.getCacheBust(APP.urls.getGiftcardLookup):show?APP.$frame.attr("src",Util.getCacheBust(APP.urls.getGiftcardLookup)).on("load",(function(){APP.hideSpinner(),APP.$frame.delay(400).fadeIn(200)})):(APP.$frame.fadeOut(200),$("#cl4-load-wrap").removeClass("show"),APP.$frame.promise().done((function(){$("#cl4-load-wrap").remove()})))},showSubscribe:function(show,id){if(show&&isIframedContent){var msg={command:"showSubscribe",id:id};window.parent.postMessage(JSON.stringify(msg),"*")}else mobile?document.location=Util.getCacheBust(APP.urls.getSubscribe+id):show?APP.$frame.attr("src",Util.getCacheBust(APP.urls.getSubscribe+id)).on("load",(function(){APP.hideSpinner(),APP.$frame.delay(400).fadeIn(200)})):(APP.$frame.fadeOut(200),$("#cl4-load-wrap").removeClass("show"),APP.$frame.promise().done((function(){$("#cl4-load-wrap").remove()})))},showSubscribeManage:function(show){if(show&&isIframedContent){window.parent.postMessage(JSON.stringify({command:"showSubscribeManage"}),"*")}else mobile?document.location=Util.getCacheBust(APP.urls.getManageSubscribe):show?APP.$frame.attr("src",Util.getCacheBust(APP.urls.getManageSubscribe)).on("load",(function(){APP.hideSpinner(),APP.$frame.delay(400).fadeIn(200)})):(APP.$frame.fadeOut(200),$("#cl4-load-wrap").removeClass("show"),APP.$frame.promise().done((function(){$("#cl4-load-wrap").remove()})))},showSpinner:function(){mobile||($("body").prepend('\t\t\t\t\t<div id="cl4-load-wrap" class="'+PREFS.overlay_color_class+" swatch-"+PREFS.swatch_color_class+'">\t\t\t\t\t</div>\t\t\t\t\t<div id="cl4-loader-outer">\t\t\t\t\t<div id="cl4-loader-inner">\t\t\t\t\t<div id="cl4-loader" class="swatch-'+PREFS.swatch_color_class+'">\t\t\t\t\t<svg class="circular" viewBox="25 25 50 50">\t\t\t\t\t<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10"/>\t\t\t\t\t</svg>\t\t\t\t\t\x3c!--[if lte IE 9]><img class="lt-ie10" src="http://perronimg.com/loading-gifs/white/animations/original-white-loading-animation-large.gif"><![endif]--\x3e\t\t\t\t\t</div>\t\t\t\t\t</div>\t\t\t\t\t</div>'),$("html").addClass("cl4-fixed"),setTimeout((function(){$("#cl4-load-wrap").addClass("show")}),50))},hideSpinner:function(){$("#cl4-loader-outer").fadeOut((function(){$(this).remove()}))},getStoreCounts:function(){isIframedContent||$.getJSONP({timeout:APP.ajaxTimeout,url:APP.urls.getCounts,success:function(json){APP.updateCartQty(json.qty,json.total)},onTimeout:function(){Util.debug("getCounts timed out.")}})},resizeParentiFrame:function(h,f){return Util.debug("resize height = "+h),Util.debug("iframe selector = "+f),$("iframe.cartloom-iframe."+f).css({height:h}),!0},scrollTopParentiFrame:function(f){Util.debug("scrollTopParentiFrame = "+f),$("html, body").animate({scrollTop:$("iframe.cartloom-iframe."+f).offset().top-100},"fast")},sendSizetoParentiFrame:function(){var w=Math.max($("body").outerWidth(!0),document.body.clientWidth),device="";w>850&&$("body").removeClass("tablet-lg tablet-sm phone-lg phone-sm"),w<=850&&w>=700?device="tablet-lg":$("body").removeClass("tablet-sm phone-lg phone-sm"),w<=700&&w>=500?device="tablet-lg tablet-sm":$("body").removeClass("phone-lg phone-sm"),w<=500&&w>=350?device="tablet-lg tablet-sm phone-lg":$("body").removeClass("phone-sm"),w<=350&&(device="tablet-lg tablet-sm phone-lg phone-sm"),$("body").addClass(device),isIframedContent&&setTimeout((function(){var height=Math.max($("body").outerHeight(!0),document.body.clientHeight),selector=(Math.max($("body").outerWidth(!0),document.body.clientWidth),$("body").data("selector"));w<505&&w>490?$("body").addClass("passVH"):$("body").removeClass("passVH");var data={command:"resizeParentiFrame",height:height,selector:selector};window.parent.postMessage(JSON.stringify(data),"*")}),100)},searchClear:function(){var storeProducts=$("#cl4-em-store-gen").find(".cl4-em-wrap-outer"),searchClear=$("#cl4-search-input").next(),listView=1==$("#cl4-em-container").data("listview");$("#cl4-search-input").val(""),storeProducts.removeClass("show hide"),storeProducts.addClass("show"),searchClear.removeClass("clear"),listView?TweenMax.set(storeProducts.children(),{autoAlpha:0}):TweenMax.set(storeProducts.children(),{autoAlpha:0,scale:.8}),TweenMax.staggerTo(storeProducts.children(),.8,{autoAlpha:1,scale:1,ease:Power3.easeOut},.1),APP.sendSizetoParentiFrame(),$("#cl4-search-input").removeAttr("placeholder").attr("placeholder",""+searchPlaceholder)},storeSelect:function(uid){if($("html,body").scrollTop(0),isIframedContent){var data={command:"scrollTopParentiFrame",selector:$("body").data("selector")};window.parent.postMessage(JSON.stringify(data),"*")}if(1==$("#cl4-em-container").data("modal"))$("#cl4-em-products-gen .cl4-em-wrap-outer").addClass("hide"),$("#cl4-em-products-gen").removeClass("hide"),$("#cl4-em-products-gen").find('.cl4-em-wrap-outer[data-uid="'+uid+'"]').removeClass("hide"),$("body").addClass("cl4-product modal lock"),TweenLite.set($("#cl4-em-products-gen").children(),{autoAlpha:0,y:-10}),TweenLite.set($("#cl4-em-products-gen"),{autoAlpha:0}),TweenLite.to($("#cl4-em-products-gen").children(),.8,{delay:.2,autoAlpha:1,y:0,ease:Expo.easeOut}),TweenLite.to($("#cl4-em-products-gen"),.2,{autoAlpha:1});else{var rightDesc=$("#pid-"+uid+" .cl4-em-long-desc").attr("style","");setTimeout((function(){rightDesc.height()>300&&rightDesc.addClass("limit-more")}),100),$(".readmore").on("click",(function(){var el=$("#pid-"+uid+" .cl4-em-long-desc"),curHeight=el.height(),autoHeight=el.css("height","auto").height();rightDesc.removeClass("limit-more"),$("#pid-"+uid).css("padding-bottom",curHeight),APP.sendSizetoParentiFrame(),el.height(curHeight).animate({height:autoHeight},300,(function(){$("#pid-"+uid).css("padding-bottom","0")})),$(".readless").show()})),$(".readless").on("click",(function(){var el=productPID.find(".cl4-em-long-desc"),curHeight=el.height();rightDesc.addClass("limit-more"),productPID.css("padding-bottom",curHeight),APP.sendSizetoParentiFrame(),el.height(curHeight).animate({height:280},280,(function(){productPID.css("padding-bottom","0")})),$(this).hide()}));var productPID=$("#pid-"+uid),thumbnails=productPID.find(".cl4-em-images li").removeClass("selected");firstImage=thumbnails.first().addClass("selected").children(),imageS=firstImage.attr("data-full"),imageW=firstImage.data("width"),imageH=firstImage.data("height"),imageG=thumbnails.parent().parent(),showcaseImage=productPID.find(".cl4-em-showcase img"),thumbnails.last().addClass("last"),showcaseImage.attr("src",imageS).parent().attr("data-width",imageW).attr("data-height",imageH),$.isFunction($.fn.swipe)&&showcaseImage.parent().parent().swipe({swipeRight:function(event,direction,distance,duration,fingerCount){var selected=productPID.find(".cl4-em-images li.selected");selected.hasClass("first")||selected.prev().trigger("click")},swipeLeft:function(event,direction,distance,duration,fingerCount){var selected=productPID.find(".cl4-em-images li.selected");selected.hasClass("last")||selected.next().trigger("click")}}),thumbnails.on("click",(function(){var $this=$(this),imageS=$this.children().attr("data-full"),imageW=$this.children().data("width"),imageH=$this.children().data("height");showcaseImage.attr("src","#"),TweenLite.to(showcaseImage,.1,{autoAlpha:0}),showcaseImage.attr("src",imageS).parent().attr("data-width",imageW).attr("data-height",imageH),thumbnails.removeClass("selected"),$this.addClass("selected"),TweenLite.to(showcaseImage,.25,{autoAlpha:1}),APP.sendSizetoParentiFrame()})),1==thumbnails.length&&imageG.addClass("single-image"),$("#cl4-em-products-gen .cl4-em-wrap-outer").add($("#cl4-em-store-gen")).addClass("hide"),$("#cl4-em-products-gen").removeClass("hide"),$("#pid-"+uid).removeClass("hide"),$("body").addClass("cl4-product").removeClass("cl4-store"),TweenLite.set($("#cl4-em-products-gen"),{autoAlpha:0}),TweenLite.to($("#cl4-em-products-gen"),.8,{autoAlpha:1}),APP.sendSizetoParentiFrame()}},searchStore:function(query){var storeGen=$("#cl4-em-store-gen"),storeProducts=storeGen.find(".cl4-em-wrap-outer"),productGen=$("#cl4-em-products-gen"),products=productGen.find(".cl4-em-wrap-outer"),searchClear=$("#cl4-search-input").next(),listView=1==$("#cl4-em-container").data("listview");if(storeProducts.removeClass("show hide"),""==$("#cl4-search-input").val()&&(storeProducts.addClass("show"),searchClear.removeClass("clear"),$("#cl4-search-input").attr("placeholder",searchPlaceholder),listView?TweenMax.set(storeProducts.children(),{autoAlpha:0}):TweenMax.set(storeProducts.children(),{autoAlpha:0,scale:.8}),TweenMax.staggerTo(storeProducts.children(),.8,{autoAlpha:1,scale:1,ease:Power3.easeOut},.1)),query){if(searchClear.addClass("clear"),$("body").hasClass("cl4-product")){TweenLite.to(productGen,.2,{autoAlpha:0,onComplete:function hideProduct(){products.add(productGen).addClass("hide"),storeGen.removeClass("hide"),$("body").removeClass("cl4-product").addClass("cl4-store")}})}storeProducts.each((function(){var $this=$(this),category=($(this).data("uid"),$(this).data("category")),heading=$this.find(".cl4-em-header").text(),longDesc=$this.find(".cl4-em-long-desc").text();heading.toLowerCase().indexOf(query)>=0||category.toLowerCase().indexOf(query)>=0||longDesc.toLowerCase().indexOf(query)>=0?($this.addClass("show"),listView?TweenMax.set(storeProducts.children(),{autoAlpha:0}):TweenMax.set(storeProducts.children(),{autoAlpha:0,scale:.8}),TweenMax.to($this.children(),.5,{delay:.3,autoAlpha:1,scale:1,ease:Power3.easeOut})):$this.addClass("hide")}))}},storeViewAll:function(){var modal=1==$("#cl4-em-container").data("modal"),storeProducts=$("#cl4-em-store-gen").find(".cl4-em-wrap-outer");if(modal){(new TimelineLite).to($("#cl4-em-products-gen").children(),.4,{autoAlpha:0,y:15,ease:Power3.easeInOut}).to($("#cl4-em-products-gen"),.3,{autoAlpha:0,onComplete:function modalClass(){$("body").removeClass("modal lock")}})}else $("#cl4-em-products-gen .cl4-em-wrap-outer").add($("#cl4-em-store-gen")).addClass("hide"),$("#cl4-em-products-gen").addClass("hide"),$("#cl4-em-store-gen").removeClass("hide"),$(".alt-viewcart").hide(),$("body").removeClass("cl4-product").addClass("cl4-store"),TweenLite.set(storeProducts.children(),{autoAlpha:0}),TweenMax.staggerTo(storeProducts.children(),1,{delay:.2,autoAlpha:1,scale:1,ease:Power3.easeOut},.08),APP.sendSizetoParentiFrame()}};function doInit(){isIframedContent="cartloom-framed"===document.body.id,$("body").hasClass("cl4-store"),isStorefront=$("body").hasClass("storefront"),$("#cl4-em-container").data("quickadd"),isSlugMatch=$("#cl4-em-container").data("slug");var w=Math.max($("body").outerWidth(!0),document.body.clientWidth),device="";w>850&&$("body").removeClass("tablet-lg tablet-sm phone-lg phone-sm"),w<=850&&w>=700?device="tablet-lg":$("body").removeClass("tablet-sm phone-lg phone-sm"),w<=700&&w>=500?device="tablet-lg tablet-sm":$("body").removeClass("phone-lg phone-sm"),w<=500&&w>=350?device="tablet-lg tablet-sm phone-lg":$("body").removeClass("phone-sm"),w<=350&&(device="tablet-lg tablet-sm phone-lg phone-sm"),$("body").addClass(device),$("#cl4-em-store-gen .cl4-em-showcase").not(":has(img)").addClass("no-image");initialized||(initialized=!0,$("body").addClass("ready"),setTimeout((function(){$("#cl4-em-init-loader").remove()}),600),isSlugMatch&&APP.storeSelect(isSlugMatch),APP.sendSizetoParentiFrame(),APP.preInitialize())}$(document).ready(doInit),$(window).on("load",(function(){})),setTimeout(doInit,5e3)}}();