var $the_post=jQuery("#the-post"),$postContent=$the_post.find(".entry");$doc.ready(function(){"use strict";function e(e){var t;if(!e)var e=window.event;return e.which?t=3==e.which:e.button&&(t=2==e.button),t}function t(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!=document.selection.type&&(e=document.selection.createRange().text),e}if(jQuery("#show-comments-section").on("click",function(){var e=jQuery("#comments");return tie_animate_element(e),e.show(),jQuery(this).hide(),!1}),$doc.on("click",".print-share-btn",function(){return window.print(),!1}),tie.responsive_tables&&$the_post.find("table").wrap('<div class="table-is-responsive"></div>'),!tie.autoload_posts){var o=jQuery("#the-sticky-video");if(tie.is_sticky_video&&o.length){var n=o.offset().top,a=tie.sticky_desktop?60:0,a=$body.hasClass("admin-bar")?a+32:a,s=Math.floor(n+o.outerHeight()-a),i=$window.width();jQuery(".video-close-btn").click(function(){o.removeClass("video-is-sticky").addClass("stop-sticky")});var r=jQuery(".sidebar");if($body.hasClass("has-sidebar")&&r.length){var l=r.width(),c=$body.hasClass("magazine2")&&$body.hasClass("sidebar-right")?40:15,d=$window.width()-(r.offset().left+l);l&&o.find(".featured-area-inner").css({width:l,right:d-c,left:"auto",bottom:"auto",top:a+20})}$window.on("scroll",function(){o.hasClass("stop-sticky")||o.toggleClass("video-is-sticky",$window.scrollTop()>s&&i>992).show()})}if(tie.reading_indicator&&$postContent.length){var h=$postContent.height(),u=$window.height();$window.scroll(function(){var e=0,t=$postContent.offset().top,o=$window.scrollTop();o>t&&(e=100*(o-t)/(h-u)),jQuery("#reading-position-indicator").css("width",e+"%")})}}var f=jQuery("#check-also-box");if(f.length){tie_animate_element(f);var p=$the_post.outerHeight(),w=!1,m=jQuery(document).height()-jQuery(window).height();$window.scroll(function(){if(!w){var e=$window.scrollTop();e>=p||e>=m-200?f.addClass("show-check-also"):f.removeClass("show-check-also")}})}jQuery("#check-also-close").on("click",function(){return f.removeClass("show-check-also"),w=!0,!1}),tie.select_share&&($postContent.mousedown(function(o){$body.attr("mouse-top",o.clientY+window.pageYOffset),$body.attr("mouse-left",o.clientX),!e(o)&&t().length&&(jQuery(".fly-text-share").remove(),document.getSelection().removeAllRanges())}),$postContent.mouseup(function(o){var n=(jQuery(o.target),t()),a=n;if(n.length>3&&!e(o)){var s=$body.attr("mouse-top"),i=o.clientY+window.pageYOffset;parseInt(s)<parseInt(i)&&(i=s);var r=$body.attr("mouse-left"),l=o.clientX,c=parseInt(r)+(parseInt(l)-parseInt(r))/2,d=window.location.href.split("?")[0],h=114;n=n.substring(0,h),tie.twitter_username&&(h-=tie.twitter_username.length+2,n=n.substring(0,h),n=n+" @"+tie.twitter_username);var u="";tie.select_share_twitter&&(u+='<a href="https://twitter.com/share?url='+encodeURIComponent(d)+"&text="+encodeURIComponent(n)+"\" class='tie-icon-twitter' onclick=\"window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false;\"></a>"),tie.select_share_facebook&&tie.facebook_app_id&&(u+='<a href="https://www.facebook.com/dialog/feed?app_id='+tie.facebook_app_id+"&amp;link="+encodeURIComponent(d)+"&amp;quote="+encodeURIComponent(a)+"\" class='tie-icon-facebook' onclick=\"window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false;\"></a>"),tie.select_share_linkedin&&(u+='<a href="https://www.linkedin.com/shareArticle?mini=true&url='+encodeURIComponent(d)+"&summary="+encodeURIComponent(a)+"\" class='tie-icon-linkedin' onclick=\"window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false;\"></a>"),tie.select_share_email&&(u+='<a href="mailto:?body='+encodeURIComponent(a)+" "+encodeURIComponent(d)+"\" class='tie-icon-envelope' onclick=\"window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;\"></a>"),""!=u&&$body.append('<div class="fly-text-share">'+u+"</div>"),jQuery(".fly-text-share").css({position:"absolute",top:parseInt(i)-60,left:parseInt(c)}).show()}})),$doc.on("mousemove",".taq-user-rate-active",function(e){var t=jQuery(this);if(t.hasClass("rated-done"))return!1;e.offsetX||(e.offsetX=e.clientX-jQuery(e.target).offset().left);var o=e.offsetX,n=t.width(),a=Math.round(o/n*100);t.find(".user-rate-image span").attr("data-user-rate",a).css("width",a+"%")}),$doc.on("click",".taq-user-rate-active",function(){var e=jQuery(this),t=e.parent(),o=t.find(".taq-count"),n=e.attr("data-id"),a=o.text();if(e.hasClass("rated-done")||e.hasClass("rated-in-progress"))return!1;e.addClass("rated-in-progress");var s=e.find(".user-rate-image span").data("user-rate");e.find(".user-rate-image").hide(),e.append('<span class="taq-load">'+tie.ajax_loader+"</span>"),s>=95&&(s=100);var i=5*s/100;return jQuery.post(taqyeem.ajaxurl,{action:"taqyeem_rate_post",post:n,value:i},function(){e.addClass("rated-done").attr("data-rate",s),e.find(".user-rate-image span").width(s+"%"),jQuery(".taq-load").fadeOut(function(){t.find(".taq-score").html(i),o.length?(a=parseInt(a)+1,o.html(a)):t.find("small").hide(),t.find("strong").html(taqyeem.your_rating),e.find(".user-rate-image").fadeIn()})},"html"),!1}),$doc.on("mouseleave",".taq-user-rate-active",function(){var e=jQuery(this);if(e.hasClass("rated-done"))return!1;var t=e.attr("data-rate");e.find(".user-rate-image span").css("width",t+"%")})});
;