Commit 814a60d203a7a57874976e025518a47cc47af4ad

Authored by Alex Savenko
2 parents a959b337 981643b6

Merge remote branch 'origin/Issue#1'

www/dist/js/cart.js
... ... @@ -229,16 +229,27 @@ $('.popup_window').on('click', '.basket_element_prepack .group_sizes', function(
229 229 },
230 230 success: function(data){
231 231 var $item_num = $element.find('.item_num');
232   - delOrderItem($prev.data('item_id'));
233   - add_to_basket(item_id, $item_num.val());
  232 + //delOrderItem($prev.data('item_id'));
  233 + //add_to_basket(item_id, $item_num.val());
  234 + $.ajax({
  235 + url: '/basket/delete_item',
  236 + data: {
  237 + 'item_id': $prev.data('item_id')
  238 + },
  239 + type: "POST",
  240 + dataType: 'json',
  241 + success: function () {
  242 + add_to_basket(item_id, $item_num.val());
  243 + },
  244 + error: function (e) {
  245 + console.error(e);
  246 + }
  247 + });
234 248 $element.find('.price_per_unit span').text(data['price']);
235 249 calculateSumPrice($item_num);
236 250 },
237 251 error: function(e){
238 252 console.error(e);
239   - },
240   - always: function () {
241   - console.log('ajax test');
242 253 }
243 254 });
244 255 }
... ...
www/dist/js/cart.min.js
1   -function getActionDiscount(e){$.ajax({url:"/ajax/action_discount/"+e,dataType:"html",success:function(e){$(".actions").empty(),$(".actions").html(e)},error:function(e){console.error(e.data)}})}function calculateSumPrice(e){var t=e.parents(".table_line"),a=t.find(".price_per_unit span").text(),i=parseFloat(a*e.val()).toFixed(2);t.find(".sum_price span").text(i),calculateTotalPrice(t.parent())}function calculateTotalPrice(e){var t=e.find(".sum_price span").get(),a=0;$.each(t,function(e,t){a+=+t.textContent});var i=e.find("#total_price span").length?e.find("#total_price span"):$("#total_price span");i.text(a.toFixed(2))}function calculateFirmTotal(){var e=$("#order .table_line"),t=0;$.each(e,function(e,a){"true"==$(a).attr("data-firm")&&(t+=+$(a).find(".sum_price span").text())}),$("#firm_total").find("span").text(t.toFixed(2))}function calculateFirmRemain(){var e=+$("#firm_total").find("span").text(),t=$(".activepr").find("span").text(),a=t-e;a<0&&(a=0),$("#firm_remain").find("span").text(a)}$('[data-toggle="popover"]').popover(),calculateFirmTotal(),calculateFirmRemain();var $order=$("#order"),$preorder=$("#preorder"),delOrderItem=function(e){$.ajax({url:"/basket/delete_item",data:{item_id:e},type:"POST",dataType:"json",success:function(){},error:function(e){console.error(e)}})},delPreOrderItem=function(e){$.ajax({url:"/dealer/delete_preorder_item",data:{item_id:e},type:"POST",dataType:"json",success:function(){},error:function(e){console.error(e)}})},addOrderItem=function(e,t){$.ajax({url:"/basket/add_item",data:{item_id:e,count_items:t},type:"POST",success:function(){},error:function(e){console.error(e)}})};$("body, .popup_window").on("click",".delete_but",function(e){e.preventDefault();var t=$(this).parent().parent().parent(),a=$(this).parent().parent();"order"==a.attr("data-status")?delOrderItem(a.attr("data-id")):delPreOrderItem(a.attr("data-id")),a.remove(),calculateTotalPrice(t),calculateFirmTotal(),calculateFirmRemain()}),$("body, .popup_window").on("click",".minus_button",function(e){e.preventDefault();var t=$(this).parents(".table_line"),a=$(this).parent().find(".item_num"),i=a.val();1!=i&&(a.val(--i),change_count_basket(t.data("id"),i),calculateSumPrice(a),calculateFirmTotal(),calculateFirmRemain())}),$("body, .popup_window").on("click",".plus_button",function(e){e.preventDefault();var t=$(this).parents(".table_line"),a=$(this).parent().find(".item_num"),i=a.val();a.val(++i),change_count_basket(t.data("id"),i),calculateSumPrice(a),calculateFirmTotal(),calculateFirmRemain()}),$("body, .popup_window").on("change",".item_num",function(e){e.preventDefault();var t=$(this).parents(".table_line"),a=$(this).val();change_count_basket(t.data("id"),a),calculateSumPrice($(this)),calculateFirmTotal(),calculateFirmRemain()}),$(".last_order").click(function(){$(this).find("span").hasClass("arrow_down")?($(this).find("span").removeClass("arrow_down").addClass("arrow_up"),$(".last_order_block").removeClass("hidden")):($(this).find("span").removeClass("arrow_up").addClass("arrow_down"),$(".last_order_block").addClass("hidden"))}),$("#checkbox_all").change(function(){$(this).prop("checked")?$(".single_checkbox").prop("checked",!0):$(".single_checkbox").prop("checked",!1)}),$(".product_price").click(function(e){e.preventDefault(),$(".product_price").removeClass("activepr"),$(this).addClass("activepr");var t=$(this).attr("data-id");getActionDiscount(t),calculateFirmRemain()}),$("#add_to_order").click(function(e){e.preventDefault(),$("input[name]:checked").each(function(){var e=$(this).parent().parent().detach();delPreOrderItem(e.attr("data-id")),addOrderItem(e.attr("data-id"),e.find(".item_num").val()),e.find(".nopdrgt").removeClass("nopdrgt pdglt15"),e.find("input[type=checkbox]").parent().remove(),e.find(".count1").removeClass("count1"),e.attr("data-status","order");var t=$(".table_line").last();t.before(e)}),calculateTotalPrice($order),calculateTotalPrice($preorder),calculateFirmTotal(),calculateFirmRemain()}),$(".popup_window").on("click",".basket_element_prepack .group_sizes",function(e){if(e.preventDefault(),!$(this).hasClass("active")){var t=$(this).parent(),a=t.parent(),i=t.find(".group_sizes.active");i.removeClass("active"),$(this).addClass("active");var s=$(this).data("item_id");$.ajax({url:"/change_with_size",dataType:"json",method:"POST",data:{item_id:s},success:function(e){var t=a.find(".item_num");delOrderItem(i.data("item_id")),add_to_basket(s,t.val()),a.find(".price_per_unit span").text(e.price),calculateSumPrice(t)},error:function(e){console.error(e)},always:function(){console.log("ajax test")}})}});var getCartItems=function(){$.ajax({url:"/basket/get_cart_items",dataType:"json",success:function(e){for(var t="",a=0;a<e.items.length;a++){var i=e.items[a].cover;t+='<div data-status="order" data-id="'+e.items[a].id+'" class="basket_element table_line"><div class="basket_element_name"><img src="'+i+'" class="picture_element"><div class="title_element">'+e.items[a].title+'</div></div><div class="basket_element_prepack">';for(var s=0;s<e.items[a].group_sizes.length;s++){var n=e.items[a].group_sizes[s].size;if(t+='<a href="#" class="group_sizes'+(e.items[a].group_sizes[s].size==e.items[a].size?" active":"")+'" style="text-align:start;padding-top:'+3*s+"px; width:"+(31+3*s)+'px" data-item_id="'+e.items[a].group_sizes[s].id+'" ><span class="group_sizes_header"></span><span class="group_sizes_content">'+e.items[a].group_sizes[s].size+"</span></a>",void 0===e.items[a].group_sizes[s+1]||n===e.items[a].group_sizes[s+1].size)break}t+='</div><div class="basket_element_priceone"><span class="price price_per_unit"><span>'+e.items[a].price+'</span> грн.</span></div><div class="basket_element_pricenum"><div style="width: 100px"><a href="#" class="minus_button"><img src="/images/minus.png" style="padding-right:7px;"></a><input type="number" value="'+e.items[a].count+'" min="1" class="item_num"><a href="#" class="plus_button"><img src="/images/plus.png" style="padding-left:7px;"></a></div></div><div class="basket_element_priceall"><span class="price sum_price"><span>'+e.items[a].total_price+'</span> грн.</span></div><div class="basket_element_delete"><a class="delete_but"></a></div></div>'}for(var r="",a=0;a<e.items.length;a++){var i=e.items[a].cover;r+='<div data-status="order" data-id="'+e.items[a].id+'" class="basket_element table_line"><div class="basket_element_delete" ><a class="delete_but"></a></div><div class="title_element">'+e.items[a].title+'</div><img src="'+i+'" class="picture_element" style="max-width:50%;margin: 0 !important;"><div class="basket_element_priceone"><span class="price price_per_unit"><span>'+e.items[a].price+'</span> грн.</span></div><div class="basket_element_pricenum"><div style="width: 100px"><a href="#" class="minus_button"><img src="/images/minus.png" style="padding-right:7px;"></a><input type="number" value="'+e.items[a].count+'" min="1" class="item_num"><a href="#" class="plus_button"><img src="/images/plus.png" style="padding-left:7px;"></a></div></div><div class="basket_element_priceall" ><span class="price sum_price"><span>'+e.items[a].total_price+'</span> грн.</span></div><div class="basket_element_prepack">';for(var s=0;s<e.items[a].group_sizes.length;s++){var n=e.items[a].group_sizes[s].size;if(r+='<a href="#" class="group_sizes'+(e.items[a].group_sizes[s].size==e.items[a].size?" active":"")+'" style="text-align:start;padding-top:'+3*s+"px; width:"+(31+3*s)+'px" data-item_id="'+e.items[a].group_sizes[s].id+'" ><span class="group_sizes_header"></span><span class="group_sizes_content">'+e.items[a].group_sizes[s].size+"</span></a>",void 0===e.items[a].group_sizes[s+1]||n===e.items[a].group_sizes[s+1].size)break}r+="</div></div>"}$(".summary_price .sum").text(e.total_price),$(".basket_block_content").html(t),$(".basket_block_content_html_mobile").html(r),$(".popup").animate({opacity:"show",display:"block"},300),$(".popup_window").animate({marginTop:"5%",width:"1000px"},120)},error:function(e){document.write(e.responseText)}})},popup=function(){function e(){$(".popup_window").animate({marginTop:"0.6in",width:"500px"},120),$(".popup").animate({opacity:"hide",display:"none"},300)}$(".cont_shop_but, .popup_close_button").click(function(t){t.preventDefault(),e()}),$(".popup").click(function(){e()}),$(".popup_window").click(function(e){e.stopPropagation()}),$(document).on("click",".buy",function(e){e.preventDefault();var t=$(this).parents(".product, .item_content"),a=$(this).data("group_id"),i=t.find(".active").data("item_id"),s=t.find("input").val();$.ajax({url:"/ajax/get_item_group",method:"POST",dataType:"json",data:{group_id:a,item_id:i},success:function(e){console.log("item_id "+e.id),add_to_basket(e.id,s||1,getCartItems)},error:function(e){console.error(e),document.write(e.responseText)}})}),$("#help").click(function(e){e.preventDefault(),videoConfirm(function(){})})};popup();
2 1 \ No newline at end of file
  2 +function getActionDiscount(e){$.ajax({url:"/ajax/action_discount/"+e,dataType:"html",success:function(e){$(".actions").empty(),$(".actions").html(e)},error:function(e){console.error(e.data)}})}function calculateSumPrice(e){var t=e.parents(".table_line"),a=t.find(".price_per_unit span").text(),i=parseFloat(a*e.val()).toFixed(2);t.find(".sum_price span").text(i),calculateTotalPrice(t.parent())}function calculateTotalPrice(e){var t=e.find(".sum_price span").get(),a=0;$.each(t,function(e,t){a+=+t.textContent});var i=e.find("#total_price span").length?e.find("#total_price span"):$("#total_price span");i.text(a.toFixed(2))}function calculateFirmTotal(){var e=$("#order .table_line"),t=0;$.each(e,function(e,a){"true"==$(a).attr("data-firm")&&(t+=+$(a).find(".sum_price span").text())}),$("#firm_total").find("span").text(t.toFixed(2))}function calculateFirmRemain(){var e=+$("#firm_total").find("span").text(),t=$(".activepr").find("span").text(),a=t-e;a<0&&(a=0),$("#firm_remain").find("span").text(a)}$('[data-toggle="popover"]').popover(),calculateFirmTotal(),calculateFirmRemain();var $order=$("#order"),$preorder=$("#preorder"),delOrderItem=function(e){$.ajax({url:"/basket/delete_item",data:{item_id:e},type:"POST",dataType:"json",success:function(){},error:function(e){console.error(e)}})},delPreOrderItem=function(e){$.ajax({url:"/dealer/delete_preorder_item",data:{item_id:e},type:"POST",dataType:"json",success:function(){},error:function(e){console.error(e)}})},addOrderItem=function(e,t){$.ajax({url:"/basket/add_item",data:{item_id:e,count_items:t},type:"POST",success:function(){},error:function(e){console.error(e)}})};$("body, .popup_window").on("click",".delete_but",function(e){e.preventDefault();var t=$(this).parent().parent().parent(),a=$(this).parent().parent();"order"==a.attr("data-status")?delOrderItem(a.attr("data-id")):delPreOrderItem(a.attr("data-id")),a.remove(),calculateTotalPrice(t),calculateFirmTotal(),calculateFirmRemain()}),$("body, .popup_window").on("click",".minus_button",function(e){e.preventDefault();var t=$(this).parents(".table_line"),a=$(this).parent().find(".item_num"),i=a.val();1!=i&&(a.val(--i),change_count_basket(t.data("id"),i),calculateSumPrice(a),calculateFirmTotal(),calculateFirmRemain())}),$("body, .popup_window").on("click",".plus_button",function(e){e.preventDefault();var t=$(this).parents(".table_line"),a=$(this).parent().find(".item_num"),i=a.val();a.val(++i),change_count_basket(t.data("id"),i),calculateSumPrice(a),calculateFirmTotal(),calculateFirmRemain()}),$("body, .popup_window").on("change",".item_num",function(e){e.preventDefault();var t=$(this).parents(".table_line"),a=$(this).val();change_count_basket(t.data("id"),a),calculateSumPrice($(this)),calculateFirmTotal(),calculateFirmRemain()}),$(".last_order").click(function(){$(this).find("span").hasClass("arrow_down")?($(this).find("span").removeClass("arrow_down").addClass("arrow_up"),$(".last_order_block").removeClass("hidden")):($(this).find("span").removeClass("arrow_up").addClass("arrow_down"),$(".last_order_block").addClass("hidden"))}),$("#checkbox_all").change(function(){$(this).prop("checked")?$(".single_checkbox").prop("checked",!0):$(".single_checkbox").prop("checked",!1)}),$(".product_price").click(function(e){e.preventDefault(),$(".product_price").removeClass("activepr"),$(this).addClass("activepr");var t=$(this).attr("data-id");getActionDiscount(t),calculateFirmRemain()}),$("#add_to_order").click(function(e){e.preventDefault(),$("input[name]:checked").each(function(){var e=$(this).parent().parent().detach();delPreOrderItem(e.attr("data-id")),addOrderItem(e.attr("data-id"),e.find(".item_num").val()),e.find(".nopdrgt").removeClass("nopdrgt pdglt15"),e.find("input[type=checkbox]").parent().remove(),e.find(".count1").removeClass("count1"),e.attr("data-status","order");var t=$(".table_line").last();t.before(e)}),calculateTotalPrice($order),calculateTotalPrice($preorder),calculateFirmTotal(),calculateFirmRemain()}),$(".popup_window").on("click",".basket_element_prepack .group_sizes",function(e){if(e.preventDefault(),!$(this).hasClass("active")){var t=$(this).parent(),a=t.parent(),i=t.find(".group_sizes.active");i.removeClass("active"),$(this).addClass("active");var s=$(this).data("item_id");$.ajax({url:"/change_with_size",dataType:"json",method:"POST",data:{item_id:s},success:function(e){var t=a.find(".item_num");$.ajax({url:"/basket/delete_item",data:{item_id:i.data("item_id")},type:"POST",dataType:"json",success:function(){add_to_basket(s,t.val())},error:function(e){console.error(e)}}),a.find(".price_per_unit span").text(e.price),calculateSumPrice(t)},error:function(e){console.error(e)}})}});var getCartItems=function(){$.ajax({url:"/basket/get_cart_items",dataType:"json",success:function(e){for(var t="",a=0;a<e.items.length;a++){var i=e.items[a].cover;t+='<div data-status="order" data-id="'+e.items[a].id+'" class="basket_element table_line"><div class="basket_element_name"><img src="'+i+'" class="picture_element"><div class="title_element">'+e.items[a].title+'</div></div><div class="basket_element_prepack">';for(var s=0;s<e.items[a].group_sizes.length;s++){var n=e.items[a].group_sizes[s].size;if(t+='<a href="#" class="group_sizes'+(e.items[a].group_sizes[s].size==e.items[a].size?" active":"")+'" style="text-align:start;padding-top:'+3*s+"px; width:"+(31+3*s)+'px" data-item_id="'+e.items[a].group_sizes[s].id+'" ><span class="group_sizes_header"></span><span class="group_sizes_content">'+e.items[a].group_sizes[s].size+"</span></a>",void 0===e.items[a].group_sizes[s+1]||n===e.items[a].group_sizes[s+1].size)break}t+='</div><div class="basket_element_priceone"><span class="price price_per_unit"><span>'+e.items[a].price+'</span> грн.</span></div><div class="basket_element_pricenum"><div style="width: 100px"><a href="#" class="minus_button"><img src="/images/minus.png" style="padding-right:7px;"></a><input type="number" value="'+e.items[a].count+'" min="1" class="item_num"><a href="#" class="plus_button"><img src="/images/plus.png" style="padding-left:7px;"></a></div></div><div class="basket_element_priceall"><span class="price sum_price"><span>'+e.items[a].total_price+'</span> грн.</span></div><div class="basket_element_delete"><a class="delete_but"></a></div></div>'}for(var r="",a=0;a<e.items.length;a++){var i=e.items[a].cover;r+='<div data-status="order" data-id="'+e.items[a].id+'" class="basket_element table_line"><div class="basket_element_delete" ><a class="delete_but"></a></div><div class="title_element">'+e.items[a].title+'</div><img src="'+i+'" class="picture_element" style="max-width:50%;margin: 0 !important;"><div class="basket_element_priceone"><span class="price price_per_unit"><span>'+e.items[a].price+'</span> грн.</span></div><div class="basket_element_pricenum"><div style="width: 100px"><a href="#" class="minus_button"><img src="/images/minus.png" style="padding-right:7px;"></a><input type="number" value="'+e.items[a].count+'" min="1" class="item_num"><a href="#" class="plus_button"><img src="/images/plus.png" style="padding-left:7px;"></a></div></div><div class="basket_element_priceall" ><span class="price sum_price"><span>'+e.items[a].total_price+'</span> грн.</span></div><div class="basket_element_prepack">';for(var s=0;s<e.items[a].group_sizes.length;s++){var n=e.items[a].group_sizes[s].size;if(r+='<a href="#" class="group_sizes'+(e.items[a].group_sizes[s].size==e.items[a].size?" active":"")+'" style="text-align:start;padding-top:'+3*s+"px; width:"+(31+3*s)+'px" data-item_id="'+e.items[a].group_sizes[s].id+'" ><span class="group_sizes_header"></span><span class="group_sizes_content">'+e.items[a].group_sizes[s].size+"</span></a>",void 0===e.items[a].group_sizes[s+1]||n===e.items[a].group_sizes[s+1].size)break}r+="</div></div>"}$(".summary_price .sum").text(e.total_price),$(".basket_block_content").html(t),$(".basket_block_content_html_mobile").html(r),$(".popup").animate({opacity:"show",display:"block"},300),$(".popup_window").animate({marginTop:"5%",width:"1000px"},120)},error:function(e){document.write(e.responseText)}})},popup=function(){function e(){$(".popup_window").animate({marginTop:"0.6in",width:"500px"},120),$(".popup").animate({opacity:"hide",display:"none"},300)}$(".cont_shop_but, .popup_close_button").click(function(t){t.preventDefault(),e()}),$(".popup").click(function(){e()}),$(".popup_window").click(function(e){e.stopPropagation()}),$(document).on("click",".buy",function(e){e.preventDefault();var t=$(this).parents(".product, .item_content"),a=$(this).data("group_id"),i=t.find(".active").data("item_id"),s=t.find("input").val();$.ajax({url:"/ajax/get_item_group",method:"POST",dataType:"json",data:{group_id:a,item_id:i},success:function(e){console.log("item_id "+e.id),add_to_basket(e.id,s||1,getCartItems)},error:function(e){console.error(e),document.write(e.responseText)}})}),$("#help").click(function(e){e.preventDefault(),videoConfirm(function(){})})};popup();
