(function(i,j){var c=i.bShareUtil,o=i.bShareControl,q=j.body;c.createShareBox=function(n){var b=i[n],f=b.config;b.createBox=function(e){e=e||b.boxConfig;e.hasMore=e.hasMore&&f.mdiv>=0;var a=e.id||"bsBox";if(!c.getElemById(a)){c.loadStyle(".bsBox{display:none;z-index:100000001;font-size:12px;background:url("+b.imageBasePath+"/background-opaque-dark.gif) !important;padding:6px !important;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;}.bsClose{_overflow:hidden;cursor:pointer;position:absolute;z-index:10000000;color:#666;font-weight:bold;font-family:Helvetica,Arial;font-size:14px;line-height:20px;}.bsTop{color:"+ f.poptxtc+";background:"+f.popbgc+";height:24px;line-height:24px;border-bottom:1px solid #e8e8e8;}.bsTop span{float:left;}.bsFrameDiv,#bsMorePanel{border:none;background:#fff;}.bsReturn{float:right;*margin-right:20px;margin-right:36px;text-align:right;cursor:pointer;line-height:24px;color:#666;opacity:0.5;}#bsReturn:hover{text-decoration:underline;opacity:1;}");var d;d='
X
';e.hasTop&&(d+='
'+(e.hasMore?'
\u9009\u62e9\u5176\u4ed6\u5e73\u53f0 >>
':"")+''+ (b.params.promote?b.iL8n.shareTextPromote:b.iL8n.shareText)+'
');d+='
'+(e.hasFrame?'':"
")+"
"+(e.hasMore?'':"");a=c.createElement("div",a,"bsBox","",d);q.appendChild(a);c.getElem(a,"div","bsClose")[0].onclick=function(){b.disappear()}; if(e.hasMore)c.getElem(a,"div","bsReturn")[0].onclick=function(){b.moreDiv()}}};b.resetBox=function(c,a){b.boxConfig[c]=a};b.getFrame=function(e){e=e||b.boxConfig;e=c.getElemById(e.id||"bsBox");return c.getElem(e,"div","bsFrameDiv")[0].firstChild};b.disappear=function(){var b=c.getElem(j,"div","bsBox"),a,d;for(a=0,d=b.length;a=0;c.getElem(j,"div","bsBox");var d=c.getElemById(a.id|| "bsBox"),g=c.getElem(d,"div","bsClose")[0],k=c.getElem(d,"span","bsPlatName")[0],h=c.getElem(d,"div","bsFrameDiv")[0].firstChild,i=c.getElemById("bsMorePanel"),r=e?i:h,l=a.position=a.position||0,m=l?c.getOffset(c.getElem(j,"a",a.anchor)[b.curb]):null;d.style.left=l?m.x+"px":"50%";d.style.top=l?m.y+m.h+2+"px":"50%";d.style.marginLeft=l?0:-a.boxWidth/2+"px";d.style.marginTop=l?0:-a.boxHeight/2+"px";d.style.position=!l&&!c.isQk()?"fixed":"absolute";g.style.top=a.closeTop+"px";g.style.right=a.closeRight+ "px";r.style.height=a.boxHeight-(a.hasTop?25:0)+"px";r.style.width=a.boxWidth+"px";r.style.display="block";d.style.height=a.boxHeight+"px";d.style.width=a.boxWidth+"px";d.style.display="block";if(a.hasTop&&(c.getElem(d,"div","bsTop")[0].style.width=a.boxWidth+"px",b.params.target))k.innerHTML=" - "+b.pnMap[b.params.target][0];if(a.hasMore)e?(h.style.display="none",k.style.display="none"):(i.style.display="none",k.style.display="block"),c.getElem(d,"div","bsReturn")[0].style.display=e?"none": ""}};c.loadEngine=function(n){var b=i[n],f=b.config,e=b.params;b.prepare=function(a){var d={};typeof a=="object"?d=a:(b.curb=c.isUndefined(a)?b.curb:a,b.curb>=0&&(d=b.entries[b.curb]||{}));e.url=d.url||e.url||i.location.href;e.title=d.title||e.title;if(!e.title)e.title=/([^-_]*).*/.exec(j.title)[1];e.summary=d.summary?c.shortenText(d.summary,110):e.summary||c.getContent();e.lang=e.request_locale=f.lang;e.pics=d.pics||c.getPics();e.pic=d.pic||e.pic;for(var g in d)/url|title|summary|content/.test(g)|| (e[g]=d[g])};b.share=function(a,d,g){b.prepare(g);b.load(d)&&b.afterLoad&&b.afterLoad(d);c.stopProp(a)};b.stats=function(a,d,g){b.prepare(g);b.shareStats(d);c.stopProp(a)};b.shareStats=function(a){var d=b.bhost+"/bshare_share_statistics?";d+="site="+a;d+="&url="+c.encode(e.url);d+="&title="+c.encode(e.title);d+="&publisherUuid="+e.publisherUuid;d+="&type="+e.type;c.loadScript(d)};b.view=function(a){a=a||i.location.href;if(o.viewed){var d=0,g=function(){b.viewInfo?b.viewcb():d>=6||(++d,setTimeout(g, 500))};b.viewInfo||g()}else{o.viewed=!0;var k=b.bhost+"/bshare_view?Callback="+n+".viewcb&";k+="url="+c.encode(a);k+="&h="+c.encode(i.location.hash);k+="&uuid="+e.publisherUuid;f.showShareCount&&(k+="&sc=1");k+=b.bpsCount?"&l="+b.bpsCount:"&l=17";this.isLite&&(k+="&lite=1");if(j.referrer){var a=j.referrer,h,p;h=c.parseOptions(a,!0);if(a.indexOf(".baidu.")>-1)p=h.wd||h.word;else if(/\.(google|bing|so)\./.test(a))p=h.q;else if(a.indexOf(".yahoo.")>-1)p=h.p||h.keyword;else if(a.indexOf(".sogou.")>-1)p= h.query;else if(a.indexOf(".youdao.")>-1)p=h.q||h.keyword;else if(a.indexOf(".soso.")>-1)p=h.w;k+="&ref="+c.encode(a);k=c.addUrlCValue(k,"q",p)}k=c.addUrlCValue(k,"ot",j.title);k=c.addUrlCValue(k,"kws",c.keywords());c.loadScript(k)}};b.click=function(){if(!o.clicked&&(o.clicked=!0,b.preb!==b.curb)){b.preb=b.curb;var a=b.bhost+"/bshare_click?";a+="url="+c.encode(b.params.url);a+="&title="+c.encode(b.params.title);a+="&uuid="+e.publisherUuid;c.loadScript(a)}};b.showPromo=function(a){a.style.position= "relative";var d=c.isQk()||(j.documentMode?+j.documentMode==7:c.isIe7);a.style.display=d?"inline":"inline-block";if(d)a.style.zoom="1";c.getElem(a,"div","bsPromo",function(d,e){d.style.display="block";if(!b.isLite||f.style!=-1)d.innerHTML=b.iL8n?b.iL8n.promote:"\u5206\u4eab\u6709\u793c",a.style.overflow="visible";else var h=setInterval(function(){if(b.anchorsBinded){clearInterval(h);var i=c.getElem(a,"a","bshare-bsharesync")[0],f=c.getElem(a,"a","bshare-more"),l=f[f.length-1],m,n,o;if(i||l){m=i||l;f=m.offsetHeight|| 0;if(f<20&&(!i||i.offsetLeft-1?a.c:0,b.showCount(a.c); if(a.n)b.user=a.n;if(a.p&&a.p.length>0)f.bps=c.getPNames(a.p);f.lang!="en"&&(f.promote||a.pt)&&typeof b.promote=="function"&&b.promote();(a.n||a.p)&&typeof b.ready=="function"&&b.ready();a.lk&&b.entries.length<=1&&typeof b.showStatus=="function"&&b.showStatus(a.lk);a.cl&&typeof b.collect=="function"&&b.collect();b.cmatch(a.v,a.m)};b.cmatch=function(a,d){if(a&&d){var g=c.createElement("iframe","","","display:none;");g.src=b.shost+"/cm.html?cid="+a+"&m="+d;q.appendChild(g)}};b.collect=function(){var a= b.bhost+"/bshare_log_params?uuid="+e.publisherUuid,d;for(d in b.customization)a+="&"+d+"="+b.customization[d];c.loadScript(a)};b.count=function(a){if(f.showShareCount){var d=b.bhost+"/bshare_share_count?Callback="+n+".showCount";d+="&url="+c.encode(a);c.loadScript(d)}};b.shareCount=function(a,d){/0|2|10/.test(f.style)?a=c.longRound(a):/11/.test(f.style)||(a=c.shortRound(a));var b={cssFloat:"none"};if(n!="bShareLike")switch(f.style){case 1:b.left="36px";b.color="#fff";b.fontsize="12px";break;case 10:b.left= "27px";case 0:case 2:b.fontsize="11px";break;case 11:b.top="25px",b.fontsize="17px"}if(d){var e=d.style,h;for(h in b)if(h!="color"||!e.color)e[h]=b[h];d.innerHTML=c.addCommas(a)}else return c.addCommas(a)};b.showCount=function(a){b.counters=a;var d=c.getElem(j,"span","shareCount");if(!d||d.length==0)d=c.getElem(j,"span","BSHARE_COUNT");var g,e;if(typeof a=="number"){for(g=0,e=d.length;g 0){e=a.length;for(g=0;g999999)return c.roundNumber(a/1E6,2)+"M";else if(a>99999)return c.roundNumber(a/1E3,1)+"K";return a};c.shortRound=function(a){if(a>999999)return c.roundNumber(a/1E6,1)+"M";else if(a>99999)return c.roundNumber(a/1E3,0)+"K";else if(a>9999)return c.roundNumber(a/1E3,1)+"K";else if(a>999)return c.roundNumber(a/ 1E3,2)+"K";return a};c.addCommas=function(a){try{a+="";for(var b=a.split("."),c=b[0],e=b.length>1?"."+b[1]:"",b=/(\d+)(\d{3})/;b.test(c);)c=c.replace(b,"$1,$2");return c+e}catch(f){return a}};c.shortenText=function(a,b){a=a||"";return a.length>b?a.slice(0,b)+"...":a};c.getCurrentSelection=function(){var a="";if(i.getSelection)a=i.getSelection().toString();else if(j.getSelection)a=j.getSelection;else if(j.selection)try{a=j.selection.createRange().text}catch(b){}return a};c.grabTextContent=function(){for(var a= "",b=j.getElementsByTagName("p"),e=0,f=b.length;e=1500)break;a!=""&&(a+="|");a+=h.src}}return a};c.removeUrlHash=function(a){var b=a.indexOf("#");b>0&&(a=a.slice(0,b));return a};c.showClipboardSuccess=function(){alert(b.iL8n.copySuccess)};c.showClipboardUnsupportBrowsertxt=function(a){prompt(b.iL8n.copyTip,a)};c.getPNames=function(a){var c=[],e;for(e in a)c.push(b.plats[a[e]]);return c};c.copy2Clipboard=function(){try{var a=c.removeUrlHash(e.url),b=e.title+ " "+a,f=i.clipboardData;f?(f.clearData(),f.setData("Text",b),c.showClipboardSuccess()):c.showClipboardUnsupportBrowsertxt(b)}catch(j){}};c.add2Printer=function(){i.print()};c.add2Bookmark=function(){if(i.sidebar)i.sidebar.addPanel(e.title,e.url,"");else if(i.chrome)alert(b.iL8n.bookmarkTip);else if(i.external)try{i.external.AddFavorite(e.url,e.title)}catch(a){}else if(i.opera&&i.print)return!0;else alert(b.iL8n.notSupport)}}})(window,document);