function trim(b,a){return ltrim(rtrim(b,a),a)}function ltrim(c,b){var a=(b!=undefined)?b:"\\s";return c.replace(new RegExp("^["+b+"]*","g"),"")}function rtrim(c,b){var a=(b!=undefined)?b:"\\s";return c.replace(new RegExp("["+b+"]*$","g"),"")}var AsGetRating=function(o){document.getElementById("loading").style.display="none";eval("var aReturn = "+o.responseText);aRD[o.argument]=aReturn;ProcessTable(aReturn)};function GetRating(){if($("st").value==1&&GI("table_data3").innerHTML==""||$("st").value==0&&GI("table_data2").innerHTML==""){document.getElementById("li").value=0}if($("na").value==Lang.Global.NamePers){sNameSearch=""}else{sNameSearch=$("na").value}sKey=$("st").value+"-"+$("br").value+"-"+$("or").value+"-"+sNameSearch+"-"+$("li").value;if(typeof(aRD[sKey])!="undefined"){ProcessTable(aRD[sKey]);return false}document.getElementById("loading").style.display="block";typeof(urchinTracker)=="function"?urchinTracker("/ranking/"+sKey+"/"):"";var a={success:AsGetRating,failure:Af,argument:sKey};YAHOO.util.Connect.setForm(document.getElementById("heroic"));var b=YAHOO.util.Connect.asyncRequest("POST","/proxy.html",a);return false}function ProcessTable(c){var g=new Array();g[1]="";g[2]="";g[3]="";if(c.length>0){var b="";b=Lang.Global.Position;sOrderActual=document.getElementById("or").value.substring(1);iOrderActual=document.getElementById("or").value.substring(0,1);var f=new Array();f[0]="first";f[1]="second";f[2]="third";f[3]="fourth";f[4]="fifth";var g=new Array();g[1]="    <table>\n";g[1]+='      <tr class="first">\n';g[1]+='        <th class="purple">'+b+"</th>\n";g[1]+='        <th class="purple">'+Lang.Heroic.commu+"</th>\n";g[1]+='        <th class="purple">'+Lang.Global.Nom+"</th>\n";g[1]+='        <th class="purple">'+Lang.Global.Classe+"</th>\n";g[1]+='        <th class="purple">'+Lang.Global.Sexe+"</th>\n";g[1]+='        <th class="purple">'+Lang.Global.Niveau+"</th>\n";if(document.getElementById("table_data2")){g[1]+='        <th class="purple">'+Lang.Heroic.GainXP+"</th>\n"}else{if(document.getElementById("table_data3")){g[1]+='        <th class="purple">'+Lang.Heroic.Trophies+"</th>\n"}}g[1]+='        <th class="purple">'+Lang.Global.Alignement+"</th>\n";g[1]+="      </tr>\n";g[2]="";g[3]="";if(c.length>0){document.getElementById("no_search").style.display="none";var e=0;var d=false;for(i=0;i<c.length;i++){var h=(c[i]["tro"]).split(";");if(c[i]["na"]!="undefined"){if(document.getElementById("na").value.toUpperCase().replace(/^[\s]+/,"").replace(/[\s]+$/,"").replace(/[\s]{2,}/," ")==c[i]["na"].toUpperCase()){g[1]+='      <tr class="search">\n';e=i;d=true}else{g[1]+="      <tr"+(i%2==0?' class="alt"':"")+">\n"}g[1]+='        <td class="left">'+formatNumber(c[i]["rgl"])+"</td>\n";g[1]+='        <td class="left center"><img src="'+IMG_URL+"/serveur_heroique_cimetiere/"+c[i]["ct"]+'.png" style="margin-left:5px;" /></td>\n';g[1]+='        <td class="left">'+c[i]["na"]+"</td>\n";g[1]+='        <td class="left">'+aBreed[c[i]["br"]]+"</td>\n";g[1]+='        <td class="brown center">'+aSex[c[i]["se"]]+"</td>\n";g[1]+='        <td class="center">'+formatNumber(c[i]["le"])+"</td>\n";if(document.getElementById("table_data2")){g[1]+='        <td class="brown left">'+formatNumber(c[i]["xp1"])+"</td>\n"}else{if(document.getElementById("table_data3")){g[1]+='        <td class="brown left center">'+(h[0]?h.length:0)+"/10</td>\n"}}g[1]+='        <td class="left">'+aAlignment[c[i]["al"]]+"</td>\n";g[1]+="      </tr>\n"}}var a=0;for(i=0;i<c.length;i++){if(i>=e&&i<e+5){if(d&&e==i||!d){var h=(c[i]["tro"]).split(";");if(!d){g[2]+=' <div class="rank'+(a+1)+' rank">\n'}else{g[2]+=' <div class="bg_rank bg_rank'+(c[i]["rgl"]<6?c[i]["rgl"]:6)+'">\n';if(c[i]["rgl"]>5){g[2]+="   <div style='margin-top:50px;font-size:25px;font-weight:bold;color:#5D4837;'>"+formatNumber(c[i]["rgl"])+" "+Lang.Heroic.Ranking+"</div>\n"}g[2]+="</div>\n";g[2]+=' <div class="rank6 rank rank_search'+c[i]["rgl"]+'">\n'}g[2]+='   <img src="'+IMG_URL+"/serveur_heroique_cimetiere/"+c[i]["ct"]+'.png" />\n';g[2]+='   <div class="avatar ava'+c[i]["br"]+"_"+c[i]["se"]+'"></div>\n';g[2]+="   <p>"+Lang.KanamaCombat.pseudo+": <strong>"+c[i]["na"]+"</strong></p>\n";g[2]+="   <p>"+Lang.Heroic.pers+": <strong>"+aBreed[c[i]["br"]]+"</strong></p>\n";g[2]+="   <p>"+Lang.Global.Niveau+": <strong>"+formatNumber(c[i]["le"])+"</strong></p>\n";g[2]+="   <p>"+Lang.Heroic.seelast+": <strong>"+c[i]["dla"]+"</strong>"+Lang.Heroic.at+" <strong>"+c[i]["dm"].replace("//","")+"</strong></p>\n";g[2]+="   <p>"+Lang.Heroic.PVP+": <strong>"+c[i]["pvp"]+"</strong></p>\n";g[2]+=" </div>\n";g[3]+=' <div class="'+(d?"tombe1 ":"")+"tombe "+(c[i]["rgl"]<6?"tombe"+c[i]["rgl"]:"tombe0")+'">\n';if(c[i]["al"]=="2"){g[3]+='   <div class="wings"></div>\n'}else{if(c[i]["al"]=="1"){g[3]+='   <div class="wings1"></div>\n'}}for(j=0;j<h.length;j++){if(h[j]=="107"){g[3]+='   <div class="t_107"></div>\n'}if(h[j]=="226"){g[3]+='   <div class="t_226"></div>\n'}if(h[j]=="257"){g[3]+='   <div class="t_257"></div>\n'}if(h[j]=="113"){g[3]+='   <div class="t_113"></div>\n'}if(h[j]=="121"){g[3]+='   <div class="t_121"></div>\n'}if(h[j]=="1045"){g[3]+='   <div class="t_1045"></div>\n'}if(h[j]=="180"){g[3]+='   <div class="t_180"></div>\n'}if(h[j]=="670"){g[3]+='   <div class="t_670"></div>\n'}if(h[j]=="943"){g[3]+='   <div class="t_943"></div>\n'}if(h[j]=="478"){g[3]+='   <div class="t_478"></div>\n'}}g[3]+='   <div class="tombe_inscription">\n';g[3]+='     <div><img src="'+IMG_URL+"/serveur_heroique_cimetiere/"+c[i]["ct"]+'.png" />'+Lang.KanamaCombat.pseudo+": <strong>"+c[i]["na"]+"</strong></div>\n";g[3]+="     <div>"+Lang.Heroic.pers+": <strong>"+aBreed[c[i]["br"]]+"</strong></div>\n";g[3]+="     <div>"+Lang.Global.Niveau+": <strong>"+formatNumber(c[i]["le"])+"</strong></div>\n";g[3]+="     <div>"+Lang.Heroic.Mort+" <strong>"+c[i]["dd"]+"</strong> <br/>"+Lang.Heroic.at+" <strong>"+c[i]["dm"].replace("//","")+"</strong></div>\n";g[3]+="     <div>"+Lang.Heroic.Mortpar+": <strong>"+(c[i]["dk"]==0?Lang.Heroic.invoc:c[i]["dk"])+"</strong></div>\n";g[3]+="   </div>\n";g[3]+=" </div>\n";a++}}}}g[1]+="    </table>\n";g[1]+='    <div class="navi"><a class="navi_left" id="navi_left" style="display:'+(document.getElementById("li").value==0||d?"none":"block")+';" href="javascript:void(0);" onclick="GetNavi(0)"><img src="'+IMG_URL+'/serveur_heroique_cimetiere/navi_left.jpg" /><div>'+Lang.Heroic.PagePre+'</div><img src="'+IMG_URL+'/serveur_heroique_cimetiere/navi_left1.jpg" /></a><a class="navi_right" href="javascript:void(0);" onclick="GetNavi(1)" style="display:'+(d?"none":"block")+';"><img src="'+IMG_URL+'/serveur_heroique_cimetiere/navi_right1.jpg" /><div>'+Lang.Heroic.PageSuivante+'</div><img src="'+IMG_URL+'/serveur_heroique_cimetiere/navi_right.jpg" /></a></div>\n';for(i=1;i<=3;i++){if(document.getElementById("table_data"+i)){if(i!=1&&document.getElementById("li").value==0||i==1){document.getElementById("table_data"+i).innerHTML=g[i]}}}if(d&&GI("table_data3")){document.getElementById("table_data3").style.height="456px";document.getElementById("border_left").style.height="1234px";document.getElementById("border_right").style.height="1234px";document.getElementById("table_data1").style.height="484px"}else{if(!d&&GI("table_data3")){document.getElementById("table_data3").style.height="1243px";document.getElementById("border_left").style.height="2021px";document.getElementById("border_right").style.height="2021px";document.getElementById("table_data1").style.height="484px"}}if(d&&GI("table_data2")){document.getElementById("table_data2").className="ranking1";document.getElementById("table_data2").style.height="249px";document.getElementById("border_left").style.height="1200px";document.getElementById("border_right").style.height="1200px";document.getElementById("table_data1").style.height="484px"}else{if(!d&&GI("table_data2")){document.getElementById("table_data2").className="ranking";document.getElementById("table_data2").style.height="731px";document.getElementById("border_left").style.height="1550px";document.getElementById("border_right").style.height="1550px";document.getElementById("table_data1").style.height="484px"}}}else{document.getElementById("no_search").style.display="block";if(GI("table_data2")){document.getElementById("table_data2").className="ranking1";document.getElementById("table_data2").style.height="259px";document.getElementById("table_data1").style.height="80px";document.getElementById("border_left").style.height="674px";document.getElementById("border_right").style.height="674px"}if(GI("table_data3")){document.getElementById("table_data3").style.height="318px";document.getElementById("border_left").style.height="705px";document.getElementById("border_right").style.height="705px";document.getElementById("table_data1").style.height="93px"}for(i=1;i<=3;i++){if(GI("table_data"+i)){document.getElementById("table_data"+i).innerHTML=g[i]}}}}function GetNavi(a){if(a){document.getElementById("li").value=(document.getElementById("li").value-1+21)}else{document.getElementById("li").value=(document.getElementById("li").value-20)}GetRating()}function GetChangeClass(){document.getElementById("li").value=0;GetRating()}function ChangeOrder(a,b){if(a&&b){document.getElementById("or").value=a+b}else{sOrderActual=document.getElementById("or").value.substring(1);iOrderActual=document.getElementById("or").value.substring(0,1);if(iOrderActual==a){document.getElementById("or").value=iOrderActual+(sOrderActual=="A"?"D":"A")}else{document.getElementById("or").value=a+"D"}}GetRating()};