function add_cart(a){a&&$.ajax({type:"POST",cache:!1,url:"/store/store_cart/add_product/"+a,success:function(){0==$(".store_cart").length?linkJS("/cart"):reloadCart(a)}})}
function reloadCart(a){0!=$(".store_cart").length&&(idBox=$(".store_cart").parent().attr("id"),idd=idBox.split("_"),id=idd[1].split("-"),$.ajax({type:"POST",cache:!1,url:"/store/store_cart/loadBoxCart/"+id[0],success:function(b){$("#store_AddCart_"+a).effect("transfer",{to:$(".store_cart"),className:"store_transfer"},500);setTimeout(function(){$("#"+idBox).replaceWith(b)},300)}}))}
function reloadShippingPayments(a){void 0==a&&(a=0);nation=$("#store_nation").val();$("#store_shipping_payments").load("/store/store_cart/shipping_payments/"+a+"/0/"+nation+"/print")}function reloadCoupon(){var a=$("#store_coupon").val();nation=$("#store_nation").val();$.ajax({type:"POST",cache:!1,data:"coupon="+a,url:"/store/store_cart/update_coupon/"+a,success:function(a){"error"==a?alert("Non valido"):linkJS("/cart")}})}
function updateCart(a,b){var c=$("#qty_"+a).val();nation=$("#store_nation").val();1==b?c++:-1==b&&c--;$.ajax({type:"POST",cache:!1,data:"qty="+c,url:"/store/store_cart/update_product/"+a,success:function(){$("#store_cart_row_"+a).effect("highlight");$("#center").load("/store/store_cart/index/0/true/0/0/"+nation)}})}
function deleteCart(a){nation=$("#store_nation").val();$.ajax({type:"POST",cache:!1,url:"/store/store_cart/delete_product/"+a,success:function(){$("#store_cart_row_"+a).effect("highlight");$("#center").load("/store/store_cart/index/0/true/0/0/"+nation)}})}
$(document).ready(function(){$(".store_menu_category-parent").find("a:first").removeAttr("href").append("<span>+</span>");$(".store_menu_category-parent").click(function(){$(this).find("ul:first").show()});$(".store_menu_category-parent").bind({mouseenter:function(){$(this).find("span:first").show()},mouseleave:function(){$(this).find("span:first").hide()}})});function fontsize(a){"100%"==a?$("body").css("font-size","12px"):$("body").css("font-size",a)};

