(function(){if(TB.rank){return }TB.namespace("rank");TB.rank=new function(){var C=this;var D=[[-1000,3],[4,10],[11,40],[41,90],[91,150],[151,250],[251,500],[501,1000],[1001,2000],[2001,5000],[5001,10000],[10001,20000],[20001,50000],[50001,100000],[100001,200000],[200001,50000000]];var B="http://service.taobao.com/support/153-156-164/help-842.htm";var A="http://service.taobao.com/support/153-156-164/help-1179.htm";C.rate=function(H){var I=H.getAttribute("rank:params").toQueryParams();var M=TB.common.stripTags(H.innerHTML).trim();if(isNaN(parseInt(M))){M=0}var E=I.level;if(!E){for(var K=0;K<D.length;K++){if(D[K][0]<=M&&D[K][1]>=M){E=K;break}}}if(E<1){if(I.override){H.innerHTML=""}return true}var L=document.createElement(I.uid?"a":"span");var G=(I.type=="b");var F="";if(I.uid){if(I.uid=="none"){F=G?A:B}else{var J=TB.bom.pickDocumentDomain(2);F="http://my."+J+"/mytaobao/rate/rate.htm?userID="+I.uid;F+="&received_or_posted=0&buyer_or_seller="+(G?1:0)}L.href=F;L.setAttribute("target","_blank")}L.title=D[E][0]+"\uff0d"+D[E][1]+"\u4e2a"+(G?"\u4e70\u5bb6":"\u5356\u5bb6")+"\u4fe1\u7528\u79ef\u5206"+(F?"\uff0c\u8bf7\u70b9\u51fb\u67e5\u770b\u8be6\u60c5":"");$D.addClass(L,"tb-rank");$D.addClass(L,(G?"buyer":"seller")+"-rank-"+E);if(I.override){H.innerHTML=""}H.appendChild(L);return true};C._autoRate=function(){var F=$D.getElementsByClassName("rank:token","span",$("Content"));for(var E=0;E<F.length;E++){C.rate(F[E])}};C._init=function(){var E="";E+=".tb-rank{display:-moz-inline-block;display:-moz-inline-box;display:inline-block;height:16px;overflow:hidden;background-image:url(http://pics.taobao.com/2k7/sys/rank_bg.gif) !important;background-repeat:repeat;vertical-align:text-bottom;*vertical-align:baseline;margin-left:5px;}";E+=".tb-rank-nolink{cursor: default !important;}";E+=".buyer-rank-1,.buyer-rank-6,.buyer-rank-11,.seller-rank-1,.seller-rank-6,.seller-rank-11{width:17px;}";E+=".buyer-rank-2,.buyer-rank-7,.buyer-rank-12,.seller-rank-2,.seller-rank-7,.seller-rank-12{width:34px;}";E+=".buyer-rank-3,.buyer-rank-8,.buyer-rank-13,.seller-rank-3,.seller-rank-8,.seller-rank-13{width:51px;}";E+=".buyer-rank-4,.buyer-rank-9,.buyer-rank-14,.seller-rank-4,.seller-rank-9,.seller-rank-14{width:68px;}";E+=".buyer-rank-5,.buyer-rank-10,.buyer-rank-15,.seller-rank-5,.seller-rank-10,.seller-rank-15 {width:85px;}";E+=".seller-rank-1,.seller-rank-2,.seller-rank-3,.seller-rank-4,.seller-rank-5{background-position:0 0;}";E+=".buyer-rank-1,.buyer-rank-2,.buyer-rank-3,.buyer-rank-4,.buyer-rank-5{background-position:0 -16px;}";E+=".seller-rank-6,.seller-rank-7,.seller-rank-8,.seller-rank-9,.seller-rank-10{background-position:0 -32px;}";E+=".buyer-rank-6,.buyer-rank-7,.buyer-rank-8,.buyer-rank-9,.buyer-rank-10{background-position:0 -48px;}";E+=".seller-rank-11,.seller-rank-12,.seller-rank-13,.seller-rank-14,.seller-rank-15{background-position:0 -64px;}";E+=".buyer-rank-11,.buyer-rank-12,.buyer-rank-13,.buyer-rank-14,.buyer-rank-15{background-position:0 -80px;}";TB.dom.addCSS(E);if(TB.bom.isIE){if($("Content")){$E.onContentReady("Content",C._autoRate)}else{$E.on(window,"load",C._autoRate)}}else{$E.onDOMReady(C._autoRate)}};C._init();return C}})();
