jQuery(document).ready(function(){var u=0,i=0,t=jQuery("#idplayer");function n(){if(0==u)try{t[0].load()}catch(e){console.log(e)}u=i,t[0].play()}jQuery("ul.blktab li").on("click",function(){var e=jQuery(this).attr("rel");jQuery("ul.blktab li.active").removeClass("active"),jQuery(this).addClass("active"),jQuery("ul.blktmc").hide(),jQuery("#"+e).show()}),jQuery(".grid-item .mcp .like").on("click",function(){var r=jQuery(this).attr("id"),e=jQuery(this).attr("rel");jQuery("#"+r).find("span").html("..."),jQuery.ajax({type:"post",url:"./wp-admin/admin-ajax.php",enctype:"multipart/form-data",data:{action:"post_liker",post_id:e},success:function(e){jQuery("#"+r).find("span").html(e)}})}),jQuery(".slike").on("click",function(){var r=jQuery(this).attr("ref-id"),e=jQuery(this).attr("rel");jQuery("#"+r).html("..."),jQuery.ajax({type:"post",enctype:"multipart/form-data",url:"./wp-admin/admin-ajax.php",data:{action:"post_liker",post_id:e},success:function(e){jQuery("#"+r).html(e)}})}),jQuery(".mcpplay, .playlayer, .smcpplay").on("click",function(){jQuery(".player_portable").show(),i=jQuery(this).attr("data-pid"),u!=i&&(u=0);var e=jQuery(this).attr("data-artist"),r=jQuery(this).attr("data-track"),t=jQuery(this).attr("data-image"),a=jQuery(this).attr("data-music");jQuery(".player_portable .img img").attr("src",t),jQuery("#idplayermusic").attr("src",a),jQuery(".player_portable .details").html(e+" <span>"+r+"</span>"),n()}),jQuery(".mcntpause").on("click",function(){jQuery(".mcntpause").hide(),jQuery(".mcntplay").show(),t[0].pause()}),jQuery(".mcntplay").on("click",function(){jQuery(".mcntpause").show(),jQuery(".mcntplay").hide(),n()}),jQuery(t).unbind("timeupdate"),jQuery(t).bind("timeupdate",function(){var e;t[0].paused||(e=t[0].currentTime/t[0].duration*100,jQuery(".player_portable .seekbar div").width(e+"%"),t[0].duration,jQuery("img#mcntplay").hide(),jQuery("img#mcntpause").show()),t[0].paused?(jQuery("#mcntplay").show(),jQuery("#mcntpause").hide()):(jQuery("#mcntplay").hide(),jQuery("#mcntpause").show())}),jQuery(".player_portable .seekbar").click(function(e){var r=(r=e.pageX)-(jQuery(document).width()/2-jQuery("div.player_portable").width()/2)-56,e=jQuery("div.player_portable .seekbar").width();r<1&&(r=0),t[0].paused||(t[0].currentTime=parseInt(parseInt(100*r/e)*t[0].duration/100))}),t.on("ended",function(){MPOnline[0].pause(),MPOnline[0].currentTime=0});new Swiper(".mySwiper",{slidesPerView:2,spaceBetween:20,loop:!0,autoplay:{delay:5e3}});jQuery("#sendcm").click(function(){var r=jQuery(this).html(),t=jQuery(this);jQuery(this).html("در حال ارسال ..."),jQuery.ajax({type:"post",url:"./wp-admin/admin-ajax.php",dataType:"json",enctype:"multipart/form-data",data:jQuery("form#cmform").serialize(),success:function(e){""==e.error?(alert("نظر شما ارسال، و پس از بررسی به نمایش در خواهد آمد"),jQuery("#cmbtnreply").hide(),jQuery("#cmbtnreply span").html(""),jQuery("#cm_parent").val(0),jQuery("#cm_name").val(""),jQuery("#cm_email").val(""),jQuery("#cm_comment").val("")):alert(e.error),jQuery(t).html(r)}})}),jQuery("div.cmbtnreply").on("click",function(){jQuery("#cmbtnreply").show(),jQuery("#cmbtnreply span").html(jQuery(this).attr("attr-name")),jQuery("#cm_parent").val(jQuery(this).attr("rel"));var e=(e=jQuery("#cmform").offset()).top;jQuery("html, body").stop().animate({scrollTop:e-110},"500","swing")}),jQuery(".mobmenu div:first-child img").on("click",function(){jQuery(".mobmenu div ul").toggle()}),jQuery("#cmbtnreply a").click(function(){jQuery("#cmbtnreply").hide(),jQuery("#cmbtnreply span").html(""),jQuery("#cm_parent").val(0)}),jQuery("img#searchact").click(function(){jQuery(".searchpopbox").fadeIn(200)}),jQuery(".close_search").click(function(){jQuery(".searchpopbox").fadeOut(200)})});