"; html += "
"; html += " "; html += ""; return html; } function createCart(data) { if (!(JSON.stringify(data) == "[null]" || data == null)) { var html = ""; $(".shopcart-box .table").html(html); $.each(data, function(id,d) { html += renderCart(d); }); $(".shopcart-box .table").html(html); updateTotal(); $(".shopcart-box .table .quantity_itemcart").change(function(){ var id = $(this).attr("id").replace("quantity_itemcart_",""); var qty = $(this).val()-shopcart[id]["quantity"]; updateItem(undefined,id,qty); }); $(".shopcart-box .table .remove_itemcart").click(function(){ var id = $(this).attr("id").replace("remove_itemcart_",""); updateItem(undefined,id); }); $(".shopcart-widget .dropdown-menu,.shopcart-box .table .remove_itemcart,.shopcart-box .table .quantity_itemcart").click(function(e){ e.stopPropagation(); }); } } $(".order_itemcart").click(function() { var id = parseInt($(this).attr("id").replace("order_itemcart_","")); var d = {}; var idata = id; $("#item-shopcart-"+id+" .item-shopcart").each( function(v,i) { var atr = $(i).attr("id"); if (atr.substr(0,5) == "data_") { idata += $(i).val(); d["data_"+atr.substr(5).replace(/_/g," ")] = $(i).val(); } else { d[atr] = $(i).val(); } } ); var idata = enAsci(idata); d["idata"] = idata; var val = {"shopcart":{}}; val["shopcart"]["data"] = d; if ($("#quantity_itemcart_"+d["idata"]).length > 0) { $("#quantity_itemcart_"+d["idata"]).val(parseFloat($("#quantity_itemcart_"+d["idata"]).val())+parseFloat(d["quantity"])); updateItem(undefined,d["idata"],d["quantity"]); } else { updateItem(val,idata); } }); var shopcart = null; createCart(shopcart); (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'); ga('create', 'UA-81016797-1', 'auto'); ga('send', 'pageview'); var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date(); (function(){ var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0]; s1.async=true; s1.src='\/\/embed.tawk.to\/57e2a21b2b517443ae47c7fc\/default'; s1.charset='UTF-8'; s1.setAttribute('crossorigin','*'); s0.parentNode.insertBefore(s1,s0); })(); var Ssidebar = $('#navbar-collapse'); var Swindow = $(window); var done = false; Swindow.on('scroll resize', function(e) { var offsetPixels = 80; var mh = $(".main-header").width(); Ssidebar.css({"width":mh+"px"}); if (Swindow.scrollTop() > offsetPixels) { if(!done && Swindow.width() >= 753) { done = true; Ssidebar.css({"position": "fixed","top": "0px","margin-left":"-15px","margin-right":"-15px"}); $("#navbar-collapse #logocon").css("display",""); $("#header .logo").css("display","none"); } } else { if(done) { done = false; Ssidebar.css({"position": "","top": ""}); $("#navbar-collapse #logocon").css("display","none"); $("#header .logo").css("display",""); } } }); $("#btn-scroll-up").click(function() { $("html, body").animate({ scrollTop: 0 }, "slow"); return false; }); $(document).ready(function() { setTimeout(function(){ $('body').addClass('loaded'); }, 500); });