var di_url="";var custom_url_submit="";var productSelectorElement;var cartFormElement;var AddToCart_btn;var isArrayOrHTML=function(obj){var type=Function.prototype.call.bind(Object.prototype.toString);return type(obj)==="[object Array]"||type(obj)==="[object HTMLCollection]";};window.onload=function(){var cssId="fancyCSS";if(!document.getElementById(cssId)){var head=document.getElementsByTagName("head")[0];var link=document.createElement("link");jQuery.getScript("//customcat.mylocker.net/js/jquery.fancybox.pack.js?v=2.1.5",function(){});link.id=cssId;link.rel="stylesheet";link.media="screen";link.type="text/css";link.href="//customcat.mylocker.net/css/jquery.fancybox.css?v=2.1.5";link.media="all";head.appendChild(link);}cartFormElement=document.getElementsByClassName("variations_form cart")[0];AddToCart_btn=document.getElementsByClassName("single_add_to_cart_button")[0];if(typeof AddToCart_btn==="undefined"){AddToCart_btn=jQuery(cartFormElement).find(":submit")[0];}var productSelectorElement=document.getElementsByClassName("variations")[0];if(typeof AddToCart_btn!=="undefined"&&cartFormElement&&productSelectorElement){var Customize=document.createElement("div");var Customize_div=document.createElement("div");var Customize_Link="Customize";var Customize_input_span=document.createElement("span");var Customize_input='';Customize_div.style.display="none";Customize_input_span.style.display="none";AddToCart_btn.style.display="none";Customize_div.id="cc-custom";Customize.innerHTML=Customize_Link;Customize_input_span.innerHTML=Customize_input;insertAfter(AddToCart_btn,Customize);insertAfter(Customize,Customize_div);insertAfter(productSelectorElement,Customize_input_span);}};function CC_Customize(){variation=jQuery("input[name='variation_id']").val();if(!jQuery.isNumeric(variation)||variation<1){variation=jQuery("input[name='product_id']").val();}ccCustomize(document.getElementById("cc-custom")).customizer({sku:0,variant:variation,source:"WooCommerce",this_shop:window.location.protocol+"//"+window.location.host});}function CCLoaded(){var ccImage=document.getElementById("cc-image");ccImage.style.height="385px";ccImage.style.width="385px";var dataToLoad=document.getElementById("cc-custom").innerHTML;document.getElementById("cc-custom").innerHTML="";jQuery.fancybox(dataToLoad,{"autoDimensions":false,"width":400,"height":500,"autoScale":false});return false;}function insertAfter(referenceNode,newNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling);}function setDIURLS(){custom_url=di_url;custom_url_2submit=custom_url_submit;tt_id=document.getElementById("cc-tt");bt_id=document.getElementById("cc-bt");tn_id=document.getElementById("cc-tn");tm_id=document.getElementById("cc-tm");if(document.body.contains(tt_id)){console.log(tt_id.value);console.log(encodeURIComponent(tt_id.value));custom_url=custom_url+"&tt="+encodeURIComponent(tt_id.value);custom_url_2submit=custom_url_2submit+"\u0026tt="+encodeURIComponent(tt_id.value);}if(document.body.contains(bt_id)){custom_url=custom_url+"&bt="+encodeURIComponent(bt_id.value);custom_url_2submit=custom_url_2submit+"\u0026bt="+encodeURIComponent(bt_id.value);}if(document.body.contains(tn_id)){custom_url=custom_url+"&tn="+encodeURIComponent(tn_id.value);custom_url_2submit=custom_url_2submit+"\u0026tn="+encodeURIComponent(tn_id.value);}if(document.body.contains(tm_id)){custom_url=custom_url+"&tm="+encodeURIComponent(tm_id.value);custom_url_2submit=custom_url_2submit+"\u0026tm="+encodeURIComponent(tm_id.value);}console.log(custom_url_2submit);document.getElementById("your_design").value=custom_url_2submit;}function AddToCartCC(){setDIURLS();AddToCart_btn.click();}function isEmpty(str){return(!str||0===str.length);}