$(function(){$("#share-popup").hover(function(){window.clearTimeout(MaSha.instance.timeoutHovers[shareLinkedTextIndex])},function(){MaSha.instance.timeoutHovers[shareLinkedTextIndex]=window.setTimeout(function(){$("."+shareLinkedTextIndex,MaSha.instance.selectable).removeClass("hover");typeof hideSharePopup!="undefined"&&hideSharePopup(shareLinkedTextIndex)},2E3)});MaSha.instance=new MaSha({selectable:$("#selectable-content")[0],onMark:function(){updateSharePopupContent();showSharePopup($(".num"+ (this.counter-1),$(this.selectable))[0])},onUnmark:function(){typeof hideSharePopup!="undefined"&&hideSharePopup("",true);updateSharePopupContent()}});updateSharePopupContent()});var shareLinkedTextIndex=null; updateSharePopupContent=function(){$("#share-popup .link a").html(location+"<ins></ins>").attr("href",location);var b=encodeURI($("title").text()),a=encodeURIComponent(location);$("#share-popup .social .tw").attr("href","http://twitter.com/share?url="+a+"&text="+b);$("#share-popup .social .fb").attr("href","http://www.facebook.com/share.php?u="+a);$("#share-popup .social .vk").attr("href","http://vkontakte.ru/share.php?url="+a);$("#share-popup .social .gp").attr("href","https://m.google.com/app/plus/x/?v=compose&content="+ b);$("#share-popup .social .gp").attr("onclick","window.open('https://m.google.com/app/plus/x/?v=compose&content="+b+" - "+a+"','gplusshare','width=450,height=300,left='+(screen.availWidth/2-225)+',top='+(screen.availHeight/2-150)+'');return false;")}; showSharePopup=function(b){var a=b.className.match(/num\d+/ig);a.length&&(a=a[0]);if(a==shareLinkedTextIndex)return false;shareLinkedTextIndex=a;a=$(b).offset();$("#share-popup").hide().stop().css({left:a.left+5+$("#share-popup").width()>=$(window).width()?$(window).width()-$("#share-popup").width()-15:a.left+5,top:a.top-10-$("#share-popup").height()-($(b).height()>20?0:20),opacity:0}).show().animate({top:"+=15px",opacity:1},function(){$(this).css({opacity:""})})}; hideSharePopup=function(b,a){typeof a=="undefined"&&(a=false);if(!a)if(typeof b=="string")var c=b;else c=b.className.match(/num\d+/ig),c.length&&(c=c[0]);if(c==shareLinkedTextIndex||a)shareLinkedTextIndex=null,$("#share-popup").fadeOut()};
