$(function(){function e(){t||($(".m-comment").scrollLeft(n),n>=450&&(n=0,i.children("li:eq(0)").insertAfter(".m-comment > ul li:last"),$(".m-comment").scrollLeft(n)),n+=1)}function u(n){var t=$('div[name="standards"]').find("a.selected");t.length>0&&(n.standard=t.attr("data-value"));n.__RequestVerificationToken=$(':hidden[name="__RequestVerificationToken"]').val()}function o(n){u(n);$.exfloading.show("请稍候...");$.post(ApiUrl("BuyBasket"),n,function(n){if($.exfloading.close(),n.flag){var t=Number(n.msg);$("#BasketNumber").text(t).show();$.exfwindow.msgbox("加入购物车成功！",4,!0)}else $.exfwindow.msgbox(n.msg,2,!0)})}function s(n){u(n);$.exfloading.show("请稍候...");$.post(ApiUrl("BuyBasket"),n,function(n){n.flag?location.href=MakeUrl("ucenter/shop/cart"):($.exfloading.close(),$.exfwindow.msgbox(n.msg,2,!0))})}function h(){function u(){t.removeClass("active");t.eq(n).addClass("active");i.stop(!0,!0).fadeOut();i.eq(n).fadeIn();i.length>1&&o()}function o(){r||(e=setTimeout(function(){r||(n++,n>=s&&(n=0),u())},3e3))}var f=$(".m-detail-view"),i=$(".m-detail-pic").find("a").fadeOut(0),t=f.children("ul").find("li"),e=null,s=t.length,r=!1,n=0;i.length>1?(f.hover(function(){clearTimeout(e);r=!0},function(){r=!1;o()}),t.click(function(){n=$(this).index();u()})):t.children("a").css({cursor:"default"});u()}var f=null,t=!1,n=0,i=$(".m-comment").children("ul"),r=i.children("li").length;r<=3&&(t=!0);setTimeout(function(){f=setInterval(e,20)},5e3);r>3&&$(".m-comment-item").hover(function(){t=!0},function(){t=!1});$("button[data-type]").click(function(){var i=$(this).attr("data-type"),n=$(this).attr("data-id"),t=$("#BuyCount").val();switch(i){case"buy-basket":IsLoginCall(o,{id:n,count:t});break;case"buy":IsLoginCall(s,{id:n,count:t})}});h();$('div[name="standards"]').find("a").click(function(){$(this).closest("div").find(".selected").removeClass("selected");$(this).addClass("selected")}).eq(0).click();$("#BuyCount").numberinput({upClass:"default",downClass:"default",min:1,max:99999,onChange:function(){var n=$(this).val()}})})