3 3 \ No newline at end of file
... ...
www/js/main.js
... ... @@ -1491,15 +1491,11 @@ $(document).ready(function()
1491 1491 });
1492 1492 }
1493 1493 });
1494   - console.log('ajax test success');
1495 1494  
1496 1495 },
1497 1496 error: function(e)
1498 1497 {
1499 1498 console.info(e.responseText);
1500   - },
1501   - always: function () {
1502   - console.log('ajax test 123');
1503 1499 }
1504 1500 });
1505 1501 });
... ...
www/js/main.min.js
1   -function dialogue(e,t){e=$("<div />",{class:"dialogue clearfix"}).append(e),$.iLightBox([{URL:e,type:"html",title:t?t:null}],{skin:"light ilightbox-dialogue",minScale:1,innerToolbar:!0,overlay:{blur:!1},controls:{fullscreen:!1},callback:{onRender:function(e){$(".btn",e.currentElement).click(function(){$(".btn",e.currentElement).unbind("click"),e.hide()})},onShow:function(e){$(".btn-primary",e.currentElement).focus()}}})}function videoConfirm(e){var t=$("<div />",{html:'<iframe width="560" height="315" src="https://www.youtube.com/embed/WR3kUJ6p3eE" frameborder="0" allowfullscreen></iframe>'}),a=$("<button />",{html:"Закрить",class:"btn alert_button",style:"display:block;margin:0px auto;width:150px;",click:function(){e(!1),$(".dialogue").hide(),console.log($(".dialogue"))}});dialogue(t.add(a),"Потрібна допомога?",function(){e(!1)})}function Confirm(e,t,a){var n=$("<div />",{html:e}),i=$("<button />",{html:"Перейти до кошику",class:"btn btn-primary alert_button",click:function(){a(!0)},keyup:function(e){13==e.keyCode&&$(this).trigger("click")}}),s=$("<button />",{html:"Продовжити покупки",class:"btn alert_button",click:function(){a(!1)}});video=$("<button />",{html:"Потрібна допомога?",class:"btn alert_button",style:"display:block;margin:0px auto;width:200px;",click:function(){a(!1),videoConfirm(a)}}),dialogue(n.add(s).add(i).add(video),t,function(){a(!1)})}function p(e){console.info(e)}function get(){getNovaPoshtaCity()}function getNovaPoshtaCity(){$("#order_city_novaposhta").autocomplete({source:function(e,t){$.ajax({url:"/ajax/get_cities",data:{term:e.term},scriptCharset:"utf-8",type:"POST",dataType:"json",success:function(e){1==val&&(t(e),$("#loading_city").addClass("display_none"),$(".owner_city .description").addClass("display_none"))},error:function(){console.info("error")}}).fail(function(){$(".order_city_novaposhta .description").removeClass("display_none"),$("#order_city_novaposhta").val(""),$("#loading_city").addClass("display_none")}),$("#loading_city").removeClass("display_none")},minLength:2,select:function(e,t){return $("#order_city_novaposhta").val(t.item.label),$("#order_city_ref").val(t.item.ref),$("#loading_city").addClass("display_none"),getNovaPoshtaOffice(t.item.value),!1}})}function getNovaPoshtaOffice(e){$("#loading_office").removeClass("display_none"),$.ajax({url:"/ajax/get_offices/",data:{city:e},type:"POST",dataType:"json",success:function(e){var t="";if(e){for(var a in e)t+='<option value="'+e[a].number+"-"+e[a].address+'" data-store_ref="'+e[a].store_ref+'">'+e[a].address+"</option>";$("#store_address").html(t),$("#loading_office").addClass("display_none");$("select#store_address option:selected").data("store_ref");$("#order_store_address_ref").val($("select#store_address option:selected").data("store_ref")),$("#store_address").on("click",function(){$("#order_store_address_ref").val($("select#store_address option:selected").data("store_ref"))})}},error:function(){console.info("error")}})}function add_item_for_compare(e,t){$.ajax({url:"/ajax/add_item_for_compare",data:{check:e,item_id:t},type:"POST",dataType:"json",success:function(e){var t="";if(0==e.length)$(".compare_wrapper").empty();else{var a=0;t+='<div class="compare"><a href="#" title="Список порівняння">Список порівняння </a></div><div class="compare_list"><div class="compare"><a href="#" title="Список порівняння">Список порівняння </a></div><ul>';for(var n in e)for(var i in e[n]){var s=e[n][i].url.substr(2),o=e[n][i].url_del.substr(2);t+='<li class="clearfix"><a href="'+s+'" title="" class="float">'+e[n][i].title+" "+e[n][i].count+'</a><a href="'+o+'" title="" class="float"><img src="/images/compare_del.jpg" alt="" height="8" width="8" /></a></li>',a+=e[n][i].count}t+="</ul></div>",$(".compare_wrapper").html(t),$(".compare").html('<a href="#" title="Список порівняння">Список порівняння '+a+"</a>"),$(".compare").click(function(e){e.preventDefault();var t=$(this).parent(),a=t.find(".compare_list");a.length>0?a.toggle():t.toggle()})}},error:function(e,t){console.error(e),console.error("error: "+t)}})}function change_items(e,t,a){console.log(e+", "+t+", "+a),$.ajax({url:"/change_top_items/",data:{block_class:t,next_page:e,news_id:a},type:"POST",dataType:"json",success:function(e){var a="";if(e.length){for(var n in e)a+='<div class="one_item float '+(4==n?"last":"")+'"><div class="one_item_image"><a href="'+e[n].alias+'" title="'+e[n].title+'"><img src="'+e[n].cover+'" alt="'+e[n].title+'" width="126" height="200" /></a></div><div class="one_item_title"><a href="'+e[n].alias+'" title="'+e[n].title+'"><h3>'+e[n].title+'</h3></a></div><div class="align_bottom"><div class="one_item_price">ціна від <span>'+parseFloat(e[n].price2).toFixed(2)+'</span> грн</div><div class="one_item_buttons"><a href="'+e[n].alias+'" title="'+e[n].title+'" class="btn grey">детальніше</a><a data-group_id="'+e[n].group_id+'" href="#" title="" class="btn green buy">придбати</a></div><div class="one_item_compare"><input type="checkbox" id="items_compare_item_'+e[n].id+'" value="'+e[n].catalog+"-"+e[n].id+'" '+(e[n].checked?'checked="checked"':"")+' /><label for="items_compare_item_'+e[n].id+'"><span></span>до порівняння</label></div></div></div>';$("."+t+" .items").html(a),$(".one_item_compare").on("change",function(){var e=0,t=$(this).find("input").val();$(this).find("input").prop("checked")&&(e=1),add_item_for_compare(e,t)})}},error:function(){console.info("error")}})}function change_similar_items(e,t,a){$.ajax({url:"/change_similar_items",data:{catalog_id:e,group_id:t,similar:a},type:"POST",dataType:"json",success:function(e){var t="";for(var a in e)t+='<div class="one_item float '+(4==a?"last":"")+'"><div class="new_top clearfix">'+(1==e[a].is_new?'<div class="float"><img src="/images/new.png" alt="Новинки" width="47" height="14" /></div>':"")+(1==e[a].is_top?'<div class="float"><img src="/images/top.png" alt="Топ продаж" width="63" height="14" /></div>':"")+'</div><div class="one_item_image"><a href="'+e[a].alias+'" title="'+e[a].title+'"><img src="'+e[a].cover+'" alt="'+e[a].title+'" width="126" height="200" /></a></div><div class="one_item_title"><a href="'+e[a].alias+'" title="'+e[a].title+'"><h3>'+e[a].title+'</h3></a></div><div class="one_item_description"><p>'+e[a].description+'</p></div><div class="align_bottom"><div class="one_item_price">ціна від <span>'+parseFloat(e[a].price).toFixed(2)+'</span> грн</div><div class="one_item_buttons"><a href="'+e[a].alias+'" title="" class="btn grey">подробиці</a><a data-group_id="'+e[a].group_id+'" href="javascript:;" title="" class="'+(0!=e[a].count_available?"btn green buy":"not_available grey")+'">придбати</a></div><div class="one_item_compare"><input type="checkbox" id="compare_item_'+e[a].id+'" value="'+e[a].type+"-"+e[a].catalog+"-"+e[a].id+'" '+(e[a].checked?'checked="checked"':"")+' /><label for="compare_item_'+e[a].id+'"><span></span>до порівняння</label></div></div></div>';$(".other_items .items").html(t),$(".one_item_compare").on("change",function(){var e=0,t=$(this).find("input").val();$(this).find("input").prop("checked")&&(e=1),add_item_for_compare(e,t)})},error:function(){console.info("error1")}})}function change_price(e,t){var a=$(".sort_params").val(),n=$("input.current_url").val(),i="price-"+e+"-"+t,s=n+"--"+i;0!=a&&(s=s.replace(/\/\-\-/,"/")+"/sort-"+a),$(".price_ok").attr("href",s.replace(/\/\-\-/,"/"))}function add_to_basket(e,t,a){$.ajax({url:"/basket/add_item",data:{item_id:e,count_items:t},type:"POST",dataType:"json",success:function(e){if("0"==e)console.log(e);else{$(".basket_number a").html(e),$("span.basket_number").html(e);var n=$(".count_cart"),i=parseInt(n.text());n.text(i+parseInt(t)),$(".top_count_cart").text(i+parseInt(t))}a&&a()},error:function(){console.info("error")}})}function change_count_basket(e,t){$.ajax({url:"/basket/change_count_basket",data:{item_id:e,count_items:t},type:"POST",dataType:"json",success:function(e){for(var t=0,a=0;a<e.length;a++)t+=e[a].count_items;$(".count_cart").text(t)},error:function(e){console.info(e)}})}function Counter(e,t,a){var n=$(t).FlipClock(e,{clockFace:"DailyCounter",countdown:!0,autoStart:!1});n.start(function(){}),$(".days .flip-clock-label").html("Днів"),$(".hours .flip-clock-label").html("Годин"),$(".minutes .flip-clock-label").html("Хвилин"),$(".seconds .flip-clock-label").html("Секунд")}var val;$(document).ready(function(){function e(e){var t=50.46529,a=30.64543,n=50.378636,i=30.471027,s=50.415115,o=30.661012,l=50.522001,r=30.498161,c="/images/icon_map.png",d=new google.maps.LatLng(t,a),p=new google.maps.LatLng(n,i),u=new google.maps.LatLng(s,o),m=(new google.maps.LatLng(l,r),{zoom:10,center:d,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:!0,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},scrollwheel:!1}),_=new google.maps.Map(document.getElementById(e),m),h=new google.maps.Marker({position:d,map:_,icon:c}),f=new google.maps.Marker({position:p,map:_,icon:c}),v=new google.maps.Marker({position:u,map:_,icon:c}),$='<div id="content_map"><p>м. Київ, ст.м. Лісова, пр-т Броварський, Торговий павільон "Професійне насіння" №25</p><p>9:00 - 19:00</p><p>Пн-Сб</p><a href="mailto:info@hs.kiev.ua" class="callback email" title="написати нам">написати нам</a><div class="contact_callback_phones"></div></div>',g='<div id="content_map"><p>м. Київ, ст.м. Іподром, пр-т Академіка Глушкова, магазин "Професійне насіння" навпроти Південного автовокзалу</p><p>9:00 - 19:00</p><p>Пн-Сб</p><a href="mailto:info@hs.kiev.ua" class="callback email" title="написати нам">написати нам</a><div class="contact_callback_phones"></div></div>',b='<div id="content_map"><p>м. Київ, вул. Харьківське шосе 164А, біля магазину "Сільпо"</p><p>9:00 - 19:00</p><p>Пн-Пт</p><p>9:00 - 18:00</p><p>Сб-Нд</p><a href="mailto:info@hs.kiev.ua" class="callback email" title="написати нам">написати нам</a><div class="contact_callback_phones"></div></div>',y='<div id="content_map"><p>м. Київ, ст.м. Героїв Дніпра, пр-т Оболонський 43</p><p>9:00 - 19:00</p><p>Вт-Нд</p><a href="mailto:info@hs.kiev.ua" class="callback email" title="написати нам">написати нам</a><div class="contact_callback_phones"></div></div>',k=new google.maps.InfoWindow({content:$}),w=new google.maps.InfoWindow({content:g}),C=new google.maps.InfoWindow({content:b});new google.maps.InfoWindow({content:y});google.maps.event.addListener(h,"click",function(){k.open(_,h)}),google.maps.event.addListener(f,"click",function(){w.open(_,f)}),google.maps.event.addListener(v,"click",function(){C.open(_,v)})}function t(e){var t=50.361007,a=30.607597,n=50.45527,i=30.654585,s="/images/icon_map.png",o=new google.maps.LatLng(t,a),l=new google.maps.LatLng(n,i),r={zoom:13,center:o,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:!0,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},scrollwheel:!1},c={zoom:13,center:l,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:!0,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},scrollwheel:!1},d=new google.maps.Map(document.getElementById("google-map-contacts1"),r),p=new google.maps.Map(document.getElementById("google-map-contacts2"),c),u=new google.maps.Marker({position:o,map:d,icon:s}),m=new google.maps.Marker({position:l,map:p,icon:s}),_='<div id="content_map"><div class="content_map_title">Центральний офіс</div><p>м. Київ вул.Садова 95</p><p>(дачний масив Осокорки)</p><a href="mailto:#" class="callback email" title="написати нам">написати нам</a><div class="contact_phones"><span class="small_digits">(044)</span><span>451 48 59</span>, <span class="small_digits">(044)</span><span>581 67 15</span></div><div class="contact_mob_phones"><span class="small_digits">(067)</span><span>464 48 59</span>, <span class="small_digits">(050)</span><span>464 48 59</span></div><div class="contact_callback_phones"><a href="#" class="callback" title="">зворотній зв\'язок</a></div></div>',h='<div id="content_map2"><div class="content_map_title">Оптовий Склад</div><p>м.Київ, вул.Віскозна 17/а</p><div class="contact_phones"><span class="small_digits">(044)</span><span>454 12 15</span>, </div><div class="contact_callback_phones"><a href="#" class="callback" title="">зворотній зв\'язок</a></div></div>',f=new google.maps.InfoWindow({content:_}),v=new google.maps.InfoWindow({content:h});google.maps.event.addListener(u,"click",function(){f.open(d,u)}),google.maps.event.addListener(m,"click",function(){v.open(p,m)})}function a(e,t){var a=e.offset().left,n=40,i=a+n,s=t.offset().left,o=40,l=s+o;return!(i<s||a>l)}function n(){var e=$("span[id=total_price_basket]").html();e>100?$(".min_price_message").css("display","none"):$(".min_price_message").css("display","block")}function i(e,t){e=$("<div />",{class:"dialogue clearfix"}).append(e),$.iLightBox([{URL:e,type:"html",title:t?t:null}],{skin:"light ilightbox-dialogue",minScale:1,innerToolbar:!0,overlay:{blur:!1},controls:{fullscreen:!1},callback:{onRender:function(e){$(".btn",e.currentElement).click(function(){$(".btn",e.currentElement).unbind("click"),e.hide()})},onShow:function(e){$(".btn-primary",e.currentElement).focus()}}})}function s(e){var t=$("<div />",{html:'<iframe width="560" height="315" src="https://www.youtube.com/embed/WR3kUJ6p3eE" frameborder="0" allowfullscreen></iframe>'}),a=$("<button />",{html:"Закрить",class:"btn alert_button",style:"display:block;margin:0px auto;width:150px;",click:function(){e(!1)}});i(t.add(a),"Потрібна допомога?",function(){e(!1)})}function o(e,t,a){var n=$("<div />",{html:e}),o=$("<button />",{html:"Перейти до кошику",class:"btn btn-primary alert_button",click:function(){a(!0)},keyup:function(e){13==e.keyCode&&$(this).trigger("click")}}),l=$("<button />",{html:"Продовжити покупки",class:"btn alert_button",click:function(){a(!1)}});video=$("<button />",{html:"Потрібна допомога?",class:"btn alert_button",style:"display:block;margin:0px auto;width:200px;",click:function(){a(!1),s(a)}}),i(n.add(l).add(o).add(video),t,function(){a(!1)})}function l(e,t,a){var n=$("<p />",{html:e}),s=$("<button />",{html:"Продовжити покупки",class:"btn btn-primary alert_button",click:function(){a(!0)},keyup:function(e){13==e.keyCode&&$(this).trigger("click")}}),o=$("<button />",{html:"Залишитись в кошику",class:"btn alert_button",click:function(){a(!1)}});i(n.add(o).add(s),t,function(){a(!1)})}function r(e,t){var e=$("<p />",{html:e,class:"dialogue_message"}),a=$("<button />",{html:"OK",class:"btn btn-primary alert_button",keyup:function(e){13==e.keyCode&&$(this).trigger("click")}});i(e.add(a),t)}n(),$("#layerslider").layerSlider({autoStart:!0,responsive:!0,responsiveUnder:0,sublayerContainer:0,firstLayer:1,twoWaySlideshow:!1,randomSlideshow:!1,keybNav:!0,touchNav:!0,imgPreload:!1,navPrevNext:!0,navStartStop:!1,navButtons:!0,thumbnailNavigation:"disabled",tnWidth:100,tnHeight:60,tnContainerWidth:"60%",tnActiveOpacity:35,tnInactiveOpacity:100,hoverPrevNext:!0,hoverBottomNav:!1,skin:"default",skinsPath:"/layerslider/skins/",pauseOnHover:!0,globalBGColor:"transparent",globalBGImage:!1,animateFirstLayer:!1,yourLogo:!1,yourLogoStyle:"position: absolute; z-index: 1001; left: 10px; top: 10px;",yourLogoLink:!1,yourLogoTarget:"_blank",loops:0,forceLoopNum:!0,autoPlayVideos:!0,autoPauseSlideshow:"auto",youtubePreview:"maxresdefault.jpg",showBarTimer:!1,showCircleTimer:!0,slideDirection:"right",slideDelay:1e4,durationIn:"bottom",durationOut:"fade",easingIn:"easeOutQuart",easingOut:"easeInBack",delayIn:0,delayOut:0}),window.onload=function(){document.getElementById("google-map")&&e("google-map")},"/contacts"==window.location.pathname&&(window.onload=function(){document.getElementById("google-map-contacts1")&&(t("google-map-contacts1"),e("google-map-contacts2"))}),function(){if((!window.pluso||"function"!=typeof window.pluso.start)&&void 0==window.ifpluso){window.ifpluso=1;var e=document,t=e.createElement("script"),a="getElementsByTagName";t.type="text/javascript",t.charset="UTF-8",t.async=!0,t.src=("https:"==window.location.protocol?"https":"http")+"://share.pluso.ru/pluso-like.js";var n=e[a]("body")[0];n.appendChild(t)}}(),!function(e,t,a,n){var i=e.createElement("script");i.src="http://connect.ok.ru/connect.js",i.onload=i.onreadystatechange=function(){this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||this.executed||(this.executed=!0,setTimeout(function(){OK.CONNECT.insertShareWidget(t,a,n)},0))},e.documentElement.appendChild(i)}(document,"ok_shareWidget","","{width:145,height:30,st:'straight',sz:20,ck:1}"),function(e,t,a){var n,i=e.getElementsByTagName(t)[0];e.getElementById(a)||(n=e.createElement(t),n.id=a,n.src="//connect.facebook.net/ru_RU/all.js#xfbml=1",i.parentNode.insertBefore(n,i))}(document,"script","facebook-jssdk");var c=parseInt($("#price_to").val()),d=parseInt($("#price_from").val());if($("#slider").slider({range:!0,min:0,max:parseInt($(".max_price").val()),values:[d,c],slide:function(e,t){$(".ui-slider-handle:eq(0) .price-range-min").html(t.values[0]+"грн"),$(".ui-slider-handle:eq(1) .price-range-max").html(t.values[1]+"грн"),$("#price_from").val(t.values[0]),$("#price_to").val(t.values[1]),t.values[0]==t.values[1]?$(".price-range-both i").css("display","none"):$(".price-range-both i").css("display","inline"),change_price(t.values[0],t.values[1]),1==a($(".price-range-min"),$(".price-range-max"))?($(".price-range-min, .price-range-max").css("opacity","1"),$(".price-range-both").css("display","block")):($(".price-range-min, .price-range-max").css("opacity","1"),$(".price-range-both").css("display","none"))}}),$(".ui-slider-handle:eq(0)").append('<span class="price-range-min value">'+$("#slider").slider("values",0)+'грн</span><span class="range"></span>'),$(".ui-slider-handle:eq(1)").append('<span class="price-range-max value">'+$("#slider").slider("values",1)+'грн</span><span class="range"></span>'),$("input#price_from").change(function(){var e=$("input#price_from").val(),t=$("input#price_to").val();parseInt(e)>parseInt(t)&&(e=t,$("input#price_from").val(e)),change_price(e,t),$("#slider").slider("values",0,e),$(".ui-slider-handle:eq(0) .price-range-min").html(e+"грн")}),$("input#price_to").change(function(){var e=$("input#price_from").val(),t=$("input#price_to").val();parseInt(e)>parseInt(t)&&(t=e,$("input#price_to").val(t)),change_price(e,t),$("#slider").slider("values",1,t),$(".ui-slider-handle:eq(1) .price-range-max").html(t+"грн")}),$("#subcategory_menu").on("click",".main",function(){$(this).hasClass("subcategory_menu_closed")?($(this).removeClass("subcategory_menu_closed"),$(this).parent().find("ul").removeClass("display_none")):$(this).hasClass("subcategory_menu_price")||($(this).addClass("subcategory_menu_closed"),$(this).parent().find("ul").addClass("display_none"))}),$(".tabs").on("click","ul li",function(e){if($(this).parent().parent().find("ul li").removeClass("previous"),$(this).parent().find("li").removeClass("active_tab"),$(this).hasClass("active_tab")||($(this).parent().parent().find("ul li").addClass("not_active"),$(this).addClass("active_tab"),$(this).prev().addClass("previous")),$(this).parent().hasClass("change_item_description")){e.preventDefault();var t=$(this).data("change_item_description");$(".item_menu_content .item_menu_content_wrapper").addClass("display_none"),$(".item_menu_content div").hasClass(t)&&$(".item_menu_content div."+t).removeClass("display_none")}else if($(this).parent().hasClass("change_similar_items")){e.preventDefault();var a=$(this).find("a").data("change_similar_items"),n=$(this).find("a").data("catalog_id"),i=$(this).find("a").data("group_id");change_similar_items(n,i,a)}else $(this).parent().parent().hasClass("do_order")&&($(this).hasClass("new_customer")?($("div.new_customer").removeClass("display_none"),$("div.registrated_customer").addClass("display_none")):($("div.registrated_customer").removeClass("display_none"),$("div.new_customer").addClass("display_none")))}),$("body").on("click",".sort_price.last",function(e){$(".sort_price_dropdown").hasClass("display_none")?$(".sort_price_dropdown").removeClass("display_none"):$(".sort_price_dropdown").addClass("display_none")}),$("#header_nav").on("click",".header_nav_catalog",function(e){e.preventDefault(),$("#content_subnav").hasClass("display_none")?$("#content_subnav").removeClass("display_none"):$("#content_subnav").addClass("display_none")}),$.cookie("view")&&"lists"==$.cookie("view")&&($("#content .subcategory").addClass("subcategory_list"),$("#content div").removeClass("subcategory"),$(".lists").addClass("active"),$(".lists").parent().find(".thumbs").removeClass("active")),$(".content_wrapper_header_menu").on("click",".thumbs",function(e){e.preventDefault(),$.cookie("view","thumbs"),$("#content .subcategory_list").addClass("subcategory"),$("#content div").removeClass("subcategory_list"),$(this).addClass("active"),$(this).parent().find(".lists").removeClass("active")}),$(".content_wrapper_header_menu").on("click",".lists",function(e){e.preventDefault(),$.cookie("view","lists"),$("#content .subcategory").addClass("subcategory_list"),$("#content div").removeClass("subcategory"),$(this).addClass("active"),$(this).parent().find(".thumbs").removeClass("active")}),$(".content_items").on("click",".content_arrow_right",function(e){e.preventDefault();var t=$(this).parent().parent().parent().data("class"),a=parseInt($("."+t+" .page_number").text()),n=$(this).parent().find("span.max_page").text(),i=$(this).parent().parent().parent().data("news_id")?parseInt($(this).parent().parent().parent().data("news_id")):"0";if(a<n){var s=a+1;$("."+t+" .page_number").text(s,t),change_items(s,t,i)}else{var s=1;$("."+t+" .page_number").text(s,t),change_items(s,t,i)}}),$(".content_items").on("click",".content_arrow_left",function(e){e.preventDefault();var t=$(this).parent().parent().parent().data("class"),a=parseInt($("."+t+" .page_number").text()),n=$(this).parent().parent().parent().data("news_id")?parseInt($(this).parent().parent().parent().data("news_id")):"0";if(a>1){var i=a-1;$("."+t+" .page_number").text(i,t),change_items(i,t,n)}}),$(".plus ").on("click",function(e){e.preventDefault();var t=parseInt($(this).parent().find(".count_input input").val())+1,a=$(".item_id_for_basket").val();if(a||(a=$(".count_items").data("item_id")),change_count_basket(a,t),$(this).parent().find(".count_input input").val(t),$(this).parent().hasClass("order_third_column")){var i=parseFloat($(this).parent().parent().find(".order_second_column").find("span").html()),s=i*t;s%1!==0&&(s=s.toFixed(1)),$(this).parent().parent().find(".order_fourth_column").find("span.price").html(s);var o=0;$(".order_second_column .price").each(function(){o+=parseFloat($(this).parent().parent().find(".order_fourth_column").find("span.price").html()),$(".order_last span.price").html(o.toFixed(1)),n()})}}),$(".minus ").on("click",function(e){e.preventDefault();var t=parseInt($(this).parent().find(".count_input input").val()),a=t-1,i=$(this).parent().find(".count_input input").data("item_id");if(change_count_basket(i,a),t>1&&($(this).parent().find(".count_input input").val(a),$(this).parent().hasClass("order_third_column"))){var s=parseFloat($(this).parent().parent().find(".order_second_column").find("span").html()),o=s*a;o%1!==0&&(o=o.toFixed(1)),$(this).parent().parent().find(".order_fourth_column").find("span.price").html(o);var l=0;$(".order_second_column .price").each(function(){l+=parseFloat($(this).parent().parent().find(".order_fourth_column").find("span.price").html()),$(".order_last span.price").html(l.toFixed(1)),n()})}}),$(".count_input input").on("keyup",function(e){e.preventDefault();var t=$(this).val(),a=$(this).data("item_id");if(change_count_basket(a,t),t>1&&$(this).parent().parent().hasClass("order_third_column")){var i=parseFloat($(this).parent().parent().parent().find(".order_second_column").find("span").html()),s=i*t;s%1!==0&&(s=s.toFixed(1)),$(this).parent().parent().parent().find(".order_fourth_column").find("span.price").html(s);var o=0;$(".order_second_column .price").each(function(){o+=parseFloat($(this).parent().parent().parent().find(".order_fourth_column").find("span.price").html()),$(".order_last span.price").html(o.toFixed(1)),n()})}}),$("#send_order").click(function(e){e.preventDefault();var t=$("span[id=total_price_basket]").html();console.log(t),t<100?l(" Мінімальна сума замовлення складає 100 гривень. Замовте ще!","Кошик",function(e){e&&(document.location="/")}):$("form[name=order_add]").submit()}),$(".thumbnail").iLightBox({skin:"metro-black",path:"horizontal",maxScale:1.3,overlay:{opacity:.8},styles:{nextOffsetX:75,nextOpacity:.55,prevOffsetX:75,prevOpacity:.55},thumbnails:{normalOpacity:.9,activeOpacity:1},controls:{thumbnail:1,arrows:1}}),$(".item").on("click",".group_sizes",function(e){if($(this).hasClass("not_exist"))return!1;e.preventDefault();var t=$(this).data("item_id"),a=$(this).data("catalog_id"),n=$(this).data("group_alias");$(this).parent().find("a.group_sizes").removeClass("active"),$(this).addClass("active"),$.ajax({url:"/change_with_size",data:{item_id:t,catalog_id:a,group_alias:n},type:"POST",dataType:"json",success:function(e){var a=e.html;if($(".item_images .thumbnails").html(e.image),$(".presence_status").html(e.status),$(".properties_article").html(e.product_id),$(".colors").html(e.color),$(".change_with_size").html(a),$(".recommended_prices").remove(),$("#firm").empty(),$("#stock_availability").attr("src","/images/dost0.png"),console.log(e.recommended_prices),e.recommended_prices){var n='<div class="recommended_prices"><div style="display: inline-block;vertical-align: top">'+e.recommended_prices.name+'</div><div class="recommended_prices_block">';if(e.recommended_prices.dealer.forEach(function(e){n+='<div style="display: inline-block; margin-left: 10px"><div class="dealer_price"><span>'+e.dealer_price+'</span> грн.</div><div class="dealer_name">'+e.dealer_name+"</div></div>"}),n+="</div></div>",$(".packing").after(n),e.recommended_prices.firm){var i='<img src="/images/minilogo.png"><span>'+e.recommended_prices.firm_product+'</span><a style="display:inline-block;width: 14px;height: 14px" href="#" data-placement="bottom" data-toggle="popover" data-trigger="hover" data-content="Some content" class="products_more"></a>';$("#firm").html(i)}else $("#firm").empty();e.recommended_prices.stock_availability?$("#stock_availability").attr("src","/images/dost"+e.recommended_prices.stock_availability+".png"):$("#stock_availability").attr("src","/images/dost0.png")}$(".thumbnail").iLightBox({skin:"metro-black",path:"horizontal",maxScale:1.3,overlay:{opacity:.8},styles:{nextOffsetX:75,nextOpacity:.55,prevOffsetX:75,prevOpacity:.55},thumbnails:{normalOpacity:.9,activeOpacity:1},controls:{thumbnail:1,arrows:1}}),$("#show_confirm").click(function(e){var a=$("#stock").data("stock");if(console.log(a),e.preventDefault(),a){var n=$(".count_input .count_items").val();add_to_basket(t,n),o("Ви додали товар до кошика","Кошик",function(e){e&&(document.location="/basket")})}else{var n=$(".count_input .count_items").val();add_to_basket(t,n),o("Ви замовляєте товар, який на сьогоднішній день<br><b>відсутній на складі</b>. Будь ласка,<br> узгодьте термін доставки даного товару.","Кошик",function(e){e&&(document.location="/basket")})}}),console.log("ajax test success")},error:function(e){console.info(e.responseText)},always:function(){console.log("ajax test 123")}})}),$(".group_sizes:first").click(),$(".item").on("click",".change_with_color",function(e){e.preventDefault();var t=$(this).data("item_id"),a=$(this).data("type_id"),n=$(this).data("subtype_id"),i=$(this).data("group_id"),s=$(this).data("group_alias"),l=$(this).data("color_id"),r=$(".current_item_size").val();$(".change_with_color a").removeClass("active"),$(".change_with_color a").css("border-color","#e2e2e2"),$(this).find("a").addClass("active"),$.ajax({url:"/change_with_color",data:{item_id:t,type_id:a,subtype_id:n,group_id:i,group_alias:s,color_id:l,current_item_size:r},type:"POST",dataType:"json",success:function(e){var i="";for(var s in e){i+='<div class="clearfix buy_compare"><div class="one_item_price float">ціна <span>'+parseFloat(e[s].price2).toFixed(2)+'</span> грн</div><div class="one_item_buttons float"><a href="'+e[s].alias+'" title="" class="btn green" id="show_confirm">придбати</a></div><div class="one_item_compare float"><input type="checkbox" id="compare_item_'+t+'" value="'+a+"-"+n+"-"+t+'" /><label for="compare_item_'+t+'"><span></span>до порівняння</label><input type="hidden" class="item_id_for_basket" value="'+t+'"><input type="hidden" class="current_item_size" value="'+e[s].size+'"></div></div><div class="clearfix features">';for(var l in e[s].filters)i+='<a href="#" class="float">'+e[s].filters[l].value_value+"</a>";i+="</div>",$(".item_images .thumbnails").html(e[s].image),$(".presence_status").html(e[s].status),$(".properties_article").html(e[s].product_id),$(".colors").html(e[s].color),$(".packing_images").html(e[s].sizes),$(".item_properties").html(e[s].properties),$(".change_with_color a").hasClass("active")&&$(".change_with_color a.active").css("border-color",e[s].absolute_color)}$(".change_with_size").html(i),$(".thumbnail").iLightBox({skin:"metro-black",path:"horizontal",maxScale:1.3,overlay:{opacity:.8},styles:{nextOffsetX:75,nextOpacity:.55,prevOffsetX:75,prevOpacity:.55},thumbnails:{normalOpacity:.9,activeOpacity:1},controls:{thumbnail:1,arrows:1}}),$("#show_confirm").click(function(e){var a=$("#stock").data("stock");if(console.log(a),e.preventDefault(),a){var n=$(".count_input .count_items").val();add_to_basket(t,n),o("Ви додали товар до кошика","Кошик",function(e){e&&(document.location="/basket")})}else{var n=$(".count_input .count_items").val();add_to_basket(t,n),o("Ви замовляєте товар, який на сьогоднішній день<br> відсутній на складі, будь ласка, після замовлення<br> узгодьте термін доставки товару.","Кошик",function(e){e&&(document.location="/basket")})}})},error:function(){console.info("error")}})}),$("#profiler span.profiler-sql-show").on("click",function(e){e.preventDefault(),$("#profiler-sql").is(":visible")?$("#profiler-sql").hide():$("#profiler-sql").show()}),$("#show_confirm").click(function(e){e.preventDefault(),$(this).text("у кошику");var t=$(".item_id_for_basket").val(),a=$(".count_input .count_items").val();$.ajax({url:"/basket/add_item",data:{item_id:t,count_items:a},type:"POST",dataType:"json",success:function(e){"0"==e?o("Такий товар вже є у кошику","Кошик",function(e){e&&(document.location="/basket")}):($(".basket_number a").html(e),$("span.basket_number").html(e))},error:function(){console.info("error")}});var n=$("#stock").data("stock");if(console.log(n),e.preventDefault(),n){var a=$(".count_input .count_items").val();add_to_basket(t,a),o("Ви додали товар до кошика","Кошик",function(e){e&&(document.location="/basket")})}else{var a=$(".count_input .count_items").val();add_to_basket(t,a),o("Ви замовляєте товар, який на сьогоднішній день<br> відсутній на складі, будь ласка, після замовлення<br> узгодьте термін доставки товару.","Кошик",function(e){e&&(document.location="/basket")})}}),$(".order_fifth_column a").click(function(e){e.preventDefault();var t=$(this).data("item_id");$.ajax({url:"/basket/delete_item",data:{item_id:t},type:"POST",dataType:"json",success:function(e){"0"==e?document.location="/":($(".basket_number a").html(e),$("span.basket_number").html(e),document.location="/basket")},error:function(){console.info("error")}})}),"/"==window.location.pathname){var p=document.cookie.match("(^|;) ?order=([^;]*)(;|$)"),u=document.cookie.match("(^|;) ?callback=([^;]*)(;|$)");p&&1==p[2]&&(document.cookie="order=; expires=Thu, 01 Jan 1970 00:00:00 GMT",r("Ви успішно оформили замовлення","Кошик")),u&&1==u[2]&&(document.cookie="callback=; expires=Thu, 01 Jan 1970 00:00:00 GMT",r("Ви успішно відправили повідомлення","Зворотній зв'язок"))}$(".order_fifth_column a").click(function(e){e.preventDefault();var t=$(this).data("item_id");$.ajax({url:"/basket/delete_item",data:{item_id:t},type:"POST",dataType:"json",success:function(e){"0"==e?document.location="/":($(".basket_number a").html(e),
2   -$("span.basket_number").html(e),document.location="/basket")},error:function(){console.info("error")}})}),$(".cabinet .my_orders").click(function(e){e.preventDefault(),$(".toggle").toggle()}),$(".compare").click(function(e){e.preventDefault();var t=$(this).parent(),a=t.find(".compare_list");a.length>0?a.toggle():t.toggle()}),$("#ajax_simple").iLightBox({attr:"target",innerToolbar:!0,overlay:{opacity:.6},controls:{fullscreen:!1},skin:"light",minScale:1}),$("#ajax_simple").iLightBox({attr:"target",innerToolbar:!0,overlay:{opacity:.6},controls:{fullscreen:!1},skin:"light",minScale:1}),$(".bind").click(function(){val=1,$(".owner_city").addClass("display_none"),$(".order_city_novaposhta").removeClass("display_none"),3==$(this).val()?($(".owner_address").addClass("display_none"),$(".store_address").removeClass("display_none"),$(".owner_address_s").addClass("display_none")):($(".store_address").addClass("display_none"),$(".owner_address").removeClass("display_none"),$(".owner_address_s").addClass("display_none")),get(),$(".owner_city .description").addClass("display_none")}),$(".unbind").click(function(){val=2,$(".order_city_novaposhta").addClass("display_none"),$(".store_address").addClass("display_none"),$(".address_mark").addClass("display_none"),1==$(this).val()?($(".owner_city").addClass("display_none"),$(".owner_address").addClass("display_none"),$(".owner_address_s").addClass("display_none")):10==$(this).val()?($(".owner_city").removeClass("display_none"),$(".owner_address_s").removeClass("display_none"),$(".owner_address").addClass("display_none")):7==$(this).val()||9==$(this).val()||11==$(this).val()||12==$(this).val()?($(".owner_city").addClass("display_none"),$(".owner_address").removeClass("display_none"),$(".address_mark").removeClass("display_none"),$(".owner_address_s").addClass("display_none")):($(".owner_city").removeClass("display_none"),$(".owner_address").removeClass("display_none"),$(".owner_address_s").addClass("display_none")),$(".owner_city .description").addClass("display_none")}),$("#search_item").autocomplete({source:function(e,t){$.ajax({url:"/ajax/get_items",data:{term:e.term},scriptCharset:"utf-8",type:"POST",dataType:"json",success:function(t){if($(".site_search").addClass("active"),t.length){var a='<ul class="search_result clearfix">';for(var n in t)a+='<li class="clearfix"><a href="'+t[n].alias+'" title=""><img src="'+t[n].cover+'" height="100" alt="'+t[n].title+'" /></a><a href="'+t[n].alias+'" class="search_result_title" title="'+t[n].title+'">'+t[n].title+'</a><p class="search_result_price">ціна від <span class="price">'+t[n].price2+"</span> грн</p></li>";a+='</ul><a href="/search/'+e.term+'" title="" class="all_search_result">Всі результати пошуку</a>',$(".search_result_display").html(a)}else $(".search_result_display").html('<p class="no_search_result">Немає товарів за цим запитом</p>')},error:function(){console.info("error")}}).fail(function(){}),$("#loading_city").removeClass("display_none")},minLength:2,select:function(e,t){return!1}}),$(document).click(function(e){var t=e.target;$(t).is(".search_result_wrapper")||$(t).is("#search_item")?$(".site_search").addClass("active"):$(".site_search").removeClass("active")}),$("body").on("change",".one_item_compare",function(){var e=0,t=$(this).find("input").val();$(this).find("input").prop("checked")&&(e=1),add_item_for_compare(e,t)}),$(".one_video_title").on("click",function(e){$(this).data("video_srs")}),$(".carousel-demo1").sliderkit({auto:!1,shownavitems:6,circular:!0});var m=function(e){var t=+e.css("height").replace("px","")+30;return t};$(".question_mark").hover(function(){var e=$(this).siblings(".additional_info"),t=m(e);e.css("top","-"+t+"px"),e.stop(!1,!0).fadeIn(300)},function(){$(this).siblings(".additional_info").stop(!1,!0).fadeOut(300)}),$(".additional_info").hover(function(){$(this).stop(!1,!0).fadeIn(300)},function(){$(this).stop(!1,!0).fadeOut(300)}),"1"!==$.cookie("sub-closed")&&$(".subscription-wr-all").delay(29970).toggle(600),$(".sub-closed").click(function(){$(".subscription-wr-all").toggle(450),$.cookie("sub-closed","1",{expires:1})});var _={fullName:function(){var e=$("#fullname");e.val().length<2?(_.errors=!0,$(".sub-sale-forma-blocks-name-first").removeClass("normal").addClass("wrong")):$(".sub-sale-forma-blocks-name-first").removeClass("wrong").addClass("normal")},email:function(){var e=$("#email"),t=/^.+@.+[.].{2,}$/i;t.test(e.val())?$(".sub-sale-forma-blocks-name").removeClass("wrong").addClass("normal"):(_.errors=!0,$(".sub-sale-forma-blocks-name").removeClass("normal").addClass("wrong"))},sendIt:function(){_.errors||console.log("submit")}};$("#send").click(function(e){e.preventDefault(),e.stopPropagation(),_.errors=!1,_.fullName(),_.email(),_.errors||(console.log("asdfsdfs"),eventMailer.email=$("#email").val(),eventMailer.name=$("#fullname").val(),eventMailer.event_type="add_subscribe",eventMailer.event="registration_complete",eventMailer.sendWithTimeOut(),$(".subscription-wr-all").fadeOut())}),$("#fullname").change(_.fullName),$("#email").change(_.email)}),$(document).ready(function(){$(".open_list_btn").click(function(){$(this).parent().find(".white_list").toggleClass("hidden"),$(this).parent().toggleClass("small")}),$(".close_list_btn").click(function(){$(this).parent().find(".white_list").toggleClass("hidden"),$(this).parent().toggleClass("small")})});
3 1 \ No newline at end of file
  2 +function dialogue(e,t){e=$("<div />",{class:"dialogue clearfix"}).append(e),$.iLightBox([{URL:e,type:"html",title:t?t:null}],{skin:"light ilightbox-dialogue",minScale:1,innerToolbar:!0,overlay:{blur:!1},controls:{fullscreen:!1},callback:{onRender:function(e){$(".btn",e.currentElement).click(function(){$(".btn",e.currentElement).unbind("click"),e.hide()})},onShow:function(e){$(".btn-primary",e.currentElement).focus()}}})}function videoConfirm(e){var t=$("<div />",{html:'<iframe width="560" height="315" src="https://www.youtube.com/embed/WR3kUJ6p3eE" frameborder="0" allowfullscreen></iframe>'}),a=$("<button />",{html:"Закрить",class:"btn alert_button",style:"display:block;margin:0px auto;width:150px;",click:function(){e(!1),$(".dialogue").hide(),console.log($(".dialogue"))}});dialogue(t.add(a),"Потрібна допомога?",function(){e(!1)})}function Confirm(e,t,a){var i=$("<div />",{html:e}),n=$("<button />",{html:"Перейти до кошику",class:"btn btn-primary alert_button",click:function(){a(!0)},keyup:function(e){13==e.keyCode&&$(this).trigger("click")}}),s=$("<button />",{html:"Продовжити покупки",class:"btn alert_button",click:function(){a(!1)}});video=$("<button />",{html:"Потрібна допомога?",class:"btn alert_button",style:"display:block;margin:0px auto;width:200px;",click:function(){a(!1),videoConfirm(a)}}),dialogue(i.add(s).add(n).add(video),t,function(){a(!1)})}function p(e){console.info(e)}function get(){getNovaPoshtaCity()}function getNovaPoshtaCity(){$("#order_city_novaposhta").autocomplete({source:function(e,t){$.ajax({url:"/ajax/get_cities",data:{term:e.term},scriptCharset:"utf-8",type:"POST",dataType:"json",success:function(e){1==val&&(t(e),$("#loading_city").addClass("display_none"),$(".owner_city .description").addClass("display_none"))},error:function(){console.info("error")}}).fail(function(){$(".order_city_novaposhta .description").removeClass("display_none"),$("#order_city_novaposhta").val(""),$("#loading_city").addClass("display_none")}),$("#loading_city").removeClass("display_none")},minLength:2,select:function(e,t){return $("#order_city_novaposhta").val(t.item.label),$("#order_city_ref").val(t.item.ref),$("#loading_city").addClass("display_none"),getNovaPoshtaOffice(t.item.value),!1}})}function getNovaPoshtaOffice(e){$("#loading_office").removeClass("display_none"),$.ajax({url:"/ajax/get_offices/",data:{city:e},type:"POST",dataType:"json",success:function(e){var t="";if(e){for(var a in e)t+='<option value="'+e[a].number+"-"+e[a].address+'" data-store_ref="'+e[a].store_ref+'">'+e[a].address+"</option>";$("#store_address").html(t),$("#loading_office").addClass("display_none");$("select#store_address option:selected").data("store_ref");$("#order_store_address_ref").val($("select#store_address option:selected").data("store_ref")),$("#store_address").on("click",function(){$("#order_store_address_ref").val($("select#store_address option:selected").data("store_ref"))})}},error:function(){console.info("error")}})}function add_item_for_compare(e,t){$.ajax({url:"/ajax/add_item_for_compare",data:{check:e,item_id:t},type:"POST",dataType:"json",success:function(e){var t="";if(0==e.length)$(".compare_wrapper").empty();else{var a=0;t+='<div class="compare"><a href="#" title="Список порівняння">Список порівняння </a></div><div class="compare_list"><div class="compare"><a href="#" title="Список порівняння">Список порівняння </a></div><ul>';for(var i in e)for(var n in e[i]){var s=e[i][n].url.substr(2),o=e[i][n].url_del.substr(2);t+='<li class="clearfix"><a href="'+s+'" title="" class="float">'+e[i][n].title+" "+e[i][n].count+'</a><a href="'+o+'" title="" class="float"><img src="/images/compare_del.jpg" alt="" height="8" width="8" /></a></li>',a+=e[i][n].count}t+="</ul></div>",$(".compare_wrapper").html(t),$(".compare").html('<a href="#" title="Список порівняння">Список порівняння '+a+"</a>"),$(".compare").click(function(e){e.preventDefault();var t=$(this).parent(),a=t.find(".compare_list");a.length>0?a.toggle():t.toggle()})}},error:function(e,t){console.error(e),console.error("error: "+t)}})}function change_items(e,t,a){console.log(e+", "+t+", "+a),$.ajax({url:"/change_top_items/",data:{block_class:t,next_page:e,news_id:a},type:"POST",dataType:"json",success:function(e){var a="";if(e.length){for(var i in e)a+='<div class="one_item float '+(4==i?"last":"")+'"><div class="one_item_image"><a href="'+e[i].alias+'" title="'+e[i].title+'"><img src="'+e[i].cover+'" alt="'+e[i].title+'" width="126" height="200" /></a></div><div class="one_item_title"><a href="'+e[i].alias+'" title="'+e[i].title+'"><h3>'+e[i].title+'</h3></a></div><div class="align_bottom"><div class="one_item_price">ціна від <span>'+parseFloat(e[i].price2).toFixed(2)+'</span> грн</div><div class="one_item_buttons"><a href="'+e[i].alias+'" title="'+e[i].title+'" class="btn grey">детальніше</a><a data-group_id="'+e[i].group_id+'" href="#" title="" class="btn green buy">придбати</a></div><div class="one_item_compare"><input type="checkbox" id="items_compare_item_'+e[i].id+'" value="'+e[i].catalog+"-"+e[i].id+'" '+(e[i].checked?'checked="checked"':"")+' /><label for="items_compare_item_'+e[i].id+'"><span></span>до порівняння</label></div></div></div>';$("."+t+" .items").html(a),$(".one_item_compare").on("change",function(){var e=0,t=$(this).find("input").val();$(this).find("input").prop("checked")&&(e=1),add_item_for_compare(e,t)})}},error:function(){console.info("error")}})}function change_similar_items(e,t,a){$.ajax({url:"/change_similar_items",data:{catalog_id:e,group_id:t,similar:a},type:"POST",dataType:"json",success:function(e){var t="";for(var a in e)t+='<div class="one_item float '+(4==a?"last":"")+'"><div class="new_top clearfix">'+(1==e[a].is_new?'<div class="float"><img src="/images/new.png" alt="Новинки" width="47" height="14" /></div>':"")+(1==e[a].is_top?'<div class="float"><img src="/images/top.png" alt="Топ продаж" width="63" height="14" /></div>':"")+'</div><div class="one_item_image"><a href="'+e[a].alias+'" title="'+e[a].title+'"><img src="'+e[a].cover+'" alt="'+e[a].title+'" width="126" height="200" /></a></div><div class="one_item_title"><a href="'+e[a].alias+'" title="'+e[a].title+'"><h3>'+e[a].title+'</h3></a></div><div class="one_item_description"><p>'+e[a].description+'</p></div><div class="align_bottom"><div class="one_item_price">ціна від <span>'+parseFloat(e[a].price).toFixed(2)+'</span> грн</div><div class="one_item_buttons"><a href="'+e[a].alias+'" title="" class="btn grey">подробиці</a><a data-group_id="'+e[a].group_id+'" href="javascript:;" title="" class="'+(0!=e[a].count_available?"btn green buy":"not_available grey")+'">придбати</a></div><div class="one_item_compare"><input type="checkbox" id="compare_item_'+e[a].id+'" value="'+e[a].type+"-"+e[a].catalog+"-"+e[a].id+'" '+(e[a].checked?'checked="checked"':"")+' /><label for="compare_item_'+e[a].id+'"><span></span>до порівняння</label></div></div></div>';$(".other_items .items").html(t),$(".one_item_compare").on("change",function(){var e=0,t=$(this).find("input").val();$(this).find("input").prop("checked")&&(e=1),add_item_for_compare(e,t)})},error:function(){console.info("error1")}})}function change_price(e,t){var a=$(".sort_params").val(),i=$("input.current_url").val(),n="price-"+e+"-"+t,s=i+"--"+n;0!=a&&(s=s.replace(/\/\-\-/,"/")+"/sort-"+a),$(".price_ok").attr("href",s.replace(/\/\-\-/,"/"))}function add_to_basket(e,t,a){$.ajax({url:"/basket/add_item",data:{item_id:e,count_items:t},type:"POST",dataType:"json",success:function(e){if("0"==e)console.log(e);else{$(".basket_number a").html(e),$("span.basket_number").html(e);var i=$(".count_cart"),n=parseInt(i.text());i.text(n+parseInt(t)),$(".top_count_cart").text(n+parseInt(t))}a&&a()},error:function(){console.info("error")}})}function change_count_basket(e,t){$.ajax({url:"/basket/change_count_basket",data:{item_id:e,count_items:t},type:"POST",dataType:"json",success:function(e){for(var t=0,a=0;a<e.length;a++)t+=e[a].count_items;$(".count_cart").text(t)},error:function(e){console.info(e)}})}function Counter(e,t,a){var i=$(t).FlipClock(e,{clockFace:"DailyCounter",countdown:!0,autoStart:!1});i.start(function(){}),$(".days .flip-clock-label").html("Днів"),$(".hours .flip-clock-label").html("Годин"),$(".minutes .flip-clock-label").html("Хвилин"),$(".seconds .flip-clock-label").html("Секунд")}var val;$(document).ready(function(){function e(e){var t=50.46529,a=30.64543,i=50.378636,n=30.471027,s=50.415115,o=30.661012,l=50.522001,r=30.498161,c="/images/icon_map.png",d=new google.maps.LatLng(t,a),p=new google.maps.LatLng(i,n),u=new google.maps.LatLng(s,o),m=(new google.maps.LatLng(l,r),{zoom:10,center:d,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:!0,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},scrollwheel:!1}),_=new google.maps.Map(document.getElementById(e),m),h=new google.maps.Marker({position:d,map:_,icon:c}),f=new google.maps.Marker({position:p,map:_,icon:c}),v=new google.maps.Marker({position:u,map:_,icon:c}),$='<div id="content_map"><p>м. Київ, ст.м. Лісова, пр-т Броварський, Торговий павільон "Професійне насіння" №25</p><p>9:00 - 19:00</p><p>Пн-Сб</p><a href="mailto:info@hs.kiev.ua" class="callback email" title="написати нам">написати нам</a><div class="contact_callback_phones"></div></div>',g='<div id="content_map"><p>м. Київ, ст.м. Іподром, пр-т Академіка Глушкова, магазин "Професійне насіння" навпроти Південного автовокзалу</p><p>9:00 - 19:00</p><p>Пн-Сб</p><a href="mailto:info@hs.kiev.ua" class="callback email" title="написати нам">написати нам</a><div class="contact_callback_phones"></div></div>',b='<div id="content_map"><p>м. Київ, вул. Харьківське шосе 164А, біля магазину "Сільпо"</p><p>9:00 - 19:00</p><p>Пн-Пт</p><p>9:00 - 18:00</p><p>Сб-Нд</p><a href="mailto:info@hs.kiev.ua" class="callback email" title="написати нам">написати нам</a><div class="contact_callback_phones"></div></div>',y='<div id="content_map"><p>м. Київ, ст.м. Героїв Дніпра, пр-т Оболонський 43</p><p>9:00 - 19:00</p><p>Вт-Нд</p><a href="mailto:info@hs.kiev.ua" class="callback email" title="написати нам">написати нам</a><div class="contact_callback_phones"></div></div>',k=new google.maps.InfoWindow({content:$}),w=new google.maps.InfoWindow({content:g}),C=new google.maps.InfoWindow({content:b});new google.maps.InfoWindow({content:y});google.maps.event.addListener(h,"click",function(){k.open(_,h)}),google.maps.event.addListener(f,"click",function(){w.open(_,f)}),google.maps.event.addListener(v,"click",function(){C.open(_,v)})}function t(e){var t=50.361007,a=30.607597,i=50.45527,n=30.654585,s="/images/icon_map.png",o=new google.maps.LatLng(t,a),l=new google.maps.LatLng(i,n),r={zoom:13,center:o,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:!0,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},scrollwheel:!1},c={zoom:13,center:l,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:!0,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},scrollwheel:!1},d=new google.maps.Map(document.getElementById("google-map-contacts1"),r),p=new google.maps.Map(document.getElementById("google-map-contacts2"),c),u=new google.maps.Marker({position:o,map:d,icon:s}),m=new google.maps.Marker({position:l,map:p,icon:s}),_='<div id="content_map"><div class="content_map_title">Центральний офіс</div><p>м. Київ вул.Садова 95</p><p>(дачний масив Осокорки)</p><a href="mailto:#" class="callback email" title="написати нам">написати нам</a><div class="contact_phones"><span class="small_digits">(044)</span><span>451 48 59</span>, <span class="small_digits">(044)</span><span>581 67 15</span></div><div class="contact_mob_phones"><span class="small_digits">(067)</span><span>464 48 59</span>, <span class="small_digits">(050)</span><span>464 48 59</span></div><div class="contact_callback_phones"><a href="#" class="callback" title="">зворотній зв\'язок</a></div></div>',h='<div id="content_map2"><div class="content_map_title">Оптовий Склад</div><p>м.Київ, вул.Віскозна 17/а</p><div class="contact_phones"><span class="small_digits">(044)</span><span>454 12 15</span>, </div><div class="contact_callback_phones"><a href="#" class="callback" title="">зворотній зв\'язок</a></div></div>',f=new google.maps.InfoWindow({content:_}),v=new google.maps.InfoWindow({content:h});google.maps.event.addListener(u,"click",function(){f.open(d,u)}),google.maps.event.addListener(m,"click",function(){v.open(p,m)})}function a(e,t){var a=e.offset().left,i=40,n=a+i,s=t.offset().left,o=40,l=s+o;return!(n<s||a>l)}function i(){var e=$("span[id=total_price_basket]").html();e>100?$(".min_price_message").css("display","none"):$(".min_price_message").css("display","block")}function n(e,t){e=$("<div />",{class:"dialogue clearfix"}).append(e),$.iLightBox([{URL:e,type:"html",title:t?t:null}],{skin:"light ilightbox-dialogue",minScale:1,innerToolbar:!0,overlay:{blur:!1},controls:{fullscreen:!1},callback:{onRender:function(e){$(".btn",e.currentElement).click(function(){$(".btn",e.currentElement).unbind("click"),e.hide()})},onShow:function(e){$(".btn-primary",e.currentElement).focus()}}})}function s(e){var t=$("<div />",{html:'<iframe width="560" height="315" src="https://www.youtube.com/embed/WR3kUJ6p3eE" frameborder="0" allowfullscreen></iframe>'}),a=$("<button />",{html:"Закрить",class:"btn alert_button",style:"display:block;margin:0px auto;width:150px;",click:function(){e(!1)}});n(t.add(a),"Потрібна допомога?",function(){e(!1)})}function o(e,t,a){var i=$("<div />",{html:e}),o=$("<button />",{html:"Перейти до кошику",class:"btn btn-primary alert_button",click:function(){a(!0)},keyup:function(e){13==e.keyCode&&$(this).trigger("click")}}),l=$("<button />",{html:"Продовжити покупки",class:"btn alert_button",click:function(){a(!1)}});video=$("<button />",{html:"Потрібна допомога?",class:"btn alert_button",style:"display:block;margin:0px auto;width:200px;",click:function(){a(!1),s(a)}}),n(i.add(l).add(o).add(video),t,function(){a(!1)})}function l(e,t,a){var i=$("<p />",{html:e}),s=$("<button />",{html:"Продовжити покупки",class:"btn btn-primary alert_button",click:function(){a(!0)},keyup:function(e){13==e.keyCode&&$(this).trigger("click")}}),o=$("<button />",{html:"Залишитись в кошику",class:"btn alert_button",click:function(){a(!1)}});n(i.add(o).add(s),t,function(){a(!1)})}function r(e,t){var e=$("<p />",{html:e,class:"dialogue_message"}),a=$("<button />",{html:"OK",class:"btn btn-primary alert_button",keyup:function(e){13==e.keyCode&&$(this).trigger("click")}});n(e.add(a),t)}i(),$("#layerslider").layerSlider({autoStart:!0,responsive:!0,responsiveUnder:0,sublayerContainer:0,firstLayer:1,twoWaySlideshow:!1,randomSlideshow:!1,keybNav:!0,touchNav:!0,imgPreload:!1,navPrevNext:!0,navStartStop:!1,navButtons:!0,thumbnailNavigation:"disabled",tnWidth:100,tnHeight:60,tnContainerWidth:"60%",tnActiveOpacity:35,tnInactiveOpacity:100,hoverPrevNext:!0,hoverBottomNav:!1,skin:"default",skinsPath:"/layerslider/skins/",pauseOnHover:!0,globalBGColor:"transparent",globalBGImage:!1,animateFirstLayer:!1,yourLogo:!1,yourLogoStyle:"position: absolute; z-index: 1001; left: 10px; top: 10px;",yourLogoLink:!1,yourLogoTarget:"_blank",loops:0,forceLoopNum:!0,autoPlayVideos:!0,autoPauseSlideshow:"auto",youtubePreview:"maxresdefault.jpg",showBarTimer:!1,showCircleTimer:!0,slideDirection:"right",slideDelay:1e4,durationIn:"bottom",durationOut:"fade",easingIn:"easeOutQuart",easingOut:"easeInBack",delayIn:0,delayOut:0}),window.onload=function(){document.getElementById("google-map")&&e("google-map")},"/contacts"==window.location.pathname&&(window.onload=function(){document.getElementById("google-map-contacts1")&&(t("google-map-contacts1"),e("google-map-contacts2"))}),function(){if((!window.pluso||"function"!=typeof window.pluso.start)&&void 0==window.ifpluso){window.ifpluso=1;var e=document,t=e.createElement("script"),a="getElementsByTagName";t.type="text/javascript",t.charset="UTF-8",t.async=!0,t.src=("https:"==window.location.protocol?"https":"http")+"://share.pluso.ru/pluso-like.js";var i=e[a]("body")[0];i.appendChild(t)}}(),!function(e,t,a,i){var n=e.createElement("script");n.src="http://connect.ok.ru/connect.js",n.onload=n.onreadystatechange=function(){this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||this.executed||(this.executed=!0,setTimeout(function(){OK.CONNECT.insertShareWidget(t,a,i)},0))},e.documentElement.appendChild(n)}(document,"ok_shareWidget","","{width:145,height:30,st:'straight',sz:20,ck:1}"),function(e,t,a){var i,n=e.getElementsByTagName(t)[0];e.getElementById(a)||(i=e.createElement(t),i.id=a,i.src="//connect.facebook.net/ru_RU/all.js#xfbml=1",n.parentNode.insertBefore(i,n))}(document,"script","facebook-jssdk");var c=parseInt($("#price_to").val()),d=parseInt($("#price_from").val());if($("#slider").slider({range:!0,min:0,max:parseInt($(".max_price").val()),values:[d,c],slide:function(e,t){$(".ui-slider-handle:eq(0) .price-range-min").html(t.values[0]+"грн"),$(".ui-slider-handle:eq(1) .price-range-max").html(t.values[1]+"грн"),$("#price_from").val(t.values[0]),$("#price_to").val(t.values[1]),t.values[0]==t.values[1]?$(".price-range-both i").css("display","none"):$(".price-range-both i").css("display","inline"),change_price(t.values[0],t.values[1]),1==a($(".price-range-min"),$(".price-range-max"))?($(".price-range-min, .price-range-max").css("opacity","1"),$(".price-range-both").css("display","block")):($(".price-range-min, .price-range-max").css("opacity","1"),$(".price-range-both").css("display","none"))}}),$(".ui-slider-handle:eq(0)").append('<span class="price-range-min value">'+$("#slider").slider("values",0)+'грн</span><span class="range"></span>'),$(".ui-slider-handle:eq(1)").append('<span class="price-range-max value">'+$("#slider").slider("values",1)+'грн</span><span class="range"></span>'),$("input#price_from").change(function(){var e=$("input#price_from").val(),t=$("input#price_to").val();parseInt(e)>parseInt(t)&&(e=t,$("input#price_from").val(e)),change_price(e,t),$("#slider").slider("values",0,e),$(".ui-slider-handle:eq(0) .price-range-min").html(e+"грн")}),$("input#price_to").change(function(){var e=$("input#price_from").val(),t=$("input#price_to").val();parseInt(e)>parseInt(t)&&(t=e,$("input#price_to").val(t)),change_price(e,t),$("#slider").slider("values",1,t),$(".ui-slider-handle:eq(1) .price-range-max").html(t+"грн")}),$("#subcategory_menu").on("click",".main",function(){$(this).hasClass("subcategory_menu_closed")?($(this).removeClass("subcategory_menu_closed"),$(this).parent().find("ul").removeClass("display_none")):$(this).hasClass("subcategory_menu_price")||($(this).addClass("subcategory_menu_closed"),$(this).parent().find("ul").addClass("display_none"))}),$(".tabs").on("click","ul li",function(e){if($(this).parent().parent().find("ul li").removeClass("previous"),$(this).parent().find("li").removeClass("active_tab"),$(this).hasClass("active_tab")||($(this).parent().parent().find("ul li").addClass("not_active"),$(this).addClass("active_tab"),$(this).prev().addClass("previous")),$(this).parent().hasClass("change_item_description")){e.preventDefault();var t=$(this).data("change_item_description");$(".item_menu_content .item_menu_content_wrapper").addClass("display_none"),$(".item_menu_content div").hasClass(t)&&$(".item_menu_content div."+t).removeClass("display_none")}else if($(this).parent().hasClass("change_similar_items")){e.preventDefault();var a=$(this).find("a").data("change_similar_items"),i=$(this).find("a").data("catalog_id"),n=$(this).find("a").data("group_id");change_similar_items(i,n,a)}else $(this).parent().parent().hasClass("do_order")&&($(this).hasClass("new_customer")?($("div.new_customer").removeClass("display_none"),$("div.registrated_customer").addClass("display_none")):($("div.registrated_customer").removeClass("display_none"),$("div.new_customer").addClass("display_none")))}),$("body").on("click",".sort_price.last",function(e){$(".sort_price_dropdown").hasClass("display_none")?$(".sort_price_dropdown").removeClass("display_none"):$(".sort_price_dropdown").addClass("display_none")}),$("#header_nav").on("click",".header_nav_catalog",function(e){e.preventDefault(),$("#content_subnav").hasClass("display_none")?$("#content_subnav").removeClass("display_none"):$("#content_subnav").addClass("display_none")}),$.cookie("view")&&"lists"==$.cookie("view")&&($("#content .subcategory").addClass("subcategory_list"),$("#content div").removeClass("subcategory"),$(".lists").addClass("active"),$(".lists").parent().find(".thumbs").removeClass("active")),$(".content_wrapper_header_menu").on("click",".thumbs",function(e){e.preventDefault(),$.cookie("view","thumbs"),$("#content .subcategory_list").addClass("subcategory"),$("#content div").removeClass("subcategory_list"),$(this).addClass("active"),$(this).parent().find(".lists").removeClass("active")}),$(".content_wrapper_header_menu").on("click",".lists",function(e){e.preventDefault(),$.cookie("view","lists"),$("#content .subcategory").addClass("subcategory_list"),$("#content div").removeClass("subcategory"),$(this).addClass("active"),$(this).parent().find(".thumbs").removeClass("active")}),$(".content_items").on("click",".content_arrow_right",function(e){e.preventDefault();var t=$(this).parent().parent().parent().data("class"),a=parseInt($("."+t+" .page_number").text()),i=$(this).parent().find("span.max_page").text(),n=$(this).parent().parent().parent().data("news_id")?parseInt($(this).parent().parent().parent().data("news_id")):"0";if(a<i){var s=a+1;$("."+t+" .page_number").text(s,t),change_items(s,t,n)}else{var s=1;$("."+t+" .page_number").text(s,t),change_items(s,t,n)}}),$(".content_items").on("click",".content_arrow_left",function(e){e.preventDefault();var t=$(this).parent().parent().parent().data("class"),a=parseInt($("."+t+" .page_number").text()),i=$(this).parent().parent().parent().data("news_id")?parseInt($(this).parent().parent().parent().data("news_id")):"0";if(a>1){var n=a-1;$("."+t+" .page_number").text(n,t),change_items(n,t,i)}}),$(".plus ").on("click",function(e){e.preventDefault();var t=parseInt($(this).parent().find(".count_input input").val())+1,a=$(".item_id_for_basket").val();if(a||(a=$(".count_items").data("item_id")),change_count_basket(a,t),$(this).parent().find(".count_input input").val(t),$(this).parent().hasClass("order_third_column")){var n=parseFloat($(this).parent().parent().find(".order_second_column").find("span").html()),s=n*t;s%1!==0&&(s=s.toFixed(1)),$(this).parent().parent().find(".order_fourth_column").find("span.price").html(s);var o=0;$(".order_second_column .price").each(function(){o+=parseFloat($(this).parent().parent().find(".order_fourth_column").find("span.price").html()),$(".order_last span.price").html(o.toFixed(1)),i()})}}),$(".minus ").on("click",function(e){e.preventDefault();var t=parseInt($(this).parent().find(".count_input input").val()),a=t-1,n=$(this).parent().find(".count_input input").data("item_id");if(change_count_basket(n,a),t>1&&($(this).parent().find(".count_input input").val(a),$(this).parent().hasClass("order_third_column"))){var s=parseFloat($(this).parent().parent().find(".order_second_column").find("span").html()),o=s*a;o%1!==0&&(o=o.toFixed(1)),$(this).parent().parent().find(".order_fourth_column").find("span.price").html(o);var l=0;$(".order_second_column .price").each(function(){l+=parseFloat($(this).parent().parent().find(".order_fourth_column").find("span.price").html()),$(".order_last span.price").html(l.toFixed(1)),i()})}}),$(".count_input input").on("keyup",function(e){e.preventDefault();var t=$(this).val(),a=$(this).data("item_id");if(change_count_basket(a,t),t>1&&$(this).parent().parent().hasClass("order_third_column")){var n=parseFloat($(this).parent().parent().parent().find(".order_second_column").find("span").html()),s=n*t;s%1!==0&&(s=s.toFixed(1)),$(this).parent().parent().parent().find(".order_fourth_column").find("span.price").html(s);var o=0;$(".order_second_column .price").each(function(){o+=parseFloat($(this).parent().parent().parent().find(".order_fourth_column").find("span.price").html()),$(".order_last span.price").html(o.toFixed(1)),i()})}}),$("#send_order").click(function(e){e.preventDefault();var t=$("span[id=total_price_basket]").html();console.log(t),t<100?l(" Мінімальна сума замовлення складає 100 гривень. Замовте ще!","Кошик",function(e){e&&(document.location="/")}):$("form[name=order_add]").submit()}),$(".thumbnail").iLightBox({skin:"metro-black",path:"horizontal",maxScale:1.3,overlay:{opacity:.8},styles:{nextOffsetX:75,nextOpacity:.55,prevOffsetX:75,prevOpacity:.55},thumbnails:{normalOpacity:.9,activeOpacity:1},controls:{thumbnail:1,arrows:1}}),$(".item").on("click",".group_sizes",function(e){if($(this).hasClass("not_exist"))return!1;e.preventDefault();var t=$(this).data("item_id"),a=$(this).data("catalog_id"),i=$(this).data("group_alias");$(this).parent().find("a.group_sizes").removeClass("active"),$(this).addClass("active"),$.ajax({url:"/change_with_size",data:{item_id:t,catalog_id:a,group_alias:i},type:"POST",dataType:"json",success:function(e){var a=e.html;if($(".item_images .thumbnails").html(e.image),$(".presence_status").html(e.status),$(".properties_article").html(e.product_id),$(".colors").html(e.color),$(".change_with_size").html(a),$(".recommended_prices").remove(),$("#firm").empty(),$("#stock_availability").attr("src","/images/dost0.png"),console.log(e.recommended_prices),e.recommended_prices){var i='<div class="recommended_prices"><div style="display: inline-block;vertical-align: top">'+e.recommended_prices.name+'</div><div class="recommended_prices_block">';if(e.recommended_prices.dealer.forEach(function(e){i+='<div style="display: inline-block; margin-left: 10px"><div class="dealer_price"><span>'+e.dealer_price+'</span> грн.</div><div class="dealer_name">'+e.dealer_name+"</div></div>"}),i+="</div></div>",$(".packing").after(i),e.recommended_prices.firm){var n='<img src="/images/minilogo.png"><span>'+e.recommended_prices.firm_product+'</span><a style="display:inline-block;width: 14px;height: 14px" href="#" data-placement="bottom" data-toggle="popover" data-trigger="hover" data-content="Some content" class="products_more"></a>';$("#firm").html(n)}else $("#firm").empty();e.recommended_prices.stock_availability?$("#stock_availability").attr("src","/images/dost"+e.recommended_prices.stock_availability+".png"):$("#stock_availability").attr("src","/images/dost0.png")}$(".thumbnail").iLightBox({skin:"metro-black",path:"horizontal",maxScale:1.3,overlay:{opacity:.8},styles:{nextOffsetX:75,nextOpacity:.55,prevOffsetX:75,prevOpacity:.55},thumbnails:{normalOpacity:.9,activeOpacity:1},controls:{thumbnail:1,arrows:1}}),$("#show_confirm").click(function(e){var a=$("#stock").data("stock");if(console.log(a),e.preventDefault(),a){var i=$(".count_input .count_items").val();add_to_basket(t,i),o("Ви додали товар до кошика","Кошик",function(e){e&&(document.location="/basket")})}else{var i=$(".count_input .count_items").val();add_to_basket(t,i),o("Ви замовляєте товар, який на сьогоднішній день<br><b>відсутній на складі</b>. Будь ласка,<br> узгодьте термін доставки даного товару.","Кошик",function(e){e&&(document.location="/basket")})}})},error:function(e){console.info(e.responseText)}})}),$(".group_sizes:first").click(),$(".item").on("click",".change_with_color",function(e){e.preventDefault();var t=$(this).data("item_id"),a=$(this).data("type_id"),i=$(this).data("subtype_id"),n=$(this).data("group_id"),s=$(this).data("group_alias"),l=$(this).data("color_id"),r=$(".current_item_size").val();$(".change_with_color a").removeClass("active"),$(".change_with_color a").css("border-color","#e2e2e2"),$(this).find("a").addClass("active"),$.ajax({url:"/change_with_color",data:{item_id:t,type_id:a,subtype_id:i,group_id:n,group_alias:s,color_id:l,current_item_size:r},type:"POST",dataType:"json",success:function(e){var n="";for(var s in e){n+='<div class="clearfix buy_compare"><div class="one_item_price float">ціна <span>'+parseFloat(e[s].price2).toFixed(2)+'</span> грн</div><div class="one_item_buttons float"><a href="'+e[s].alias+'" title="" class="btn green" id="show_confirm">придбати</a></div><div class="one_item_compare float"><input type="checkbox" id="compare_item_'+t+'" value="'+a+"-"+i+"-"+t+'" /><label for="compare_item_'+t+'"><span></span>до порівняння</label><input type="hidden" class="item_id_for_basket" value="'+t+'"><input type="hidden" class="current_item_size" value="'+e[s].size+'"></div></div><div class="clearfix features">';for(var l in e[s].filters)n+='<a href="#" class="float">'+e[s].filters[l].value_value+"</a>";n+="</div>",$(".item_images .thumbnails").html(e[s].image),$(".presence_status").html(e[s].status),$(".properties_article").html(e[s].product_id),$(".colors").html(e[s].color),$(".packing_images").html(e[s].sizes),$(".item_properties").html(e[s].properties),$(".change_with_color a").hasClass("active")&&$(".change_with_color a.active").css("border-color",e[s].absolute_color)}$(".change_with_size").html(n),$(".thumbnail").iLightBox({skin:"metro-black",path:"horizontal",maxScale:1.3,overlay:{opacity:.8},styles:{nextOffsetX:75,nextOpacity:.55,prevOffsetX:75,prevOpacity:.55},thumbnails:{normalOpacity:.9,activeOpacity:1},controls:{thumbnail:1,arrows:1}}),$("#show_confirm").click(function(e){var a=$("#stock").data("stock");if(console.log(a),e.preventDefault(),a){var i=$(".count_input .count_items").val();add_to_basket(t,i),o("Ви додали товар до кошика","Кошик",function(e){e&&(document.location="/basket")})}else{var i=$(".count_input .count_items").val();add_to_basket(t,i),o("Ви замовляєте товар, який на сьогоднішній день<br> відсутній на складі, будь ласка, після замовлення<br> узгодьте термін доставки товару.","Кошик",function(e){e&&(document.location="/basket")})}})},error:function(){console.info("error")}})}),$("#profiler span.profiler-sql-show").on("click",function(e){e.preventDefault(),$("#profiler-sql").is(":visible")?$("#profiler-sql").hide():$("#profiler-sql").show()}),$("#show_confirm").click(function(e){e.preventDefault(),$(this).text("у кошику");var t=$(".item_id_for_basket").val(),a=$(".count_input .count_items").val();$.ajax({url:"/basket/add_item",data:{item_id:t,count_items:a},type:"POST",dataType:"json",success:function(e){"0"==e?o("Такий товар вже є у кошику","Кошик",function(e){e&&(document.location="/basket")}):($(".basket_number a").html(e),$("span.basket_number").html(e))},error:function(){console.info("error")}});var i=$("#stock").data("stock");if(console.log(i),e.preventDefault(),i){var a=$(".count_input .count_items").val();add_to_basket(t,a),o("Ви додали товар до кошика","Кошик",function(e){e&&(document.location="/basket")})}else{var a=$(".count_input .count_items").val();add_to_basket(t,a),o("Ви замовляєте товар, який на сьогоднішній день<br> відсутній на складі, будь ласка, після замовлення<br> узгодьте термін доставки товару.","Кошик",function(e){e&&(document.location="/basket")})}}),$(".order_fifth_column a").click(function(e){e.preventDefault();var t=$(this).data("item_id");$.ajax({url:"/basket/delete_item",data:{item_id:t},type:"POST",dataType:"json",success:function(e){"0"==e?document.location="/":($(".basket_number a").html(e),$("span.basket_number").html(e),document.location="/basket")},error:function(){console.info("error")}})}),"/"==window.location.pathname){var p=document.cookie.match("(^|;) ?order=([^;]*)(;|$)"),u=document.cookie.match("(^|;) ?callback=([^;]*)(;|$)");p&&1==p[2]&&(document.cookie="order=; expires=Thu, 01 Jan 1970 00:00:00 GMT",r("Ви успішно оформили замовлення","Кошик")),u&&1==u[2]&&(document.cookie="callback=; expires=Thu, 01 Jan 1970 00:00:00 GMT",r("Ви успішно відправили повідомлення","Зворотній зв'язок"))}$(".order_fifth_column a").click(function(e){e.preventDefault();var t=$(this).data("item_id");$.ajax({url:"/basket/delete_item",data:{item_id:t},type:"POST",dataType:"json",success:function(e){"0"==e?document.location="/":($(".basket_number a").html(e),$("span.basket_number").html(e),document.location="/basket");
  3 +},error:function(){console.info("error")}})}),$(".cabinet .my_orders").click(function(e){e.preventDefault(),$(".toggle").toggle()}),$(".compare").click(function(e){e.preventDefault();var t=$(this).parent(),a=t.find(".compare_list");a.length>0?a.toggle():t.toggle()}),$("#ajax_simple").iLightBox({attr:"target",innerToolbar:!0,overlay:{opacity:.6},controls:{fullscreen:!1},skin:"light",minScale:1}),$("#ajax_simple").iLightBox({attr:"target",innerToolbar:!0,overlay:{opacity:.6},controls:{fullscreen:!1},skin:"light",minScale:1}),$(".bind").click(function(){val=1,$(".owner_city").addClass("display_none"),$(".order_city_novaposhta").removeClass("display_none"),3==$(this).val()?($(".owner_address").addClass("display_none"),$(".store_address").removeClass("display_none"),$(".owner_address_s").addClass("display_none")):($(".store_address").addClass("display_none"),$(".owner_address").removeClass("display_none"),$(".owner_address_s").addClass("display_none")),get(),$(".owner_city .description").addClass("display_none")}),$(".unbind").click(function(){val=2,$(".order_city_novaposhta").addClass("display_none"),$(".store_address").addClass("display_none"),$(".address_mark").addClass("display_none"),1==$(this).val()?($(".owner_city").addClass("display_none"),$(".owner_address").addClass("display_none"),$(".owner_address_s").addClass("display_none")):10==$(this).val()?($(".owner_city").removeClass("display_none"),$(".owner_address_s").removeClass("display_none"),$(".owner_address").addClass("display_none")):7==$(this).val()||9==$(this).val()||11==$(this).val()||12==$(this).val()?($(".owner_city").addClass("display_none"),$(".owner_address").removeClass("display_none"),$(".address_mark").removeClass("display_none"),$(".owner_address_s").addClass("display_none")):($(".owner_city").removeClass("display_none"),$(".owner_address").removeClass("display_none"),$(".owner_address_s").addClass("display_none")),$(".owner_city .description").addClass("display_none")}),$("#search_item").autocomplete({source:function(e,t){$.ajax({url:"/ajax/get_items",data:{term:e.term},scriptCharset:"utf-8",type:"POST",dataType:"json",success:function(t){if($(".site_search").addClass("active"),t.length){var a='<ul class="search_result clearfix">';for(var i in t)a+='<li class="clearfix"><a href="'+t[i].alias+'" title=""><img src="'+t[i].cover+'" height="100" alt="'+t[i].title+'" /></a><a href="'+t[i].alias+'" class="search_result_title" title="'+t[i].title+'">'+t[i].title+'</a><p class="search_result_price">ціна від <span class="price">'+t[i].price2+"</span> грн</p></li>";a+='</ul><a href="/search/'+e.term+'" title="" class="all_search_result">Всі результати пошуку</a>',$(".search_result_display").html(a)}else $(".search_result_display").html('<p class="no_search_result">Немає товарів за цим запитом</p>')},error:function(){console.info("error")}}).fail(function(){}),$("#loading_city").removeClass("display_none")},minLength:2,select:function(e,t){return!1}}),$(document).click(function(e){var t=e.target;$(t).is(".search_result_wrapper")||$(t).is("#search_item")?$(".site_search").addClass("active"):$(".site_search").removeClass("active")}),$("body").on("change",".one_item_compare",function(){var e=0,t=$(this).find("input").val();$(this).find("input").prop("checked")&&(e=1),add_item_for_compare(e,t)}),$(".one_video_title").on("click",function(e){$(this).data("video_srs")}),$(".carousel-demo1").sliderkit({auto:!1,shownavitems:6,circular:!0});var m=function(e){var t=+e.css("height").replace("px","")+30;return t};$(".question_mark").hover(function(){var e=$(this).siblings(".additional_info"),t=m(e);e.css("top","-"+t+"px"),e.stop(!1,!0).fadeIn(300)},function(){$(this).siblings(".additional_info").stop(!1,!0).fadeOut(300)}),$(".additional_info").hover(function(){$(this).stop(!1,!0).fadeIn(300)},function(){$(this).stop(!1,!0).fadeOut(300)}),"1"!==$.cookie("sub-closed")&&$(".subscription-wr-all").delay(29970).toggle(600),$(".sub-closed").click(function(){$(".subscription-wr-all").toggle(450),$.cookie("sub-closed","1",{expires:1})});var _={fullName:function(){var e=$("#fullname");e.val().length<2?(_.errors=!0,$(".sub-sale-forma-blocks-name-first").removeClass("normal").addClass("wrong")):$(".sub-sale-forma-blocks-name-first").removeClass("wrong").addClass("normal")},email:function(){var e=$("#email"),t=/^.+@.+[.].{2,}$/i;t.test(e.val())?$(".sub-sale-forma-blocks-name").removeClass("wrong").addClass("normal"):(_.errors=!0,$(".sub-sale-forma-blocks-name").removeClass("normal").addClass("wrong"))},sendIt:function(){_.errors||console.log("submit")}};$("#send").click(function(e){e.preventDefault(),e.stopPropagation(),_.errors=!1,_.fullName(),_.email(),_.errors||(console.log("asdfsdfs"),eventMailer.email=$("#email").val(),eventMailer.name=$("#fullname").val(),eventMailer.event_type="add_subscribe",eventMailer.event="registration_complete",eventMailer.sendWithTimeOut(),$(".subscription-wr-all").fadeOut())}),$("#fullname").change(_.fullName),$("#email").change(_.email)}),$(document).ready(function(){$(".open_list_btn").click(function(){$(this).parent().find(".white_list").toggleClass("hidden"),$(this).parent().toggleClass("small")}),$(".close_list_btn").click(function(){$(this).parent().find(".white_list").toggleClass("hidden"),$(this).parent().toggleClass("small")})});
4 4 \ No newline at end of file
... ...