(function(s){function t(s){s=s||500;$("html,body").stop().animate({scrolltop:0},s)}function i(t){function i(){$(s).scrolltop()>0?n.addclass("isfixed"):n.removeclass("isfixed")}var n=$(t);$(function(){i()}),$(s).on("scroll",i),$(s).on("load",i),$(s).on("resize",i)}function n(t){var i=$(t),n=!0;if($(s).width()>1200&&i.find("video").length>0){function e(){o(),l(),a()}function o(){var s=i.find(".slick-slide[data-slick-index=0]"),t=s.find("video");t.length>0?(i.slick("slickpause"),i.get(0).slick.slidecount<2&&t.attr("loop","loop"),t.get(0).paused&&settimeout(function(){t.get(0).play()},100)):i.slick("slickplay")}function a(){i.on("afterchange",function(s,t,e){i.find("video").each(function(){var s=$(this).get(0);s.pause(),s.currenttime=0});var o=$(t.$slides[e]),a=o.find("video");a.length>0?(i.slick("slickpause"),a.get(0).play()):n&&i.slick("slickplay")})}function l(){i.find("video").each(function(){var s=$(this).get(0);s.onended=function(){n&&(i.slick("next"),i.slick("slickplay"))}})}e()}else i.slick("play");var c={play:function(){i.slick("slickplay"),n=!0},pause:function(){n=!1,i.slick("slickpause")}};return c}function e(s,t){var i=$(s);i.find(".ys_select_li").each(function(){var s=$(this).index();null==$(this).attr("data-id")&&$(this).attr("data-id",s),$(this).attr("data-value",$(this).text())}),i.find(".ys_select_hd").click(function(s){if(s.stoppropagation(),$(this).toggleclass("on"),$(this).parents(".ys_select").hasclass("zindex"))$(this).siblings(".ys_select_bd").removeclass("showscroll"),$(this).siblings(".ys_select_bd").stop().slideup(function(){$(this).parents(".ys_select").removeclass("zindex")});else{var t=this;settimeout(function(){$(t).parents(".ys_select").addclass("zindex")},200),$(this).siblings(".ys_select_bd").stop().slidedown(function(){$(this).mcustomscrollbar("update"),$(this).addclass("showscroll")})}$(".ys_select_hd").not(this).removeclass("on"),$(".ys_select_hd").not(this).siblings(".ys_select_bd").removeclass("showscroll").stop().slideup();t=this;settimeout(function(){$(".ys_select_hd").not(t).parents(".ys_select").removeclass("zindex")},200)}),i.find(".ys_select_bd").on("click",".ys_select_li",function(){var s=$(this).text(),i=$(this).data("value"),n=$(this).data();$(this).parents(".ys_select_bd").siblings(".ys_select_hd").find(".ys_select_show").val(s),$(this).parents(".ys_select_bd").siblings(".ys_select_hd").find(".ys_select_real").attr("data-id",n.id).val(i).trigger("change"),$(this).addclass("on").siblings().removeclass("on"),t&&t(n)}),$("body").click(function(){$(".ys_select_hd").removeclass("on"),$(".ys_select_bd").removeclass("showscroll").stop().slideup(function(){$(this).parents(".ys_select").removeclass("zindex")})}),i.find(".ys_select_bd").mcustomscrollbar({axis:"y",scrollinertia:500,theme:"dark",scrollbarposition:"outside"})}function o(s,t,i,n){var e=$(t);$("body").on("click",s,function(){var s=$(this);if(e.stop().fadein(),n){function t(t){$.each(t,function(t,i){var n=i[2],o=s.find(i[0]).length>0?s.find(i[0]):s;"text"!=n&&n||e.find(i[1]).text(o.text()),"img"==n&&e.find(i[1]).attr({src:o.attr("src")}),"attr"==n&&(console.log(i[3],o),e.find(i[1]).html(o.attr(i[3]))),"html"==n&&e.find(i[1]).html(o.html())})}t(n)}k.hide()}),$("body").on("click",".ys_modal_close",function(){$(this).parents(t).stop().fadeout(function(){k.show(),n&&$.each(n,function(s,t){e.find(t[1]).empty()})})});i=i||".ys_modal_content";"noscroll"!=i?e.find(i).mcustomscrollbar({axis:"y",scrollinertia:500,theme:"dark"}):e.find(".ys_modal_content").addclass("noscroll")}function a(t,i){var n;if($(".ys_videom").length>0)n=$(".ys_videom");else{var e='
';n=$(e),$("body").append(n)}var o={$self:n,close:function(){k.show(),n.hide(),n.find(".ys_videom_video").remove(),n.find(".ys_videom_iframebox").hide().find("iframe").remove()},show:function(){k.hide(),n.show()}};$("body").on("click",t,function(){var t=$(this).attr("data-type"),e=$(this).attr("data-src");if("video"==t){n.find(".ys_videom_video").length>0&&n.find(".ys_videom_video").remove();var a=$(this).data("poster"),l=$('');$(s).width()<767&&-1!=e.indexof("http")&&(l=$(''),l.get(0).muted=!1),l.append($("