var ESHOP_COOKIE_NAME='eshop_show_alert';$(document).ready(function(){$("input[name='eshop_show_alert']").change(function(){var eshop_show_alert=($("input[name='eshop_show_alert']").attr("checked")?"false":"true");$.cookie(ESHOP_COOKIE_NAME,eshop_show_alert);});$("input.basket_button").click(function(){var eshop_add_product_to_cart=$("input[name='eshop_add_product_to_cart']").val();var product_id=parseInt($(this).parent().find("input[name='product_id']").val());var product_amount=parseInt($("#product_amount").val());var is_action=false;if(document.cookie&&document.cookie!=''){if($.cookie('slovart_counter')=='3'){var cookies=document.cookie.split(';');var cookies_slovart=new Array();for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,16)==('slovart_product_')){product=cookie.split('=');productid=product['0'].split('_product_');console.log(productid['1']);console.log(product['1']);$.getJSON(eshop_add_product_to_cart,{product_id:productid['1'],product_amount:product['1']},function(data){if(data.result=="ok")
{if(i==2){$(".eshop-product-amount").html(data.products_amount);$(".eshop-product-amount-text").html(data.products_amount_text);}}});is_action=true;}}
setTimeout('window.location = $("input[name=\'eshop_shopping_cart\']").val()',2000);}}
if(product_id>0&&!is_action)
{$.getJSON(eshop_add_product_to_cart,{product_id:product_id,product_amount:product_amount},function(data){if(data.result=="ok")
{$(".eshop-product-amount").html(data.products_amount);$(".eshop-product-amount-text").html(data.products_amount_text);if((null===$.cookie(ESHOP_COOKIE_NAME))||($.cookie(ESHOP_COOKIE_NAME)=="true"))
{tb_show(null,"#TB_inline?height=200&amp;width=240&amp;inlineId=basket_nadler&amp;modal=true",false);}
else
{window.location=$("input[name='eshop_shopping_cart']").val();}}});}});$(".eshop-submit-form").click(function(){$("#eshop_cart").submit();return false;});$(".eshop-shoping-cart-next").click(function(){$("input[name='redirect']").val($("input[name='eshop_next_step_url']").val());$('#eshop_cart').submit();return false;});$("input[name='customer_type']").change(function(){if($("input:checked[name='customer_type']").val()=="person")
{$(".eshop-person-fields").show();$(".eshop-body-corporate-fields").hide();}
else
{$(".eshop-person-fields").hide();$(".eshop-body-corporate-fields").show();}}).change();$("input[name='customer_type']").click(function(){$("input[name='customer_type']").change();});$("input[name='delivery_address_choice']").change(function(){if($("input:checked[name='delivery_address_choice']").val()=="identical")
{$(".eshop-delivery-address").hide();}
else
{$(".eshop-delivery-address").show();}}).change();$("input[name='delivery_address_choice']").click(function(){$("input[name='delivery_address_choice']").change();});$(".eshop-confirm-order").click(function(){$(".eshop-confirm-order-form").submit();return false;});$("input[name='transport_type']").change(function(){$("input[name='payment_type']").parents("tr").hide();var $selected_payment_types=$(".transport_type_payments-"+$("input:checked[name='transport_type']").val());if($selected_payment_types.length>0)
{$("label[for='payment_type']").parents("tr").show();var selected_payment_types=$selected_payment_types.val().split(";");for(var i=0;i<selected_payment_types.length;i++)
{$("input[name='payment_type'][value='"+selected_payment_types[i]+"']").parents("tr").show();}}
else
{$("label[for='payment_type']").parents("tr").hide();$(".eshop-payment-type-errors").parents("tr").hide();}}).change();$("input[name='transport_type']").click(function(){$("input[name='transport_type']").change();});});