text: "abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(b){document.createElement(b)});var U_GROUP_TESTER=1;var U_GROUP_ADMIN=2;var U_GROUP_EDITOR=4;var U_GROUP_MOD=8;var U_GROUP_BUREAU=16;var U_GROUP_DEV=32;var U_GROUP_VIP=64;var U_GROUP_BLOGGER=128;var U_GROUP_PREMIUM=256;var U_GROUP_LOCALIZER=512;var U_GROUP_SALESAGENT=1024;var U_GROUP_SCREENSHOT=2048;var U_GROUP_VIDEO=4096;var U_GROUP_APIONLY=8192;var U_GROUP_PENDING=16384;var U_GROUP_STAFF=U_GROUP_ADMIN|U_GROUP_EDITOR|U_GROUP_MOD|U_GROUP_BUREAU|U_GROUP_DEV|U_GROUP_BLOGGER|U_GROUP_LOCALIZER|U_GROUP_SALESAGENT;var U_GROUP_EMPLOYEE=U_GROUP_ADMIN|U_GROUP_BUREAU|U_GROUP_DEV;var U_GROUP_GREEN_TEXT=U_GROUP_MOD|U_GROUP_BUREAU|U_GROUP_DEV;var U_GROUP_PREMIUMISH=U_GROUP_PREMIUM|U_GROUP_EDITOR;var U_GROUP_MODERATOR=U_GROUP_ADMIN|U_GROUP_MOD|U_GROUP_BUREAU;var U_GROUP_COMMENTS_MODERATOR=U_GROUP_BUREAU|U_GROUP_MODERATOR|U_GROUP_LOCALIZER;var U_GROUP_PREMIUM_PERMISSIONS=U_GROUP_PREMIUM|U_GROUP_STAFF|U_GROUP_VIP|U_GROUP_EDITOR;var g_users={};var g_completion={};var g_favorites=[];var g_customColors={};$WH.isUsernameValid=function(b){return(b.match(/[^a-z0-9]/i)==null&&b.length>=4&&b.length<=16)};$WH.requireCaptcha=function(){return !((g_user.permissions&1)>0||(typeof(skipCaptcha)!="undefined"&&skipCaptcha))};var User=new function(){var b=this;b.hasPermissions=function(c){if(!c){return true}return !!(g_user.roles&c)}};function Ajax(c,f){if(!c){return}var b;try{b=new XMLHttpRequest()}catch(g){try{b=new ActiveXObject("Msxml2.XMLHTTP")}catch(g){try{b=new ActiveXObject("Microsoft.XMLHTTP")}catch(g){if(window.createRequest){b=window.createRequest()}else{alert(LANG.message_ajaxnotsupported);return}}}}this.request=b;$WH.cO(this,f);this.method=this.method||(this.params&&"POST")||"GET";b.open(this.method,c,this.async==null?true:this.async);b.onreadystatechange=Ajax.onReadyStateChange.bind(this);if(this.method.toUpperCase()=="POST"){b.setRequestHeader("Content-Type",(this.contentType||"application/x-www-form-urlencoded")+"; charset="+(this.encoding||"UTF-8"))}b.send(this.params)}Ajax.onReadyStateChange=function(){if(this.request.readyState==4){if(this.request.status==0||(this.request.status>=200&&this.request.status<300)){this.onSuccess!=null&&this.onSuccess(this.request,this)}else{this.onFailure!=null&&this.onFailure(this.request,this)}if(this.onComplete!=null){this.onComplete(this.request,this)}}};var Announcement=function(b){if(!b){b={}}$WH.cO(this,b);if(!this.parentDiv){if(this.parent){this.parentDiv=$WH.ge(this.parent)}else{return}}if(!this.parentDiv){return}this.parentDiv.setAttribute("data-announcement-id",Math.abs(this.id));if(g_user.id==0&&(!$WH.cookiesEnabled()||$WH.getWowheadCookie("announcement-"+this.id)=="closed")){return}this.initialize()};Announcement.prototype={initialize:function(){this.parentDiv.style.display="none";switch(this.mode){case 2:this.parentDiv.className="announcement announcement-fixed";break;case 0:this.parentDiv.className="announcement announcement-pagetop";break;case 1:default:this.parentDiv.className="announcement announcement-contenttop"}var j=this.innerDiv=$WH.ce("div");j.className="announcement-inner text";this.setStyle(this.style);var b=null;var h=parseInt(this.id);if(g_user&&(g_user.roles&(U_GROUP_ADMIN|U_GROUP_BUREAU))>0&&Math.abs(h)>0){if(h<0){b=$WH.ce("a");b.style.cssFloat=b.style.styleFloat="right";b.href="/admin=announcements&id="+Math.abs(h)+"&status=2";b.onclick=function(){return confirm("Are you sure you want to delete "+this.name+"?")};$WH.ae(b,$WH.ct("Delete"));var g=$WH.ce("small");$WH.ae(g,b);$WH.ae(j,g);b=$WH.ce("a");b.style.cssFloat=b.style.styleFloat="right";b.style.marginRight="10px";b.href="/admin=announcements&id="+Math.abs(h)+"&status="+(this.status==1?0:1);b.onclick=function(){return confirm("Are you sure you want to delete "+this.name+"?")};$WH.ae(b,$WH.ct((this.status==1?"Disable":"Enable")));var g=$WH.ce("small");$WH.ae(g,b);$WH.ae(j,g)}b=$WH.ce("a");b.href="/admin=announcements&id="+Math.abs(h)+"&edit";b.className="fa fa-pencil";if(!Platform.isTouch()){$WH.Tooltip.simple(b,LANG.edit,"q2")}var g=$WH.ce("small");$WH.ae(g,b);$WH.ae(j,g)}var c=$WH.ce("div");c.id=this.parent+"-markup";c.className="announcement-markup";$WH.ae(j,c);var f=$WH.ce("div");f.id=this.parent+"-markup-responsive";f.className="announcement-markup-responsive";$WH.ae(j,f);if(h>=0){b=$WH.ce("a");b.id="closeannouncement";b.href="javascript:;";b.className="fa fa-times announcement-close";if(this.nocookie){b.onclick=this.hide.bind(this)}else{b.onclick=this.markRead.bind(this)}$WH.ae(j,b);if(h==195||h==200){$(b).removeClass("fa-times announcement-close").addClass("fa-square q1").text("I Accept")}else{if(!Platform.isTouch()){$WH.Tooltip.simple(b,LANG.close,"q2")}}}$WH.ae(j,$WH.ce("div",{style:{clear:"both"}}));$WH.ae(this.parentDiv,j);this.setText(this.text,this.mobiletext);setTimeout(this.show.bind(this),500)},show:function(){$(this.parentDiv).animate({opacity:"show",height:"show"},{duration:333});$WH.track.event("Announcements","Show",""+this.name)},hide:function(){$(this.parentDiv).animate({opacity:"hide",height:"hide"},{duration:200})},markRead:function(){$WH.track.event("Announcements","Close",""+this.name);$WH.setWowheadCookie("announcement-"+this.id,"closed");this.hide()},setStyle:function(b){this.style=b;this.innerDiv.setAttribute("style",$WH.fixWowheadHTTPS(b))},setText:function(c,b){this.text=c;this.mobiletext=b;Markup.printHtml(this.text,this.parent+"-markup",{allow:Markup.CLASS_STAFF});$WH.track.addToNode($WH.ge(this.parent+"-markup"),{category:"Announcements",actions:{"Follow link":function(f){return true}}},this.id);if(!b){b=c}Markup.printHtml(b,this.parent+"-markup-responsive",{allow:Markup.CLASS_STAFF});$WH.track.addToNode($WH.ge(this.parent+"-markup-responsive"),{category:"Announcements",actions:{"Follow link":function(f){return true}}},this.id)}};var g_audiocontrols={__windowloaded:false,__rewardedAchievement:false};var g_audioplaylist={};if(!window.JSON){window.JSON={parse:function(sJSON){return eval("("+sJSON+")")},stringify:function(c){if(c instanceof Object){var g="";if(c.constructor===Array){for(var b=0;b<c.length;g+=this.stringify(c[b])+",",b++){}return"["+g.substr(0,g.length-1)+"]"}if(c.toString!==Object.prototype.toString){return'"'+c.toString().replace(/"/g,"\\$&")+'"'}for(var f in c){g+='"'+f.replace(/"/g,"\\$&")+'":'+this.stringify(c[f])+","}return"{"+g.substr(0,g.length-1)+"}"}return typeof c==="string"?'"'+c.replace(/"/g,"\\$&")+'"':String(c)}}}AudioControls=function(){var o=-1;var g=false;var h=false;var m=false;var b=false;var q={};var c=[];var l="";function j(){if(g_audiocontrols.__rewardedAchievement){return}if(!($WH.isSet("g_user")&&g_user.id)){return}$.ajax({url:"/website-achievement-explored",data:{trigger:"playsound"},success:function(){AchievementCheck()},type:"POST"});g_audiocontrols.__rewardedAchievement=true}function p(r,B,v){var t=$WH.ce("audio");t.preload="none";t.controls="true";$(t).click(function(s){s.stopPropagation()});$WH.aE(t,"ended",j);t.style.marginTop="5px";q.audio.parentNode.replaceChild(t,q.audio);q.audio=t;$WH.aE(q.audio,"ended",f.bind(r));if(v){t.preload="auto";b=true;$WH.aE(q.audio,"canplaythrough",k.bind(this))}if(!g){q.table.style.visibility="visible"}var u;do{o+=B;if(o>c.length-1){o=0;if(!g){var w=$WH.ce("div");w.className="minibox";$WH.st(w,$WH.sprintf(LANG.message_browsernoaudio,u.type));q.table.parentNode.replaceChild(w,q.table);return}}if(o<0){o=c.length-1}u=c[o]}while(q.audio.canPlayType(u.type)=="");var C=$WH.ce("source");C.src=u.url;C.type=u.type;$WH.ae(q.audio,C);if(q.hasOwnProperty("title")){if(l){$WH.ee(q.title);var A=$WH.ce("a");A.href=l;$WH.st(A,'"'+u.title+'"');$WH.ae(q.title,A)}else{$WH.st(q.title,'"'+u.title+'"')}}if(q.hasOwnProperty("trackdisplay")){$WH.st(q.trackdisplay,""+(o+1)+" / "+c.length)}if(!g){g=true;for(var y=o+1;y<=c.length-1;y++){if(q.audio.canPlayType(c[y].type)){$(q.controlsdiv).children("a").removeClass("btn-disabled");break}}}if(q.hasOwnProperty("addbutton")){$(q.addbutton).removeClass("btn-disabled");$WH.st(q.addbutton,LANG.add)}}function k(){if(!b){return}b=false;q.audio.play()}this.init=function(u,s,t){if(!$WH.isArray(u)){return}if(u.length==0){return}if((s.id=="")||g_audiocontrols.hasOwnProperty(s.id)){var A=0;while(g_audiocontrols.hasOwnProperty("auto-audiocontrols-"+(++A))){}s.id="auto-audiocontrols-"+A}g_audiocontrols[s.id]=this;if(typeof t=="undefined"){t={}}h=!!t.loop;if(t.hasOwnProperty("url")){l=t.url}c=u;q.div=s;if(!t.listview){var C=$WH.ce("table",{className:"audio-controls"});q.table=C;q.table.style.visibility="hidden";$WH.ae(q.div,C);var y=$WH.ce("tr");$WH.ae(C,y);var v=$WH.ce("td");$WH.ae(y,v);q.audio=$WH.ce("div");$WH.ae(v,q.audio);q.title=$WH.ce("div",{className:"audio-controls-title"});$WH.ae(v,q.title);q.controlsdiv=$WH.ce("div",{className:"audio-controls-pagination"});$WH.ae(v,q.controlsdiv);var B=n(LANG.previous,true);$WH.ae(q.controlsdiv,B);$WH.aE(B,"click",this.btnPrevTrack.bind(this));q.trackdisplay=$WH.ce("div",{className:"audio-controls-pagination-track"});$WH.ae(q.controlsdiv,q.trackdisplay);var r=n(LANG.next,true);$WH.ae(q.controlsdiv,r);$WH.aE(r,"click",this.btnNextTrack.bind(this))}else{m=true;var w=$WH.ce("div");q.table=w;$WH.ae(q.div,w);q.audio=$WH.ce("div");$WH.ae(w,q.audio);q.trackdisplay=t.trackdisplay;q.controlsdiv=$WH.ce("span");$WH.ae(w,q.controlsdiv)}if(g_audioplaylist.isEnabled()&&!t.fromplaylist){var z=n(LANG.add);$WH.ae(q.controlsdiv,z);$WH.aE(z,"click",this.btnAddToPlaylist.bind(this,z));q.addbutton=z;if(m){z.style.verticalAlign="50%"}}if(g_audiocontrols.__windowloaded){this.btnNextTrack()}};function f(){p(this,1,(h||(o<(c.length-1))))}this.btnNextTrack=function(){p(this,1,(g&&(q.audio.readyState>1)&&(!q.audio.paused)))};this.btnPrevTrack=function(){p(this,-1,(g&&(q.audio.readyState>1)&&(!q.audio.paused)))};this.btnAddToPlaylist=function(s){if(m){for(var r=0;r<c.length;r++){g_audioplaylist.addSound(c[r])}}else{g_audioplaylist.addSound(c[o])}s.className+=" btn-disabled";$WH.st(s,LANG.added)};this.isPlaying=function(){return !q.audio.paused};this.removeSelf=function(){q.table.parentNode.removeChild(q.table);delete g_audiocontrols[q.div]};function n(r,s){return $WH.createButton(r,null,{disabled:s,"float":false,style:"margin:0 12px"})}};$WH.aE(window,"load",function(){g_audiocontrols.__windowloaded=true;for(var b in g_audiocontrols){if(b.substr(0,2)!="__"){g_audiocontrols[b].btnNextTrack()}}});AudioPlaylist=function(){var f=false;var j=[];var h,g;var c=false;this.init=function(){if(!$WH.localStorage.isSupported()){return}f=true;var k;if(k=$WH.localStorage.get("AudioPlaylist")){j=JSON.parse(k)}};this.savePlaylist=function(){if(!f){return false}$WH.localStorage.set("AudioPlaylist",JSON.stringify(j))};this.isEnabled=function(){return f};this.addSound=function(k){if(!f){return false}this.init();j.push(k);this.savePlaylist();b()};this.deleteSound=function(k){if(k<0){j=[]}else{j.splice(k,1)}this.savePlaylist();if(!h.isPlaying()){h.removeSelf();this.setAudioControls(g)}if(j.length==0){$WH.Tooltip.hide()}};this.getList=function(){var m=[];for(var k=0;k<j.length;k++){m.push(j[k].title)}return m};this.setAudioControls=function(k){if(!f){return false}g=k;h=new AudioControls();h.init(j,g,{loop:true,fromplaylist:true})};function b(){if(c){return}if(!($WH.isSet("g_user")&&g_user.id)){return}if(j.length<2){return}$.ajax({url:"/sound&playlist",data:{achievement:1},success:function(){AchievementCheck()},type:"POST"});c=true}};g_audioplaylist=(new AudioPlaylist);g_audioplaylist.init();$WH.BattleNet=new function(){var c=false;var b=0;this.CharacterExists=function(o,h,g,m){if(!$WH.localStorage.isSupported()||!(JSON&&"stringify" in JSON)){m(true);return false}h=h.toLowerCase().replace(/[^\w -]/,"").replace(" ","-");var n=(o+"|"+h+"|"+g).toLowerCase();if(!c){c={};try{c=JSON.parse($WH.localStorage.get("BattleNetCharCache"));if(c==null){c={}}}catch(k){c={}}}if(c.hasOwnProperty(n)){if(parseInt(c[n].substr(1),10)>Math.floor((Date.now()-(1000*60*60*24*4))/1000)){m(c[n].substr(0,1)=="t");return true}}var l="LR"+(b++);this[l]=(function(s,q,p,t){s[q]=((t&&t.name)?"t":"f")+Math.floor(Date.now()/1000);$WH.localStorage.set("BattleNetCharCache",JSON.stringify(s));p(s[q])}).bind(null,c,n,m);var f="https://"+o+".api.battle.net/wow/character/"+h+"/"+g+"?apikey="+$WH.BattleNet.apiKey+"&jsonp=$WH.BattleNet."+l;var j=$WH.ce("script",{type:"text/javascript",src:f});$WH.aE(j,"error",function(){$WH.BattleNet[l](false)});$WH.ae(document.getElementsByTagName("head")[0],j);return true};this.apiKey="nysaj9axzq4dvdjvg8tnhk9m5jde372w"};(function(g){g.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(j,h){g.fx.step[h]=function(k){if(k.state==0){k.start=f(k.elem,h);k.end=b(k.end)}k.elem.style[h]="rgb("+[Math.max(Math.min(parseInt((k.pos*(k.end[0]-k.start[0]))+k.start[0]),255),0),Math.max(Math.min(parseInt((k.pos*(k.end[1]-k.start[1]))+k.start[1]),255),0),Math.max(Math.min(parseInt((k.pos*(k.end[2]-k.start[2]))+k.start[2]),255),0)].join(",")+")"}});function b(h){var j;if(h&&h.constructor==Array&&h.length==3){return h}if(j=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(h)){return[parseInt(j[1]),parseInt(j[2]),parseInt(j[3])]}if(j=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(h)){return[parseFloat(j[1])*2.55,parseFloat(j[2])*2.55,parseFloat(j[3])*2.55]}if(j=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(h)){return[parseInt(j[1],16),parseInt(j[2],16),parseInt(j[3],16)]}if(j=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(h)){return[parseInt(j[1]+j[1],16),parseInt(j[2]+j[2],16),parseInt(j[3]+j[3],16)]}return c[g.trim(h).toLowerCase()]}function f(k,h){var j;do{j=g.curCSS(k,h);if(j!=""&&j!="transparent"||g.nodeName(k,"body")){break}h="backgroundColor"}while(k=k.parentNode);return b(j)}var c={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);function SetupReplies(b,c){SetupAddEditComment(b,c,false);SetupShowMoreComments(b,c);b.find(".comment-reply-row").each(function(){SetupRepliesControls($(this),c)});b.find(".comment-reply-row").hover(function(){$(this).find("span").attr("data-hover","true")},function(){$(this).find("span").attr("data-hover","false")})}function SetupAddEditComment(z,c,p){var m=null;var s=null;var v=null;var B=null;var o=null;var G=null;var n=null;var D=15;var u=600;var r=false;var y=false;var h=false;var C=false;var q=z.find(".comment-replies > table");var t=z.find(".add-reply");var k=c.replies.length;if(p){w()}else{t.click(function(){w()})}function f(){if(r){return}r=true;var H=$("<tr/>");if(p){H.addClass("comment-reply-row").addClass("reply-edit-row")}H.html('<td style="width: 0"></td><td class="comment-form"><form><table><form><table><tr><td style="width: 600px"><textarea required="required" name="body" cols="68" rows="3"></textarea></td><td><input type="submit" value="'+(p?LANG.save:LANG.addreply)+'" /><img src="'+g_staticUrl+'/images/icons/ajax.gif" class="ajax-loader" /></td></tr><tr><td colspan="2"><span class="text-counter">Text counter placeholder</span></td></tr></table></form></td>');s=H.find(".comment-form textarea");v=H.find(".comment-form input[type=submit]");B=H.find(".comment-form span.text-counter");m=H.find(".comment-form form");o=H.find(".comment-form .ajax-loader");G=H.find(".comment-form");m.submit(function(){j();return false});l();s.keyup(function(I){l()});s.keydown(function(I){if(I.keyCode==27){A();return false}});s.keypress(function(I){if(I.keyCode==13){j();return false}});if(p){z.after(H);z.hide();m.find("textarea").text(c.replies[z.attr("data-idx")].body)}else{q.append(H)}n=H;$WH.safeFocus(m.find("textarea"))}function w(){if(!r){f()}y=true;if(!p){t.hide();z.find(".comment-replies").show();G.show()}}function A(){y=false;if(p){if(n){n.remove()}z.show();return}t.show();G.hide();if(k==0){z.find(".comment-replies").hide()}}function j(){if(!y||C){return}if(s.val().length<D||s.val().length>u){if(!h){h=true;B.animate({opacity:"0.0"},150);B.animate({opacity:"1.0"},150,null,function(){h=false})}return false}b();$.ajax({type:"POST",url:p?"/comment=edit-reply":"/comment=add-reply",data:{commentId:c.id,replyId:(p?z.attr("data-replyid"):0),body:s.val()},success:function(H){F(H)},dataType:"json",error:function(H){E(H.responseText)}});return true}function b(){C=true;o.show();v.prop("disabled",true);G.find(".message-box").remove()}function g(){C=false;o.hide();v.prop("disabled",false)}function F(H){c.replies=H;Listview.templates.comment.updateReplies(c)}function E(H){g();MessageBox(G,H)}function l(){var K="(error)";var J="q0";var I=s.val().replace(/(\s+)/g," ").replace(/^\s*/,"").replace(/\s*$/,"").length;var H=u-I;if(I==0){K=$WH.sprintf(LANG.replylength1_format,D)}else{if(I<D){K=$WH.sprintf(LANG.replylength2_format,D-I)}else{K=$WH.sprintf(H==1?LANG.replylength4_format:LANG.replylength3_format,H);if(H<120){J="q10"}else{if(H<240){J="q5"}else{if(H<360){J="q11"}}}}}B.html(K).attr("class",J)}}function SetupShowMoreComments(c,j){var g=c.find(".show-more-replies");var f=c.find(".comment-replies");g.click(function(){b()});function b(){g.hide();f.append($("<img>",{"class":"ajax-loader",alt:"",src:g_staticUrl+"/images/icons/ajax.gif"}));$.ajax({type:"GET",url:"/comment=show-replies",data:{id:j.id},success:function(k){j.replies=k;Listview.templates.comment.updateReplies(j)},dataType:"json",error:function(){h()}})}function h(){g.show();f.find(".ajax-loader").remove();MessageBox(f,"There was an error fetching the comments. Try refreshing the page.")}}function SetupRepliesControls(t,n){var q=t.attr("data-replyid");var l=t.find(".reply-upvote");var r=t.find(".reply-downvote");var m=t.find(".reply-report");var b=t.find(".reply-rating");var o=t.find(".reply-controls");var h=t.find(".reply-delete");var k=t.find(".reply-edit");var c=false;var s=false;k.click(function(){SetupAddEditComment(t,n,true)});m.click(function(){if(c||!confirm(LANG.replyreportwarning_tip)){return}c=true;$.ajax({type:"POST",url:"/comment=flag-reply",data:{id:q},success:function(){j()},error:function(u){f(u.responseText)}})});l.click(function(){if(l.attr("data-hasvoted")=="true"||l.attr("data-canvote")!="true"||c){return}c=true;$.ajax({type:"POST",url:"/comment=upvote-reply",data:{id:q},success:function(){p(1)},error:function(u){f(u.responseText)}})});r.click(function(){if(r.attr("data-hasvoted")=="true"||r.attr("data-canvote")!="true"||c){return}c=true;$.ajax({type:"POST",url:"/comment=downvote-reply",data:{id:q},success:function(){p(-1)},error:function(u){f(u.responseText)}})});h.click(function(){if(s){return}if(!confirm(LANG.deletereplyconfirmation_tip)){return}s=true;$.ajax({type:"POST",url:"/comment=delete-reply",data:{id:q},success:function(){g()},error:function(u){f(u.responseText)}})});function p(u){var v=parseInt(b.text());v+=u;b.text(v);if(u>0){l.attr("data-hasvoted","true")}else{r.attr("data-hasvoted","true")}l.attr("data-canvote","false");r.attr("data-canvote","false");if(ratingChance>0){m.remove()}c=false}function j(){c=false;m.remove()}function g(){t.remove();s=false}function f(u){c=false;s=false;if(!u){u="An error has occurred. Try refreshing the page."}MessageBox(o,u)}}function co_addYourComment(){tabsContribute.focus(0);var b=$WH.gE(document.forms.addcomment,"textarea")[0];$WH.safeFocus(b)}function co_validateForm(h){var c=$WH.gE(h,"textarea")[0];var j=false;if($WH.isSet("tabsContribute")){for(var b=0;b<tabsContribute.tabs.length;b++){if(tabsContribute.tabs[b].id=="suggest-a-video"){j=b;break}}}if(j!==false&&c.value.length<350){var g;for(var b in vi_sitevalidation){if(!vi_sitevalidation.hasOwnProperty(b)){continue}if(g=vi_sitevalidation[b].exec(c.value)){break}}if(g&&!confirm(LANG.message_commentasvideo_tip)){tabsContribute.show(j);$('#tab-suggest-a-video input[name="videourl"]').attr("value",g[0]);return false}}if(Listview.funcBox.coValidate(c)){if(!$WH.requireCaptcha()){return true}if(h.elements.recaptcha_response_field.value.length){return true}else{alert(LANG.message_codenotentered);$WH.safeFocus(h.elements.recaptcha_response_field)}}return false}$(document).ready(function(){$WH.setupChangeWarning($("form[name=addcomment]"),[$("textarea[name=commentbody]")],LANG.message_startedpost)});var ContactTool=new function(){this.general=0;this.comment=1;this.post=2;this.screenshot=3;this.video=5;this.guide=6;var h;var g={0:[[1,true],[9,true],[2,true],[8,true],[3,true],[4,true],[5,true],[6,true],[7,true]],1:[[15,function(j){return((j.roles&U_GROUP_MODERATOR)==0)}],[16,true],[18,function(j){return((j.roles&U_GROUP_MODERATOR)==0)}],[19,function(j){return((j.roles&U_GROUP_MODERATOR)==0)}],[20,function(j){return((j.roles&U_GROUP_MODERATOR)==0)}]],2:[[30,function(j){return(g_users&&g_users[j.user]&&(g_users[j.user].roles&U_GROUP_MODERATOR)==0)}],[37,function(j){return((j.roles&U_GROUP_MODERATOR)==0&&g_users&&g_users[j.user]&&(g_users[j.user].roles&U_GROUP_MODERATOR)==0&&g_users[j.user].avatar==2)}],[31,true],[32,true],[33,function(j){return(g_users&&g_users[j.user]&&(g_users[j.user].roles&U_GROUP_MODERATOR)==0)}],[34,function(j){return(g_users&&g_users[j.user]&&(g_users[j.user].roles&U_GROUP_MODERATOR)==0&&j.op&&!j.sticky)}],[35,function(j){return(g_users&&g_users[j.user]&&(g_users[j.user].roles&U_GROUP_MODERATOR)==0)}],[36,function(j){return(g_users&&g_users[j.user]&&(g_users[j.user].roles&U_GROUP_MODERATOR)==0)}]],3:[[45,true],[46,true],[47,function(j){return(g_users&&g_users[j.user]&&(g_users[j.user].roles&U_GROUP_MODERATOR)==0)}],[48,function(j){return(g_users&&g_users[j.user]&&(g_users[j.user].roles&U_GROUP_MODERATOR)==0)}]],5:[[45,true],[46,true],[47,function(j){return(g_users&&g_users[j.user]&&(g_users[j.user].roles&U_GROUP_MODERATOR)==0)}],[48,function(j){return(g_users&&g_users[j.user]&&(g_users[j.user].roles&U_GROUP_MODERATOR)==0)}]],6:[[45,true],[46,true],[48,true]]};var f={1:LANG.ct_resp_error1,2:LANG.ct_resp_error2,3:LANG.ct_resp_error3,7:LANG.ct_resp_error7};var c=null;var b=null;this.monkeyBrokerCallback=function(j){b=j};this.displayError=function(k,j){alert(j)};this.onShow=function(){$WH.ajaxIshRequest("http://mb.zam.com/mb/HistoryViewer?callback=ContactTool.monkeyBrokerCallback",true);if(location.hash&&location.hash!="#contact"){c=location.hash}if(this.data.mode==0){location.replace("#contact")}};this.onHide=function(){if(c&&(c.indexOf("screenshots:")==-1||c.indexOf("videos:")==-1)){$WH.setHash(c)}else{$WH.clearHash()}};this.onSubmit=function(w,r,p){if(w.submitting){return false}for(var v=0;v<p.elements.length;++v){p.elements[v].disabled=true}var u=["contact=1","mode="+$WH.urlEncode(w.mode),"reason="+$WH.urlEncode(w.reason),"desc="+$WH.urlEncode(w.description),"ua="+$WH.urlEncode(navigator.userAgent),"appname="+$WH.urlEncode(navigator.appName),"page="+$WH.urlEncode(w.currenturl)];if(w.mode==0){if(w.relatedurl){u.push("relatedurl="+$WH.urlEncode(w.relatedurl))}if(w.email){u.push("email="+$WH.urlEncode(w.email))}}else{if(w.mode==1){u.push("id="+$WH.urlEncode(w.comment.id))}else{if(w.mode==2){u.push("id="+$WH.urlEncode(w.post.id))}else{if(w.mode==3){u.push("id="+$WH.urlEncode(w.screenshot.id))}else{if(w.mode==5){u.push("id="+$WH.urlEncode(w.video.id))}else{if(w.mode==6){u.push("id="+$WH.urlEncode(w.guide))}}}}}}if(w.reason==9){var n="No ad data. Probably blocked by user.";if(typeof WAS=="undefined"){n='"Ads" object not found. User may have ad blocking enabled. No ad log available.'}else{if(b){var o=function(A){var k=[];for(var j in A){if(A.hasOwnProperty(j)&&(typeof A[j]=="number"||typeof A[j]=="string")){k.push(j)}}k.sort();return k};n="<b>UID: "+b.uid+"</b><br><br>";for(var t=0,y;y=b.history.entries[t];t++){if(y.eventTypeName=="pixel"){continue}var q=new Date(y.time*1000);n+="<b>"+q.toUTCString()+"</b><br>";var m=o(y);for(var s=0,z;z=m[s];s++){n+="<b>"+z+":</b> "+y[z]+"<br>"}n+="<br><br>";if(t>15){break}}}}u.push("adinfo="+encodeURIComponent(n))}w.submitting=true;var l="/contactus";new Ajax(l,{method:"POST",params:u.join("&"),onSuccess:function(A,j){var k=A.responseText;if(k==0){if(g_user.name){alert($WH.sprintf(LANG.ct_dialog_thanks_user,g_user.name))}else{alert(LANG.ct_dialog_thanks)}Lightbox.hide()}else{if(f[k]){alert(f[k])}else{alert("Error: "+k)}}},onFailure:function(k,j){alert("Failure submitting contact request: "+k.statusText)},onComplete:function(A,k){for(var j=0;j<p.elements.length;++j){p.elements[j].disabled=false}w.submitting=false}});return false};this.show=function(j){if(!j){j={}}var l={mode:0};$WH.cO(l,j);l.reasons=g[l.mode];if(location.href.indexOf("#contact")!=-1){l.currenturl=location.href.substr(0,location.href.indexOf("#contact"))}else{l.currenturl=location.href}var k="contactus";if(l.mode!=0){k="reportform"}if(!h){this.init()}h.show(k,{data:l,onShow:this.onShow,onHide:this.onHide,onSubmit:this.onSubmit})};this.checkPound=function(){if(location.hash&&location.hash=="#contact"){ContactTool.show()}};this.init=function(){h=new Dialog();Dialog.templates.contactus={title:LANG.ct_dialog_contactwowhead,width:550,buttons:[["check",LANG.ok],["x",LANG.cancel]],fields:[{id:"reason",type:"select",label:LANG.ct_dialog_reason,required:1,options:[],compute:function(r,s,l,p){$WH.ee(r);for(var q=0;q<this.data.reasons.length;++q){var m=this.data.reasons[q][0];var k=this.data.reasons[q][1];var j=false;if(typeof k=="function"){j=k(this.extra)}else{j=k}if(!j){continue}var n=$WH.ce("option");n.value=m;if(s&&s==m){n.selected=true}$WH.ae(n,$WH.ct(g_contact_reasons[m]));$WH.ae(r,n)}r.onchange=function(){if(this.value==1||this.value==2||this.value==3){l.currenturl.parentNode.parentNode.style.display="";l.relatedurl.parentNode.parentNode.style.display=""}else{if(this.value==9){l.currenturl.parentNode.parentNode.style.display="";l.relatedurl.parentNode.parentNode.style.display="none"}else{l.currenturl.parentNode.parentNode.style.display="none";l.relatedurl.parentNode.parentNode.style.display="none"}}}.bind(r);p.style.width="98%"},validate:function(m,l,k){var j="";if(!m||m.length==0){j=LANG.ct_dialog_error_reason}if(j==""){return true}ContactTool.displayError(k.reason,j);$WH.safeFocus(k.reason);return false}},{id:"currenturl",type:"text",disabled:true,label:LANG.ct_dialog_currenturl,size:40},{id:"relatedurl",type:"text",label:LANG.ct_dialog_relatedurl,caption:LANG.ct_dialog_optional,size:40,validate:function(n,m,l){var k="";var j=/^(http(s?)\:\/\/|\/)?([\w]+:\w+@)?([a-zA-Z]{1}([\w\-]+\.)+([\w]{2,5}))(:[\d]{1,5})?((\/?\w+\/)+|\/?)(\w+\.[\w]{3,4})?((\?\w+=\w+)?(&\w+=\w+)*)?/;n=n.trim();if(n.length>=250){k=LANG.ct_dialog_error_relatedurl}else{if(n.length>0&&!j.test(n)){k=LANG.ct_dialog_error_invalidurl}}if(k==""){return true}ContactTool.displayError(l.relatedurl,k);$WH.safeFocus(l.relatedurl);return false}},{id:"email",type:"text",label:LANG.ct_dialog_email,caption:LANG.ct_dialog_email_caption,compute:function(n,m,k,o,l){var j=function(){$("#contact-emailwarn").css("display",$WH.isEmailValid($(k.email).val())?"none":"");Lightbox.reveal()};$(n).keyup(j).blur(j)},validate:function(m,l,k){var j="";m=m.trim();if(m.length>=100){j=LANG.ct_dialog_error_emaillen}else{if(m.length>0&&!$WH.isEmailValid(m)){j=LANG.ct_dialog_error_email}}if(j==""){return true}ContactTool.displayError(k.email,j);$WH.safeFocus(k.email);return false}},{id:"description",type:"textarea",caption:LANG.ct_dialog_desc_caption,width:"98%",required:1,size:[10,30],validate:function(m,l,k){var j="";m=m.trim();if(m.length==0||m.length>100000){j=LANG.ct_dialog_error_desc}if(j==""){return true}ContactTool.displayError(k.description,j);$WH.safeFocus(k.description);return false}},{id:"noemailwarning",type:"caption",compute:function(l,k,j,m){$(m).html('<span id="contact-emailwarn" class="q10">'+LANG.ct_dialog_noemailwarning+"</span>").css("white-space","normal").css("padding","0 4px")}}],onInit:function(j){},onShow:function(j){if(this.data.focus&&j[this.data.focus]){setTimeout($WH.setCaretPosition.bind(null,j[this.data.focus],j[this.data.focus].value.length),100)}else{if(j.reason&&!j.reason.value){setTimeout(j.reason.focus.bind(j.reason),10)}else{if(j.relatedurl&&!j.relatedurl.value){setTimeout(j.relatedurl.focus.bind(j.relatedurl),10)}else{if(j.email&&!j.email.value){setTimeout(j.email.focus.bind(j.email),10)}else{if(j.description&&!j.description.value){setTimeout(j.description.focus.bind(j.description),10)}}}}}setTimeout(Lightbox.reveal,250)}};Dialog.templates.reportform={title:LANG.ct_dialog_report,width:550,buttons:[["check",LANG.ok],["x",LANG.cancel]],fields:[{id:"reason",type:"select",label:LANG.ct_dialog_reason,options:[],compute:function(t,u,l,q){switch(this.data.mode){case 1:l.firstChild.innerHTML=$WH.sprintf(LANG.ct_dialog_reportcomment,'<a href="/user='+this.data.comment.user+'">'+this.data.comment.user+"</a>");break;case 2:var s='<a href="/user='+this.data.post.user+'">'+this.data.post.user+"</a>";if(this.data.post.op){l.firstChild.innerHTML=$WH.sprintf(LANG.ct_dialog_reporttopic,s)}else{l.firstChild.innerHTML=$WH.sprintf(LANG.ct_dialog_reportpost,s)}break;case 3:l.firstChild.innerHTML=$WH.sprintf(LANG.ct_dialog_reportscreen,'<a href="/user='+this.data.screenshot.user+'">'+this.data.screenshot.user+"</a>");break;case 5:l.firstChild.innerHTML=$WH.sprintf(LANG.ct_dialog_reportvideo,'<a href="/user='+this.data.video.user+'">'+this.data.video.user+"</a>");break;case 6:l.firstChild.innerHTML="Report guide";break}l.firstChild.setAttribute("style","");$WH.ee(t);var p;if(this.data.mode==1){p=this.data.comment}else{if(this.data.mode==2){p=this.data.post}else{if(this.data.mode==3){p=this.data.screenshot}else{if(this.data.mode==5){p=this.data.video}else{if(this.data.mode==6){p=this.data.guide}}}}}$WH.ae(t,$WH.ce("option",{selected:(!u),value:-1}));for(var r=0;r<this.data.reasons.length;++r){var m=this.data.reasons[r][0];var k=this.data.reasons[r][1];var j=false;if(typeof k=="function"){j=k(p)}else{j=k}if(!j){continue}var n=$WH.ce("option");n.value=m;if(u&&u==m){n.selected=true}$WH.ae(n,$WH.ct(g_contact_reasons[m]));$WH.ae(t,n)}q.style.width="98%"},validate:function(m,l,k){var j="";if(!m||m==-1||m.length==0){j=LANG.ct_dialog_error_reason}if(j==""){return true}ContactTool.displayError(k.reason,j);$WH.safeFocus(k.reason);return false}},{id:"description",type:"textarea",caption:LANG.ct_dialog_desc_caption,width:"98%",required:1,size:[10,30],validate:function(m,l,k){var j="";m=m.trim();if(m.length==0||m.length>10000){j=LANG.ct_dialog_error_desc}if(j==""){return true}ContactTool.displayError(k.description,j);$WH.safeFocus(k.description);return false}}],onInit:function(j){},onShow:function(k){var l=$(k).find("*[name=reason]")[0];var j=$(k).find("*[name=description]")[0];if(this.data.focus&&k[this.data.focus]){setTimeout($WH.setCaretPosition.bind(null,k[this.data.focus],k[this.data.focus].value.length),100)}else{if(!l.value){setTimeout(l.focus.bind(l),10)}else{if(!j.value){setTimeout(j.focus.bind(j),10)}}}}}};$(document).ready(this.checkPound)};$WH.cookiesEnabled=function(){document.cookie="enabledTest";return(document.cookie.indexOf("enabledTest")!=-1)?true:false};$WH.getWowheadCookie=function(b){if(g_user.id>0){return g_user.cookies[b]}else{return $WH.getCookies(b)}};$WH.setWowheadCookie=function(f,g,c){var b=f.substr(0,5)=="temp_";if(!c&&g_user.id>0&&!b){new Ajax("/cookie="+f+"&"+f+"="+$WH.urlEncode(g),{method:"get",onSuccess:function(h){if(h.responseText==0){g_user.cookies[f]=g}}})}else{if(c||g_user.id==0){$WH.setCookie(f,14,g,"/",".wowhead.com")}}};var Dialog=function(){var h=this,n,w=null,r,o={},q,g=false,t=$WH.ce("form"),f={};t.onsubmit=function(){u();return false};this.show=function(z,A){if(z){r=z;n=$WH.cOr({},Dialog.templates[r]);h.template=n}else{return}if(n.onInit&&!g){(n.onInit.bind(h,t,A))()}if(A.onBeforeShow){o.onBeforeShow=A.onBeforeShow.bind(h,t)}if(n.onBeforeShow){n.onBeforeShow=n.onBeforeShow.bind(h,t)}if(A.onShow){o.onShow=A.onShow.bind(h,t)}if(n.onShow){n.onShow=n.onShow.bind(h,t)}if(A.onHide){o.onHide=A.onHide.bind(h,t)}if(n.onHide){n.onHide=n.onHide.bind(h,t)}if(A.onSubmit){o.onSubmit=A.onSubmit}if(n.onSubmit){w=n.onSubmit.bind(h,t)}if(A.data){g=false;q={};$WH.cO(q,A.data)}h.data=q;Lightbox.show("dialog-"+r,{onShow:b,onHide:p})};this.getValue=function(z){return m(z)};this.setValue=function(A,z){k(A,z)};this.getSelectedValue=function(z){return v(z)};this.getCheckedValue=function(z){return y(z)};function b(z,A){if(A||!g){j(z)}if(n.onBeforeShow){n.onBeforeShow()}if(o.onBeforeShow){o.onBeforeShow()}Lightbox.setSize(n.width,n.height);z.className+=" dialog";s();if(n.onShow){n.onShow()}if(o.onShow){o.onShow()}window.setTimeout(c,5)}function c(){for(var z=0,B,A;B=n.fields[z];z++){if($WH.inArray(["text","number"],B.type)>=0){f[B.id].focus();break}}}function j(H){$WH.ee(H);$WH.ee(t);var z=$WH.ce("div");z.className="lightbox-content text";$WH.ae(H,z);$WH.ae(z,t);if(n.title){$WH.ae(t,$WH.getImitationHeading($WH.ct(n.title),1))}var J=$WH.ce("table"),F=$WH.ce("tbody"),C=false;$WH.ae(J,F);$WH.ae(t,J);for(var Q=0,R=n.fields.length;Q<R;++Q){var A=n.fields[Q],G;if(!C){tr=$WH.ce("tr");th=$WH.ce("th");td=$WH.ce("td")}A.__tr=tr;if(q[A.id]==null){q[A.id]=(A.value?A.value:"")}var E;if(A.options){E=[];if(A.optorder){$WH.cO(E,A.optorder)}else{for(var P in A.options){E.push(P)}}if(A.sort){E.sort(function(V,U){return A.sort*$WH.stringCompare(A.options[V],A.options[U])})}}switch(A.type){case"caption":th.colSpan=2;th.style.textAlign="left";th.style.padding=0;if(A.compute){(A.compute.bind(h,null,q[A.id],t,th,tr))()}else{if(A.label){$WH.ae(th,$WH.ct(A.label))}}$WH.ae(tr,th);$WH.ae(F,tr);continue;break;case"textarea":var S=G=$WH.ce("textarea");S.name=A.id;if(A.disabled){S.disabled=true}S.rows=A.size[0];S.cols=A.size[1];td.colSpan=2;if(A.label){th.colSpan=2;th.style.textAlign="left";th.style.padding=0;td.style.padding=0;$WH.ae(th,$WH.ct(A.label));$WH.ae(tr,th);$WH.ae(F,tr);tr=$WH.ce("tr")}$WH.ae(td,S);break;case"select":var S=G=$WH.ce("select");S.name=A.id;if(A.size){S.size=A.size}if(A.disabled){S.disabled=true}if(A.multiple){S.multiple=true}if(A.onchange){S.onchange=A.onchange.bind(h,S)}for(var P=0,D=E.length;P<D;++P){var M=$WH.ce("option");M.value=E[P];$WH.ae(M,$WH.ct(A.options[E[P]]));$WH.ae(S,M)}$WH.ae(td,S);break;case"dynamic":td.colSpan=2;td.style.textAlign="left";td.style.padding=0;if(A.compute){(A.compute.bind(h,null,q[A.id],t,td,tr))()}$WH.ae(tr,td);$WH.ae(F,tr);G=td;break;case"checkbox":case"radio":var O=0;G=[];for(var P=0,D=E.length;P<D;++P){var K=$WH.ce("span"),S,N,B="sdfler46"+A.id+"-"+E[P];if(P>0&&!A.noInputBr){$WH.ae(td,$WH.ce("br"))}N=$WH.ce("label");N.setAttribute("for",B);N.onmousedown=$WH.rf;S=$WH.ce("input");S.setAttribute("type",A.type);S.name=A.id;S.value=E[P];S.id=B;if(A.disabled){S.disabled=true}if(A.onchange){S.onchange=A.onchange.bind(h,S)}if(A.submitOnDblClick){N.ondblclick=S.ondblclick=function(U){u()}}if(A.compute){(A.compute.bind(h,S,q[A.id],t,td,tr,N))()}$WH.ae(N,S);$WH.ae(N,$WH.ct(A.options[E[P]]));$WH.ae(td,N);G.push(S)}break;default:var S=G=$WH.ce("input");S.name=A.id;if(A.size){S.size=A.size}if(A.disabled){S.disabled=true}if(A.submitOnEnter){S.onkeypress=function(U){U=$WH.normalizeEvent(U);if(U.keyCode==13){u()}}}S.setAttribute("type",A.type);$WH.ae(td,S);break}if(A.label){if(A.type=="textarea"){if(A.labelAlign){td.style.textAlign=A.labelAlign}td.colSpan=2}else{if(A.labelAlign){th.style.textAlign=A.labelAlign}$WH.ae(th,$WH.ct(A.label));$WH.ae(tr,th)}}if(A.placeholder){S.placeholder=A.placeholder}if(A.type!="checkbox"&&A.type!="radio"){if(A.width){S.style.width=A.width}if(A.compute&&A.type!="caption"&&A.type!="dynamic"){(A.compute.bind(h,S,q[A.id],t,td,tr))()}}if(A.caption){var K=$WH.ce("small");if(A.type!="textarea"){K.style.paddingLeft="2px"}$WH.ae(K,$WH.ct(A.caption));$WH.ae(td,K)}$WH.ae(tr,td);$WH.ae(F,tr);C=A.mergeCell;f[A.id]=G}var L={arrow:"external-link",check:"check",question:"question",x:"times"};for(var Q=n.buttons.length;Q>0;--Q){var I=n.buttons[Q-1],T=$WH.ce("a");T.onclick=u.bind(T,I[0]);T.className="dialog-"+I[0]+" fa fa-"+L[I[0]];T.href="javascript:;";$WH.ae(T,$WH.ct(I[1]));$WH.ae(H,T)}g=true}function s(){for(var C=0,z=n.fields.length;C<z;++C){var E=n.fields[C],D=f[E.id];switch(E.type){case"caption":break;case"select":for(var B=0,A=D.options.length;B<A;B++){D.options[B].selected=(D.options[B].value==q[E.id]||$WH.inArray(q[E.id],D.options[B].value)!=-1)}break;case"checkbox":case"radio":for(var B=0,A=D.length;B<A;B++){D[B].checked=(D[B].value==q[E.id]||$WH.inArray(q[E.id],D[B].value)!=-1)}break;default:D.value=q[E.id];break}if(E.update){(E.update.bind(h,null,q[E.id],t,D))()}}}function p(){if(n.onHide){n.onHide()}if(o.onHide){o.onHide()}}function u(A){if(A=="x"){return Lightbox.hide()}for(var B=0,z=n.fields.length;B<z;++B){var D=n.fields[B],C;switch(D.type){case"caption":continue;case"select":C=v(D.id);break;case"checkbox":case"radio":C=y(D.id);break;case"dynamic":if(D.getValue){C=D.getValue(D,q,t);break}default:C=m(D.id);break}if(D.validate){if(!D.validate(C,q,t)){return}}if(C&&typeof C=="string"){C=$WH.trim(C)}q[D.id]=C}l(A)}function l(A){var z;if(w){z=w(q,A,t)}if(o.onSubmit){z=o.onSubmit(q,A,t)}if(z===undefined||z){Lightbox.hide()}return false}function m(z){return f[z].value}function k(A,z){f[A].value=z}function v(D){var C=[],B=f[D];for(var A=0,z=B.options.length;A<z;A++){if(B.options[A].selected){C.push(parseInt(B.options[A].value)==B.options[A].value?parseInt(B.options[A].value):B.options[A].value)}}if(C.length==1){C=C[0]}return C}function y(D){var C=[],B=f[D];for(var A=0,z=B.length;A<z;A++){if(B[A].checked){C.push(parseInt(B[A].value)==B[A].value?parseInt(B[A].value):B[A].value)}}return C}};Dialog.templates={};Dialog.extraFields={};$WH.addCss=function(c){var f=$WH.ce("style");f.type="text/css";if(f.styleSheet){f.styleSheet.cssText=c}else{$WH.ae(f,$WH.ct(c))}var b=document.getElementsByTagName("head")[0];$WH.ae(b,f)};$WH.setTextNodes=function(f,c){if(f.nodeType==3){f.nodeValue=c}else{for(var b=0;b<f.childNodes.length;++b){$WH.setTextNodes(f.childNodes[b],c)}}};$WH.setInnerHtml=function(g,f,b){if(g.nodeName.toLowerCase()==b){g.innerHTML=f}else{for(var c=0;c<g.childNodes.length;++c){$WH.setInnerHtml(g.childNodes[c],f,b)}}};$WH.getFirstTextContent=function(f){for(var c=0;c<f.childNodes.length;++c){if(f.childNodes[c].nodeName=="#text"){return f.childNodes[c].nodeValue}var b=$WH.getFirstTextContent(f.childNodes[c]);if(b){return b}}return false};$WH.getTextContent=function(f){var b="";for(var c=0;c<f.childNodes.length;++c){if(f.childNodes[c].nodeValue){b+=f.childNodes[c].nodeValue}else{if(f.childNodes[c].nodeName=="BR"){if($WH.Browser.ie67){b+="\r"}else{b+="\n"}}}b+=$WH.getTextContent(f.childNodes[c])}return b};$WH.toggleDisplay=function(g,f){var c=$(g);var b=c.is(":visible");if(f){c.slideToggle(150)}else{c.toggle()}return !b};$WH.preventScroll=function(b,c){if(b){$WH.aE(document,"mousewheel",$WH.preventScroll.cancelScroll);$WH.aE(window,"DOMMouseScroll",$WH.preventScroll.cancelScroll);if(c){$WH.aE(document.body,"touchmove",$WH.preventScroll.touch.bind(c))}}else{$WH.dE(document,"mousewheel",$WH.preventScroll.cancelScroll);$WH.dE(window,"DOMMouseScroll",$WH.preventScroll.cancelScroll);$WH.dE(document.body,"touchmove",$WH.preventScroll.touch)}};$WH.preventScroll.cancelScroll=function(b){if(b.stopPropagation){b.stopPropagation()}if(b.preventDefault){b.preventDefault()}b.returnValue=false;b.cancelBubble=true;return false};$WH.preventScroll.touch=function(f){var b=$(this);if(b.length){var c=b.get(0);if(c.contains&&!c.contains(f.target)){f.preventDefault()}}else{f.preventDefault()}};$WH.safeFocus=function(b){if(!Platform.isTouch()){$(b).focus()}};$WH.safeSelect=function(b){if(!Platform.isTouch()){$(b).select()}};$WH.setCaretPosition=function(f,c){if(!f){return}if(f.createTextRange){var b=f.createTextRange();b.move("character",c);b.select()}else{if(f.selectionStart!=undefined){f.focus();f.setSelectionRange(c,c)}else{f.focus()}}};$WH.insertTag=function(g,b,l,m){var c=$WH.ge(g);c.focus();if(c.selectionStart!=null){var p=c.selectionStart,k=c.selectionEnd,o=c.scrollLeft,f=c.scrollTop;var j=c.value.substring(p,k);if(typeof m=="function"){j=m(j)}c.value=c.value.substr(0,p)+b+j+l+c.value.substr(k);c.selectionStart=c.selectionEnd=k+b.length;c.scrollLeft=o;c.scrollTop=f}else{if(document.selection&&document.selection.createRange){var h=document.selection.createRange();if(h.parentElement()!=c){return}var j=h.text;if(typeof m=="function"){j=m(j)}h.text=b+j+l}}if(c.onkeyup){c.onkeyup()}};$WH.onAfterTyping=function(b,f,c){var g;b.onkeyup=function(){if(g){clearTimeout(g);g=null}g=setTimeout(f,c)}};$WH.isLeftClick=function(b){b=$WH.normalizeEvent(b);return(b&&b._button==1)};$WH.preventEmptyFormSubmission=function(){if(!$.trim(this.elements[0].value)){return false}};var Draggable=new function(){var b={},l={},p,g;function n(t){t=$WH.normalizeEvent(t);if(this._handle){var q=t._target,s=false,r=0;while(q&&r<=3){if(q==this._handle){s=true;break}q=q.parentNode;++r}if(!s){return false}}p=this;b=$WH.getCursorPos(t);$WH.aE(document,"mousemove",c);$WH.aE(document,"mouseup",f);if(p.onClick){p.onClick(t,p)}return false}function c(t){t=$WH.normalizeEvent(t);var u=$WH.getCursorPos(t);if(p){if(Math.abs(u.x-b.x)>5||Math.abs(u.y-b.y)>5){m(t,p);p=null}}if(!g||!g._bounds){return false}var s=k(g),r=u.x-b.x,q=u.y-b.y;r=Math.max(g._bounds.x1-l.x,Math.min(g._bounds.x2-l.x-(s.x2-s.x1),r));q=Math.max(g._bounds.y1-l.y,Math.min(g._bounds.y2-l.y-(s.y2-s.y1),q));o(r,q);return false}function f(q){q=$WH.normalizeEvent(q);p=null;if(g){j(q)}}function m(r,q){if(g){j(r)}var s=$WH.ac(q);l.x=s[0];l.y=s[1];if(q._targets.length){g=q.cloneNode(true);g._orig=q;$WH.ae(document.body,g);o(-2323,-2323)}else{g=q}$WH.Tooltip.disabled=true;$WH.Tooltip.hide();if(q.onDrag){q.onDrag(r,g,q)}g._bounds=k(q._container);g.className+=" dragged"}function j(v){var u=false,w=$WH.getCursorPos(v);if(g._orig&&g._orig._targets.length){h();var y={x1:g._x,x2:g._x+parseInt(g.offsetWidth),y1:g._y,y2:g._y+parseInt(g.offsetHeight)};$WH.de(g);g=g._orig;for(var t=0,r=g._targets.length;t<r;++t){var q=g._targets[t],s=k(q);if(y.x2>=s.x1&&y.x1<s.x2&&y.y2>=s.y1&&y.y1<s.y2){u=true;if(g.onDrop){g.onDrop(v,g,q,(w.x>=s.x1&&w.x<=s.x2&&w.y>=s.y1&&w.y<=s.y2))}else{$WH.ae(q,g)}}}}if(!u&&g.onDrop){g.onDrop(v,g,null)}$WH.dE(document,"mousemove",c);$WH.dE(document,"mouseup",f);$WH.Tooltip.disabled=false;g.className=g.className.replace(/dragged/,"");g=null}function o(r,q){g.style.position="absolute";g.style.left=l.x+r+"px";g.style.top=l.y+q+"px";g._x=l.x+r;g._y=l.y+q}function h(){g.style.left="-2323px";g.style.top="-2323px"}function k(q){var r=$WH.ac(q);return{x1:r[0],x2:r[0]+parseInt(q.offsetWidth),y1:r[1],y2:r[1]+parseInt(q.offsetHeight)}}this.init=function(u,t){u.onmousedown=n;var r=u.getElementsByTagName("a");for(var s=0,q=r.length;s<q;++s){$WH.disableOldIESelect(r[s])}if(!u._targets){u._targets=[]}if(!u._container){u._container=document.body}if(t!=null){if(t.targets){for(var s=0,q=t.targets.length;s<q;++s){u._targets.push($WH.ge(t.targets[s]))}}if(t.container){u._container=$WH.ge(t.container)}if(t.onClick){u.onClick=t.onClick}if(t.onDrop){u.onDrop=t.onDrop}if(t.onDrag){u.onDrag=t.onDrag}}}};var Facebook={getCurrentOpenGraphUrl:function(){return $("head meta[property='og:url']").attr("content")},createLikeButton:function(c,f){if(!f){f={}}var b,g,h;if(f.simple){g=90;h=21;b="button_count"}else{g=400;h=23;b="standard"}return $("<iframe/>",{src:"//www.facebook.com/plugins/like.php?href="+$WH.urlEncode(c)+"&locale=en_US&layout="+b+"&show_faces=false&action=like&font=arial&colorscheme=dark&width="+g+"&height="+h,scrolling:"no",frameborder:"0",allowtransparency:"true",css:{border:"none",overflow:"hidden",width:g+"px",height:h+"px",display:"none"}}).on("load",function(){$(this).show()})}};var Favorites=new function(){var k=null;var l=null;var n=null;this.pageInit=function(r,q,s){if(typeof r=="string"){if(!document.querySelector){return}r=document.querySelector(r)}if(!r||typeof q!="number"||typeof s!="number"){return}k=q;l=s;b(r)};function j(){var q=typeof g_pageInfo=="object"&&typeof g_pageInfo.type=="number"&&typeof g_pageInfo.typeId=="number"?document.querySelector("#main-contents .heading-size-1"):null;if(!q){if(document.readyState!=="complete"){setTimeout(j,9)}return}k=g_pageInfo.type;l=g_pageInfo.typeId;b(q)}this.hasFavorites=function(){return !!g_favorites.length};this.getMenu=function(){var s=[];var A=0;var q=0;for(var t=0,z;z=g_favorites[t];t++){if(!z.entities.length){continue}A++;var D=[];for(var y=0,B;B=z.entities[y];y++){D.push([B[0],B[1],"/"+g_types[z.id]+"="+B[0]]);q++}Menu.sort(D);s.push([z.id,LANG.types[z.id][2],,D])}Menu.sort(s);if((A==1&&q<=45)||(A==2&&A+q<=30)||(A>2&&A+q<=15)){var w=[];for(var v=0;D=s[v];v++){w.push([,D[MENU_IDX_NAME]]);for(var u=0,C;C=D[MENU_IDX_SUB][u];u++){var r=[C[MENU_IDX_ID],C[MENU_IDX_NAME],C[MENU_IDX_URL]];if(C[MENU_IDX_OPT]){r[MENU_IDX_OPT]=C[MENU_IDX_OPT]}w.push(r)}}s=w}return s};this.refreshMenu=function(){var q=$(".zul-bar-user-item-favorites");if(!q.length){return}var r=Favorites.getMenu();if(!r.length){q.hide();return}Menu.add(q,r);q.show()};function b(q){n=$("<span/>",{"class":"fav-star fa",mouseout:$WH.Tooltip.hide}).appendTo(q);if($WH.userIsLoggedIn()&&g_user.sessionKey){n.addClass("fa-star"+(o(k,l)?"":"-o")).click((function(s,t,r){g(s,t,r);p(s,t);$WH.Tooltip.hide()}).bind(null,k,l,q.textContent.trim().replace(/(.+)<.*/,"$1")));if(!Platform.isTouch()){n.mouseover(function(r){var s=this.className.match(/\bfa-star-o\b/)?LANG.addtofavorites:LANG.removefromfavorites;$WH.Tooltip.show(this,s,false,false,"q2")})}}else{n.addClass("fa-star-o").click(function(){LoginDialog.show();$WH.Tooltip.hide()}).mouseover(function(r){$WH.Tooltip.show(this,LANG.favorites_login+'<div class="q2" style="margin-top:10px">'+LANG.clicktologin+"</span>")})}}function p(r,t){if(n){var q="fa-star-o";var s="fa-star";if(!o(r,t)){q="fa-star";s="fa-star-o"}n.removeClass(q).addClass(s)}}function o(s,u){var r=f(s);if(r==-1){return false}for(var q=0,t;t=g_favorites[r].entities[q];q++){if(t[0]==u){return true}}return false}function g(r,s,q){if(o(r,s)){c(r,s)}else{h(r,s,q)}}function h(t,v,s){var r=f(t,true);if(r==-1){$WH.console.error("Invalid type when adding entity to favorites! Type was:",t);return}for(var q=0,u;u=g_favorites[r].entities[q];q++){if(u[0]==v){alert(LANG.favorites_duplicate.replace("%s",LANG.types[t][1]));return}}m("add",t,v);g_favorites[r].entities.push([v,s]);Favorites.refreshMenu()}function c(s,u){var r=f(s);if(r==-1){return}for(var q=0,t;t=g_favorites[r].entities[q];q++){if(t[0]==u){m("remove",s,u);g_favorites[r].entities.splice(q,1);if(!g_favorites[r].entities.length){g_favorites.splice(r,1)}Favorites.refreshMenu();return}}}function f(t,r){if(!LANG.types[t]){return -1}for(var s=0,q;q=g_favorites[s];s++){if(q.id==t){return s}}if(!r){return -1}g_favorites.push({id:t,entities:[]});g_favorites.sort(function(v,u){return $WH.stringCompare(LANG.types[v.id],LANG.types[u.id])});for(s=0;q=g_favorites[s];s++){if(q.id==t){return s}}return -1}function m(q,s,t){var r={id:t,sessionKey:g_user.sessionKey};r[q]=s;$.post("/account=favorites",r)}if(document.querySelector&&$WH.localStorage.isSupported()){j()}};var Gatherer=new function(){var requested={};this.fetchItems=function(itemIDs,options){fetchData("items",itemIDs,options)};this.fetchSpells=function(spellIDs,options){fetchData("spells",spellIDs,options)};function validateID(id){return typeof id=="number"||(typeof id=="string"&&!id.match(/[^0-9]/))}function prepareEntityArray(type,entityIDs,options){if(!requested[type]){requested[type]={}}if(entityIDs instanceof Array){var entityArray=[];for(var i=0,entityID;entityID=entityIDs[i];i++){if(validateID(entityID)){if(requested[type][entityID]&&!options.forceRequest){}else{requested[type][entityID]=true;entityArray.push(entityID)}}}return entityArray}else{if(validateID(entityIDs)){if(requested[type][entityIDs]&&!options.forceRequest){return[]}else{requested[type][entityIDs]=true;return[entityIDs]}}else{if(typeof console!="undefined"&&typeof console.error=="function"){console.error("Gatherer requires an array of IDs or single ID!")}return[]}}}function fetchData(type,entityIDs,options){if(!options){options={}}var entityArray=prepareEntityArray(type,entityIDs,options);if(!entityArray.length){switch(typeof options.onSuccess){case"string":eval(options.onSuccess+"()");break;case"function":options.onSuccess();break}return}entityArray.sort();var url="/gatherer?"+type+"="+entityArray.join(",");if(typeof options.onSuccess=="string"){url+="&callback="+options.onSuccess}var callback=typeof options.onSuccess=="function"?options.onSuccess:null;$.getScript(url,callback)}};var g_localTime=new Date();var g_blogimages={};function GetStars(b,l,q,o){var m=5;var c=b;if(q){b=q}b=Math.round(b*2)/2;var p=Math.round(b);var n=$("<span>").addClass("stars").addClass("max-"+m).addClass("stars-"+p);if(!g_user.id){l=false}if(l){n.addClass("ratable")}if(q){n.addClass("rated")}var k="<span>";var h=b;for(var g=1;g<=m;++g){if(h<1&&h>0){k+='<b class="stars-half">'}else{if(h<=0){k+='<b class="stars-empty">'}else{k+='<b class="stars-full">'}}h--;k+='<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-half"></i>'}for(var g=1;g<=m;++g){k+="</b>"}k+="</span>";n.append(k);if(l){var f=0;$("b",n).each(function(){var r=++f;$("> i",this).click(function(){VoteGuide(o,c,r);return false})})}if(q){var j=$("<span>").addClass("clear fa fa-times-circle").click(function(){VoteGuide(o,c,0)});n.append(j)}if(b>=0){n.mouseover(function(r){$WH.Tooltip.showAtCursor(r,"Rating:&nbsp;"+b+"&nbsp;/&nbsp;"+m,0,0,"q")}).mousemove(function(r){$WH.Tooltip.cursorUpdate(r)}).mouseout(function(){$WH.Tooltip.hide()})}return n}function VoteGuide(guideId,oldRating,newRating){$("#guiderating").html(GetStars(oldRating,true,newRating,guideId));$.ajax({cache:false,url:"/guide=vote",type:"POST",error:function(){$("#guiderating").html(GetStars(oldRating,true,0,guideId));alert("Voting failed. Try again later.")},success:function(json){var data=eval("("+json+")");$("#guiderating-value").text(data.rating);$("#guiderating-votes").text($WH.getN5(data.nvotes))},data:{id:guideId,rating:newRating}})}var Icon={sizes:["small","medium","large","blizzard"],sizes2:[18,36,56,64],sizeIds:{small:0,medium:1,large:2,blizzard:3},premiumOffsets:[[-56,-36],[-56,0],[0,0],[0,0]],premiumBorderClasses:["-premium","-gold","","-premiumred","-red",""],STANDARD_BORDER:2,privilegeBorderClasses:{uncommon:"-q2",rare:"-q3",epic:"-q4",legendary:"-q5"},create:function(f,s,m,c,j,r,b,q,o){var l=$WH.ce(o?"span":"div"),g=$WH.ce("ins"),k=$WH.ce("del");if(s==null){s=1}l.className="icon"+Icon.sizes[s];$WH.ae(l,g);if(!b){$WH.ae(l,k)}Icon.setTexture(l,s,f);if(c){var n=$WH.ce("a");n.href=c;if(c.indexOf("wowhead.com")==-1&&c.substr(0,5)=="http:"){n.target="_blank"}$WH.ae(l,n)}else{if(f){var p=l.firstChild.style;var h=(p.backgroundImage.indexOf("/avatars/")!=-1);if(!h){l.onclick=Icon.onClick;if(c!==false){var n=$WH.ce("a");n.href="javascript:;";$WH.ae(l,n)}}}}if(q&&typeof n!="undefined"){n.rel=q}Icon.setNumQty(l,j,r);return l},createUser:function(h,k,g,f,c,l,b){if(h==2){k=g_staticUrl+"/uploads/avatars/"+k+".jpg"}var j=Icon.create(k,g,null,f,null,null,l);if(c!=Icon.STANDARD_BORDER){if(Icon.premiumBorderClasses[c]){j.className+=" "+j.className+Icon.premiumBorderClasses[c]}}else{if(b&&Icon.privilegeBorderClasses.hasOwnProperty(b)){j.className+=" "+j.className+Icon.privilegeBorderClasses[b]}}if(h==2){Icon.moveTexture(j,g,Icon.premiumOffsets[g][0],Icon.premiumOffsets[g][1],true)}return j},getPrivilegeBorder:function(c){var b=false;if(c>=5000){b="uncommon"}if(c>=10000){b="rare"}if(c>=15000){b="epic"}if(c>=25000){b="legendary"}return b},setTexture:function(g,f,c){if(!c){return}var b=g.firstChild.style;if(c.indexOf("/")!=-1){b.backgroundImage="url("+c+")"}else{b.backgroundImage="url("+g_staticUrl+"/images/wow/icons/"+Icon.sizes[f]+"/"+c.toLowerCase()+".jpg)"}Icon.moveTexture(g,f,0,0)},moveTexture:function(h,f,b,j,g){var c=h.firstChild.style;if(b||j){if(g){c.backgroundPosition=b+"px "+j+"px"}else{c.backgroundPosition=(-b*Icon.sizes2[f])+"px "+(-j*Icon.sizes2[f])+"px"}}else{if(c.backgroundPosition){c.backgroundPosition=""}}},setNumQty:function(h,f,j){var c=$WH.gE(h,"span");for(var g=0,b=c.length;g<b;++g){if(c[g]){$WH.de(c[g])}}if(f!=null&&((f>1&&f<2147483647)||(f.length&&f!="0"&&f!="1"))){c=$WH.createTextGlow(f,"q1");c.style.right="0";c.style.bottom="0";c.style.position="absolute";$WH.ae(h,c)}if(j!=null&&j>0){c=$WH.createTextGlow("("+j+")","q");c.style.left="0";c.style.top="0";c.style.position="absolute";$WH.ae(h,c)}},getLink:function(b){return $WH.gE(b,"a")[0]},showIconName:function(b){if(b.firstChild){var f=b.firstChild.style;if(f.backgroundImage.length&&(f.backgroundImage.indexOf(g_staticUrl)>=4||g_staticUrl=="")){var g=f.backgroundImage.lastIndexOf("/"),c=f.backgroundImage.indexOf(".jpg");if(g!=-1&&c!=-1){Icon.displayIcon(f.backgroundImage.substring(g+1,c))}}}},onClick:function(){Icon.showIconName(this)},displayIcon:function(c){if(!Dialog.templates.icondisplay){var b=392;switch(Locale.getId()){case LOCALE_ESES:b=408;break;case LOCALE_RURU:b=412;break}Dialog.templates.icondisplay={title:LANG.icon,width:b,buttons:[["arrow",LANG.original],["x",LANG.close]],fields:[{id:"icon",label:LANG.dialog_imagename,required:1,type:"text",labelAlign:"left",compute:function(h,g,f,l){l.className="icon-dialog-content";var k=$WH.ce("div");var j=this.iconDiv=$WH.ce("div");j.update=function(){setTimeout(function(){$WH.safeSelect(h)},10);$WH.ee(j);$WH.ae(j,Icon.create(h.value,2))};$WH.ae(j,Icon.create(g,2));$WH.ae(k,j);$WH.ae(k,h);$WH.ae(l,k)}},{id:"location",label:" ",required:1,type:"caption",compute:function(k,j,g,f,h){$WH.ee(f);f.className="icon-dialog-caption";var m=$WH.ce("div");var l=LANG.dialog_seeallusingicon;l=l.replace("$1",'<a href="/items?filter=142;0;'+this.data.icon+'">'+LANG.types[3][3]+"</a>");l=l.replace("$2",'<a href="/spells?filter=15;0;'+this.data.icon+'">'+LANG.types[6][3]+"</a>");l=l.replace("$3",'<a href="/achievements?filter=10;0;'+this.data.icon+'">'+LANG.types[10][3]+"</a>");m.innerHTML=l;$WH.ae(f,m)}}],onInit:function(f){this.updateIcon=this.template.updateIcon.bind(this,f)},onShow:function(f){this.updateIcon();if(location.hash&&location.hash.indexOf("#icon")==-1){this.oldHash=location.hash}else{this.oldHash=""}var g="#icon";var h=($WH.isSet("g_pageInfo")&&g_pageInfo.type&&$WH.inArray([3,6,10],g_pageInfo.type)==-1);if(!h){g+=":"+this.data.icon}location.hash=g},onHide:function(f){if(this.oldHash){$WH.setHash(this.oldHash)}else{$WH.clearHash()}},updateIcon:function(f){this.iconDiv.update()},onSubmit:function(j,h,f,g){if(f=="arrow"){var k=window.open(g_staticUrl+"/images/wow/icons/large/"+h.icon.toLowerCase()+".jpg","_blank");k.focus();return false}return true}}}if(!Icon.icDialog){Icon.icDialog=new Dialog()}Icon.icDialog.show("icondisplay",{data:{icon:c}})},checkPound:function(){if(location.hash&&location.hash.indexOf("#icon")==0){var c=location.hash.split(":");var b=false;if(c.length==2){b=c[1]}else{if(c.length==1&&$WH.isSet("g_pageInfo")){switch(g_pageInfo.type){case 3:b=g_items[g_pageInfo.typeId].icon.toLowerCase();break;case 6:b=g_spells[g_pageInfo.typeId].icon.toLowerCase();break;case 10:b=g_achievements[g_pageInfo.typeId].icon.toLowerCase();break}}}if(b){Icon.displayIcon(b)}}}};$(document).ready(Icon.checkPound);if($WH.isSet("INSTART")&&$WH.isSet("g_user")&&g_user.hasOwnProperty("roles")&&(g_user.roles&U_GROUP_PREMIUM_PERMISSIONS)){(function(){var b;try{b="sessionStorage" in window&&window.sessionStorage!==null}catch(c){b=false}if(b){try{sessionStorage.setItem("test","123");b=sessionStorage.getItem("test")=="123";sessionStorage.removeItem("test")}catch(c){b=false}}if(!b){if($WH.isDev()){console.log("Cannot bounce out of Instart because sessionStorage is not supported.")}return}if(sessionStorage.getItem("performedInstartReload")=="yes"){if($WH.isDev()){console.log("Cannot bounce out of Instart because we already tried this session.")}return}if(/[\.\/]g\d+[\.\/]/.test(location.href)){if($WH.isDev()){console.log("Cannot bounce out of Instart because location.href contains Instart URL.")}return}sessionStorage.setItem("performedInstartReload","yes");location.href=location.href})()}var Lightbox=new function(){var h,q,r,m={},f={},n,k;function s(){$WH.aE(h,"click",j);$WH.aE(q,"click",g);$WH.aE(document,"keydown",l);$WH.aE(window,"resize",b)}function p(){$WH.dE(h,"click",j);$WH.dE(q,"click",g);$WH.dE(document,"keydown",l);$WH.dE(window,"resize",b)}function c(){if(n){return}n=1;var t=document.body;h=$WH.ce("div");h.className="lightbox-overlay";q=$WH.ce("div");q.className="lightbox-outer";r=$WH.ce("div");r.className="lightbox-inner";h.style.display=q.style.display="none";$WH.ae(t,h);$WH.ae(q,r);$WH.ae(t,q)}function l(t){t=$WH.normalizeEvent(t);switch(t.keyCode){case 27:j();break}}function b(t){if(t!=1234){if(f.onResize){f.onResize()}}h.style.height=document.body.offsetHeight+"px"}function g(t){if(t.target&&t.target.className=="lightbox-outer"){j()}}function j(){if(!n){return}p();if(f.onHide){f.onHide()}h.style.display=q.style.display="none";WAS.restoreHidden();PoundChecker.resume();$WH.preventScroll(false)}function o(){h.style.display=q.style.display=m[k].style.display="";Lightbox.setSize(r.offsetWidth,r.offsetHeight,1)}this.setSize=function(t,u,v){r.style.visibility="hidden";if(!v){r.style.width=t+"px"}r.style.visibility="visible"};this.show=function(y,w,u){f=w||{};Menu.hide(true);$WH.Tooltip.hide();WAS.hideAll();PoundChecker.pause();c();s();if(k!=y&&m[k]!=null){m[k].style.display="none"}k=y;var v=0,t;if(m[y]==null){v=1;t=$WH.ce("div",{className:"lightbox-frame"});$WH.ae(r,t);m[y]=t}else{t=m[y];t.className="lightbox-frame"+(t.className?" "+t.className.replace(/lightbox-frame */,""):"")}if(f.onShow){f.onShow(t,v,u)}b(1234);o();$WH.preventScroll(true,".lightbox-content")};this.reveal=function(){o()};this.hide=function(){j()};this.isVisible=function(){return(h&&h.style.display!="none")}};function Line(h,p,c,n,m){var j=Math.min(h,c),s=Math.max(h,c),o=Math.min(p,n),l=Math.max(p,n),g=(s-j),q=(l-o),k=Math.sqrt(Math.pow(g,2)+Math.pow(q,2)),t=Math.atan2(q,g),b=Math.sin(t),f=Math.cos(t);var r=$('<span class="line" />').css({top:o.toFixed(2)+"px",left:j.toFixed(2)+"px",width:g.toFixed(2)+"px",height:q.toFixed(2)+"px"}).append($("<var />").css({width:k.toFixed(2)+"px","-o-transform":"rotate("+t+"rad)","-moz-transform":"rotate("+t+"rad)","-webkit-transform":"rotate("+t+"rad)",filter:"progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11="+f+", M12="+(-1*b)+", M21="+b+", M22="+f+")"}));if(!(h==j&&p==o)&&!(c==j&&n==o)){r.addClass("flipped")}if(m!=null){r.addClass("line-"+m)}return r[0]}var Links=new function(){var c=null;var g=null;var f={item:1};var b={29:"icondb"};this.onShow=function(){if(location.hash&&location.hash!="#links"){g=location.hash}location.replace("#links")};this.onHide=function(){if(g&&(g.indexOf("screenshots:")==-1||g.indexOf("videos:")==-1)){$WH.setHash(g)}else{$WH.clearHash()}};this.show=function(j){if(!j||!j.type||!j.typeId){return}var s=g_types[j.type];if(!c){this.init()}if(f[s]&&Dialog.templates.links.fields[1].id!="armoryurl"){Dialog.templates.links.fields.splice(1,0,{id:"armoryurl",type:"text",label:"Armory URL",size:40})}var t="";if(j.linkColor&&j.linkId&&j.linkName){t=$WH.getIngameLink(j.linkColor,j.linkId,j.linkName)}if(j.sound){t="/script PlaySoundKitID("+j.sound+")"}if(j.dressup&&j.dressup.length){t='/run local function f(i,b)DressUpItemLink("item:"..i.."::::::::::::9:"..b);end;';for(var u=0,r;r=j.dressup[u];u++){while(r.length<2){r.push(0)}t+="f("+r.shift()+","+(r.length>1?('"'+r.join(":")+'"'):r.shift())+");"}}if(t){if(h(Dialog.templates.links.fields,"ingamelink")===false){Dialog.templates.links.fields.splice(Dialog.templates.links.fields.length-1,0,{id:"ingamelink",type:"text",label:"Ingame Link",size:40})}}var n={wowheadurl:"http://www.wowhead.com/"+s+"="+j.typeId+((j.bonuses&&j.bonuses.length)?("&bonus="+j.bonuses.join(":")):"")+(j.lvl?"&lvl="+j.lvl:"")+(j.spec?"&spec="+j.spec:""),armoryurl:"http://us.battle.net/wow/en/"+s+"/"+j.typeId,ingamelink:t,markuptag:"["+(b[j.type]||s)+"="+j.typeId+((j.bonuses&&j.bonuses.length)?(" bonus="+j.bonuses.join(":")):"")+(j.spec?" spec="+j.spec:"")+"]"};var p="";var q=h(Dialog.templates.links.fields,"simcraft");if(s=="item"&&j.slot){var l,v,p="";v=parseInt(j.slot);for(var m in g_character_slots_data){if(!g_character_slots_data.hasOwnProperty(m)){continue}l=g_character_slots_data[m];if($WH.inArray(l.itemSlots,v)>=0){p=l.simCraftName||l.name;break}}if(p){n.simcraft=p+"="+j.linkName.toLowerCase().replace(/['\.]/g,"").replace(/\W/g,"_")+",id="+j.typeId;if(j.bonuses&&j.bonuses.length&&j.bonuses[0]!=0){n.simcraft+=",bonus_id="+j.bonuses.join("/")}}}if(p){if(q===false){Dialog.templates.links.fields.splice(Dialog.templates.links.fields.length-1,0,{id:"simcraft",type:"text",label:"SimulationCraft",size:40})}}else{if(q!==false){Dialog.templates.links.fields.splice(q,1)}}c.show("links",{data:n,onShow:this.onShow,onHide:this.onHide,onSubmit:function(){return false}})};this.checkPound=function(){if(location.hash&&location.hash=="#links"){$("#open-links-button").click()}};this.init=function(){c=new Dialog();Dialog.templates.links={title:"Links",buttons:[["x",LANG.close]],fields:[{id:"wowheadurl",type:"text",label:"Wowhead URL",size:40},{id:"markuptag",type:"text",label:"Markup Tag",size:40}],onInit:function(j){},onShow:function(j){setTimeout(function(){$WH.safeSelect(j.ingamelink)},50);setTimeout(Lightbox.reveal,100)}}};function h(k,n){var l=false;for(var m,j=0;m=k[j];j++){if(m.id==n){l=j;break}}return l}$(document).ready(this.checkPound)};function li_addListMenu(g){var f=$WH.ce("span");f.className="zul-bar-user-item-list-wrapper";if(!g){f.style.position="relative";f.style.opacity=0.1;f.style.right="-400px"}var b=$WH.ce("a");b.href="javascript:;";b.id="zul-bar-user-item-lists";li_initListMenu(b);var j=$WH.ce("span");j.className="zul-bar-user-item-list-text";j.innerHTML=LANG.li_myprofiles;var c=$WH.ce("span");c.className="zul-bar-user-item-list-number";c.innerHTML=g_user.templists.length;var h=$WH.ce("span");h.className="fa fa-chevron-down";$WH.ae(b,j);$WH.ae(b,c);$WH.ae(b,h);$WH.ae(f,b);$("#zul-bar-user").prepend(f);if(!g){$(f).animate({opacity:1,right:0},{duration:1000,easing:"easeOutBounce",complete:function(){if($(document.body).hasClass("home")){var k=$WH.ce("span");k.className="zul-bar-user-item-list-warning";k.innerHTML='<a href="/account=signin">'+LANG.li_logintosave+"</a>";k.style.display="none";$WH.aef(this,k);$(k).fadeIn()}}})}}$(document).ready(function(){if(g_user.templists&&g_user.templists.length){setTimeout(li_addListMenu,1000)}});function li_initListMenu(b){var c=[];g_user.templists.sort(function(g,f){return $WH.stringCompare(g.name,f.name)});$.each(g_user.templists,function(f,g){c.push(li_generateListMenuItem(g))});$(b).addClass("hassubmenu");Menu.add(b,c)}function li_generateListUrl(b){return"/list="+b.id+"/"+b.url}function li_generateListMenuItem(f,c){var b={className:(f.mode!=1||(f.armory&&!f.errcode)?"listmanager-mode"+f.mode:"q10")};if(c&&f.region){if(f.thumbnail){b.armory="//render-"+f.region.toLowerCase()+".worldofwarcraft.com/character/"+f.thumbnail}else{if(f.race&&f.gender){b.armory="//"+f.region.toLowerCase()+".battle.net/wow/static/images/2d/avatar/"+f.race+"-"+f.gender+".jpg"}}}else{if(f.mode==1&&f.pinned){b.fontIcon="thumb-tack"}}return[f.id,f.name,li_generateListUrl(f),null,b]}function li_createList(h,c,j,b,g){$WH.assertSession();if(h==1){if(!j||!b||!g){if(c!==null){alert(LANG.li_filloutdetails)}if(c){return}var f=new Dialog();f.show("fetchlist",{data:{region:j,realm:b,character:g},onSubmit:function(k){li_createList(1,false,k.region,k.realm,k.character);return false}});return}location.href="/list/"+$WH.urlize(j+"-"+b+"-"+g,true)}else{new Ajax("/list&new",{method:"POST",params:"t="+new Date().getTime(),onSuccess:function(m,k){var l=li_onSaveTab(m,k);if(l){location.href=li_generateListUrl(l)}}})}}function li_addToSaved(z,o,B,s){z=z||window.event;var p;for(var w in g_types){if(g_types[w]==o){p=w;break}}if(!p||!B){return}if(!isNaN(B)){var r=(o=="currency"?"g_gatheredcurrencies":"g_"+o+"s");B=[$.extend({},window[r][B])];if(o=="item"){var c=$WH.ge("tt"+B[0].id);if(c&&c._bonusesBtn&&c._bonusesBtn.selectedBonus){var l=c._bonusesBtn.selectedBonus.split(":");var b=l.indexOf("u");if(b!=-1){l.splice(b,1)}if(l&&l.length>0){B[0].bonuses=l}}}}var m={},q,g={"-1":function(D,E){var k=[];if(E.bonuses&&E.bonuses.length){for(var j in E.bonuses){if(E.bonuses[j]){k.push(E.bonuses[j])}}}return(D=="item"&&(E.classs==4||E.classs==2)&&E.id)?([E.id]).concat(k):false},"-2":function(j,k){return(j=="spell"&&k.cat==-5?k.id:false)},"-3":function(j,k){return(j=="npc"&&!k.untameable&&k.npc&&k.npc.type==12?k.npc.id:(j=="npc"&&k.type==12?k.id:false))}};for(var u in g_list_tabs){m[u]=[];for(var w=0;w<B.length;++w){if(p==u){m[u].push(B[w].id)}else{if(g[u]&&(q=g[u](o,B[w]))){m[u].push(q)}}}}for(var u in m){if(m[u].length!=B.length){delete m[u]}}var A=function(K,j,I,G,E,k){var D;var F=function(P,M){var N=li_onSaveTab(P,M);if(N){var O=$("#announcement-0").empty().offset().top;if($(document).scrollTop()>O){$("body").animate({scrollTop:O},1000)}k=k?'"'+k+'"':g_list_tabs[K];new Announcement({parent:"announcement-0",text:$WH.sprintf('[span class="listmanager-announcement"][span class="icon-star"][/span]'+$WH.sprintf(LANG.li_savedtotab,k)+': [url="/list=$1/$2"]'+E+"[/url].[/span]",N.id,N.url),style:"",nocookie:1,id:"list-"+N.id})}};var J="";if(K=="-1"){for(var L=0;L<j.length;++L){J+=((J=="")?"":",")+j[L].join(":")}}else{J=j.join(",")}if(I==null){var H=new Dialog();H.show("createlist",{data:{name:E,type:K,ids:J},onSubmit:function(N){var M="/list&new&type="+N.type+"&ids="+J;new Ajax(M,{method:"POST",params:"name="+$WH.urlEncode(N.name)+"&t="+new Date().getTime(),onSuccess:F})}});return}else{if(G==null){D="/list&new-tab="+I+"&type="+K+"&ids="+J}else{D="/list="+I+"&append-tab="+G+"&ids="+J}}new Ajax(D,{method:"POST",params:"t="+new Date().getTime(),onSuccess:F})};var f=[[,LANG.li_choosealist]];for(var w in g_user.lists){var y=g_user.lists[w];if(y.mode==1){continue}var h=[];for(var u in m){for(var t=0;t<y.lists.length;++t){var n=y.lists[t];if(n.type!=u){continue}if(!h.length){h.push([,LANG.li_addtoexistingtab])}h.push([n.id,n.name,A.bind(null,u,m[u],y.id,n.id,y.name,n.name)])}}h.push([,LANG.li_createnewtab]);for(var u in m){h.push([-u,g_list_tabs[u],A.bind(null,u,m[u],y.id,null,y.name,null)])}f.push([y.id,y.name,,h])}if(g_user.canCreateList){var C=LANG.li_newlist,v=1;for(var w in g_user.lists){if(g_user.lists[w].name==C||g_user.lists[w].name==(C+" ("+v+")")){v++}}if(v>1){C+=" ("+v+")"}var h=[];h.push([,LANG.li_chooseatab]);for(var u in m){h.push([-u,g_list_tabs[u],A.bind(null,u,m[u],null,null,C,null)])}f.push([-1,LANG.li_createnewlist+"...",,h,{fontIcon:"plus"}])}if(g_user.id<1){f=[[0,LANG.li_addlogin,function(){LoginDialog.show()}]]}if(s){Menu.show(f,s)}else{Menu.showAtCursor(f,$WH.normalizeEvent(z))}}function li_onSaveTab(xhr,opt){var text=xhr.responseText;if(text.charAt(0)!="{"||text.charAt(text.length-1)!="}"){return}var list=(JSON&&JSON.parse(text))||eval(text);if(!list||!list.id){return}return list}function li_getCurrentUserList(c){if(g_user.lists&&g_user.lists.length){for(var b in g_user.lists){if(g_user.lists[b].id==c){return g_user.lists[b]}}}return null}function li_getListStatus(id,onSuccess){new Ajax("/list&status="+id+"&t="+Math.random(),{method:"POST",onSuccess:function(xhr,opt){var response=eval(xhr.response)[0];if(!response.id){return}li_setButtonStatus($WH.ge("list-status"),response);if(response.refresh){setTimeout(li_getListStatus,response.refresh,id,onSuccess);return}if(response.status==3&&onSuccess){onSuccess()}}})}function li_setButtonStatus(c,f){var g=LANG["li_status"+f.status];var h=$("#list-delete");h.hide();if(f.errcode>0){g=LANG["li_code"+f.errcode]+" #"+f.errcode;h.show()}var j="";if(f.status==1||f.status==2){j=" fa-spin";g+=LANG.colon+$WH.sprintf(LANG.li_linenumber,$WH.numberFormat(f.position))}if(c){var b=" btn-";switch(f.status){case 1:case 2:b+="warning";break;case 3:b+="success";break;case 4:b+="danger";break;case 0:default:b+="primary"}c.className=c.className.replace(/ +btn-[^ ]+\b/,b).replace(/( fa-spin)?( +status-[^ ]+\b)?/,j+" status-"+f.status);c.innerHTML=g}}function li_updateRealmSelect(g,c){$WH.ee(c);$WH.ae(c,$WH.ce("option"));if(!li_realms||!li_realms[g]){return}for(var b=0;b<li_realms[g].length;++b){var f=$WH.ce("option");$WH.st(f,li_realms[g][b]);$WH.ae(c,f)}}function li_appendSticky(){var m=$WH.ge("infobox-sticky-li");if(!m){return}var j=g_pageInfo.type;var h=g_pageInfo.typeId;if(lv_lists.length){var c=$("#infobox-lists");if(!c){c=$("th",$(m).parents().prev("tr"))}c.append(" ("+lv_lists.length+")").wrapInner($('<a href="#lists"></a>').click(function(){tabsRelated.focus(tabsRelated.getTabById("lists"));return false}))}var b=$WH.ce("div");b.style.width="150px";b.style.whiteSpace="normal";b.style.margin="0 auto";var l=$WH.arrayFilter(lv_lists,function(n){return n.user==g_user.name});if(l.length){$WH.st(b,"You have added this to");$WH.ae(b,$WH.ce("br"));for(var f=0;f<l.length;++f){if(f>4){$WH.ae(b,$WH.ct(" and "+(l.length-f)+" more."));break}var g=l[f];var k=$WH.ce("a");k.href=li_generateListUrl(g);k.className=(g.mode!=1||(g.armory&&!g.errcode)?"listmanager-mode"+g.mode:"q10");$WH.st(k,l[f].name);if(f>0){$WH.ae(b,$WH.ct(f==l.length-1?LANG.and:", "))}$WH.ae(b,k)}}else{if(g_user.id>0){$WH.st(b,LANG.li_notaddedtolistyet)}}var k=$WH.ce("a");k.href="/account=signin";if(g_user.canCreateList){k.href="javascript:;";k.onclick=(function(n){li_addToSaved.call(this,n,g_types[j],h)}).bind(k)}$WH.st(k,LANG.li_addtolist);$WH.ae(m,b);$WH.ae(m,k);li_appendSticky=function(){}}Dialog.templates.createlist={title:LANG.li_createnewlist,width:400,buttons:[["check",LANG.ok],["x",LANG.cancel]],fields:[{id:"name",label:LANG.name,required:1,type:"text"}]};Dialog.templates.fetchlist={title:LANG.li_lookupbattlenetprofile,width:400,buttons:[["check",LANG.ok],["x",LANG.cancel]],fields:[{id:"region",label:LANG.region,required:1,type:"select",options:{US:"US",EU:"EU",KR:"KR",TW:"TW",CN:"CN"},compute:function(h,g,c,j,f,b){h.id="dialog-region";$(h).change(function(){li_updateRealmSelect($(this).val(),$("#dialog-realm").get(0))})}},{id:"realm",label:LANG.realm,required:1,type:"select",options:[],compute:function(h,g,c,j,f,b){h.id="dialog-realm";li_updateRealmSelect($("#dialog-region").val(),h)}},{id:"character",label:LANG.li_character,required:1,type:"text"}]};$WH.ajaxIshRequest("/data=realms");var g_listviews={};function Listview(b){$WH.cO(this,b);if(this.id){var l=(this.tabs?"tab-":"lv-")+this.id;if(this.parent){var w=$WH.ce("div");w.id=l;$WH.ae($WH.ge(this.parent),w);this.container=w}else{this.container=$WH.ge(l)}if(this.tabs){this.container.style.display="none"}}else{return}var z=$WH.getGets();if((z.debug!=null||g_user.debug)&&g_user.roles&U_GROUP_STAFF){this.debug=true}if(this.template&&Listview.templates[this.template]){this.template=Listview.templates[this.template]}else{return}g_listviews[this.id]=this;if(this.data==null){this.data=[]}if(this.poundable==null){if(this.template.poundable!=null){this.poundable=this.template.poundable}else{this.poundable=true}}if(this.searchable==null){if(this.template.searchable!=null){this.searchable=this.template.searchable}else{this.searchable=false}}if(this.filtrable==null){if(this.template.filtrable!=null){this.filtrable=this.template.filtrable}else{this.filtrable=false}}if(this.sortable==null){if(this.template.sortable!=null){this.sortable=this.template.sortable}else{this.sortable=true}}if(this.customPound==null){if(this.template.customPound!=null){this.customPound=this.template.customPound}else{this.customPound=false}}if(this.data.length==1){this.filtrable=false;this.searchable=false}if(this.searchable&&this.searchDelay==null){if(this.template.searchDelay!=null){this.searchDelay=this.template.searchDelay}else{this.searchDelay=333}}if(this.clickable==null){if(this.template.clickable!=null){this.clickable=this.template.clickable}else{this.clickable=true}}if(this.hideBands==null){this.hideBands=this.template.hideBands}if(this.hideNav==null){this.hideNav=this.template.hideNav}if(this.hideHeader==null){this.hideHeader=this.template.hideHeader}if(this.hideCount==null){this.hideCount=this.template.hideCount}if(this.computeDataFunc==null&&this.template.computeDataFunc!=null){this.computeDataFunc=this.template.computeDataFunc}if(this.createCbControls==null&&this.template.createCbControls!=null){this.createCbControls=this.template.createCbControls}if(this.createTooltipToggle==null&&this.template.createTooltipToggle!=null){this.createTooltipToggle=this.template.createTooltipToggle}if(this.template.onBeforeCreate!=null){if(this.onBeforeCreate==null){this.onBeforeCreate=this.template.onBeforeCreate}else{this.onBeforeCreate=[this.template.onBeforeCreate,this.onBeforeCreate]}}if(this.onAfterCreate==null&&this.template.onAfterCreate!=null){this.onAfterCreate=this.template.onAfterCreate}if(this.onNoData==null&&this.template.onNoData!=null){this.onNoData=this.template.onNoData}if(this.createNote==null&&this.template.createNote!=null){this.createNote=this.template.createNote}if(this.sortOptions==null&&this.template.sortOptions!=null){this.sortOptions=this.template.sortOptions}if(this.customFilter==null&&this.template.customFilter!=null){this.customFilter=this.template.customFilter}if(this.onSearchSubmit==null&&this.template.onSearchSubmit!=null){this.onSearchSubmit=this.template.onSearchSubmit}if(this.getItemLink==null&&this.template.getItemLink!=null){this.getItemLink=this.template.getItemLink}if(this.noRowClick==null&&this.template.noRowClick!=null){this.noRowClick=this.template.noRowClick}if(this.forceBandTop==null&&this.template.forceBandTop!=null){this.forceBandTop=this.template.forceBandTop}if(this.completionText==null&&this.template.completionText!=null){this.completionText=this.template.completionText}if(this.completionText==null){this.completionText=LANG.lvcompletion}if(this.clip==null&&this.template.clip!=null){this.clip=this.template.clip}if(this.clip||this.template.compute||this.id=="topics"||this.id=="recipes"){this.debug=false}if(this.mode==null){this.mode=this.template.mode}if(this.template.noStyle!=null){this.noStyle=this.template.noStyle}if(this.nItemsPerPage==null){if(this.template.nItemsPerPage!=null){this.nItemsPerPage=this.template.nItemsPerPage}else{this.nItemsPerPage=50}}this.nItemsPerPage|=0;if(this.nItemsPerPage<=0){this.nItemsPerPage=0}this.nFilters=0;this.resetRowVisibility();if(this.mode==Listview.MODE_TILED){if(this.nItemsPerRow==null){var u=this.template.nItemsPerRow;this.nItemsPerRow=(u!=null?u:4)}this.nItemsPerRow|=0;if(this.nItemsPerRow<=1){this.nItemsPerRow=1}if(this.nextRowCheck==null){this.nextRowCheck=this.template.nextRowCheck}}else{if(this.mode==Listview.MODE_CALENDAR){this.dates=[];this.nItemsPerRow=7;this.nItemsPerPage=1;this.nDaysPerMonth=[];if(this.template.startOnMonth!=null){this.startOnMonth=this.template.startOnMonth}else{this.startOnMonth=new Date()}this.startOnMonth.setDate(1);this.startOnMonth.setHours(0,0,0,0);if(this.nMonthsToDisplay==null){if(this.template.nMonthsToDisplay!=null){this.nMonthsToDisplay=this.template.nMonthsToDisplay}else{this.nMonthsToDisplay=1}}var n=this.startOnMonth.getFullYear(),p=this.startOnMonth.getMonth();for(var r=0;r<this.nMonthsToDisplay;++r){var A=new Date(n,p+r,32);this.nDaysPerMonth[r]=32-A.getDate();for(var s=1;s<=this.nDaysPerMonth[r];++s){this.dates.push({date:new Date(n,p+r,s)})}}if(this.template.rowOffset!=null){this.rowOffset=this.template.rowOffset}}else{this.nItemsPerRow=1}}this.columns=[];for(var s=0,t=this.template.columns.length;s<t;++s){var B=this.template.columns[s],h={};$WH.cO(h,B);this.columns.push(h)}if(this.extraCols!=null){for(var s=0,t=this.extraCols.length;s<t;++s){var f=null;var c=this.extraCols[s];if(c.after||c.before){var k=$WH.inArray(this.columns,(c.after?c.after:c.before),function(j){return j.id});if(k!=-1){f=(c.after?k+1:k)}}if(f==null){f=this.columns.length}if(c.id=="debug-id"){this.columns.splice(0,0,c)}else{this.columns.splice(f,0,c)}}}this.visibility=[];var q=[],o=[];if(this.visibleCols!=null){$WH.arrayWalk(this.visibleCols,function(j){q[j]=1})}if(this.hiddenCols!=null){$WH.arrayWalk(this.hiddenCols,function(j){o[j]=1})}if($.isArray(this.sortOptions)){for(var s=0,t=this.sortOptions.length;s<t;++s){var c=this.sortOptions[s];if(q[c.id]!=null||(!c.hidden&&o[c.id]==null)){this.visibility.push(s)}}}else{for(var s=0,t=this.columns.length;s<t;++s){var c=this.columns[s];if(q[c.id]!=null||(!c.hidden&&o[c.id]==null)){this.visibility.push(s)}}}if(this.sort==null&&this.template.sort){this.sort=this.template.sort.slice(0)}if(this.sort!=null){var g=this.sort;this.sort=[];for(var s=0,t=g.length;s<t;++s){var c=parseInt(g[s]);if(isNaN(c)){var v=0;if(g[s].charAt(0)=="-"){v=1;g[s]=g[s].substring(1)}var k=$WH.inArray(this.columns,g[s],function(j){return j.id});if(k!=-1){if(v){this.sort.push(-(k+1))}else{this.sort.push(k+1)}}}else{this.sort.push(c)}}}else{this.sort=[]}if(this.debug){this.columns.splice(0,0,{id:"debug-id",compute:function(j,m){if(j.id){$WH.ae(m,$WH.ct(j.id))}},getVisibleText:function(j){if(j.id){return j.id}else{return""}},getValue:function(j){if(j.id){return j.id}else{return 0}},sortFunc:function(m,j,y){if(m.id==null){return -1}else{if(j.id==null){return 1}}return $WH.stringCompare(m.id,j.id)},name:"ID",width:"5%",tooltip:"ID"});this.visibility.splice(0,0,-1);for(var s=0,t=this.visibility.length;s<t;++s){this.visibility[s]=this.visibility[s]+1}for(var s=0,t=this.sort.length;s<t;++s){if(this.sort[s]<0){this.sort[s]=this.sort[s]-1}else{this.sort[s]=this.sort[s]+1}}}if(this.tabs){this.tabIndex=this.tabs.add(this.getTabName(),$.extend({id:this.id,onLoad:this.initialize.bind(this)},this.tabOpts));this.tabClick=Tabs.trackClick.bind(this.tabs,this.tabs.tabs[this.tabIndex])}else{this.initialize()}}Listview.MODE_DEFAULT=0;Listview.MODE_CHECKBOX=1;Listview.MODE_DIV=2;Listview.MODE_TILED=3;Listview.MODE_CALENDAR=4;Listview.MODE_FLEXGRID=5;Listview.prototype={initialize:function(){if(this.data.length){if(this.computeDataFunc!=null){for(var j=0,n=this.data.length;j<n;++j){this.computeDataFunc(this.data[j])}}}if(this.tabs){this.pounded=(this.tabs.poundedTab==this.tabIndex);if(this.pounded){this.readPound()}}else{this.readPound()}this.applySort();var h;if(this.onBeforeCreate!=null){if(typeof this.onBeforeCreate=="function"){h=this.onBeforeCreate()}else{for(var j=0;j<this.onBeforeCreate.length;++j){(this.onBeforeCreate[j].bind(this))()}}}this.noData=$WH.ce("div");this.noData.className="listview-nodata text";if(this.mode==Listview.MODE_DIV){this.mainContainer=this.mainDiv=$WH.ce("div");if(!this.noStyle){this.mainContainer.className="listview-mode-div"}}else{if(this.mode==Listview.MODE_FLEXGRID){this.mainContainer=this.mainDiv=$WH.ce("div",{className:"listview-mode-flexgrid"});this.mainContainer.setAttribute("data-cell-min-width",this.template.cellMinWidth);if(this.clickable){this.mainContainer.className+=" clickable"}var b=$(".layout");var l=parseInt(b.css("max-width"))-(parseInt(b.css("padding-left"))||0)-(parseInt(b.css("padding-right"))||0);var k=Math.floor(l/this.template.cellMinWidth);var g='.listview-mode-flexgrid[data-cell-min-width="'+this.template.cellMinWidth+'"] > div {min-width:'+this.template.cellMinWidth+"px;width:"+(100/k)+"%}";var o=Platform.isTouch()?0:40;while(k--){if(k){g+="\n@media screen and (max-width: "+(((k+1)*this.template.cellMinWidth)-1+o)+"px) {";g+='\n    .listview-mode-flexgrid[data-cell-min-width="'+this.template.cellMinWidth+'"] > div {width:'+(100/k)+"%}";g+="\n}"}}if($(".layout.has-sidebar").length){l=l-$("#sidebar").outerWidth();k=Math.floor(l/this.template.cellMinWidth);g+='\n.layout.has-sidebar .listview-mode-flexgrid[data-cell-min-width="'+this.template.cellMinWidth+'"] > div {min-width:'+this.template.cellMinWidth+"px;width:"+(100/k)+"%}";while(k--){if(k){g+="\n@media screen and (max-width: "+(((k+1)*this.template.cellMinWidth)-1+o+320)+"px) {";g+='\n    .layout.has-sidebar .listview-mode-flexgrid[data-cell-min-width="'+this.template.cellMinWidth+'"] > div {width:'+(100/k)+"%}";g+="\n}"}}}$("<style/>").text(g).appendTo(document.head)}else{this.mainContainer=this.table=$WH.ce("table");this.thead=$WH.ce("thead");this.tbody=$WH.ce("tbody");if(this.clickable){this.tbody.className="clickable"}if(this.mode==Listview.MODE_TILED||this.mode==Listview.MODE_CALENDAR){if(!this.noStyle){this.table.className="listview-mode-"+(this.mode==Listview.MODE_TILED?"tiled":"calendar")}var c=(100/this.nItemsPerRow)+"%",m=$WH.ce("colgroup"),f;for(var j=0;j<this.nItemsPerRow;++j){f=$WH.ce("col");f.style.width=c;$WH.ae(m,f)}$WH.ae(this.mainContainer,m);if(this.sortOptions){setTimeout((function(){this.updateSortArrow()}).bind(this),0)}}else{if(!this.noStyle){this.table.className="listview-mode-default"}this.createHeader();this.updateSortArrow()}$WH.ae(this.table,this.thead);$WH.ae(this.table,this.tbody)}}this.createBands();if(this.customFilter!=null){this.updateFilters()}this.updateNav();this.refreshRows();this.updateBrowseSession();if(this.onAfterCreate!=null){this.onAfterCreate(h)}},createHeader:function(){var k=$WH.ce("tr");if(this.mode==Listview.MODE_CHECKBOX){var j=$WH.ce("th"),l=$WH.ce("div"),c=$WH.ce("a");j.style.width="33px";c.href="javascript:;";c.className="listview-cb";$WH.disableOldIESelect(c);$WH.ae(c,$WH.ct(String.fromCharCode(160)));$WH.ae(l,c);$WH.ae(j,l);$WH.ae(k,j)}for(var h=0,b=this.visibility.length;h<b;++h){var g=this.visibility[h],f=this.columns[g],j=$WH.ce("th");l=$WH.ce("div"),c=$WH.ce("a"),outerSpan=$WH.ce("span"),innerSpan=$WH.ce("span");f.__th=j;if(this.filtrable&&(f.filtrable==null||f.filtrable)){c.onmouseup=Listview.headerClick.bind(this,f,g);c.onclick=c.oncontextmenu=$WH.rf}else{if(this.sortable&&(f.sortable==null||f.sortable)){c.href="javascript:;";c.onclick=this.sortBy.bind(this,g+1,false)}}if(c.onclick){c.onmouseover=Listview.headerOver.bind(this,c,f);c.onmouseout=$WH.Tooltip.hide;$WH.disableOldIESelect(c)}else{c.className="static"}if(f.width!=null){j.style.width=f.width}if(f.align!=null){j.style.textAlign=f.align}if(f.span!=null){j.colSpan=f.span}$WH.ae(innerSpan,$WH.ct(f.name?f.name:String.fromCharCode(160)));$WH.ae(outerSpan,innerSpan);$WH.ae(c,outerSpan);$WH.ae(l,c);$WH.ae(j,l);$WH.ae(k,j)}if(this.hideHeader){this.thead.style.display="none"}$WH.ae(this.thead,k)},createSortOptions:function(k){if(!$.isArray(this.sortOptions)){return}var h=$WH.ce("div");h.className="listview-sort-options";h.innerHTML=LANG.lvnote_sort;var j=$WH.ce("span");j.className="listview-sort-options-choices";var f=null;if($.isArray(this.sort)){f=this.sort[0]}var b;var c=[];for(var g=0;g<this.sortOptions.length;g++){if(this.sortOptions[g].hidden){continue}b=$WH.ce("a");b.href="javascript:;";b.innerHTML=this.sortOptions[g].name;b.onclick=this.sortGallery.bind(this,b,g+1);if(f===g+1){b.className="active"}c.push(b)}for(g=0;g<c.length;g++){$WH.ae(j,c[g])}$WH.ae(h,j);$WH.aef(k,h)},sortGallery:function(b,c){var f=$(b);f.siblings("a").removeClass("active");f.addClass("active");this.sortBy(c)},createBands:function(){var q=$WH.ce("div"),s=$WH.ce("div"),t=$WH.ce("div"),r=$WH.ce("div");this.bandTop=q;this.bandBot=s;this.noteTop=t;this.noteBot=r;q.className="listview-band-top";s.className="listview-band-bottom";this.navTop=this.createNav(true);this.navBot=this.createNav(false);t.className=r.className="listview-note";if(this.note){t.innerHTML=this.note}else{if(this.createNote){this.createNote(t,r)}}this.createSortOptions(t);if(this.debug){$WH.ae(t,$WH.ct(" ("));var c=$WH.ce("a");c.onclick=this.getList.bind(this);$WH.ae(c,$WH.ct("CSV"));$WH.ae(t,c);$WH.ae(t,$WH.ct(")"))}if(this._errors){var g=$WH.ce("small"),n=$WH.ce("b");n.className="q10 icon-report";if(t.innerHTML){n.style.marginLeft="10px"}g.onmouseover=function(b){$WH.Tooltip.showAtCursor(b,LANG.lvnote_witherrors,0,0,"q")};g.onmousemove=$WH.Tooltip.cursorUpdate;g.onmouseout=$WH.Tooltip.hide;$WH.st(n,LANG.error);$WH.ae(g,n);$WH.ae(t,g)}if(!t.firstChild&&!(this.createCbControls||this.mode==Listview.MODE_CHECKBOX)){$WH.ae(t,$WH.ct(String.fromCharCode(160)))}if(!(this.createCbControls||this.mode==Listview.MODE_CHECKBOX)){$WH.ae(r,$WH.ct(String.fromCharCode(160)))}$WH.ae(q,this.navTop);if(this.searchable){var u=this.updateFilters.bind(this,true),j=(this._truncated?LANG.lvsearchdisplayedresults:LANG.lvsearchresults),g=$WH.ce("span"),f=$WH.ce("em"),p=$WH.ce("a"),o=$WH.ce("input");g.className="listview-quicksearch";if(this.tabClick){$(g).click(this.tabClick)}$WH.ae(g,f);p.href="javascript:;";p.onclick=function(){var b=this.nextSibling;b.value="";b.placeholder=j;u()};p.style.display="none";$WH.ae(p,$WH.ce("span"));$WH.ae(g,p);$WH.disableOldIESelect(p);f.className="fa fa-search";o.setAttribute("type","text");o.placeholder=j;o.style.width=(this._truncated?"19em":"15em");$WH.onAfterTyping(o,u,this.searchDelay);o.onmouseover=function(){if($WH.trim(this.value)!=""){this.className=""}};o.onfocus=function(){this.className=""};o.onblur=function(){if($WH.trim(this.value)==""){this.value=""}};o.onkeypress=this.submitSearch.bind(this);$WH.ae(g,o);this.quickSearchBox=o;this.quickSearchGlass=f;this.quickSearchClear=p;$WH.ae(q,g)}$WH.ae(q,t);if(this.showLootSpecs){this.classSelectorDiv=$WH.ce("div");this.classSelectorDiv.id="class-selector";this.classSelectorDiv.style.paddingLeft="3px";var k="";k+='<div id="class-selector-c0" class="iconmedium active"><ins><span style="text-align: center; line-height: 30px; height: 30px; width: 30px;">'+LANG.su_note_all+'</span></ins><span><img src="'+g_staticUrl+'/images/Icon/medium/border/default.png" /></span><a href="javascript:;" data-classid="0"></a></div>';for(var m in g_file_classes){k+='<div id="class-selector-c'+m+'" class="iconmedium"><ins><img src="'+g_staticUrl+"/images/wow/icons/medium/class_"+g_file_classes[m]+'.jpg" /></ins><span><img src="'+g_staticUrl+'/images/Icon/medium/border/default.png" /></span><a href="javascript:;" data-classid="'+m+'"></a></div>'}this.classSelectorDiv.innerHTML=k;$("div.iconmedium a",this.classSelectorDiv).bind("mouseover",function(b){var w=parseInt($(b.target).attr("data-classid"));if(w){var v=g_chr_classes[w];$WH.Tooltip.showAtCursor(b,v,0,0,"q")}});$("div.iconmedium",this.classSelectorDiv).bind("mouseout",function(b){$WH.Tooltip.hide()});var h=this;$("div.iconmedium a",this.classSelectorDiv).bind("contextmenu",function(b){return false});$("div.iconmedium a",this.classSelectorDiv).bind("mousedown",function(v){var b=parseInt($(v.target).attr("data-classid"));switch(v.which){case 3:if(b&&$(v.target).parent().hasClass("active")){$(v.target).parent().removeClass("active");Listview.funcBox.filterByClass.call(h,null);$("#class-selector-c0").addClass("active")}break;default:$(".iconmedium",h.classSelectorDiv).removeClass("active");$(v.target).parent().addClass("active");Listview.funcBox.filterByClass.call(h,b);break}});$(q).append(this.classSelectorDiv);$(q).append('<div class="pad" style="clear: left;"></div>');if($WH.localStorage.get("dynamic_quest_class")){m=$WH.localStorage.get("dynamic_quest_class");$("#class-selector-c"+m+" a",this.classSelectorDiv).trigger("mousedown")}}$WH.ae(s,this.navBot);$WH.ae(s,r);if(this.createCbControls||this.mode==Listview.MODE_CHECKBOX){if(this.note&&!this.showLootSpecs){t.style.paddingBottom="5px"}this.cbBarTop=this.createCbBar(true);this.cbBarBot=this.createCbBar(false);$WH.ae(q,this.cbBarTop);$WH.ae(s,this.cbBarBot);if(!this.noteTop.firstChild&&!this.cbBarTop.firstChild){this.noteTop.innerHTML="&nbsp;"}if(!this.noteBot.firstChild&&!this.cbBarBot.firstChild){this.noteBot.innerHTML="&nbsp;"}if(this.noteTop.firstChild&&this.cbBarTop.firstChild&&!this.showLootSpecs){this.noteTop.style.paddingBottom="6px"}if(this.noteBot.firstChild&&this.cbBarBot.firstChild){this.noteBot.style.paddingBottom="6px"}}if(this.hideBands&1){q.style.display="none"}if(this.hideBands&2){s.style.display="none"}$WH.ae(this.container,this.bandTop);this.containerScroller=$WH.ce("div");this.containerScroller.className="listview-scroller";$WH.ae(this.container,this.containerScroller);if(this.clip){var l=$WH.ce("div");l.className="listview-clip";l.style.width=this.clip.w+"px";l.style.height=this.clip.h+"px";this.clipDiv=l;$WH.ae(l,this.mainContainer);$WH.ae(l,this.noData);$WH.ae(this.containerScroller,l)}else{$WH.ae(this.containerScroller,this.mainContainer);$WH.ae(this.containerScroller,this.noData)}$WH.ae(this.container,this.bandBot)},createNav:function(k){var f=$WH.ce("div"),g=$WH.ce("a"),c=$WH.ce("a"),b=$WH.ce("a"),n=$WH.ce("a"),m=$WH.ce("span"),l=$WH.ce("b"),j=$WH.ce("b"),h=$WH.ce("b");f.className="listview-nav";g.href=c.href=b.href=n.href="javascript:;";$WH.ae(g,$WH.ct(String.fromCharCode(171)+LANG.lvpage_first));$WH.ae(c,$WH.ct(String.fromCharCode(8249)+LANG.lvpage_previous));$WH.ae(b,$WH.ct(LANG.lvpage_next+String.fromCharCode(8250)));$WH.ae(n,$WH.ct(LANG.lvpage_last+String.fromCharCode(187)));$WH.disableOldIESelect(g);$WH.disableOldIESelect(c);$WH.disableOldIESelect(b);$WH.disableOldIESelect(n);g.onclick=this.firstPage.bind(this);c.onclick=this.previousPage.bind(this);b.onclick=this.nextPage.bind(this);n.onclick=this.lastPage.bind(this);if(this.mode==Listview.MODE_CALENDAR){$WH.ae(l,$WH.ct("a"));$WH.ae(m,l)}else{$WH.ae(l,$WH.ct("a"));$WH.ae(j,$WH.ct("a"));$WH.ae(h,$WH.ct("a"));$WH.ae(m,l);$WH.ae(m,$WH.ct(LANG.hyphen));$WH.ae(m,j);$WH.ae(m,$WH.ct(LANG.lvpage_of));$WH.ae(m,h)}$WH.ae(f,g);$WH.ae(f,c);$WH.ae(f,m);$WH.ae(f,b);$WH.ae(f,n);if(k){if(this.hideNav&1){f.style.display="none"}}else{if(this.hideNav&2){f.style.display="none"}}if(this.tabClick){$("a",f).click(this.tabClick)}return f},createCbBar:function(b){var c=$WH.ce("div");if(this.createCbControls){this.createCbControls(c,b)}if(this.createTooltipToggle){this.createTooltipToggle(c,b)}if(c.firstChild){c.className="listview-withselected"+(b?"":"2");$WH.ae(c,this.createToggleAll())}return c},createToggleAll:function(){var c=$WH.ce("a");c.className="listview-toggleall";var b=function(f){$WH.Tooltip.showAtCursor(f,($("td:first-child input:checkbox:not(:checked)",$(this).parents(".listview")).length?LANG.lvnote_selectall:LANG.lvnote_deselectall),0,0,"q")};c.onclick=(function(h,f,j){var g=$("td:first-child",$(this).parents(".listview"));if($("input:checkbox:not(:checked)",g).length){Listview.cbSelect.call(h,true)}else{Listview.cbSelect.call(h,false)}f.call(this,j)}).bind(c,this,b);c.onmousedown=$WH.rf;c.onmouseover=b;c.onmousemove=$WH.Tooltip.cursorUpdate;c.onmouseout=$WH.Tooltip.hide;return c},refreshRows:function(m){var c=null;switch(this.mode){case Listview.MODE_DIV:c=this.mainContainer;break;case Listview.MODE_FLEXGRID:c=this.mainDiv;break;default:c=this.tbody}if(!c){return}$WH.ee(c);if(this.nRowsVisible==0){if(!this.filtered&&!this.forceBandTop){this.bandTop.style.display=this.bandBot.style.display="none";this.mainContainer.style.display="none"}this.noData.style.display="";this.showNoData();return}var t,f,g;if(!(this.hideBands&1)){this.bandTop.style.display=""}if(!(this.hideBands&2)){this.bandBot.style.display=""}if(this.nDaysPerMonth&&this.nDaysPerMonth.length){t=0;for(var n=0;n<this.rowOffset;++n){t+=this.nDaysPerMonth[n]}f=t+this.nDaysPerMonth[n]}else{if(this.nItemsPerPage>0){t=this.rowOffset;f=Math.min(t+this.nRowsVisible,t+this.nItemsPerPage);if(this.filtered&&this.rowOffset>0){for(var n=0,p=0;n<this.data.length&&p<this.rowOffset;++n){var u=this.data[n];if(u.__hidden||u.__deleted){++t}else{++p}}f+=(t-this.rowOffset)}}else{t=0;f=this.nRowsVisible}}var o=f-t;if(this.mode==Listview.MODE_DIV){for(var l=0;l<o;++l){var n=t+l,u=this.data[n];if(!u){break}if(u.__hidden||u.__deleted){++o;continue}$WH.ae(this.mainDiv,this.getDiv(n))}}else{if(this.mode==Listview.MODE_FLEXGRID){for(var l=0;l<o;++l){var n=t+l;var s=this.data[n];if(!s){break}if(s.__hidden||s.__deleted){++o;continue}$WH.ae(this.mainDiv,this.getDiv(n))}}else{if(this.mode==Listview.MODE_TILED){var h=0,q=$WH.ce("tr");for(var l=0;l<o;++l){var n=t+l,u=this.data[n];if(!u){break}if(u.__hidden||u.__deleted){++o;continue}$WH.ae(q,this.getCell(n,m));if((++h==this.nItemsPerRow)||(this.nextRowCheck&&this.nextRowCheck(this.data[n+1],u))){$WH.ae(this.tbody,q);if(l+1<o){q=$WH.ce("tr")}h=0}}if(h!=0){for(;h<4;++h){var r=$WH.ce("td");r.className="empty-cell";$WH.ae(q,r)}$WH.ae(this.tbody,q)}}else{if(this.mode==Listview.MODE_CALENDAR){var q=$WH.ce("tr");for(var n=0;n<7;++n){var b=$WH.ce("th");$WH.st(b,LANG.date_days[n]);$WH.ae(q,b)}$WH.ae(this.tbody,q);q=$WH.ce("tr");for(var h=0;h<this.dates[t].date.getDay();++h){var r=$WH.ce("td");r.className="empty-cell";$WH.ae(q,r)}for(var l=t;l<f;++l){$WH.ae(q,this.getEvent(l));if(++h==7){$WH.ae(this.tbody,q);q=$WH.ce("tr");h=0}}if(h!=0){for(;h<7;++h){var r=$WH.ce("td");r.className="empty-cell";$WH.ae(q,r)}$WH.ae(this.tbody,q)}}else{for(var l=0;l<o;++l){var n=t+l,u=this.data[n];if(!u){break}if(u.__hidden||u.__deleted){++o;continue}$WH.ae(this.tbody,this.getRow(n,m))}}}}}this.mainContainer.style.display="";this.noData.style.display="none";$WowheadPower.attachTouchTooltips(c)},showNoData:function(){var c=this.noData;$WH.ee(c);var b=-1;if(this.onNoData){b=(this.onNoData.bind(this,c))()}if(b==-1){if(this.noDataText){$WH.ae(this.noData,$WH.ct(this.noDataText))}else{$WH.ae(this.noData,$WH.ct(this.filtered?LANG.lvnodata2:LANG.lvnodata))}}},getDiv:function(b){var c=this.data[b];if(c.__div==null||this.minPatchVersion!=c.__minPatch){this.createDiv(c,b)}return c.__div},createDiv:function(c,b){var f=$WH.ce("div");c.__div=f;if(this.minPatchVersion){c.__minPatch=this.minPatchVersion}if(this.getItemLink&&this.clickable){f.onclick=this.itemClick.bind(this,c)}(this.template.compute.bind(this,c,f,b))()},getCell:function(c,b){var f=this.data[c];if(b||f.__td==null){this.createCell(f,c)}return f.__td},createCell:function(c,b){var f=$WH.ce("td");c.__td=f;(this.template.compute.bind(this,c,f,b))()},getEvent:function(b){var c=this.dates[b];if(c.__td==null){this.createEvent(c,b)}return c.__td},createEvent:function(c,b){c.events=$WH.arrayFilter(this.data,function(h){if(h.__hidden||h.__deleted){return false}var j=$WH.getEventNextDates(h,c.date);if(j[0]&&j[1]){j[0].setHours(0,0,0,0);j[1].setHours(0,0,0,0);return j[0]<=c.date&&j[1]>=c.date}return false});var g=$WH.ce("td");c.__td=g;if(c.date.getFullYear()==g_serverTime.getFullYear()&&c.date.getMonth()==g_serverTime.getMonth()&&c.date.getDate()==g_serverTime.getDate()){g.className="calendar-today"}var f=$WH.ce("div");f.className="calendar-date";$WH.st(f,c.date.getDate());$WH.ae(g,f);f=$WH.ce("div");f.className="calendar-event";$WH.ae(g,f);(this.template.compute.bind(this,c,f,b))();if(this.getItemLink){g.onclick=this.itemClick.bind(this,c)}},getRow:function(c,b){var f=this.data[c];if(b||f.__tr==null){this.createRow(f)}return f.__tr},setRow:function(b){if(this.data[b.pos]){this.data[b.pos]=b;this.data[b.pos].__tr=b.__tr;this.createRow(this.data[b.pos]);this.refreshRows()}},createRow:function(m){var k=$WH.ce("tr");m.__tr=k;if(this.mode==Listview.MODE_CHECKBOX){var f=$WH.ce("td");if(!m.__nochk){f.className="listview-cb";f.onclick=Listview.cbCellClick;var c=$WH.ce("input");$WH.disableOldIESelect(c);c.type="checkbox";c.onclick=Listview.cbClick;if(m.__chk){c.checked=true}m.__cb=c;$WH.ae(f,c)}$WH.ae(k,f)}for(var g=0,h=this.visibility.length;g<h;++g){var j=this.visibility[g],b=this.columns[j],f=$WH.ce("td"),l;if(b.align!=null){f.style.textAlign=b.align}if(b.compute){l=(b.compute.bind(this,m,f,k,j))()}else{if(m[b.value]!=null){l=m[b.value]}else{l=-1}}if(l!=-1&&l!=null){f.insertBefore($WH.ct(l),f.firstChild)}$WH.ae(k,f)}if(this.mode==Listview.MODE_CHECKBOX&&m.__chk){k.className="checked"}if(m.frommerge==1){k.className+=" mergerow"}if(this.getItemLink){k.onclick=this.itemClick.bind(this,m)}},itemClick:function(g,f){if(this.noRowClick){return}f=$WH.normalizeEvent(f);var b=0,c=f._target;while(c&&b<3){if(c.nodeName=="A"){return}c=c.parentNode}location.href=this.getItemLink(g)},submitSearch:function(f){f=$WH.normalizeEvent(f);if(!this.onSearchSubmit||f.keyCode!=13){return}for(var c=0,b=this.data.length;c<b;++c){if(this.data[c].__hidden){continue}(this.onSearchSubmit.bind(this,this.data[c]))()}},validatePage:function(){var f=this.nItemsPerPage,c=this.rowOffset,b=this.nRowsVisible;if(c<0){this.rowOffset=0}else{if(this.mode==Listview.MODE_CALENDAR){this.rowOffset=Math.min(c,this.nDaysPerMonth.length-1)}else{this.rowOffset=this.getRowOffset(c+f>b?b-1:c)}}},getRowOffset:function(c){var b=this.nItemsPerPage;return(b>0&&c>0?Math.floor(c/b)*b:0)},resetRowVisibility:function(){for(var c=0,b=this.data.length;c<b;++c){this.data[c].__hidden=false}this.filtered=false;this.rowOffset=0;this.nRowsVisible=this.data.length},getColText:function(g,b,c){var f="";if(this.template.getVisibleText){f=$WH.trim(this.template.getVisibleText(g)+" ")}if(b.getVisibleText){return f+b.getVisibleText(g)}if(b.getValue){return f+b.getValue.call(this,g)}if(b.value){return f+g[b.value]}if(b.compute){return f+b.compute.call(this,g,$WH.ce("td"),$WH.ce("tr"),c)}return""},resetFilters:function(){for(var g=0,b=this.visibility.length;g<b;++g){var f=this.visibility[g];var c=this.columns[f];if(c.__filter){c.__th.firstChild.firstChild.className="";c.__filter=null;this.nFilters--}}},updateFilters:function(g){$WH.Tooltip.hide();this.resetRowVisibility();var A,t,f;if(this.searchable){this.quickSearchBox.parentNode.style.display="";A=$WH.trim(this.quickSearchBox.value);if(A){this.quickSearchGlass.style.display="none";this.quickSearchClear.style.display="";A=A.toLowerCase().replace(/\s+/g," ");t=A.split(" ");f=t.length}else{this.quickSearchGlass.style.display="";this.quickSearchClear.style.display="none"}}else{if(this.quickSearchBox){this.quickSearchBox.parentNode.style.display="none"}}if(!A&&this.nFilters==0&&this.customFilter==null&&this.classFilter==null){if(g){this.updateNav();this.refreshRows();this.updateBrowseSession()}return}var D={1:function(j,k){return j>k},2:function(j,k){return j==k},3:function(j,k){return j<k},4:function(j,k){return j>=k},5:function(j,k){return j<=k},6:function(j,F,k){return F<=j&&j<=k}};var s={1:function(k,j,F){return j>F},2:function(k,j,F){return k<=F&&F<=j},3:function(k,j,F){return k<F},4:function(k,j,F){return j>=F},5:function(k,j,F){return k<=F},6:function(k,j,G,F){return G<=j&&k<=F}};var r=0;for(var y=0,z=this.data.length;y<z;++y){var m=this.data[y],p=0;nSearchMatches=0,matches=[];m.__hidden=true;if(this.customFilter&&!this.customFilter(m,y)){continue}if(this.customFilter2&&!this.customFilter2(m,y)){continue}if(this.classFilter&&!this.classFilter(m,y)){continue}for(var w=0,n=this.visibility.length;w<n;++w){var q=this.visibility[w];var h=this.columns[q];if(h.__filter){var b=h.__filter,c=false;if(h.type!=null&&h.type=="range"){var E=h.getMinValue(m),C=h.getMaxValue(m);c=(s[b.type])(E,C,b.value,b.value2)}else{if(h.type==null||h.type=="num"||b.type>0){var u=null;if(h.getValue){u=h.getValue(m)}else{if(h.value){u=parseFloat(m[h.value])}}if(!u){u=0}c=(D[b.type])(u,b.value,b.value2)}else{var o=this.getColText(m,h,q);if(o){o=o.toString().toLowerCase();if(b.invert){c=o.match(b.regex)!=null}else{var B=0;for(var v=0,l=b.words.length;v<l;++v){if(o.indexOf(b.words[v])!=-1){++B}else{break}}c=(B==b.words.length)}}}}if(b.invert){c=!c}if(c){++p}else{break}}if(A){var o=this.getColText(m,h,q);if(o){o=o.toString().toLowerCase();for(var v=0,l=t.length;v<l;++v){if(!matches[v]){if(o.indexOf(t[v])!=-1){matches[v]=1;++nSearchMatches}}}}}}if(m.__alwaysvisible||((this.nFilters==0||p==this.nFilters)&&(!A||nSearchMatches==f))){m.__hidden=false;++r}}this.filtered=(r<this.data.length);this.nRowsVisible=r;if(g){this.updateNav();this.refreshRows();this.updateBrowseSession()}},changePage:function(){this.validatePage();this.refreshRows();this.updateNav();this.updatePound();this.updateBrowseSession();var b=$WH.getScroll(),f=$WH.ac(this.container);if(b.y>f[1]){scrollTo(b.x,f[1])}},firstPage:function(){this.rowOffset=0;this.changePage();return false},previousPage:function(){this.rowOffset-=this.nItemsPerPage;this.changePage();return false},nextPage:function(){this.rowOffset+=this.nItemsPerPage;this.changePage();return false},lastPage:function(){this.rowOffset=99999999;this.changePage();return false},addSort:function(b,f){var c=$WH.inArray(b,Math.abs(f),function(g){return Math.abs(g)});if(c!=-1){f=b[c];b.splice(c,1)}b.splice(0,0,f)},sortBy:function(f,b){var c=this.sortOptions||this.columns;if(f<=0||f>c.length){return}this.searchSort=false;if(Math.abs(this.sort[0])==f&&!b){this.sort[0]=-this.sort[0]}else{var g=-1;if(c[f-1].type=="text"){g=1}this.addSort(this.sort,g*f)}this.applySort();this.refreshRows();this.updateSortArrow();this.updatePound()},applySort:function(){if(this.sort.length==0){return}Listview.sort=this.sort;Listview.columns=this.columns;Listview.sortOptions=this.sortOptions;if(this.template.beforeSort){this.template.beforeSort.call(this)}if(this.indexCreated){this.data.sort(Listview.sortIndexedRows.bind(this))}else{this.data.sort(Listview.sortRows.bind(this))}this.updateSortIndex();this.updateBrowseSession()},setSort:function(c,f,b){this.searchSort=false;if(this.sort.toString()!=c.toString()){this.sort=c;this.applySort();if(f){this.refreshRows()}if(b){this.updatePound()}}},readPound:function(){if(!this.poundable||!location.hash.length){return false}var c=location.hash.substr(1);if(this.tabs){var l=c.lastIndexOf(":");if(l==-1){return false}c=c.substr(l+1)}var b=parseInt(c);if(!isNaN(b)){this.rowOffset=b;this.validatePage();if(this.poundable!=2){var h=[];var k=c.match(/(\+|\-)[0-9]+/g);if(k!=null){var g=this.sortOptions||this.columns;for(var f=k.length-1;f>=0;--f){var j=parseInt(k[f])|0;var c=Math.abs(j);if(c<=0||c>g.length){break}this.addSort(h,j)}this.setSort(h,false,false)}}if(this.tabs){this.tabs.setTabPound(this.tabIndex,this.getTabPound())}}},updateBrowseSession:function(){if((!window.JSON)||(!$WH.localStorage.isSupported())){return}if(typeof fi_filters=="undefined"&&typeof Filter=="undefined"&&location.pathname!="/search"){return}if(this.data.length<3){return}if(typeof this.getItemLink!="function"){return}var m=5;var h=location.pathname+location.search;var g=(new Date(g_serverTime.getTime()-1000*60*60*24*3)).getTime();var f=$WH.localStorage.get("lvBrowse");if(f){f=window.JSON.parse(f);for(var c=0;c<f.length;c++){if((f[c].path==h)||(f[c].when<g)){f.splice(c--,1)}}if(f.length>=m){f.splice(m-1,f.length-m-1)}}else{f=[]}var l=[],k,j=/^\/[-a-z]+=\d+/i;for(var c=0;c<this.data.length;c++){if(k=j.exec(this.getItemLink(this.data[c]))){l.push(k[0])}}if(l.length<3){return}f.unshift({path:h,hash:location.hash,when:g_serverTime.getTime(),urls:l});$WH.localStorage.set("lvBrowse",window.JSON.stringify(f))},updateSortArrow:function(){if(!this.sort.length||!this.thead||this.mode==Listview.MODE_CALENDAR||this.searchSort){return}var b=$WH.inArray(this.visibility,Math.abs(this.sort[0])-1);if(b==-1){return}if(this.mode==Listview.MODE_TILED){if(!this.sortOptions){return}var f=$(".listview-sort-options a",this.noteTop).get(b);if(this.lsa&&this.lsa!=f){this.lsa.className=""}f.className=this.sort[0]<0?"active sortdesc":"active sortasc";this.lsa=f;return}if(this.mode==Listview.MODE_CHECKBOX&&b<this.thead.firstChild.childNodes.length-1){b+=1}var c=this.thead.firstChild.childNodes[b].firstChild.firstChild.firstChild;if(this.lsa&&this.lsa!=c){this.lsa.className=""}c.className=(this.sort[0]<0?"sortdesc":"sortasc");this.lsa=c},updateSortIndex:function(){var c=this.data;for(var f=0,b=c.length;f<b;++f){c[f].__si=f}this.indexCreated=true},updateTabName:function(){if(this.tabs&&this.tabIndex!=null){this.tabs.setTabName(this.tabIndex,this.getTabName())}},updatePound:function(b){if(!this.poundable){return}var c="",g="";if(b){if(location.hash.length&&this.tabs){var f=location.hash.lastIndexOf(":");if(f!=-1&&!isNaN(parseInt(location.hash.substr(f+1)))){c=location.hash.substr(f+1)}}}else{c=this.getTabPound()}if(this.customPound){g=this.customPound}else{if(this.tabs){g=this.id}}if(c&&this.tabs){this.tabs.setTabPound(this.tabIndex,c)}location.replace("#"+g+(g&&c?":":"")+c)},updateNav:function(){var j=[this.navTop,this.navBot],n=this.nItemsPerPage,m=this.rowOffset,h=this.nRowsVisible,l=0,c=0,k=0,o=0,f=new Date();if(h>0){if(!(this.hideNav&1)){j[0].style.display=""}if(!(this.hideNav&2)){j[1].style.display=""}}else{j[0].style.display=j[1].style.display="none"}if(this.mode==Listview.MODE_CALENDAR){for(var g=0;g<this.nDaysPerMonth.length;++g){if(g==m){if(g>0){c=1}if(g>1){l=1}if(g<this.nDaysPerMonth.length-1){k=1}if(g<this.nDaysPerMonth.length-2){o=1}}}f.setTime(this.startOnMonth.valueOf());f.setMonth(f.getMonth()+m)}else{if(n){if(m>0){c=1;if(m>=n+n){l=1}}if(m+n<h){k=1;if(m+n+n<h){o=1}}}}for(var g=0;g<2;++g){var b=j[g].childNodes;b[0].setAttribute("data-visible",l?"yes":"no");b[1].setAttribute("data-visible",c?"yes":"no");b[3].setAttribute("data-visible",k?"yes":"no");b[4].setAttribute("data-visible",o?"yes":"no");b=b[2].childNodes;if(this.mode==Listview.MODE_CALENDAR){b[0].firstChild.nodeValue=LANG.date_months[f.getMonth()]+" "+f.getFullYear()}else{b[0].firstChild.nodeValue=m+1;b[2].firstChild.nodeValue=n?Math.min(m+n,h):h;b[4].firstChild.nodeValue=h}}if(!l&&!c&&!k&&!o){$(j[0]).addClass("listview-nav-nocontrols");$(j[1]).addClass("listview-nav-nocontrols")}else{$(j[0]).removeClass("listview-nav-nocontrols");$(j[1]).removeClass("listview-nav-nocontrols")}},getTabName:function(){var c=this.name,g=this.data.length;for(var f=0,b=this.data.length;f<b;++f){if(this.data[f].__hidden||this.data[f].__deleted){--g}}if(typeof this.forceQuantity=="number"||typeof this.forceQuantity=="string"){g=this.forceQuantity}if((g>0||typeof this.forceQuantity=="string")&&!this.hideCount){c+=$WH.sprintf(LANG.qty,g)}return c},getTabPound:function(){var b="";b+=this.rowOffset;if(this.poundable!=2&&this.sort.length){b+=("+"+this.sort.join("+")).replace(/\+\-/g,"-")}return b},getCheckedRows:function(){var g=[];for(var f=0,b=this.data.length;f<b;++f){var c=this.data[f];if((c.__cb&&c.__cb.checked)||(!c.__cb&&c.__chk)){g.push(c)}}return g},resetCheckedRows:function(){for(var f=0,b=this.data.length;f<b;++f){var c=this.data[f];if(c.__cb){c.__cb.checked=false}else{if(c.__chk){c.__chk=null}}if(c.__tr){c.__tr.className=c.__tr.className.replace("checked","")}}},deleteRows:function(f){if(!f||!f.length){return}for(var c=0,b=f.length;c<b;++c){var g=f[c];if(!g.__hidden&&!g.__hidden){this.nRowsVisible-=1}g.__deleted=true}this.updateTabName();if(this.rowOffset>=this.nRowsVisible){this.previousPage()}else{this.refreshRows();this.updateNav();this.updateBrowseSession()}},setData:function(b){this.data=b;this.indexCreated=false;this.resetCheckedRows();this.resetRowVisibility();if(this.tabs){this.pounded=(this.tabs.poundedTab==this.tabIndex);if(this.pounded){this.readPound()}}else{this.readPound()}this.applySort();this.updateSortArrow();if(this.customFilter!=null||this.classFilter!=null){this.updateFilters()}this.updateNav();this.refreshRows();this.updateBrowseSession()},getClipDiv:function(){return this.clipDiv},getNoteTopDiv:function(){return this.noteTop},getNoDataDiv:function(){return this.noData},focusSearch:function(){$WH.safeFocus(this.quickSearchBox)},clearSearch:function(){this.quickSearchBox.value=""},getList:function(){if(!this.debug){return}var c="";for(var b=0;b<this.data.length;b++){if(!this.data[b].__hidden){c+=this.data[b].id+", "}}listviewIdList.show(c)},createIndicator:function(b,h,l,k){if(!this.noteIndicators){this.noteIndicators=$WH.ce("div");this.noteIndicators.className="listview-indicators";$(this.noteIndicators).insertBefore($(this.noteTop))}var g=this.tabClick;var j=$('<span class="indicator"></span>').html(b).append(!h?"":$('<a class="indicator-x" style="outline: none">[x]</a>').attr("href",(typeof h=="function"?"javascript:;":h)).click(function(){if(g){g()}if(typeof h=="function"){h()}})).css("cursor",(typeof l=="function"?"pointer":null)).click(function(){if(g){g()}if(typeof l=="function"){l()}});if(k){$WH.Tooltip.simple(j.get(0),k,"q")}$(this.noteIndicators).append(j);$(this.noteTop).css("padding-top","7px");if(!this.showLootSpecs){$(this.noteTop).css("padding-bottom","11px")}return j[0]},removeIndicators:function(){if(this.noteIndicators){$(this.noteIndicators).remove();this.noteIndicators=null}$(this.noteTop).css("padding-top","")},createProgressBar:function(t,s,c,p,r,h){if(!this.noteProgressBars){this.noteProgressBars=$WH.ce("table");this.noteProgressBars.className="listview-progressbars";$(this.noteProgressBars).insertBefore($(this.noteTop))}var n=4;if(isNaN(r)||r<1){r=1}if(r>n){r=n}var q=this.noteProgressBars.lastChild,k=r;if(q&&q.childNodes){for(var j=0;j<q.childNodes.length;++j){k+=(q.childNodes[j].colSpan||1)}}if(!q||k>n){q=$WH.ce("tr");$WH.ae(this.noteProgressBars,q)}var f=$WH.ce("td");if(r>1){f.colSpan=r}if(c){f.className="clickable";f.onclick=function(){c.apply(this,p)}}if(t){var b=$WH.ce("div");b.className="heading";$WH.st(b,t);$WH.ae(f,b)}var g=$WH.ce("div");g.className="bar-wrap";var l=$WH.ce("div");l.className="bar-bg";$WH.ae(g,l);if(s[2]){var o=$WH.ce("div");o.className="bar yellow";o.style.width=Math.round(((s[1]+s[2]+s[5])/s[0])*1000)/10+"%";$WH.ae(g,o)}var o=$WH.ce("div");o.className="bar";o.style.width=Math.round(((s[1]+s[5])/s[0])*1000)/10+"%";if(h){o.className+=" "+h}$WH.ae(g,o);if(s[5]){var o=$WH.ce("div");o.className="bar gray";o.style.width=Math.round((s[5]/s[0])*1000)/10+"%";$WH.ae(g,o)}else{s[5]=0}var m=$WH.ce("span");$WH.st(m,(s[1]+s[5])+(s[2]||s[3]?" ("+(s[3]||s[2])+")":"")+" / "+s[0]);$WH.ae(g,m);$WH.ae(f,g);$WH.ae(q,f);$(this.noteTop).css("padding-top","")},removeProgressBars:function(){if(this.noteProgressBars){$(this.noteProgressBars).remove();this.noteProgressBars=null}$(this.noteTop).css("padding-top","")},addTooltipToggle:function(k,j){if(!g_user.premium){return}var f=false;for(var b=0;b<this.data.length;b++){if(j[this.data[b].id]&&j[this.data[b].id].hasOwnProperty("screenshot")){f=true;break}}if(!f){return}$WH.Tooltip.hideScreenshots=true;if($WH.localStorage.isSupported()){$WH.Tooltip.hideScreenshots=$WH.localStorage.get("tooltipScreenshots")!="1"}var h=function(){$WH.Tooltip.hideScreenshots=!this.checked;if($WH.localStorage.isSupported()){if(this.checked){$WH.localStorage.set("tooltipScreenshots","1")}else{$WH.localStorage.remove("tooltipScreenshots")}}$("input[type=checkbox].tooltipToggle").prop("checked",!!this.checked)};var c=$WH.ce("label");var g=$WH.ce("input");g.type="checkbox";g.className="tooltipToggle";g.checked=!$WH.Tooltip.hideScreenshots;$WH.aE(g,"click",h.bind(g));$WH.ae(c,g);$WH.ae(c,$WH.ct(LANG.lvnote_screenshottooltips));$WH.ae(k,c)},noteTopFormIsEmpty:function(){var b=true;$("input, select",this.noteTop).each(function(){switch(this.tagName){case"INPUT":if(this.value){b=false;return false}break;case"SELECT":if($(this).val()){b=false;return false}break}});return b}};Listview.sortRows=function(g,f){var l=Listview.sort,m=Listview.sortOptions||Listview.columns;if(this.searchSort&&g.hasOwnProperty("searchpopularity")&&f.hasOwnProperty("searchpopularity")&&((g.searchpopularity>0)||(f.searchpopularity>0))){return $WH.stringCompare(f.searchpopularity,g.searchpopularity)}for(var k=0,c=l.length;k<c;++k){var j,h=m[Math.abs(l[k])-1];if(!h){h=this.template}if(h.sortFunc){j=h.sortFunc.call(this,g,f,l[k])}else{j=$WH.stringCompare(g[h.value],f[h.value])}if(j!=0){return j*l[k]}}return 0};Listview.sortIndexedRows=function(g,f){var j=Listview.sort,k=Listview.sortOptions||Listview.columns,h;if(this.searchSort&&g.hasOwnProperty("searchpopularity")&&f.hasOwnProperty("searchpopularity")&&((g.searchpopularity>0)||(f.searchpopularity>0))){return $WH.stringCompare(f.searchpopularity,g.searchpopularity)}for(var c in j){_=k[Math.abs(j[c])-1];if(!_){_=this.template}if(_.sortFunc){h=_.sortFunc.call(this,g,f,j[0])}else{h=$WH.stringCompare(g[_.value],f[_.value])}if(h!=0){return h*j[c]}}return(g.__si-f.__si)};Listview.cbSelect=function(f){for(var h=0,c=this.data.length;h<c;++h){var g=this.data[h];var k=f;if(g.__hidden){continue}if(!g.__nochk&&g.__cb){var b=g.__cb,j=b.parentNode.parentNode;if(k==null){k=!b.checked}if(b.checked!=k){b.checked=k;j.className=(b.checked?j.className+" checked":j.className.replace("checked",""))}}else{if(k==null){k=true}}g.__chk=k}};Listview.cbClick=function(b){setTimeout(Listview.cbUpdate.bind(0,0,this,this.parentNode.parentNode),1);$WH.sp(b)};Listview.cbCellClick=function(b){setTimeout(Listview.cbUpdate.bind(0,1,this.firstChild,this.parentNode),1);$WH.sp(b)};Listview.cbUpdate=function(f,b,c){if(f){b.checked=!b.checked}c.className=(b.checked?c.className+" checked":c.className.replace("checked",""))};Listview.cbAddToList=function(b,c){var f=this.getCheckedRows();if(!f.length){return}li_addToSaved(b,c,f)};Listview.headerClick=function(b,c,f){f=$WH.normalizeEvent(f);if(this.tabClick){this.tabClick()}if(f._button==3||f.shiftKey||f.ctrlKey){$WH.Tooltip.hide();setTimeout(Listview.headerFilter.bind(this,b,null),1)}else{this.sortBy(c+1)}return false};Listview.headerFilter=function(c,h){var m="";if(c.__filter){if(c.__filter.invert){m+="!"}m+=c.__filter.text}if(h==null){var h=prompt($WH.sprintf(LANG.prompt_colfilter1+(c.type=="text"?LANG.prompt_colfilter2:LANG.prompt_colfilter3),c.name),m)}if(h!=null){var g={text:"",type:-1};h=$WH.trim(h.replace(/\s+/g," "));if(!h&&this.onEmptyFilter){this.onEmptyFilter(c)}else{if(h){if(h.charAt(0)=="!"||h.charAt(0)=="-"){g.invert=1;h=h.substr(1)}if(c.type=="text"){g.type=0;g.text=h;if(g.invert){g.regex=$WH.createOrRegex(h)}else{g.words=h.toLowerCase().split(" ")}}var l,b;if(h.match(/(>|=|<|>=|<=)\s*([0-9\.]+)/)){l=parseFloat(RegExp.$2);if(!isNaN(l)){switch(RegExp.$1){case">":g.type=1;break;case"=":g.type=2;break;case"<":g.type=3;break;case">=":g.type=4;break;case"<=":g.type=5;break}g.value=l;g.text=RegExp.$1+" "+l}}else{if(h.match(/([0-9\.]+)\s*\-\s*([0-9\.]+)/)){l=parseFloat(RegExp.$1);b=parseFloat(RegExp.$2);if(!isNaN(l)&&!isNaN(b)){if(l>b){var j=l;l=b;b=j}if(l==b){g.type=2;g.value=l;g.text="= "+l}else{g.type=6;g.value=l;g.value2=b;g.text=l+" - "+b}}}else{var f=h.toLowerCase().split(" ");if(!c.allText&&f.length==1&&!isNaN(l=parseFloat(f[0]))){g.type=2;g.value=l;g.text="= "+l}else{if(c.type=="text"){g.type=0;g.text=h;if(g.invert){g.regex=$WH.createOrRegex(h)}else{g.words=f}}}}}if(g.type==-1){alert(LANG.message_invalidfilter);return}}}if(!c.__filter||g.text!=c.__filter.text||g.invert!=c.__filter.invert){var k=c.__th.firstChild.firstChild;if(h&&g.text){if(!c.__filter){k.className="q5";this.nFilters++}c.__filter=g}else{if(c.__filter){k.className="";this.nFilters--}c.__filter=null}this.updateFilters(1)}}};Listview.headerOver=function(b,c,g){if(!((this.sortable&&(c.sortable==null||c.sortable))||(this.filtrable&&(c.filtrable==null||c.filtrable)))){return}var f="";f+='<b class="q1">'+(c.tooltip?c.tooltip:c.name)+"</b>";if(c.__filter){f+="<br />"+$WH.sprintf((c.__filter.invert?LANG.tooltip_colfilter2:LANG.tooltip_colfilter1),c.__filter.text)}f+='<br /><span class="q2">'+LANG.tooltip_lvheader1+"</span>";if(this.filtrable&&(c.filtrable==null||c.filtrable)){f+='<br /><span class="q2">'+($WH.Browser.opera?LANG.tooltip_lvheader3:LANG.tooltip_lvheader2)+"</span>"}$WH.Tooltip.show(b,f,0,0,"q")};Listview.extraCols={id:{id:"id",name:"ID",width:"5%",compute:function(b,c){if(b.id){$WH.ae(c,$WH.ct(b.id))}}},patch:{id:"obj-patch",name:LANG.patch,compute:function(h,k){if(typeof h.patch!="undefined"){var b=parseInt(h.patch);if(b==0||b==-1){$WH.ae(k,$WH.ct("???"))}else{var c=Math.floor(b/10000);var g=Math.floor(b/100)%100;var j=b%100;var f=$WH.sprintf("$1.$2.$3",c,g,j);$WH.ae(k,$WH.ct(f))}}},sortFunc:function(f,c,g){if(f.patch==c.patch){return 0}else{if(f.patch<c.patch){return -1}else{return 1}}}},date:{id:"obj-date",name:LANG.added,compute:function(f,g){if(f.date){if(f.date<=86400){$WH.ae(g,$WH.ct("???"))}else{var b=new Date(f.date*1000);var c=(g_serverTime-b)/1000;return $WH.formatDate(g,c,b,null,true)}}},sortFunc:function(f,c,g){if(f.date==c.date){return 0}else{if(f.date<c.date){return -1}else{return 1}}}},cost:{id:"cost",name:LANG.cost,getValue:function(b){if(b.cost){return(b.cost[2]&&b.cost[2][0]?b.cost[2][0][1]:0)||(b.cost[1]&&b.cost[1][0]?b.cost[1][0][1]:0)||b.cost[0]}},compute:function(j,k){if(j.cost){var g=j.cost[0];var f=null;var c=j.cost[2];var b=j.cost[1];var h=0;if(j.side!=null){f=j.side}else{if(j.react!=null){if(j.react[0]==1&&j.react[1]==-1){f=1}else{if(j.react[0]==-1&&j.react[1]==1){f=2}}}}Listview.funcBox.appendMoney(k,g,f,c,b,h)}},sortFunc:function(f,c,g){if(f.cost==null){return -1}else{if(c.cost==null){return 1}}var l=0,k=0,j=0,h=0;if(f.cost[2]!=null){$WH.arrayWalk(f.cost[2],function(b,m,o,n){l+=Math.pow(10,n)+b[1]})}if(c.cost[2]!=null){$WH.arrayWalk(c.cost[2],function(b,m,o,n){k+=Math.pow(10,n)+b[1]})}if(f.cost[1]!=null){$WH.arrayWalk(f.cost[1],function(b,m,o,n){j+=Math.pow(10,n)+b[1]})}if(c.cost[1]!=null){$WH.arrayWalk(c.cost[1],function(b,m,o,n){h+=Math.pow(10,n)+b[1]})}return $WH.stringCompare(l,k)||$WH.stringCompare(j,h)||$WH.stringCompare(f.cost[0],c.cost[0])}},count:{id:"count",name:LANG.count,value:"count",compute:function(c,f){if(!(this._totalCount>0||c.outof>0)){return}if(c.outof){var b=$WH.ce("div");b.className="small q0";$WH.ae(b,$WH.ct($WH.sprintf(LANG.lvdrop_outof,c.outof)));$WH.ae(f,b)}return c.count>0?c.count:"??"},getVisibleText:function(b){var c=b.count;if(b.outof){c+=" "+b.outof}return c},sortFunc:function(f,c,g){if(f.count==null){return -1}else{if(c.count==null){return 1}}return $WH.stringCompare(f.count,c.count)}},percent:{id:"percent",name:"%",value:"percent",compute:function(row,td){var personalLootDifficulty=this.selectedDifficulty==5||this.selectedDifficulty==17;if((row.modes&&personalLootDifficulty)||(g_pageInfo&&g_pageInfo.type==1&&g_world_bosses[g_pageInfo.typeId])||(g_pageInfo&&g_pageInfo.type==3&&(g_world_bosses[row.id]||row.personal_loot))){$(td).addClass("tip").mouseover(function(event){$WH.Tooltip.showAtCursor(event,LANG.personal_loot_tt,0,0,"q")}).mousemove(function(event){$WH.Tooltip.cursorUpdate(event)}).mouseout(function(){$WH.Tooltip.hide()});return LANG.personal_loot_abbrev}if(row.count<=0){return"??"}if(row.pctstack){var text="";var data=eval("("+row.pctstack+")");for(var amt in data){var pct=(data[amt]*row.percent)/100;if(pct>=1.95){pct=parseFloat(pct.toFixed(0))}else{if(pct>=0.195){pct=parseFloat(pct.toFixed(1))}else{pct=parseFloat(pct.toFixed(2))}}text+=$WH.sprintf(LANG.stackof_format,amt,pct)+"<br />"}$(td).addClass("tip").mouseover(function(event){$WH.Tooltip.showAtCursor(event,text,0,0,"q")}).mousemove(function(event){$WH.Tooltip.cursorUpdate(event)}).mouseout(function(){$WH.Tooltip.hide()})}var value=parseFloat(row.percent.toFixed(row.percent>=1.95?0:(row.percent>=0.195?1:2)));if(row.pctstack){$(td).append($("<span>").addClass("tip").text(value))}else{return value}},getVisibleText:function(b){if(b.count<=0){return"??"}if(b.percent>=1.95){return b.percent.toFixed(0)}else{if(b.percent>=0.195){return parseFloat(b.percent.toFixed(1))}else{return parseFloat(b.percent.toFixed(2))}}},sortFunc:function(g,c,h){if(g.count==null){return -1}else{if(c.count==null){return 1}}if(g.percent>=1.95){var f=g.percent.toFixed(0)}else{if(g.percent>=0.195){f=parseFloat(g.percent.toFixed(1))}else{f=parseFloat(g.percent.toFixed(2))}}if(c.percent>=1.95){var j=c.percent.toFixed(0)}else{if(c.percent>=0.195){j=parseFloat(c.percent.toFixed(1))}else{j=parseFloat(c.percent.toFixed(2))}}return $WH.stringCompare(f,j)}},stock:{id:"stock",name:LANG.stock,width:"10%",value:"stock",compute:function(b,c){if(b.stock>0){return b.stock}else{return String.fromCharCode(8734)}},getVisibleText:function(b){if(b.stock>0){return b.stock}else{return String.fromCharCode(8734)+" infinity"}}},currency:{id:"currency",name:LANG.currency,getValue:function(b){if(b.currency){return(b.currency[0]?b.currency[0][1]:0)}},compute:function(c,f){if(c.currency){var b=null;if(c.side!=null){b=c.side}else{if(c.react!=null){if(c.react[0]==1&&c.react[1]==-1){b=1}else{if(c.react[0]==-1&&c.react[1]==1){b=2}}}}Listview.funcBox.appendMoney(f,null,b,null,c.currency)}},sortFunc:function(f,c,g){if(f.currency==null){return -1}else{if(c.currency==null){return 1}}var j=0,h=0;$WH.arrayWalk(f.currency,function(b,k,m,l){j+=Math.pow(10,l)+b[1]});$WH.arrayWalk(c.currency,function(b,k,m,l){h+=Math.pow(10,l)+b[1]});return $WH.stringCompare(j,h)}},mode:{id:"mode",name:"Mode",after:"name",type:"text",compute:function(f,g){if(f.modes&&f.modes.mode){if(this.validateBonuses){for(var b in this.validateBonuses){if($WH.inArray(f.bonustrees,this.validateBonuses[b])!=-1){if(this.diffLangref&&this.diffLangref[this.selectedDifficulty]){return this.diffLangref[this.selectedDifficulty]}else{break}}}}if(f.bonustrees&&this.diffLangref&&this.diffLangref[this.selectedDifficulty]){return this.diffLangref[this.selectedDifficulty]}var c=[983040,65784];if(((f.modes.mode&c[0])==c[0])||((f.modes.mode&c[1])==c[1])||(f.modes.mode&3)==3){return LANG.su_note_all}return Listview.extraCols.mode.getVisibleText(f)}},getVisibleText:function(r){var b=r.modes.mode&983040;if(b){switch(b){case 65536:return LANG.tab_normal;case 131072:return LANG.tab_heroic;case 262144:return LANG.tab_mythic;case 524288:return LANG.tab_raidfinder;default:break}}else{var h=!!(r.modes.mode&26);var k=!!(r.modes.mode&97);var m=!!(r.modes.mode&33554432);var j=!!(r.modes.mode&67108864);var p=!!(r.modes.mode&40);var g=!!(r.modes.mode&80);var f=!!(r.modes.mode&128);var c=(r.modes.mode&65787)==128;var n=!!(r.modes.mode&65536);var l=(r.modes.mode&65787)==65536;var o;if(p&&!g){o=10}else{if(g&&!p){o=25}}var q;if(h&&!k&&!m&&!j){q="normal"}else{if(k&&!h&&!m&&!j){q="heroic"}else{if(m&&!h&&!k&&!j){q="mythic"}}}if(q&&!f&&!n){if(o&&!m){return $WH.sprintf(LANG["tab_"+q+"X"],o)}else{return LANG["tab_"+q]}}if(o&&!f&&!n){return $WH.sprintf(LANG.lvzone_xman,o)}if(c){return LANG.tab_raidfinder}if(l){return LANG.tab_flexible}}return LANG.su_note_all},sortFunc:function(f,c,g){return -$WH.stringCompare(Listview.extraCols.mode.compute.call(this,f),Listview.extraCols.mode.compute.call(this,c))}},requires:{id:"requires",name:LANG.requires,type:"text",compute:function(c,f){if(c.achievement&&g_achievements[c.achievement]){$WH.noWrap(f);f.className="small";f.style.lineHeight="18px";var b=$WH.ce("a");b.href="/achievement="+c.achievement;b.className="icontiny tinyspecial";b.style.backgroundImage="url("+g_staticUrl+"/images/wow/icons/tiny/"+g_achievements[c.achievement].icon.toLowerCase()+".gif)";b.style.whiteSpace="nowrap";$WH.st(b,g_achievements[c.achievement]["name_"+Locale.getName()]);$WH.ae(f,b)}},getVisibleText:function(b){if(b.achievement&&g_achievements[b.achievement]){return g_achievements[b.achievement].name}},sortFunc:function(f,c,g){return $WH.stringCompare(this.getVisibleText(f),this.getVisibleText(c))}},reqskill:{id:"reqskill",name:LANG.skill,width:"10%",value:"reqskill",before:"yield"},yield:{id:"yield",name:LANG.yields,type:"text",align:"left",span:2,value:"name",compute:function(g,j,f){if(g.yield&&g_items[g.yield]){var c=$WH.ce("td");c.style.width="1px";c.style.paddingRight="0";c.style.borderRight="none";$WH.ae(c,g_items.createIcon(g.yield,1));$WH.ae(f,c);j.style.borderLeft="none";var h=$WH.ce("div");var b=$WH.ce("a");b.href="/item="+g.yield;b.className="q"+g_items[g.yield].quality;$WH.ae(b,$WH.ct(g_items[g.yield]["name_"+Locale.getName()]));$WH.ae(h,b);$WH.ae(j,h)}},getVisibleText:function(b){if(b.yield&&g_items[b.yield]){return g_items[b.yield]["name_"+Locale.getName()]}},sortFunc:function(f,c,g){if(!f.yield||!g_items[f.yield]||!c.yield||!g_items[c.yield]){return(f.yield&&g_items[f.yield]?1:(c.yield&&g_items[c.yield]?-1:0))}return -$WH.stringCompare(g_items[f.yield].quality,g_items[c.yield].quality)||$WH.stringCompare(g_items[f.yield]["name_"+Locale.getName()],g_items[c.yield]["name_"+Locale.getName()])}},compare:{id:"compare",name:LANG.completion,getValue:function(b){return Math.floor(b.compare.progress*100)},compute:function(c,f,b){$WH.ae(f,Listview.funcBox.getComparisonText(c.compare,this.completionMode,this.dataSource,this.completionText))},sortFunc:function(f,c,g){return f.compare.progress-c.compare.progress}},modify:{id:"modify",sortable:0,filtrable:0,compute:function(f,g,c){if(this.createModifyButton){g.style.cursor="default";$(g).click(function(h){h.stopPropagation()});var b=$WH.ce("a");b.href="javascript:;";b.className="icon-edit";b.innerHTML=LANG.li_menu_modify;$WH.ae(g,this.createModifyButton(f,b))}}},bpetquality:{id:"quality",name:LANG.quality,compute:function(f,g,c){var b=(f.compare.data[0].bpet&&f.compare.data[0].bpet.id)?g_item_qualities[f.compare.data[0].bpet.quality]:"";$WH.ae(g,$WH.ct(b))},sortFunc:function(g,f,h){var c=(g.compare.data[0].bpet&&g.compare.data[0].bpet.id)?g.compare.data[0].bpet.quality:-1;var j=(f.compare.data[0].bpet&&f.compare.data[0].bpet.id)?f.compare.data[0].bpet.quality:-1;return c-j}}};Listview.templates={};Listview.funcBox={smartNoDataSearchText:function(b){b.innerHTML=this.noteTopFormIsEmpty&&this.noteTopFormIsEmpty()?LANG.lv_search:LANG.lvnodata2},getCurrentItemBonuses:function(g){var k=[];var l=g.bonuses?g.bonuses:(this.itemBonusesFromDD?this.itemBonusesFromDD:null);var h=!g.bonuses&&this.itemBonusesFromDD;var f=h?this.validateBonuses:[];if((!l||!l.length)&&g.context){var c=Listview.funcBox.getBonusDataForContext.call(this,g.context);if(c.length==2){l=c[0];f=c[1];h=true}}if(l){for(var b in l){var j=l[b];if(($WH.inArray(k,j)==-1)&&(!h||($WH.inArray(g.bonustrees,f[b])!=-1))){k.push(j)}}}return k},getItemLevelWithBonuses:function(o){var j=o.level;var f=false;var h=false;var c=Listview.funcBox.getCurrentItemBonuses.call(this,o);if(c.length>0&&$WH.isSet("g_itembonuses")){for(var m in c){var g=c[m];if(g_itembonuses[g]){$WH.arrayWalk(g_itembonuses[g],function(q){switch(q[0]){case 1:j+=q[1];break;case 11:case 13:f=q[1];break;case 14:h=q[1];break}})}}}if(f){var k=$WH.convertScalingFactor.SD;var b=k?k[f]:null;if(b&&b[21]){var l=b[21];var p=(($WH.maxLevel<=l)?$WH.maxLevel:l);var n=Math.round($WH.getCurveValue(b[22],p));if(n){return n}}}if(h&&(j==o.level)){return h}return j},filterByClass:function(c){if(c){$WH.localStorage.set("dynamic_quest_class",c);this.classFilter=function(g){for(var f in g.specs){if($WH.inArray(g_chr_specs_by_class[c],g.specs[f])!=-1){return true}}return false};if(!$WH.isSet("g_filterByClassAchievement")){if(!($WH.isSet("g_user")&&g_user.id)){return}$.ajax({url:"/website-achievement-explored",data:{trigger:"bosslootfilter"},success:function(){AchievementCheck()},type:"POST"});window.g_filterByClassAchievement=true}}else{$WH.localStorage.remove("dynamic_quest_class");this.classFilter=null;for(var b in this.data){this.data[b].__tr=null}}this.updateFilters(1);this.applySort();this.refreshRows(true)},createSimpleCol:function(f,g,b,c){return{id:f,name:(LANG[g]!==undefined?LANG[g]:g),width:b,value:c}},initLootTable:function(c){var b;if(this._totalCount!=null){b=this._totalCount}else{b=c.outof}if(b==0){if(c.count!=-1){c.percent=c.count}else{c.percent=0}}else{c.percent=c.count/b*100}(Listview.funcBox.initModeFilter.bind(this,c))()},initModeFilter:function(c){if(this._lootModes==null){this._lootModes={99:0}}if(this._distinctModes==null){this._distinctModes={99:0}}if((!c.modes||c.modes.mode==4)&&c.classs!=12&&c.commondrop){this._lootModes[99]++;this._distinctModes[99]++}else{if(c.modes){for(var b=-2;b<=24;++b){if(this._lootModes[b]==null){this._lootModes[b]=0}if(c.modes.mode&1<<parseInt(b)+2){this._lootModes[b]++}}if(this._distinctModes[c.modes.mode]==null){this._distinctModes[c.modes.mode]=0}this._distinctModes[c.modes.mode]++}}},addModeIndicator:function(){var b=0;for(var n in this._distinctModes){if(this._distinctModes[n]){b++}}if(this._distinctModes[4]&&b<2){return}var h=location.hash.match(/:mode=([^:]+)/),g=[0,-1,-2,23,24,1,3,2,4,5,14,15,16,17,99],q={"-2":LANG.tab_heroic,"-1":LANG.tab_normal,0:LANG.tab_noteworthy,1:$WH.sprintf(LANG.tab_normalX,10),2:$WH.sprintf(LANG.tab_normalX,25),3:$WH.sprintf(LANG.tab_heroicX,10),4:$WH.sprintf(LANG.tab_heroicX,25),5:LANG.tab_raidfinder,14:LANG.tab_normal,15:LANG.tab_heroic,16:LANG.tab_mythic,17:LANG.tab_raidfinder,23:LANG.tab_mythic,24:LANG.tab_timewalking,99:""},s={};this.diffLangref={};$.extend(this.diffLangref,q);if(WAS.showAds()){s[1]=q[1];s[2]=q[2];s[3]=q[3];s[4]=q[4];s[5]=q[5];q[1]=LANG.lvitem_normal+10;q[2]=LANG.lvitem_normal+25;q[3]=LANG.lvitem_heroic+10;q[4]=LANG.lvitem_heroic+25;q[5]=LANG.lvitem_lfr;q[14]=LANG.lvitem_normal;q[15]=LANG.lvitem_heroic;q[16]=LANG.lvitem_mythic;q[17]=LANG.lvitem_lfr;q[23]=LANG.lvitem_mythic;q[24]=LANG.lvitem_timewalking}var k=this,c=[],r;var p=function(v,f,j){$WH.setSelectedLink(this,"lootmode-"+k.tabIndex);k.selectedDifficulty=f;var u=Listview.funcBox.getItemBonusesForDifficulty.call(k,f);k.itemBonusesFromDD=u[0];k.validateBonuses=u[1];k.customPound=k.id+(f!=null?":mode="+$WH.urlize(q[f].replace(" ","")):"");k.customFilter=function(w){return Listview.funcBox.filterMode(w,k._totalCount,v)};k.updateFilters(1);k.applySort();k.refreshRows(true);if(j){k.updatePound(1)}};var m=null;for(var l=0,o=g.length;l<o;++l){var n=g[l];if(!this._lootModes[n]){continue}r=$("<a><span>"+q[n]+"</span> ("+this._lootModes[n]+")</a>");r[0].f=p.bind(r[0],1<<n+2,n,1);r.click(r[0].f);if(n==-2||n==3||n==4||n==15||n==16||n==23){r.addClass("icon-heroic")}c.push({indicator:$('<span class="indicator-mode"></span>').append(r).append($("<b"+(n<-1||n>2?' class="icon-heroic"':"")+">"+q[n]+" ("+this._lootModes[n]+")</b>")),tooltip:s[n]});if(c.length==1){m=p.bind(r[0],1<<n+2,n,0)}if(h&&h[1]==$WH.urlize(q[n].replace(" ",""))){(r[0].f)()}}if(m&&(!$WH.setSelectedLink.groups||!$WH.setSelectedLink.groups["lootmode-"+k.tabIndex])){m()}var t=false;for(var n=0,o=c.length;n<o;++n){r=$("a",c[n].indicator);if(!$("span",r).html()&&c.length==3){t=true}else{this.createIndicator(c[n].indicator,null,r[0].f,c[n].tooltip)}}if(t){m()}if(this.showLootSpecs){this.classSelectorDiv.style.marginTop="0px"}$(this.noteTop).append($('<div class="clear"></div>'))},filterMode:function(g,c,f){if(c!=null&&g.count!=null){if(g._count==null){g._count=g.count}var b=g._count;if(f!=null&&g.modes[f]){b=g.modes[f].count;c=g.modes[f].outof}g.__tr=null;g.count=b;g.outof=c;if(c){g.percent=b/c*100}else{g.percent=b}}return(f!=null?((!g.modes||g.modes.mode==4)&&g.classs!=12&&g.commondrop?(f==32):(g.modes&&(g.modes.mode&f))):true)},getItemBonusesForDifficulty:function(c){var b=[];if(c&&$WH.isSet("g_pageInfo")){var g=c<0?-c:c;var h=0;var j=g_pageInfo.typeId;switch(g_pageInfo.type){case 1:h=(g_npcs[j]&&g_npcs[j].hasOwnProperty("location"))?g_npcs[j].location[0]:0;break;case 7:h=j;break;default:break}var f=0;if($WH.isSet("g_mapdifficulties")&&g_mapdifficulties[h]&&g_mapdifficulties[h][g]){f=g_mapdifficulties[h][g]}else{if($WH.isSet("g_difficulties")&&g_difficulties[g]){f=g_difficulties[g].order}}b=Listview.funcBox.getBonusDataForContext.call(this,f)}return b},getBonusDataForContext:function(j){var f=[];if(j&&$WH.isSet("g_item_bonuscontexts")&&g_item_bonuscontexts[j]){var k=[];var g=[];for(var h in g_item_bonuscontexts[j]){var c=g_item_bonuscontexts[j][h];k.push(c[1]);g.push(c[0])}f=[k,g]}return f},initSubclassFilter:function(c){var b=c.classs||0;if(this._itemClasses==null){this._itemClasses={}}if(this._itemClasses[b]==null){this._itemClasses[b]=0}this._itemClasses[b]++},addSubclassIndicator:function(){var m=location.hash.match(/:type=([^:]+)/),b=[];for(var l in g_item_classes){b.push({i:l,n:g_item_classes[l]})}b.sort(function(j,f){return $WH.stringCompare(j.n,f.n)});var o=function(j,f){$WH.setSelectedLink(this,"itemclass");g.customPound=g.id+(j!=null?":type="+j:"");g.customFilter=function(q){return j==null||j==q.classs};g.updateFilters(1);g.applySort();g.refreshRows();if(f){g.updatePound(1)}};var g=this,c=[],p;p=$("<a><span>"+LANG.su_note_all+"</span></a>");p[0].f=o.bind(p[0],null,1);p.click(p[0].f);var k=o.bind(p[0],null,0);k();c.push($('<span class="indicator-mode"></span>').append(p).append($("<b>"+LANG.su_note_all+"</b>")));for(var h=0,n=b.length;h<n;++h){var l=b[h].i;if(!this._itemClasses[l]){continue}p=$("<a><span>"+g_item_classes[l]+"</span> ("+this._itemClasses[l]+")</a>");p[0].f=o.bind(p[0],l,1);p.click(p[0].f);c.push($('<span class="indicator-mode"></span>').append(p).append($("<b>"+g_item_classes[l]+" ("+this._itemClasses[l]+")</b>")));if(m&&m[1]==$WH.urlize(l)){(p[0].f)()}}if(c.length>2){for(var l=0,n=c.length;l<n;++l){this.createIndicator(c[l],null,$("a",c[l])[0].f)}}},initStatisticFilter:function(b){if(this._achievTypes==null){this._achievTypes={}}if(this._achievTypes[b.type]==null){this._achievTypes[b.type]=0}this._achievTypes[b.type]++},addStatisticIndicator:function(){var l=location.hash.match(/:type=([^:]+)/),b=[];for(var k in g_achievement_types){b.push({i:k,n:g_achievement_types[k]})}b.sort(function(j,f){return $WH.stringCompare(j.n,f.n)});var o=function(j,f){$WH.setSelectedLink(this,"achievType");c.customPound=c.id+(j!=null?":type="+j:"");c.customFilter=function(q){return j==null||j==q.type};c.updateFilters(1);c.applySort();c.refreshRows();if(f){c.updatePound(1)}};var c=this,n=[],p;p=$("<a><span>"+LANG.su_note_all+"</span></a>");p[0].f=o.bind(p[0],null,1);p.click(p[0].f);var h=o.bind(p[0],null,0);h();n.push($('<span class="indicator-mode"></span>').append(p).append($("<b>"+LANG.su_note_all+"</b>")));for(var g=0,m=b.length;g<m;++g){var k=b[g].i;if(!this._achievTypes[k]){continue}p=$("<a><span>"+g_achievement_types[k]+"</span> ("+this._achievTypes[k]+")</a>");p[0].f=o.bind(p[0],k,1);p.click(p[0].f);n.push($('<span class="indicator-mode"></span>').append(p).append($("<b>"+g_achievement_types[k]+" ("+this._achievTypes[k]+")</b>")));if(l&&l[1]==k){(p[0].f)()}}if(n.length>2){for(var k=0,m=n.length;k<m;++k){this.createIndicator(n[k],null,$("a",n[k])[0].f)}}},initQuestFilter:function(c){if(this._questTypes==null){this._questTypes={}}for(var b=1;b<=4;++b){if(this._questTypes[b]==null){this._questTypes[b]=0}if(c._type&&(c._type&1<<b-1)){this._questTypes[b]++}}},addQuestIndicator:function(){var j=location.hash.match(/:type=([^:]+)/);var l=function(n,f){$WH.setSelectedLink(this,"questType");m.customPound=m.id+(n!=null?":type="+n:"");m.customFilter=function(o){return n==null||(o._type&1<<n-1)};m.updateFilters(1);m.applySort();m.refreshRows();if(f){m.updatePound(1)}};var m=this,h=[],c;c=$("<a><span>"+LANG.su_note_all+"</span></a>");c[0].f=l.bind(c[0],null,1);c.click(c[0].f);var k=l.bind(c[0],null,0);k();h.push($('<span class="indicator-mode"></span>').append(c).append($("<b>"+LANG.su_note_all+"</b>")));for(var g=1;g<=4;++g){if(!this._questTypes[g]){continue}c=$("<a><span>"+g_quest_indicators[g]+"</span> ("+this._questTypes[g]+")</a>");c[0].f=l.bind(c[0],g,1);c.click(c[0].f);h.push($('<span class="indicator-mode"></span>').append(c).append($("<b>"+g_quest_indicators[g]+" ("+this._questTypes[g]+")</b>")));if(j&&j[1]==g){(c[0].f)()}}if(h.length>2){for(var g=0,b=h.length;g<b;++g){this.createIndicator(h[g],null,$("a",h[g])[0].f)}}},initSpellFilter:function(c){if(this._spellTypes==null){this._spellTypes={}}if(this._spellTypes[c.cat]==null){this._spellTypes[c.cat]=0}this._spellTypes[c.cat]++;if(c.talentspec&&c.talentspec.length){switch(c.cat){case -14:case -12:case -2:if(this._spellSpecs==null){this._spellSpecs={}}for(var b=0;b<c.talentspec.length;b++){if(this._spellSpecs[c.talentspec[b]]==null){this._spellSpecs[c.talentspec[b]]=0}this._spellSpecs[c.talentspec[b]]++}break}}},addSpellIndicator:function(){var l=location.hash.match(/:type=([^:]+)/);var m=location.hash.match(/:spec=([^:]+)/);var q=function(t,f){$WH.setSelectedLink(this,"spellType");var v=location.hash.match(/:spec=([^:]+)/);var u=v?v[1]:null;h.customPound=h.id+(t!=null?":type="+t:"")+(u!=null?":spec="+u:"");h.customFilter=function(w){return(u==null||($WH.inArray(w.talentspec,u)!=-1)||(w.cat==-13&&w.rank&&w.rank.indexOf(g_chr_specs[u])>=0))&&(t==null||w.cat==t)};h.updateFilters(1);h.applySort();h.refreshRows();if(f){h.updatePound(1)}};var n=function(v,f){$WH.setSelectedLink(this,"spellSpec");var u=location.hash.match(/:type=([^:]+)/);var t=u?u[1]:null;h.customPound=h.id+(t!=null?":type="+t:"")+(v!=null?":spec="+v:"");h.customFilter=function(w){return(v==null||($WH.inArray(w.talentspec,v)!=-1)||(w.cat==-13&&w.rank&&w.rank.indexOf(g_chr_specs[v])>=0))&&(t==null||w.cat==t)};h.updateFilters(1);h.applySort();h.refreshRows();if(f){h.updatePound(1)}};var h=this,p=[],s;s=$("<a><span>"+LANG.su_note_all+"</span></a>");s[0].f=q.bind(s[0],null,1);s.click(s[0].f);var j=q.bind(s[0],null,0);j();p.push($('<span class="indicator-mode"></span>').append(s).append($("<b>"+LANG.su_note_all+"</b>")));for(var k in g_spell_categories){if(!this._spellTypes[k]){continue}s=$("<a><span>"+g_spell_categories[k]+"</span> ("+this._spellTypes[k]+")</a>");s[0].f=q.bind(s[0],k,1);s.click(s[0].f);p.push($('<span class="indicator-mode"></span>').append(s).append($("<b>"+g_spell_categories[k]+" ("+this._spellTypes[k]+")</b>")));if(l&&l[1]==k){(s[0].f)()}}var g=-1;var b=[];if(this._wowClass){b=g_chr_specs_by_class[this._wowClass]}else{for(k in g_chr_specs){if(g_chr_specs.hasOwnProperty(k)){b.push(k)}}}for(var r=0;r<b.length;r++){k=b[r];if(!this._spellSpecs[k]){continue}if(g==-1){s=$("<a><span>"+LANG.su_note_all+"</span></a>");s[0].f=n.bind(s[0],null,1);s.click(s[0].f);n.call(s[0],null,0);p.push($('<span class="indicator-mode"></span>').append(s).append($("<b>"+LANG.su_note_all+"</b>")));g=p.length-1}s=$("<a><span>"+g_chr_specs[k]+"</span> ("+this._spellSpecs[k]+")</a>");s[0].f=n.bind(s[0],k,1);s.click(s[0].f);p.push($('<span class="indicator-mode"></span>').append(s).append($("<b>"+g_chr_specs[k]+" ("+this._spellSpecs[k]+")</b>")));if(m&&m[1]==k){(s[0].f)()}}var c;if(p.length>2){for(var k=0,o=p.length;k<o;++k){c=this.createIndicator(p[k],null,$("a",p[k])[0].f);if(k>0&&k==g){c.style.clear="left"}}}},initComparisonFilter:function(h,c){if(h.__deleted){return}if(this._comparisonSources==null){this._comparisonSources={all:0,identical:0,similar:0,extra:0,missing:0}}if(h.compare.data.length<2){return}this._comparisonSources.all++;if(h.compare.progress==1){this._comparisonSources.identical++}else{if(h.compare.progress>0){this._comparisonSources.similar++}else{if(h.compare.primary==this.dataSource){this._comparisonSources.extra++}else{this._comparisonSources.missing++}}}if(this._comparisonCategories==null){this._comparisonCategories={total:[0,0,0,0,{},0]}}if(!this.compareSummary){return}if(h.compare.primary!=this.dataSource){this._comparisonCategories.total[0]++}if(h.compare.progress==1){this._comparisonCategories.total[h.compare.auxiliary?5:1]++}else{if(h.compare.progress>0){this._comparisonCategories.total[2]+=(c?1:h.compare.progress);this._comparisonCategories.total[3]++}}if(!this.compareSummary.categoryId){return}var f,g,b=h[this.compareSummary.categoryId];if(!$WH.isArray(b)){b=[b]}for(g=0;g<b.length;g++){f=b[g];if(this.compareSummary.names[f]){if(this._comparisonCategories[f]==null){this._comparisonCategories[f]=[0,0,0,0,{all:0,identical:0,similar:0,extra:0,missing:0},0]}if(h.compare.primary!=this.dataSource){this._comparisonCategories[f][0]++}this._comparisonCategories[f][4].all++;if(h.compare.progress==1){this._comparisonCategories[f][h.compare.auxiliary?5:1]++;this._comparisonCategories[f][4].identical++}else{if(h.compare.progress>0){this._comparisonCategories[f][2]+=(c?1:h.compare.progress);this._comparisonCategories[f][3]++;this._comparisonCategories[f][4].similar++}else{if(h.compare.primary==this.dataSource){this._comparisonCategories[f][4].extra++}else{this._comparisonCategories[f][4].missing++}}}}}},addComparisonFilter:function(){this.removeIndicators();this.removeProgressBars();Listview.funcBox.addComparisonIndicator.call(this);Listview.funcBox.addComparisonProgressBars.call(this)},addComparisonIndicator:function(){if(!this._comparisonSources||!this._comparisonSources.all){return}var m=location.hash.match(/:compare=([^:]+)/);var o=function(y,f){$WH.setSelectedLink(this,j.id+"-compareSource");var u=location.hash.match(/:catg=([^:]+)/);var w=(u&&u[1])?u[1]:null;var v=j.compareSummary.categoryId;j.customPound=j.id+(y!=null?":compare="+y:"")+(w!=null?":catg="+w:"");j.customFilter=function(z){return((y===null)||(y=="identical"&&z.compare.progress==1)||(y=="similar"&&z.compare.progress>0&&z.compare.progress<1)||(y=="extra"&&(z.compare.progress==-1||(z.compare.progress==0&&z.compare.primary==this.dataSource)))||(y=="missing"&&z.compare.progress==0&&z.compare.primary!=this.dataSource))&&(w===null||w==z[v]||($WH.isArray(z[v])&&$WH.inArray(z[v],w)>=0))};j.updateFilters(1);j.applySort();j.refreshRows();if(f){j.updatePound(1)}};var j=this,q=[],c=["all","identical","similar","extra","missing"],s,t=this._comparisonSources;var g=location.hash.match(/:catg=([^:]+)/);var b=(g&&g[1])?g[1]:null;var h=j.compareSummary.categoryId;if((b!==null)&&(this._comparisonCategories[b])){t=this._comparisonCategories[b][4]}for(var l=0;l<c.length;++l){var p=c[l];if(!t[p]){continue}var r=this.completionMode?this.completionText[p]:LANG["lvcomparison_"+p],k="";if(p=="all"){p=null}else{k=" ("+t[p]+")"}s=$("<a><span>"+r+"</span>"+k+"</a>");s[0].f=o.bind(s[0],p,1);s.click(s[0].f);q.push($('<span class="indicator-mode"></span>').append(s).append($("<b>"+r+k+"</b>")));if(m&&m[1]==p){(s[0].f)()}else{if(p===null){(o.bind(s[0],p,0))()}}}for(var l=0,n=q.length;l<n;++l){this.createIndicator(q[l],null,$("a",q[l])[0].f)}if(this.onAfterAddComparison){this.onAfterAddComparison.call(this)}},addComparisonProgressBars:function(){if(!this._comparisonCategories||!this._comparisonCategories.total||!this._comparisonCategories.total[0]){return}var j=location.hash.match(/:catg=([^:]+)/),l=this,h=this.compareSummary.categoryId;var k=function(n,m){$WH.setSelectedLink(this,l.id+"-category");var f=location.hash.match(/:compare=([^:]+)/);var o=(f&&f[1])?f[1]:null;l.customPound=l.id+(o!=null?":compare="+o:"")+(n!=null?":catg="+n:"");l.customFilter=function(p){return(n===null||n==p[h])&&((o===null)||(o=="identical"&&p.compare.progress==1)||(o=="similar"&&p.compare.progress>0&&p.compare.progress<1)||(o=="extra"&&(p.compare.progress==-1||(p.compare.progress==0&&p.compare.primary==this.dataSource)))||(o=="missing"&&p.compare.progress==0&&p.compare.primary!=this.dataSource))};l.updateFilters(1);l.applySort();l.refreshRows();if(m){l.updatePound(1);$WH.ee(l.noteIndicators);Listview.funcBox.addComparisonIndicator.call(l)}};this.createProgressBar(LANG.overallprogress,this._comparisonCategories.total,k,[null,1],4);$("tr:last-child td:last-child",this.noteProgressBars).click();if(this.compareSummary.order){for(var g=0;g<this.compareSummary.order.length;++g){var c=this.compareSummary.order[g];if(!this.compareSummary.names[c]||!this._comparisonCategories[c]){continue}var b=this._comparisonCategories[c];if(!b[0]){if(!b[4].all){continue}b=[b[4].all,b[4].extra,0,0]}this.createProgressBar(this.compareSummary.names[c],b,k,[c,1]);if(j&&j[1]==c){$("tr:last-child td:last-child",this.noteProgressBars).click()}}}},addItemSummary:function(){if(!this.noteItemSummary){this.noteItemSummary=$WH.ce("div");this.noteItemSummary.className="listview-summary-wrapper";$(this.noteItemSummary).insertAfter($(this.noteTop))}$WH.ee(this.noteItemSummary);g_summaries["listview-summary-"+this.id]=null;var g=$WH.ce("div");g.className="listview-summary-background";$WH.ae(this.noteItemSummary,g);var k=$WH.ce("div");k.className="listview-summary";$WH.ae(g,k);var j=$WH.ce("div");j.className="listview-summary-inner";$WH.ae(k,j);var b=$WH.ce("a");b.className="listview-summary-left";b.onclick=function(){var m=$(this);var n=m.siblings(".listview-summary-inner");n.animate({scrollLeft:-1*n.width()},1000);m.removeClass("show");m.siblings(".listview-summary-right").addClass("show")};$WH.ae(b,$WH.ce("span"));$WH.ae(k,b);b=$WH.ce("a");b.className="listview-summary-right";b.onclick=function(){var m=$(this);var n=m.siblings(".listview-summary-inner");n.animate({scrollLeft:n.width()},1000);m.removeClass("show");m.siblings(".listview-summary-left").addClass("show")};$WH.ae(b,$WH.ce("span"));$WH.ae(k,b);var h=[];for(var f=0;f<this.data.length;++f){if(this.data[f].raw[0]!=4&&this.data[f].raw[0]!=19){var c=this.data[f].raw.slice(1,this.data[f].raw.length);c[8]=0;h.push([c])}}this.attachedSummary=new Summary({id:"listview-summary-"+this.id,template:"listmanager",parent:j,groups:h,level:this.characterSettings.level,talentSpec:this.characterSettings.talentSpec,charClass:this.characterSettings.charClass,race:this.characterSettings.race,selectedTalents:this.characterSettings.selectedTalents,noMaxHighlight:this.compareSummaryNoMaxHighlight,totalName:this.compareSummaryTotalName});var l=function(){var n=$(this),m=$("table.grid",n);if(n.width()<m.width()){n.siblings(".listview-summary-right").addClass("show")}else{n.siblings(".listview-summary-left, .listview-summary-right").removeClass("show")}};if(!this.summaryResizeAdded){$(window).resize((function(m){$(".listview .listview-summary-inner").each(m)}).bind(null,l));this.summaryResizeAdded=true}setTimeout((function(m,n){$(".listview-summary-inner",m).each(n)}).bind(null,this.noteItemSummary,l),0);if(this.showPaperdoll){g.className+=" has-paperdoll";Listview.funcBox.addPaperdoll.call(this,g)}},addPaperdoll:function(c){if(!this.notePaperdoll||!$WH.ge(this.notePaperdoll.id)){this.notePaperdoll=$WH.ce("div");this.notePaperdoll.id="listview-paperdoll-"+this.id;this.notePaperdoll.className="listview-paperdoll";if(c){$(c).prepend(this.notePaperdoll)}else{$(this.notePaperdoll).insertAfter($(this.noteTop))}}$WH.ee(this.notePaperdoll);var g=$.extend({id:"paperdoll-"+this.id,parent:this.notePaperdoll.id,data:this.data,sheathMain:-1,sheathOff:-1},this.characterSettings);if(this.onCreatePaperdollSlot){g.onCreateSlot=this.onCreatePaperdollSlot}var h={16:"Main",17:"Off"};for(var f=0,b=g.data.length;f<b;f++){if(g_items[g.data[f].id]&&g_items[g.data[f].id].jsonequip&&typeof g_items[g.data[f].id].jsonequip.sheathtype=="number"){if(g.data[f].raw&&h.hasOwnProperty(g.data[f].raw[0])){g["sheath"+h[g.data[f].raw[0]]]=g_items[g.data[f].id].jsonequip.sheathtype}}}new Paperdoll(g)},assocArrCmp:function(g,f,c){if(g==null){return -1}else{if(f==null){return 1}}var k=Math.max(g.length,f.length);for(var j=0;j<k;++j){if(g[j]==null){return -1}else{if(f[j]==null){return 1}}var h=$WH.stringCompare(c[g[j]],c[f[j]]);if(h!=0){return h}}return 0},assocBinFlags:function(h,b){var g=[];for(var c in b){if(!isNaN(c)&&(h&1<<c-1)){g.push(c)}}g.sort(function(j,f){return $WH.stringCompare(b[j],b[f])});return g},location:function(m,f,g){if(m.location==null){return -1}var c=g?g:3;var b=m.location.slice(0,c);if(b.length<m.location.length){b.push(-1)}for(var h=0,k=b.length;h<k;++h){if(h>0){$WH.ae(f,$WH.ct(LANG.comma))}var j=b[h];if(j==-1){$WH.ae(f,$WH.ct(LANG.ellipsis))}else{var l=$WH.ce("a");l.className="q1";l.href="/zone="+j;$WH.ae(l,$WH.ct(g_zones[j]));$WH.ae(f,l)}}},arrayText:function(c,h){if(c==null){return}else{if(!$WH.isArray(c)){return h[c]}}var g="";for(var f=0,b=c.length;f<b;++f){if(f>0){g+=" "}if(!h[c[f]]){continue}g+=h[c[f]]}return g},createCenteredIcons:function(b,h,m,c,k,t){if(b!=null){var g=0;var w=$WH.ce("div"),z=$WH.ce("div");$WH.ae(document.body,w);if(m&&(b.length!=1||c!=2)){var s=$WH.ce("div");s.style.position="relative";s.style.width="1px";var A=$WH.ce("div");A.className="q0";A.style.position="absolute";A.style.right="2px";A.style.lineHeight="26px";A.style.fontSize="11px";A.style.whiteSpace="nowrap";$WH.ae(A,$WH.ct(m));$WH.ae(s,A);$WH.ae(w,s);w.style.paddingLeft=$(A).width()+"px"}var o=g_items;if(c==1){o=g_spells}else{if(c==3){o=g_petabilities}}for(var q=0,r=b.length;q<r;++q){if(t&&g%t==0){$WH.ae(w,$WH.ce("div",{className:"clear-left"}))}g++;var u;if(b[q]==null){u=$WH.ce("div");u.style.width=u.style.height="26px"}else{var n,j,f;if(typeof b[q]=="object"){n=b[q][0];j=b[q][1];f=b[q][2]}else{n=b[q]}if(typeof n=="string"){u=Icon.create(n,0,null,f)}else{if(n){u=o.createIcon(n,0,j)}else{u=Icon.create("inventoryslot_empty",0,null,"javascript:;")}}if(k){u.children[2].rel=k[q]}}if(b.length==1&&c==2){if(n&&g_items[n]){$WH.ee(w);var v=g_items[n],y=$WH.ce("a"),p=$WH.ce("span");p.style.paddingTop="4px";y.href="/item="+n;y.className="q"+v.quality+" icontiny tinyspecial";y.style.backgroundImage="url("+g_staticUrl+"/images/wow/icons/tiny/"+v.icon.toLowerCase()+".gif)";y.style.whiteSpace="nowrap";$WH.st(y,v["name_"+Locale.getName()]);$WH.ae(p,y);if(j>1){$WH.ae(p,$WH.ct(" ("+j+")"))}if(m){var s=$WH.ce("span");s.className="q0";s.style.fontSize="11px";s.style.whiteSpace="nowrap";$WH.ae(s,$WH.ct(m));$WH.ae(w,s);if($(A).length>0){p.style.paddingLeft=$(A).width()+"px"}}$WH.ae(w,p)}}else{u.style.cssFloat=u.style.styleFloat="left";$WH.ae(w,u);w.style.margin="0 auto";w.style.textAlign="left";var l=b.length;if(t&&t<b.length){l=t}w.style.width=(26*l)+"px"}}z.className="clear";$WH.ae(h,w);$WH.ae(h,z);return true}},createSocketedIcons:function(c,g,f,j,p){var o=0,m=$WH.ce("div"),b=$WH.ce("div");for(var h=0,k=c.length;h<k;++h){var n,l=f[h];if(g_items&&g_items[l]){n=g_items.createIcon(l,0)}else{if($WH.isSet("g_gems")&&g_gems&&g_gems[l]){n=Icon.create(g_gems[l].icon,0,null,"/item="+l)}else{n=Icon.create(null,0,null,"javascript:;")}}n.className+=" iconsmall-socket-"+g_file_gems[c[h]]+(!f||!l?"-empty":"");n.style.cssFloat=n.style.styleFloat="left";if(j&&j[h]){n.insertBefore($WH.ce("var"),n.childNodes[1]);++o}$WH.ae(m,n)}m.style.margin="0 auto";m.style.textAlign="left";m.style.width=(26*c.length)+"px";b.className="clear";$WH.ae(g,m);$WH.ae(g,b);if(p&&o==c.length){m=$WH.ce("div");m.style.paddingTop="4px";$WH.ae(m,$WH.ct(p));$WH.ae(g,m)}},addBattlePetExpandedView:function(h,g,l,t,c){if(!c){c=h}var n=function(){setTimeout((function(){if(Platform.isTouch()&&!$(".expanded-pet-view",this).is(":visible")){var A=$("a",this).attr("href");if(A){location.href=A}}}).bind(this),5)};if(c.tagName=="TD"){c.onmouseover=function(){$(this).addClass("expand-pet-view");n.call(this)};c.onmouseout=function(){$(this).removeClass("expand-pet-view")}}else{c.onmouseover=function(){$(this).parents("td").addClass("expand-pet-view");n.call(this)};c.onmouseout=function(){$(this).parents("td").removeClass("expand-pet-view")}}var j=$WH.ce("div");j.className="expanded-pet-view";if(g.compare){$WH.ae(j,Listview.funcBox.getComparisonText(g.compare,this.completionMode,this.dataSource,this.completionText))}if(g.companion){j.className+=" companion"}if(g.untameable){j.className+=" untameable"}if(g.elite){j.className+=" elite"}var z=$WH.ce("img");z.src=g_staticUrl+ModelViewer.getStaticBase()+"/thumbs/npc/"+g.model+".png";z.height=z.width=240;$WH.ae(j,z);var p=$WH.ce("div");p.className="icon";$WH.ae(p,Icon.create(g.icon,1,null,this.getItemLink(g)));$WH.ae(j,p);p=$WH.ce("div");p.className="type";p.style.backgroundPosition=((g.type-1)*-35)+"px 0";p.onmouseover=function(B,A){$WH.Tooltip.showAtCursor(A,g_battlepetability_types[g.type],0,0,"q")};p.onmousemove=$WH.Tooltip.cursorUpdate;p.onmouseout=$WH.Tooltip.hide;$WH.ae(j,p);var y=$WH.ce("div");y.className="name";if(g.elite){z=$WH.ce("img");z.src=g_staticUrl+"/images/icons/boss.gif";z.height=16;z.width=12;z.style.verticalAlign="middle";z.onmouseover=function(A){$WH.Tooltip.showAtCursor(A,LANG.lvspecies_elite,0,0,"q")};z.onmousemove=$WH.Tooltip.cursorUpdate;z.onmouseout=$WH.Tooltip.hide;$WH.ae(y,z);$WH.ae(y,$WH.ct(" "))}var u=$WH.ce("a");u.href=this.getItemLink(g);u.className="q"+l.quality;u.innerHTML=g.npc.name;$WH.ae(y,u);$WH.ae(j,y);var q=$WH.ce("div");q.className="leveltype";if(g.elite){q.innerHTML=(g.companion?LANG.lvspecies_companion:$WH.sprintf(LANG.lvspecieselite_levelcombo,l.level,g_battlepetability_types[g.type]))}else{q.innerHTML=(g.companion?LANG.lvspecies_companion:$WH.sprintf(LANG.lvspecies_levelcombo,l.level,g_battlepetability_types[g.type]))}$WH.ae(j,q);if(!g.companion){var w=$WH.ce("table");w.className="stats";var m=["health","power","speed"],s=$WH.ce("tr"),r=$WH.ce("tr"),b,k;for(var o=0;o<m.length;++o){b=$WH.ce("td");k=$WH.ce("span");k.className=m[o]+"-icon";b.onmouseover=(function(B,A){$WH.Tooltip.showAtCursor(A,B,0,0,"q")}).bind(null,LANG[m[o]]);b.onmousemove=$WH.Tooltip.cursorUpdate;b.onmouseout=$WH.Tooltip.hide;$WH.ae(b,k);$WH.ae(s,b);b=$WH.ce("td");b.innerHTML=t[m[o]];b.onmouseover=(function(B,A){$WH.Tooltip.showAtCursor(A,B,0,0,"q")}).bind(null,LANG[m[o]]);b.onmousemove=$WH.Tooltip.cursorUpdate;b.onmouseout=$WH.Tooltip.hide;$WH.ae(r,b)}$WH.ae(w,s);$WH.ae(w,r);$WH.ae(j,w);var f=$WH.ce("div");f.className="abilities";if(g.untameable){span=$WH.ce("div");span.className="label q0";span.innerHTML=LANG.untameable;$WH.ae(f,span);for(var o=0;o<g.abilities.length;++o){p=$WH.ce("div");p.className="icon-"+(o+1);$WH.ae(p,Icon.create(g_petabilities[g.abilities[o]].icon,0,null,"/pet-ability="+g.abilities[o]));$WH.ae(f,p)}}else{for(var o=1;o<=3;o++){p=$WH.ce("span");p.className="connector-"+o;$WH.ae(f,p)}for(var o=0;o<g.abilities.length;++o){p=$WH.ce("div");p.className="icon-"+(o+1);if(o<3&&l.level>=$WH.battlePetAbilityLevels[1]){p.className+=" iconsmall-gold"}var v=null;if(l.level<$WH.battlePetAbilityLevels[o]||$WH.battlePetAbilityLevels[o]>1){v=$WH.battlePetAbilityLevels[o]}if(l.level<$WH.battlePetAbilityLevels[o]){p.className+=" inactive"}$WH.ae(p,Icon.create(g_petabilities[g.abilities[o]].icon,0,null,"/pet-ability="+g.abilities[o],v));$WH.ae(f,p)}}$WH.ae(j,f)}$WH.ae(h,j)},getItemType:function(f,b,c){if(c!=null&&g_item_subsubclasses[f]!=null&&g_item_subsubclasses[f][b]!=null){return{url:"/items="+f+"."+b+"."+c,text:g_item_subsubclasses[f][b][c]}}else{if(b!=null&&g_item_subclasses[f]!=null){return{url:"/items="+f+"."+b,text:g_item_subclasses[f][b]}}else{return{url:"/items="+f,text:g_item_classes[f]}}}},getQuestCategory:function(b){return g_quest_sorts[b]},getQuestReputation:function(g,c){if(c.reprewards){for(var f=0,b=c.reprewards.length;f<b;++f){if(c.reprewards[f][0]==g){return c.reprewards[f][1]}}}},getFactionCategory:function(c,b){if(c){return g_faction_categories[c]}else{return g_faction_categories[b]}},createTextRange:function(c,b){c|=0;b|=0;if(c>1||b>1){if(c!=b&&b>0){return c+"-"+b}else{return c+""}}return null},coGetColor:function(g,c,b){if(g.user&&g_customColors[g.user]){return" comment-"+g_customColors[g.user]}switch(c){case -1:var f=null;if(!b){f=g.divPost.childNodes[1].className.match(/comment-([a-z]+)/)}else{f=g.divBody[0].className.match(/comment-([a-z]+)/)}if(f!=null){return" comment-"+f[1]}break;case 3:if(g.roles&U_GROUP_PREMIUMISH){return" comment-gold"}case 4:if(g.roles&U_GROUP_ADMIN){return" comment-blue"}if(g.roles&U_GROUP_GREEN_TEXT){return" comment-green"}if(g.roles&U_GROUP_VIP){return" comment-gold"}if(g.roles&U_GROUP_PREMIUMISH){return" comment-red"}break}if(g.roles&U_GROUP_ADMIN){return" comment-blue"}if((g.commentv2&&g.sticky)||(g.roles&U_GROUP_GREEN_TEXT)||(g.rating>=10)){return" comment-green"}if(g.rating&&g.rating<-2){return" comment-bt"}if(g.roles&U_GROUP_PREMIUMISH){return" comment-gold"}return""},coFlagUpOfDate:function(f){var b=f.commentCell.find(".comment-notification");var c=f.user==g_user.name||((g_user.roles&(U_GROUP_ADMIN|U_GROUP_MODERATOR))!=0);if(!c){return}if(confirm("Mark comment "+f.id+" as up to date?")){f.container.removeClass("comment-outofdate");$.post("/comment=out-of-date",{id:f.id,remove:1},function(g){if(g=="ok"){MessageBox(b,LANG.lvcomment_uptodateresponse)}else{MessageBox(b,"Error: "+g)}})}return},coFlagOutOfDate:function(g){var b=g.commentCell.find(".comment-notification");var c=g.user==g_user.name||((g_user.roles&(U_GROUP_ADMIN|U_GROUP_MODERATOR))!=0);if(c){if(confirm("Mark comment "+g.id+" as out of date?")){g.container.addClass("comment-outofdate");$.post("/comment=out-of-date",{id:g.id},function(h){if(h=="ok"){MessageBox(b,LANG.lvcomment_outofdateresponse)}else{MessageBox(b,"Error: "+h)}})}return}var f=null;while(true){f=prompt(LANG.lvcomment_outofdate_tip);if(f==null||f==false){return}else{if(f.toString().length>0){break}}alert(LANG.youmustprovideareason_stc)}$.post("/comment=out-of-date",{id:g.id,reason:f},function(h){if(h=="ok"){MessageBox(b,LANG.lvcomment_outofdateresponsequeued)}else{MessageBox(b,"Error: "+h)}})},coDelete:function(f){var c=f.user==g_user.name||((g_user.roles&(U_GROUP_ADMIN|U_GROUP_MOD|U_GROUP_BUREAU))!=0);var b=f.commentCell.find(".comment-notification");if(c){if(!confirm(LANG.confirm_deletecomment)){return}$.post("/comment=delete",{id:f.id});if(!f.commentv2){this.deleteRows([f]);return}f.container.addClass("comment-deleted");MessageBox(b,LANG.commentdeleted_tip);f.deletedInfo=[g_serverTime,g_user.name];f.deleted=true;Listview.templates.comment.updateCommentCell(f);return}},coUndelete:function(f){var c=f.user==g_user.name||((g_user.roles&(U_GROUP_ADMIN|U_GROUP_MOD))!=0);var b=f.commentCell.find(".comment-notification");if(confirm(LANG.votetoundelete_tip)){$.post("/comment=undelete",{id:f.id});if(c){MessageBox(b,"This comment has been restored.");if(f.commentv2){f.container.removeClass("comment-deleted");f.deletedInfo=null;f.deleted=false;Listview.templates.comment.updateCommentCell(f)}}else{MessageBox(b,LANG.votedtodelete_tip)}}},coEdit:function(k,h,f){if(f){k.divBody.hide();k.divResponse.hide()}var j=$("<div/>");j.addClass("comment-edit");k.divEdit=j[0];if(h==-1){if(g_users[k.user]!=null){k.roles=g_users[k.user].roles}}var b=Listview.funcBox.coEditAppend(j,k,h,f);var c=$("<div/>");c.addClass("comment-edit-buttons");var g=$("<button/>",{text:LANG.compose_save});g.click(Listview.funcBox.coEditButton.bind(g[0],k,true,h,f));c.append(g);c.append($WH.ct(" "));g=$("<button/>",{text:LANG.compose_cancel});g.click(Listview.funcBox.coEditButton.bind(g[0],k,false,h,f));c.append(g);j.append(c);j.insertAfter(k.divBody);$WH.safeFocus(b)},coEditAppend:function(y,g,w,J,l,q){var o=Listview.funcBox.coGetCharLimit(w);if(w==1||w==3||w==4){g.user=g_user.name;g.roles=g_user.roles;g.rating=1}else{if(w==2){g.roles=g_user.roles;g.rating=1}}if(l){g.roles&=~U_GROUP_PENDING}if(w==-1||w==0){var s=$("<div/>",{text:LANG.compose_mode});s.addClass("comment-edit-modes");var B=$("<a/>",{href:"javascript:;",text:LANG.compose_edit});B.click(Listview.funcBox.coModeLink.bind(B[0],1,w,g));B.addClass("selected");s.append(B);s.append($WH.ct("|"));var L=$("<a/>",{href:"javascript:;",text:LANG.compose_preview});L.click(Listview.funcBox.coModeLink.bind(L[0],2,w,g));s.append(L);y.append(s)}var b=$("<div/>",{css:{display:"none"}});b.addClass("text comment-body"+Listview.funcBox.coGetColor(g,w,J));var r=$("<div/>");r.addClass("comment-edit-body");var n=$('<div style="float: left" />');n.addClass("toolbar");var j=$('<div style="float: left" />');j.addClass("menu-buttons");var p=$("<textarea/>",{val:g.body,rows:10,css:{clear:"left"}});p.addClass("comment-editbox");switch(w){case 1:p.attr("name","commentbody");p.focus($WH.revealCaptcha.bind(null,"klrbetkjerbt46",false,false,"Listview commentbody"));break;case 2:p.attr({name:"desc",originalValue:g.body});break;case 3:p.attr("name","body");p.focus($WH.revealCaptcha.bind(null,"klrbetkjerbt46",false,false,"Listview body"));break;case 4:p.attr({name:"sig",originalValue:g.body,rows:3});p.css("height","auto");break}if(w!=-1&&w!=0){var M=$("<a/>"),I=$("<div/>"),H=$("<div/>"),m=screen.availWidth<=480;var k=Listview.funcBox.coLivePreview.bind(p[0],g,w,I[0]);M.addClass("disclosure-"+(m?"off":"on"));M.text(LANG.compose_livepreview);M.attr("href","javascript:;");M.click(function(){k(1);var N=$WH.toggleDisplay(I);M.toggleClass("disclosure-on",N);M.toggleClass("disclosure-off",!N)});H.addClass("pad");b.append($WH.getMajorHeading(M,3,null,{classes:"first"}));b.append(I);b.append(H);$WH.onAfterTyping(p[0],k,50);p.focus(function(){k();b.css("display",(m?"none":""));if(w!=4&&!q){p.css("height","22em")}})}else{if(w!=4&&!q){p.focus(function(){p.css("height","22em")})}}var F=[{id:"b",icon:"bold",title:LANG.markup_b,pre:"[b]",post:"[/b]"},{id:"i",icon:"italic",title:LANG.markup_i,pre:"[i]",post:"[/i]"},{id:"u",icon:"underline",title:LANG.markup_u,pre:"[u]",post:"[/u]"},{id:"s",icon:"strikethrough",title:LANG.markup_s,pre:"[s]",post:"[/s]"},{id:"small",icon:"text-height",title:LANG.markup_small,pre:"[small]",post:"[/small]"},{id:"url",icon:"link",title:LANG.markup_url,nopending:true,onclick:function(){var N=prompt(LANG.prompt_linkurl,"http://");if(N){$WH.insertTag(p[0],"[url="+N+"]","[/url]")}}},{id:"quote",icon:"quote-left",title:LANG.markup_quote,pre:"[quote]",post:"[/quote]"},{id:"code",icon:"code",title:LANG.markup_code,pre:"[code]",post:"[/code]"},{id:"ul",icon:"list-ul",title:LANG.markup_ul,pre:"[ul]\n[li]",post:"[/li]\n[/ul]",rep:function(N){return N.replace(/\n/g,"[/li]\n[li]")}},{id:"ol",icon:"list-ol",title:LANG.markup_ol,pre:"[ol]\n[li]",post:"[/li]\n[/ol]",rep:function(N){return N.replace(/\n/g,"[/li]\n[li]")}},{id:"li",icon:"circle",title:LANG.markup_li,pre:"[li]",post:"[/li]"}];if(!J){for(var D=0,E=F.length;D<E;++D){var u=F[D];if(w==4&&u.id=="quote"){break}if((g_user.roles&U_GROUP_PENDING)&&u.nopending){continue}var z=$("<button/>",{click:function(N,O){O.preventDefault();(N.onclick!=null?N.onclick:$WH.insertTag.bind(0,p[0],N.pre,N.post,N.rep))()}.bind(null,u)});z[0].setAttribute("type","button");z.attr("title",u.title);var G=$("<i/>",{"class":"fa fa-"+u.icon});z.append(G);n.append(z)}}else{for(var D=0,E=F.length;D<E;++D){var u=F[D];if((g_user.rolls&U_GROUP_PENDING)&&u.nopending){continue}var K="tb-"+u.id;var z=$("<button/>",{click:function(N,O){O.preventDefault();(N.onclick!=null?N.onclick:$WH.insertTag.bind(0,p[0],N.pre,N.post,N.rep))()}.bind(null,u),"class":K,title:u.title});z[0].setAttribute("type","button");z.append("<ins/>");n.append(z)}n.addClass("formatting button sm")}var v=function(O,N){var P=prompt($WH.sprintf(LANG.markup_prompt,O),"");if(P!=null){$WH.insertTag(p[0],"["+N+"="+(parseInt(P)||0)+"]","")}};var h=LANG.ellipsis;var f=[[0,LANG.markup_links,,[[9,LANG.types[10][0]+h,v.bind(null,LANG.types[10][1],"achievement")],[11,LANG.types[13][0]+h,v.bind(null,LANG.types[13][1],"class")],[7,LANG.types[8][0]+h,v.bind(null,LANG.types[8][1],"faction")],[0,LANG.types[3][0]+h,v.bind(null,LANG.types[3][1],"item")],[1,LANG.types[4][0]+h,v.bind(null,LANG.types[4][1],"item-set")],[2,LANG.types[1][0]+h,v.bind(null,LANG.types[1][1],"npc")],[3,LANG.types[2][0]+h,v.bind(null,LANG.types[2][1],"object")],[8,LANG.types[9][0]+h,v.bind(null,LANG.types[9][1],"pet")],[4,LANG.types[5][0]+h,v.bind(null,LANG.types[5][1],"quest")],[12,LANG.types[14][0]+h,v.bind(null,LANG.types[14][1],"race")],[13,LANG.types[15][0]+h,v.bind(null,LANG.types[15][1],"skill")],[5,LANG.types[6][0]+h,v.bind(null,LANG.types[6][1],"spell")],[6,LANG.types[7][0]+h,v.bind(null,LANG.types[7][1],"zone")]]]];r.append(n);r.append(j);r.append($('<div style="clear: left" />'));r.append(p);r.append($("<br/>"));Menu.addButtons(j[0],f);if(w==4){r.append($WH.ct($WH.sprintf(LANG.compose_limit2,o,3)))}else{r.append($WH.ct($WH.sprintf(LANG.compose_limit,o)))}var C=$('<span class="comment-remaining"> '+$WH.sprintf(LANG.compose_remaining,o-g.body.length)+"</span>");r.append(C);p.keyup(Listview.funcBox.coUpdateCharLimit.bind(0,p,C,o));p.keydown(Listview.funcBox.coUpdateCharLimit.bind(0,p,C,o));if((w==-1||w==0)&&g_user.roles&U_GROUP_MODERATOR){var c=$("<div/>",{"class":"pad"});var A=$("<div/>",{text:(g_user.roles&U_GROUP_ADMIN?"Admin":"Moderator")+" response"});var t=$("<textarea/>",{val:g.response,rows:3,css:{height:"6em"}});r.append(c);r.append(A);r.append(t)}y.append(r);y.append(b);$("<div/>").append('<div class="pad"/>').append($WH.getMajorHeading($('<a class="disclosure-off"/>').text(LANG.compose_formattinghelp).click(function(){$WH.disclose(this.parentNode.nextSibling,this)}),3,null,{classes:"first"})).append($('<div style="display: none"/>').append(Markup.toHtml("[markupdoc help=user]"))).insertAfter(y.parent());return p},coLivePreview:function(j,h,b,c){if(c!=1&&b.style.display=="none"){return}var f=this,m=Listview.funcBox.coGetCharLimit(h),k=(f.value.length>m?f.value.substring(0,m):f.value);if(h==4){var l;if((l=k.indexOf("\n"))!=-1&&(l=k.indexOf("\n",l+1))!=-1&&(l=k.indexOf("\n",l+1))!=-1){k=k.substring(0,l)}}var n=Markup.rolesToClass(j.roles);var g=Markup.toHtml(k,{allow:n,mode:Markup.MODE_COMMENT,roles:j.roles});if(g){b.innerHTML=g}else{b.innerHTML='<span class="q6">...</span>'}},coEditButton:function(l,c,k,o){if(c){var h=$WH.gE(l.divEdit,"textarea");var g=h[0];if(!Listview.funcBox.coValidate(g,k)){return}if(g.value!=l.body||(h[1]&&h[1].value!=l.response)){var m=0;if(l.lastEdit!=null){m=l.lastEdit[1]}++m;l.lastEdit=[g_serverTime,m,g_user.name];if(!l.commentv2){Listview.funcBox.coUpdateLastEdit(l)}var n=Listview.funcBox.coGetCharLimit(k);var p=Markup.rolesToClass(l.roles);var j=Markup.toHtml((g.value.length>n?g.value.substring(0,n):g.value),{allow:p,mode:Markup.MODE_COMMENT,roles:l.roles});var b=((h[1]&&h[1].value.length>0)?Markup.toHtml("[div][/div][wowheadresponse="+g_user.name+" roles="+g_user.roles+"]"+h[1].value+"[/wowheadresponse]",{allow:Markup.CLASS_STAFF,mode:Markup.MODE_COMMENT,roles:g_user.roles}):"");if(l.commentv2){l.body=g.value;if(g_user.roles&U_GROUP_MODERATOR&&h[1]){l.response=h[1].value}Listview.templates.comment.updateCommentCell(l)}else{if(!o){l.divBody.innerHTML=j;l.divResponse.innerHTML=b}else{l.divBody.html(j);l.divResponse.html(b)}l.body=g.value;if(g_user.roles&U_GROUP_MODERATOR&&h[1]){l.response=h[1].value}}var f="body="+$WH.urlEncode(l.body);if(l.response!==undefined){f+="&response="+$WH.urlEncode(l.response)}if(k==-1){new Ajax("/forums=editpost&id="+l.id,{method:"POST",params:f})}else{new Ajax("/comment=edit&id="+l.id,{method:"POST",params:f})}}}if(l.commentv2){Listview.templates.comment.updateCommentCell(l)}else{if(!o){l.divBody.style.display="";l.divResponse.style.display="";l.divLinks.firstChild.style.display=""}else{l.divBody.show();l.divResponse.show()}}if(!l.commentv2){$WH.de(l.divEdit);l.divEdit=null}},coGetCharLimit:function(b){if(b==2){return 7500}if(b==4){return 250}if(g_user.roles&U_GROUP_STAFF){return 16000000}var c=1;if(g_user.premium){c=3}switch(b){case 0:case 1:return 7500*c;case -1:case 3:return 15000*c}},coUpdateCharLimit:function(b,c,f){var g=$(b).val();if(g.length>f){$(b).val(g.substring(0,f))}else{$(c).html(" "+$WH.sprintf(LANG.compose_remaining,f-g.length)).removeClass("q10");if(g.length==f){$(c).addClass("q10")}}},coModeLink:function(k,c,l){var q=Listview.funcBox.coGetCharLimit(c);var f=Markup.MODE_COMMENT;$WH.arrayWalk($WH.gE(this.parentNode,"a"),function(m){m.className=""});this.className="selected";var j=$WH.gE(this.parentNode.parentNode,"textarea"),g=j[0],p=g.parentNode,b=$(".comment-body",p.parentNode)[0];if(c==4){f=Markup.MODE_SIGNATURE}switch(k){case 1:p.style.display="";b.style.display="none";$WH.safeFocus(p.firstChild);break;case 2:p.style.display="none";var n=(g.value.length>q?g.value.substring(0,q):g.value);if(c==4){var o;if((o=n.indexOf("\n"))!=-1&&(o=n.indexOf("\n",o+1))!=-1&&(o=n.indexOf("\n",o+1))!=-1){n=n.substring(0,o)}}var r=Markup.rolesToClass(l.roles);var h=Markup.toHtml(n,{allow:r,mode:f,roles:l.roles});if(j[1]&&j[1].value.length>0){h+=Markup.toHtml("[div][/div][wowheadresponse="+g_user.name+" roles="+g_user.roles+"]"+j[1].value+"[/wowheadresponse]",{allow:Markup.CLASS_STAFF,mode:f,roles:g_user.roles})}b.innerHTML=h;b.style.display="";break}},coValidate:function(b,f){f|=0;if(f==1||f==-1){if($WH.trim(b.value).length<1){alert(LANG.message_forumposttooshort);return false}}else{if($WH.trim(b.value).length<1){alert(LANG.message_commenttooshort);return false}}var c=Listview.funcBox.coGetCharLimit(f);if(b.value.length>c){if(!confirm($WH.sprintf(f==1?LANG.confirm_forumposttoolong:LANG.confirm_commenttoolong,c,b.value.substring(c-30,c)))){return false}}return true},coSortNewestFirst:function(b){$WH.setCookie("comments_sort",1000,"1","/",".wowhead.com");$(b).parent().find("a.selected").removeClass("selected");b.className="selected";this.mainDiv.className+=" listview-aci";this.setSort([-5,4,6,-1,-2],true,false)},coSortOldestFirst:function(b){$WH.setCookie("comments_sort",1000,"2","/",".wowhead.com");$(b).parent().find("a.selected").removeClass("selected");b.className="selected";this.mainDiv.className+=" listview-aci";this.setSort([-5,4,6,1,2],true,false)},coSortHighestRatedFirst:function(b){$WH.setCookie("comments_sort",1000,"3","/",".wowhead.com");$(b).parent().find("a.selected").removeClass("selected");b.className="selected";this.mainDiv.className=this.mainDiv.className.replace("listview-aci","");this.setSort([-5,4,6,-3,2],true,false)},coFilterByPatchVersion:function(b){this.minPatchVersion=b.value;this.refreshRows()},coUpdateLastEdit:function(j){var c=j.divLastEdit;if(!c){return}if(j.lastEdit!=null){var h=j.lastEdit;c.childNodes[1].firstChild.nodeValue=h[2];c.childNodes[1].href="/user="+h[2];var f=new Date(h[0]);var g=(g_serverTime-f)/1000;if(c.childNodes[3].firstChild){$WH.de(c.childNodes[3].firstChild)}$WH.formatDate(c.childNodes[3],g,f);var b="";if(j.rating!=null){b+=$WH.sprintf(LANG.lvcomment_patch,$WH.getPatchVersion(f))}if(h[1]>1){b+=LANG.dash+$WH.sprintf(LANG.lvcomment_nedits,h[1])}c.childNodes[4].nodeValue=b;c.style.display=""}else{c.style.display="none"}},coFormatFileSize:function(f){var c=-1;var b="KMGTPEZY";while(f>=1024&&c<7){f/=1024;++c}if(c<0){return f+" byte"+(f>1?"s":"")}else{return f.toFixed(1)+" "+b[c]+"B"}},dateEventOver:function(f,b,k){var c=$WH.getEventNextDates(b,f),m="";if(c[0]&&c[1]){var j=c[0],g=c[1],h,l;j.setFullYear(f.getFullYear(),f.getMonth(),f.getDate());g.setFullYear(f.getFullYear(),f.getMonth(),f.getDate());if(f.getFullYear()==c[0].getFullYear()&&f.getMonth()==c[0].getMonth()&&f.getDate()==c[0].getDate()){h=true}if(f.getFullYear()==c[1].getFullYear()&&f.getMonth()==c[1].getMonth()&&f.getDate()==c[1].getDate()){l=true}if(h&&l){m=$WH.formatTimeSimple(j,LANG.lvscreenshot_from,1)+" "+$WH.formatTimeSimple(g,LANG.date_to,1)}else{if(h){m=$WH.formatTimeSimple(j,LANG.tab_starts)}else{if(l){m=$WH.formatTimeSimple(g,LANG.tab_ends)}else{m=LANG.allday}}}}$WH.Tooltip.showAtCursor(k,'<span class="q1">'+b.name+"</span><br />"+m,0,0,"q")},comparisonTextOver:function(k,f,c,m,l){var o='<table class="compare"><tr>';var b;o+="<tr>";for(var h=0;h<k.data.length;++h){b=(k.data[h].status==c?"this":"other");o+="<td><b>"+f?m[b]:LANG["lvcomparison_"+b]+"</b></td>"}o+="</tr>";for(var h=0;h<k.tooltip.length;++h){var n=1;if(k.progress<1){n=(k.tooltip[h][k.data[0].status]?1:0);for(var g=1;n&&g<k.data.length;++g){if(k.tooltip[h][k.data[g].status]=="&lt;"+LANG.fiany+"&gt;"){continue}if(!k.tooltip[h][k.data[g].status]||k.tooltip[h][k.data[g].status]!=k.tooltip[h][k.data[0].status]){n=0}}}o+="<tr>";for(var g=0;g<k.data.length;++g){o+='<td class="q'+n+'">'+k.tooltip[h][k.data[g].status]+"</td>"}o+="</tr>"}o+="</table>";$WH.Tooltip.showAtCursor(l,o,0,0,"q")},ssCellOver:function(){this.className="screenshot-caption-over"},ssCellOut:function(){this.className="screenshot-caption"},ssCellClick:function(c,g){g=$WH.normalizeEvent(g);if(g.shiftKey||g.ctrlKey){return}var b=0,f=g._target;while(f&&b<3){if(f.nodeName=="A"){return}if(f.nodeName=="IMG"){break}f=f.parentNode}ScreenshotViewer.show({screenshots:this.data,pos:c,hashname:this.id})},ssCreateCb:function(g,c){if(c.__nochk){return}var f=$WH.ce("div");f.className="listview-cb";f.onclick=Listview.cbCellClick;var b=$WH.ce("input");b.type="checkbox";b.onclick=Listview.cbClick;$WH.disableOldIESelect(b);if(c.__chk){b.checked=true}c.__cb=b;$WH.ae(f,b);$WH.ae(g,f)},viCellClick:function(c,g){g=$WH.normalizeEvent(g);if(g.shiftKey||g.ctrlKey){return}var b=0,f=g._target;while(f&&b<3){if(f.nodeName=="A"){return}if(f.nodeName=="IMG"){break}f=f.parentNode}VideoViewer.show({videos:this.data,pos:c})},moneyAchievementOver:function(b){$WH.Tooltip.showAtCursor(b,"<b>"+LANG.tooltip_achievementpoints+"</b>",0,0,"q1")},moneyCurrencyOver:function(c,j,k){var l=g_gatheredcurrencies[c]["name_"+Locale.getName()];switch(c){case 395:var g=[[80,16,LANG.tooltip_ppbheroic],[80,23,LANG.tooltip_ppbraid],[85,75,LANG.tooltip_ppbheroic],[90,100,LANG.tooltip_ppbheroic]];break;case 396:var g=[[90,40,$WH.sprintf(LANG.tooltip_ppb10man,LANG.tooltip_ppbraid)],[90,40,$WH.sprintf(LANG.tooltip_ppb25man,LANG.tooltip_ppbraid)]];break;default:var g=[];break}if(g.length&&j){l+='<br /><span class="q">';for(var f=0,b=g.length;f<b;++f){var h=Math.ceil(j/g[f][1]);if(f>0){l+="<br />"}l+=$WH.sprintf(LANG["tooltip_pointsperboss"+(h==1?1:2)],h,g[f][0],g[f][2])}l+="</span>"}$WH.Tooltip.showAtCursor(k,l,0,0,"q1")},appendMoney:function(k,b,j,g,c,q){var o,n,m=0;if(j==1||j=="alliance"){j=1}else{if(j==2||j=="horde"){j=2}else{j=3}}if(b>=10000){m=1;o=$WH.ce("span");o.className="moneygold";$WH.ae(o,$WH.ct($WH.numberFormat(Math.floor(b/10000))));$WH.ae(k,o);b%=10000}if(b>=100){if(m){$WH.ae(k,$WH.ct(" "))}else{m=1}o=$WH.ce("span");o.className="moneysilver";$WH.ae(o,$WH.ct(Math.floor(b/100)));$WH.ae(k,o);b%=100}if(b>=1){if(m){$WH.ae(k,$WH.ct(" "))}else{m=1}o=$WH.ce("span");o.className="moneycopper";$WH.ae(o,$WH.ct(b));$WH.ae(k,o)}if(g!=null){for(var f=0;f<g.length;++f){if(m){$WH.ae(k,$WH.ct(" "))}else{m=1}var r=g[f][0];var h=g[f][1];var l=g_items.getIcon(r);o=$WH.ce("a");o.href="/item="+r;o.className="moneyitem";o.style.backgroundImage="url("+g_staticUrl+"/images/wow/icons/tiny/"+l.toLowerCase()+".gif)";$WH.ae(o,$WH.ct(h));$WH.ae(k,o)}}if(c!=null){for(var f=0;f<c.length;++f){if(m){$WH.ae(k,$WH.ct(" "))}else{m=1}var p=c[f][0];var h=c[f][1];if(!g_gatheredcurrencies[p]){$.each(g_currencies,function(t,s){g_gatheredcurrencies[t]=[];g_gatheredcurrencies[t]["name_"+Locale.getName()]=s[0];g_gatheredcurrencies[t].icon=[];g_gatheredcurrencies[t].icon.push(s[1]);g_gatheredcurrencies[t].icon.push(s[1])})}var l=g_gatheredcurrencies.getIcon(p,(j==3?0:j-1));if((!l)&&$WH.isSet("g_currencies")&&g_currencies.hasOwnProperty(p)){l=g_currencies[p].icon}if(!l){l="inv_misc_questionmark"}o=$WH.ce("a");o.href="/currency="+p;o.className="icontinyr tip q1";o.style.display="inline-block";o.style.backgroundImage="url("+g_staticUrl+"/images/wow/icons/tiny/"+l.toLowerCase()+".gif)";o.onmouseover=Listview.funcBox.moneyCurrencyOver.bind(o,p,h);o.onmousemove=$WH.Tooltip.cursorUpdate;o.onmouseout=$WH.Tooltip.hide;$WH.ae(k,o);$WH.ae(o,$WH.ct($WH.numberFormat(h)))}}if(q>0){if(m){$WH.ae(k,$WH.ct(" "))}else{m=1}o=$WH.ce("span");o.className="moneyachievement tip";o.onmouseover=Listview.funcBox.moneyAchievementOver;o.onmousemove=$WH.Tooltip.cursorUpdate;o.onmouseout=$WH.Tooltip.hide;$WH.ae(o,$WH.ct($WH.numberFormat(q)));$WH.ae(k,o)}},viewColors:function(b,c){if(c>=50000){b.css("color","#FF4040");b.css("font-weight","bold")}else{if(c>=25000){b.css("color","#FF8000");b.css("font-weight","bold")}else{if(c>=10000){b.css("color","#A335EE")}else{if(c>=5000){b.css("color","#0070DD")}else{if(c>=1000){b.css("color","#1EFF00")}}}}}},getUpperSource:function(b,c){switch(b){case 2:if(c.bd){return LANG.source_bossdrop}if(c.z){return LANG.source_zonedrop}break;case 4:return LANG.source_quests;case 5:return LANG.source_vendors}return g_sources[b]},getLowerSource:function(b,g,f){switch(b){case 3:if(g.p&&g_sources_pvp[g.p]){return{text:g_sources_pvp[g.p]}}break}switch(f){case 0:case 1:case 2:if(g.z){var c={url:"/zone="+g.z,text:g_zones[g.z]};if(g.t&&b==5){c.pretext=LANG.lvitem_vendorin}if(g.dd&&g.dd!=99){if(g.dd<0){c.posttext=$WH.sprintf(LANG.lvitem_dd,"",(g.dd<-1?LANG.lvitem_heroic:LANG.lvitem_normal))}else{if(g.dd>=14){c.posttext=(g.dd==15||g.dd==16)?LANG.lvitem_heroic:LANG.lvitem_normal}else{c.posttext=$WH.sprintf(LANG.lvitem_dd,(g.dd&1?LANG.lvitem_raid10:LANG.lvitem_raid25),(g.dd>2?LANG.lvitem_heroic:LANG.lvitem_normal))}}}return c}break;case 5:return{url:"/quests="+g.c2+"."+g.c,text:Listview.funcBox.getQuestCategory(g.c)};break;case 6:if(g.c&&g.s){return{url:"/spells="+g.c+"."+g.s,text:g_spell_skills[g.s]}}else{return{url:"/spells=0",text:"??"}}break}},getExpansionText:function(b){var c="";if(b.expansion==1){c+=" bc"}else{if(b.expansion==2){c+=" wotlk wrath"}else{if(b.expansion==3){c+=" cat cata cataclysm"}}}return c},getComparisonText:function(h,c,b,k){var n=$WH.ce("span");n.className="compare-text";if(!c){n.style.display="block";n.style.margin="0 auto";n.style.textAlign="left";n.style.width="53px"}if(!k){k=LANG.lvcompletion}var f=h.hasOwnProperty("progressAmount")?h.progressAmount:h.progress;if(f<0){f=0}var l=$WH.ce("span");l.className="progress-icon progress-"+(f==1?"8":Math.min(Math.round(f*8),7));var m=$WH.ce("span");if(c){if(h.progress==1){$WH.st(m,k.identical)}else{if(h.progress==-1){$WH.st(m,k.duplicate)}else{if(!h.progress&&h.primary==b){$WH.st(m,k.extra)}else{if(!h.progress){$WH.st(m,k.missing)}else{var o=$WH.ce("span");o.className="tip";$WH.st(o,Math.floor(h.progress*100)+"%");$WH.ae(m,$WH.ct(k.similar+" ("));$WH.ae(m,o);$WH.ae(m,$WH.ct(")"))}}}}}else{$WH.st(m,Math.floor(h.progress*100)+"%")}var j=true;for(var g in h.tooltip){j=j&&(h.tooltip[g].length!=h.data.length)}if(h.tooltip.length&&j){n.onmouseover=Listview.funcBox.comparisonTextOver.bind(n,h,c,b,k);n.onmousemove=$WH.Tooltip.cursorUpdate;n.onmouseout=$WH.Tooltip.hide;if(!c){m.className="tip"}}m.insertBefore($WH.ct(" "),m.firstChild);m.insertBefore(l,m.firstChild);m.style.whiteSpace="nowrap";$WH.ae(n,m);return n}};Listview.templates.list={sort:["-rating","name"],searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",span:2,compute:function(h,f,k){var g=$WH.ce("td");g.style.width="1px";g.style.borderRight="none";g.style.paddingRight="0";$WH.ae(k,g);f.style.borderLeft="none";if(h.hasOwnProperty("thumbnail")){g.style.padding="4px 0 4px 10px";$WH.ae(g,Icon.create("//render-"+h.region.toLowerCase()+".worldofwarcraft.com/character/"+h.thumbnail,(this.iconSize==null?1:this.iconSize),null,this.getItemLink(h)));g.getElementsByTagName("ins")[0].style.backgroundSize="contain"}var m=(h.hasOwnProperty("id")||h.level>=10)?"a":"span";var c=$("<"+m+">").text(h.name).addClass("listview-cleartext").addClass(h.mode!=1||(h.armory&&!h.errcode)?"listmanager-mode"+h.mode:"q10");if(h.mode==1){f.className+=" nowrap"}if(m=="a"){var b=this.getItemLink(h);c.attr("href",b);if(!h.hasOwnProperty("id")){$WH.BattleNet.CharacterExists(h.region,h.realm,h.name,function(n){if(n){return}c.attr("href","javascript:;");c.addClass("q10");h.unreachable=true})}}else{c.addClass("q0")}if(h.description){c.mouseover(function(n){$WH.Tooltip.showAtCursor(n,h.description,0,0,"q")}).mousemove(function(n){$WH.Tooltip.cursorUpdate(n)}).mouseout(function(){$WH.Tooltip.hide()})}if(h.user==g_user.name&&(location.hostname.indexOf("wowhead.com")>=0)&&(location.protocol=="http:")){var j=$("<a>").addClass(h.published?"fa fa-eye":"fa fa-eye-slash").css("padding-right","3px");j.mouseover(function(n){$WH.Tooltip.showAtCursor(n,h.published?LANG.li_clicktohide:LANG.li_clicktoshow,0,0,"q2")}).mousemove(function(n){$WH.Tooltip.cursorUpdate(n)}).mouseout(function(){$WH.Tooltip.hide()});j.click(function(){$WH.Tooltip.hide();new Ajax("/list&publish="+h.id,{method:"POST",onSuccess:function(){if(j.hasClass("fa-eye-slash")){j.removeClass("fa-eye-slash").addClass("fa-eye").mouseover(function(n){$WH.Tooltip.showAtCursor(n,LANG.li_clicktohide,0,0,"q2")})}else{j.removeClass("fa-eye").addClass("fa-eye-slash").mouseover(function(n){$WH.Tooltip.showAtCursor(n,LANG.li_clicktoshow,0,0,"q2")})}}})});$(f).append(j);var l=$("<a>").addClass("fa fa-thumb-tack"+(h.pinned?"":" fa-color-gray"));l.mouseover(function(n){$WH.Tooltip.showAtCursor(n,h.pinned?LANG.li_clicktounpin:LANG.li_clicktopin,0,0,"q2")}).mousemove(function(n){$WH.Tooltip.cursorUpdate(n)}).mouseout(function(){$WH.Tooltip.hide()});l.click(function(){$WH.Tooltip.hide();new Ajax("/list&pin="+h.id,{method:"POST",onSuccess:function(){if(l.hasClass("fa-color-gray")){l.removeClass("fa-color-gray").mouseover(function(n){$WH.Tooltip.showAtCursor(n,LANG.li_clicktounpin,0,0,"q2")})}else{l.addClass("fa-color-gray").mouseover(function(n){$WH.Tooltip.showAtCursor(n,LANG.li_clicktopin,0,0,"q2")})}}})});$(f).append(l)}$(f).append(c);return},getVisibleText:function(b){return b.name}},{id:"realm",name:LANG.realm,type:"text",hidden:true,value:"realm",width:"15%",compute:function(b,c){$WH.st(c,b.realm+" "+b.region)},sortFunc:function(f,c){return $WH.stringCompare(f.region,c.region)||$WH.stringCompare(f.realm,c.realm)}},{id:"race",name:LANG.race,type:"text",width:"10%",compute:function(f,h){if(f.race){var g=$WH.ce("div"),c=$WH.ce("div"),b;b=Icon.create("race_"+g_file_races[f.race]+"_"+g_file_genders[f.gender],0,null,"/race="+f.race);b.onmouseover=function(j){$WH.Tooltip.showAtCursor(j,g_chr_races[f.race],0,0,"q")};b.onmousemove=$WH.Tooltip.cursorUpdate;b.onmouseout=$WH.Tooltip.hide;b.style.cssFloat=b.style.syleFloat="left";g.style.margin="0 auto";g.style.textAlign="left";g.style.width="26px";c.className="clear";$WH.ae(g,b);$WH.ae(h,g);$WH.ae(h,c)}},getVisibleText:function(b){return g_file_genders[b.gender]+" "+g_chr_races[b.race]},sortFunc:function(f,c,g){return $WH.stringCompare(g_chr_races[f.race],g_chr_races[c.race])}},{id:"classs",name:LANG.classs,type:"text",width:"10%",compute:function(f,h){if(f.classs){var g=$WH.ce("div"),c=$WH.ce("div"),b;b=Icon.create("class_"+g_file_classes[f.classs],0,null,"/class="+f.classs);b.onmouseover=function(j){$WH.Tooltip.showAtCursor(j,g_chr_classes[f.classs],0,0,"q")};b.onmousemove=$WH.Tooltip.cursorUpdate;b.onmouseout=$WH.Tooltip.hide;b.style.cssFloat=b.style.syleFloat="left";g.style.margin="0 auto";g.style.textAlign="left";g.style.width="26px";c.className="clear";$WH.ae(g,b);$WH.ae(h,g);$WH.ae(h,c)}},getVisibleText:function(b){return g_chr_classes[b.classs]},sortFunc:function(f,c,g){return $WH.stringCompare(this.getVisibleText(f),this.getVisibleText(c))}},{id:"level",name:LANG.level,value:"level",width:"10%"},{id:"user",name:LANG.author,type:"text",compute:function(c,g){var f=$("<a>").attr("href","/user="+c.user).text(c.user);var b=$WH.getStaffColorFromRoles(c.userroles|0);if(b!=""){f.addClass(b)}else{f.css("color","white")}$(g).append(f)},getVisibleText:function(b){return b.user},sortFunc:function(f,c){return $WH.stringCompare(f.user,c.user)}},{id:"patch",name:LANG.patch,type:"text",value:"patch",width:"10%",compute:function(c,g){var b=$("<span>").text($WH.sprintf("$1.$2.$3",Math.floor(c.patch/100/100),Math.floor(c.patch/100)%100,c.patch%100));var f=($WH.getPatchVersionObject()).versionnum;if(parseInt(c.patch/100)*100>=f){b.addClass("q2")}$(g).append(b);return}}],getItemLink:function(b){if(b.hasOwnProperty("id")){return li_generateListUrl(b)}if(b.level<10||b.unreachable){return"javascript:;"}return"/list/"+b.url+"?private"}};Listview.templates.resource={sort:[1],mode:0,nItemsPerPage:100,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",span:2,compute:function(f,k,h){var c=$WH.ce("td");c.style.width="1px";c.style.paddingRight="0";c.style.borderRight="none";var g=Icon.create(f.icon,(this.iconSize==null?0:this.iconSize),null,this.getItemLink(f));$WH.ae(c,g);$WH.ae(h,c);k.style.borderLeft="none";var j=$WH.ce("div");$WH.ae(k,j);var b=$WH.ce("a");b.className="listview-cleartext";b.href=this.getItemLink(f);$WH.ae(b,$WH.ct(f.name));$WH.ae(j,b)},getVisibleText:function(b){return b.name}},{id:"description",name:LANG.description,type:"text",align:"left",compute:function(b,c){c.innerHTML=b.description}}],getItemLink:function(b){return"/resource="+b.id}};Listview.templates.skill={sort:[1],searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",span:2,compute:function(c,k,h){var f=$WH.ce("td");f.style.width="1px";f.style.paddingRight="0";f.style.borderRight="none";$WH.ae(f,Icon.create(c.icon,0,null,this.getItemLink(c)));$WH.ae(h,f);k.style.borderLeft="none";var j=$WH.ce("div");var b=$WH.ce("a");b.className="listview-cleartext";b.href=this.getItemLink(c);$WH.ae(b,$WH.ct(c.name));if(c.expansion){var g=$WH.ce("span");g.className=$WH.getExpansionClassName(c.expansion);$WH.ae(g,b);$WH.ae(j,g)}else{$WH.ae(j,b)}$WH.ae(k,j)},getVisibleText:function(b){var c=b.name+Listview.funcBox.getExpansionText(b);return c}},{id:"category",name:LANG.category,type:"text",width:"16%",compute:function(c,f){if(c.category!=0&&g_skill_categories[c.category]){f.className="small q1";var b=$WH.ce("a");b.href="/skills="+c.category;$WH.ae(b,$WH.ct(g_skill_categories[c.category]));$WH.ae(f,b)}},getVisibleText:function(b){return g_skill_categories[skill.category]},sortFunc:function(f,c,g){return $WH.stringCompare(g_skill_categories[f.category],g_skill_categories[c.category])}}],getItemLink:function(b){return"/skill="+b.id}};Listview.templates.spell={sort:["name","skill","level"],mode:1,searchable:1,filtrable:1,completionText:LANG.lvcompletion_collection,columns:[{id:"name",name:LANG.name,type:"text",align:"left",span:2,value:"name",compute:function(k,h,n){var j=$WH.ce("td"),q;j.style.width="44px";j.style.padding="3px 0 3px 12px";j.style.borderRight="none";if(k.creates!=null){q=g_items.createIcon(k.creates[0],1,Listview.funcBox.createTextRange(k.creates[1],k.creates[2]))}else{if((k.taughtby!=null)&&g_items[k.taughtby]){q=g_items.createIcon(k.taughtby,1);k.name=g_items[k.taughtby].name.charAt(0)+k.name.substring(1)}else{q=g_spells.createIcon(k.id,1)}}q.style.cssFloat=q.style.styleFloat="left";$WH.ae(j,q);$WH.ae(n,j);h.style.borderLeft="none";var b=$WH.ce("div");var p=$WH.ce("a");var o=k.name.charAt(0);p.className="listview-cleartext";if(o!="@"){p.className+=" q"+(8-parseInt(o))}p.href=this.getItemLink(k);if(k.frommerge==1){p.className+=" icon-merge-right"}$WH.ae(p,$WH.ct(k.name.substring(1)));$WH.ae(b,p);if(k.rank){var m=$WH.ce("div");m.className="small2";$WH.ae(m,$WH.ct(k.rank));$WH.ae(b,m)}if(this.showRecipeClass&&k.reqclass){var m=$WH.ce("div");m.className="small2";var g=Listview.funcBox.assocBinFlags(k.reqclass,g_chr_classes);for(var j=0,l=g.length;j<l;++j){if(j>0){$WH.ae(m,$WH.ct(", "))}p=$WH.ce("a");p.href="/class="+g[j];p.className="c"+g[j];$WH.st(p,g_chr_classes[g[j]]);$WH.ae(m,p)}$WH.ae(b,m)}if(k.id>g_spells.ZAM_IDS){b.style.position="relative";var m=$WH.ce("div");m.className="listview-name-info";$WH.ae(m,$WH.ct(LANG.unreleasedspell));$WH.aef(b,m)}if(k.reqrace){b.style.position="relative";var m=$WH.ce("div");m.className="listview-name-info";if((k.reqrace&1791)==1101){$WH.ae(m,$WH.ct(g_sides[1]))}else{if((k.reqrace&1791)==690){$WH.ae(m,$WH.ct(g_sides[2]))}else{var f=Listview.funcBox.assocBinFlags(k.reqrace,g_chr_races);m.className+=" q1";for(var j=0,l=f.length;j<l;++j){if(j>0){$WH.ae(m,$WH.ct(LANG.comma))}var p=$WH.ce("a");p.href="/race="+f[j];$WH.st(p,g_chr_races[f[j]]);$WH.ae(m,p)}}}$WH.aef(b,m)}$WH.ae(h,b)},getVisibleText:function(c){var h=c.name;if(c.rank){h+=" "+c.rank}if(c.reqclass){var g=Listview.funcBox.assocBinFlags(c.reqclass,g_chr_classes);for(var f=0,b=g.length;f<b;++f){if(f>0){h+=LANG.comma}h+=g_chr_classes[g[f]]}}if(c.reqrace){h+=" "+Listview.funcBox.arrayText(Listview.funcBox.assocBinFlags(c.reqrace,g_chr_races),g_chr_races)}if((c.reqrace&1791)==1101){h+=" "+g_sides[1]}else{if((c.reqrace&1791)==690){h+=" "+g_sides[2]}}return h}},{id:"level",name:LANG.level,width:"10%",value:"level",compute:function(b,c){if(b.level>0){return b.level}},hidden:true},{id:"trainingcost",name:LANG.cost,width:"10%",hidden:true,getValue:function(b){if(b.trainingcost){return b.trainingcost}},compute:function(b,c){if(b.trainingcost){Listview.funcBox.appendMoney(c,b.trainingcost)}},sortFunc:function(f,c,g){if(f.trainingcost==null){return -1}else{if(c.trainingcost==null){return 1}}if(f.trainingcost<c.trainingcost){return -1}else{if(f.trainingcost>c.trainingcost){return 1}}return 0}},{id:"classes",name:LANG.classes,type:"text",hidden:true,width:"20%",getVisibleText:function(c){var h="";if(c.reqclass){var g=Listview.funcBox.assocBinFlags(c.reqclass,g_chr_classes);for(var f=0,b=g.length;f<b;++f){if(f>0){h+=LANG.comma}h+=g_chr_classes[g[f]]}}return h},compute:function(c,k){if(c.reqclass){var g=Listview.funcBox.assocBinFlags(c.reqclass,g_chr_classes);var j=$WH.ce("div");j.style.width=(26*g.length)+"px";j.style.margin="0 auto";for(var f=0,b=g.length;f<b;++f){var h=Icon.create("class_"+g_file_classes[g[f]],0,null,"/class="+g[f]);h.style.cssFloat=h.style.styleFloat="left";$(h).mouseover((function(l){return function(m){$WH.Tooltip.showAtCursor(m,l,0,0,"q")}})(g_chr_classes[g[f]])).mousemove(function(l){$WH.Tooltip.cursorUpdate(l)}).mouseout(function(){$WH.Tooltip.hide()});$WH.ae(j,h)}$WH.ae(k,j)}},sortFunc:function(f,c,g){return Listview.funcBox.assocArrCmp(Listview.funcBox.assocBinFlags(f.reqclass,g_chr_classes),Listview.funcBox.assocBinFlags(c.reqclass,g_chr_classes),g_chr_classes)}},{id:"singleclass",name:LANG.classs,type:"text",hidden:true,width:"15%",compute:function(b,h){if(b.reqclass){var c=Listview.funcBox.assocBinFlags(b.reqclass,g_chr_classes);var f=c[0];var g=$("<a>").css("background-image",'url("'+g_staticUrl+"/images/wow/icons/tiny/class_"+g_file_classes[f]+'.gif")').addClass("icontiny tinyspecial").addClass("c"+f).attr("href","/class="+f).text(g_chr_classes[f]);$(h).append(g)}},sortFunc:function(f,c,g){return Listview.funcBox.assocArrCmp(Listview.funcBox.assocBinFlags(f.reqclass,g_chr_classes),Listview.funcBox.assocBinFlags(c.reqclass,g_chr_classes),g_chr_classes)}},{id:"glyphtype",name:LANG.glyphtype,type:"text",hidden:true,width:"10%",compute:function(b,c){if(b.glyphtype){return g_item_glyphs[b.glyphtype]}}},{id:"guildlevel",name:LANG.guildlevel,width:"10%",value:"guildlevel",compute:function(b,c){if(b.guildlevel>0){return b.guildlevel}},hidden:true},{id:"schools",name:LANG.school,type:"text",width:"10%",hidden:true,compute:function(b,h){var g="";var f=b.schools?b.schools:b.school;for(var c=0;c<32;++c){if(!(f&(1<<c))){continue}if(g!=""){g+=", "}g+=g_spell_resistances[c]}return g},sortFunc:function(f,c,g){return $WH.stringCompare(this.compute(f),this.compute(c))}},{id:"type",name:LANG.type,type:"text",width:"14%",hidden:true,compute:function(k,f){var c=$WH.ce("div");c.className="small";if($WH.inArray([7,-2,-7,-12,-11,-13,-14,-16,-17],k.cat)!=-1){var o=$WH.ce("a");o.className="q0";o.href="/spells="+k.cat;$WH.ae(o,$WH.ct(g_spell_categories[k.cat]));$WH.ae(c,o);$WH.ae(c,$WH.ce("br"));if(k.talentspec){var n=0,l;for(var h=0,m=k.talentspec.length;h<m;++h){var p=k.talentspec[h]&65535;if(this._wowClass&&($WH.inArray(g_chr_specs_by_class[this._wowClass],p)==-1)){continue}if(!g_chr_specs.hasOwnProperty(p)){continue}if(n++>0){$WH.ae(c,$WH.ct(LANG.comma))}l=k.reqclass||k.chrclass;if(l){l=(1+Math.log(k.reqclass)/Math.LN2)}else{for(var g in g_chr_specs_by_class){if(!g_chr_specs_by_class.hasOwnProperty(g)){continue}if($WH.inArray(g_chr_specs_by_class[g],p)>=0){l=g;break}}}var b=$WH.ce("a");b.className="q1";b.href="/spells="+k.cat+"."+l+"."+p;$WH.ae(b,$WH.ct(g_chr_specs[p]));$WH.ae(c,b)}if(n==0){l=k.reqclass||k.chrclass;if(l){for(h in g_chr_classes){if(!g_chr_classes.hasOwnProperty(h)){continue}if((l&Math.pow(2,parseInt(h,10)-1))!=0){if(n++>0){$WH.ae(c,$WH.ct(LANG.comma))}var b=$WH.ce("a");b.className="q1";b.href="/spells="+k.cat+"."+h;$WH.ae(b,$WH.ct(g_chr_classes[h]));$WH.ae(c,b)}}}}}else{if(g_spell_types[k.cat]){if(k.cat==-11&&(k.type==1||k.type==2)){var b=$WH.ce("a");b.className="q1";b.href="/spells="+k.cat+"?filter=cr=22;crs="+k.type+";crv=0";$WH.ae(b,$WH.ct(g_spell_types[k.cat][k.type]));$WH.ae(c,b)}else{$WH.ae(c,$WH.ct(g_spell_types[k.cat][k.type]))}}else{if(k.reqclass){var b=$WH.ce("a");b.className="q1";b.href="/spells="+k.cat+"."+(1+Math.log(k.reqclass)/Math.LN2)+(g_item_glyphs[k.glyphtype]?"?filter=gl="+k.glyphtype:"");$WH.ae(b,$WH.ct((g_item_glyphs[k.glyphtype]?g_item_glyphs[k.glyphtype]+" ":"")+g_chr_classes[(1+Math.log(k.reqclass)/Math.LN2)]));$WH.ae(c,b)}}}}else{if(g_spell_categories[k.cat]){var o=$WH.ce("a");o.className="q1";o.href="/spells="+k.cat;$WH.ae(o,$WH.ct(g_spell_categories[k.cat]));$WH.ae(c,o)}}$WH.ae(f,c)},getVisibleText:function(b){var c=g_spell_categories[b.cat];if($WH.inArray([7,-2,-12,-11,-13,-14,-16,-17],b.cat)!=-1){if(b.talentspec){c+=" "+Listview.funcBox.arrayText(b.talentspec,g_chr_specs)}else{if(g_spell_types[b.cat]){c+=" "+g_spell_types[b.cat][b.type]}else{if(g_item_glyphs[b.glyphtype]){c+=" "+g_item_glyphs[b.glyphtype]}c+=" "+g_chr_classes[(1+Math.log(b.reqclass)/Math.LN2)]}}}return c},sortFunc:function(f,c,g){var j=(g_spell_types[f.cat]?g_spell_types[f.cat][f.type]:f.type),h=(g_spell_types[c.cat]?g_spell_types[c.cat][c.type]:f.type);return $WH.stringCompare(f.cat,c.cat)||$WH.stringCompare(j,h)}},{id:"reagents",name:LANG.reagents,width:"9%",getValue:function(b){return(b.reagents?b.reagents.length:0)},compute:function(j,f){var b=(j.reagents!=null);if(b){f.style.padding="0";var m=$WH.ce("div");var l=j.reagents;m.style.width=(44*l.length)+"px";m.style.margin="0 auto";for(var g=0,k=l.length;g<k;++g){var c=l[g][0];var h=l[g][1];var n=g_items.createIcon(c,1,h);n.style.cssFloat=n.style.styleFloat="left";$WH.ae(m,n)}$WH.ae(f,m)}},sortFunc:function(f,c){var h=(f.reagents!=null?f.reagents.length:0);var g=(c.reagents!=null?c.reagents.length:0);if(h>0&&h==g){return $WH.stringCompare(f.reagents.toString(),c.reagents.toString())}else{return $WH.stringCompare(h,g)}}},{id:"source",name:LANG.source,type:"text",width:"12%",hidden:true,compute:function(c,h){if(c.source!=null){var g="";for(var f=0,b=c.source.length;f<b;++f){if(f>0){g+=LANG.comma}g+=g_sources[c.source[f]]}return g}},sortFunc:function(f,c,g){return Listview.funcBox.assocArrCmp(f.source,c.source,g_sources)}},{id:"side",name:LANG.side,type:"text",hidden:true,compute:function(b,f){if(b.side&&b.side!=3){var c=$WH.ce("span");c.className=(b.side==1?"icon-alliance":"icon-horde");c.onmouseover=function(g){$WH.Tooltip.showAtCursor(g,g_sides[b.side],0,0,"q")};c.onmousemove=$WH.Tooltip.cursorUpdate;c.onmouseout=$WH.Tooltip.hide;$WH.ae(f,c)}},getVisibleText:function(b){if(b.side){return g_sides[b.side]}},sortFunc:function(f,c,g){return $WH.stringCompare(g_sides[f.side],g_sides[c.side])}},{id:"itemsource",name:LANG.source,type:"text",hidden:true,compute:function(b,g){var f=g_items[b.taughtby];if(f){for(var c=0;c<Listview.templates.item.columns.length;++c){if(Listview.templates.item.columns[c].id=="source"){return Listview.templates.item.columns[c].compute(f,g)}}}},getVisibleText:function(b){var f=g_items[b.taughtby];if(f){for(var c=0;c<Listview.templates.item.columns.length;++c){if(Listview.templates.item.columns[c].id=="source"){return Listview.templates.item.columns[c].getVisibleText(f)}}}},sortFunc:function(f,c){var j=g_items[f.taughtby];var h=g_items[c.taughtby];if(j&&h){for(var g=0;g<Listview.templates.item.columns.length;++g){if(Listview.templates.item.columns[g].id=="source"){return Listview.templates.item.columns[g].sortFunc(j,h)}}}}},{id:"branch",name:LANG.branch,type:"text",width:"10%",hidden:true,compute:function(b,c){if(b.project){if(g_project_branches[b.project.branch]){$(c).append(g_project_branches[b.project.branch]+"<br />")}$(c).append("<small"+(!b.project.rarity?' class="q0"':"")+">"+g_project_rarity[b.project.rarity||0]+"</small>")}},getVisibleText:function(b){var c="";if(b.project){if(g_project_branches[b.project.branch]){c+=g_project_branches[b.project.branch]+" "}c+=g_project_rarity[b.project.rarity||0]}return c},sortFunc:function(f,c,g){if(!f.project||!c.project){return(f.project?1:(c.project?-1:0))}return $WH.stringCompare(g_project_branches[f.project.branch],g_project_branches[c.project.branch])||-$WH.stringCompare(f.project.rarity,c.project.rarity)}},{id:"fragments",name:LANG.fragments,type:"text",width:"10%",hidden:true,compute:function(b,f){if(b.project){var c=$("<a/>",{href:"/currency="+b.project.currency,text:b.project.ncurrency});c.addClass("q1");if(!g_gatheredcurrencies[b.project.currency]){$.each(g_currencies,function(h,g){g_gatheredcurrencies[h]=[];g_gatheredcurrencies[h]["name_"+Locale.getName()]=g[0];g_gatheredcurrencies[h].icon=[];g_gatheredcurrencies[h].icon.push(g[1]);g_gatheredcurrencies[h].icon.push(g[1])})}c.addClass("icontinyr tip");c.css("background-image","url("+g_staticUrl+"/images/wow/icons/tiny/"+g_gatheredcurrencies[b.project.currency].icon[0].toLowerCase()+".gif)");c.mouseover(function(g){$WH.Tooltip.showAtCursor(g,g_gatheredcurrencies[b.project.currency]["name_"+Locale.getName()],0,0,"q")});c.mousemove($WH.Tooltip.cursorUpdate);c.mouseout($WH.Tooltip.hide);$(f).append(c)}},sortFunc:function(f,c,g){if(!f.project||!c.project){return(f.project?1:(c.project?-1:0))}return $WH.stringCompare(f.project.ncurrency,c.project.ncurrency)||$WH.stringCompare(f.project.currency,c.project.currency)}},{id:"keystone",name:LANG.keystone,type:"text",width:"10%",hidden:true,compute:function(b,f){if(b.project&&b.project.nkeystones&&g_items[b.project.keystone]){f.style.padding="0";var c=$WH.ce("div");c.style.width="44px";c.style.margin="0 auto";$WH.ae(c,g_items.createIcon(b.project.keystone,1,b.project.nkeystones));$WH.ae(f,c)}},getVisibleText:function(b){if(b.project&&b.project.nkeystones&&g_items[b.project.keystone]){return g_items[b.project.keystone]["name_"+Locale.getName()]}},sortFunc:function(f,c,j){if(!f.project||!c.project){return(f.project?1:(c.project?-1:0))}var h=f.project.nkeystones&&g_items[f.project.keystone]?g_items[f.project.keystone]["name_"+Locale.getName()]:"";var g=c.project.nkeystones&&g_items[c.project.keystone]?g_items[c.project.keystone]["name_"+Locale.getName()]:"";return $WH.stringCompare(h,g)||$WH.stringCompare(f.project.nkeystones,c.project.nkeystones)}},{id:"skill",name:LANG.skill,type:"text",width:"20%",getValue:function(b){return b.learnedat},compute:function(y,k,b,n){if(y.skill!=null){this.skillsColumn=n;var m=$WH.ce("div"),v;m.className="small";for(var q=0,s=y.skill.length;q<s;++q){if(q>0){$WH.ae(m,$WH.ct(LANG.comma))}if(y.skill[q]==-1){$WH.ae(m,$WH.ct(LANG.ellipsis))}else{if($WH.inArray([-3,-5,-6,-7,11,9],y.cat)!=-1){var j="";if((y.cat==-3)&&!(y.reqclass)){for(var t=0;t<mn_spells.length;t++){if(mn_spells[t][0]==-3){for(var r=0;r<mn_spells[t][3].length;r++){for(var p=0;p<mn_spells[t][3][r][3].length;p++){if(mn_spells[t][3][r][3][p][0]==y.skill[q]){j=mn_spells[t][3][r][0]+"."}}}}}}else{if(y.reqclass){j=""+(1+Math.log(y.reqclass)/Math.LN2)+"."}}var v=$WH.ce("a");v.className="q1";if($WH.inArray([-5,-6],y.cat)!=-1){v.href="/spells="+y.cat}else{v.href="/spells="+y.cat+"."+j+y.skill[q]}var u=$WH.getGets();var g=(u.spells?u.spells.split("."):[false,false]);if(y.reqclass&&(y.cat==7||y.cat==-2)){if(q<1&&((1+Math.log(y.reqclass)/Math.LN2)!=g[1])){var w=$WH.ce("a");w.className="q0";w.href="/spells="+y.cat+"."+(1+Math.log(y.reqclass)/Math.LN2);$WH.ae(w,$WH.ct(g_chr_classes[(1+Math.log(y.reqclass)/Math.LN2)]));$WH.ae(m,w);$WH.ae(m,$WH.ce("br"))}}$WH.ae(v,$WH.ct(g_spell_skills[y.skill[q]]));$WH.ae(m,v)}else{if($WH.inArray([-2,7],y.cat)!=-1){var v=$WH.ce("a");v.className="q1";v.href="/spells="+y.cat+"."+(y.reqclass?(1+Math.log(y.reqclass)/Math.LN2):"");$WH.ae(v,$WH.ct(g_spell_skills[y.skill[q]]));$WH.ae(m,v)}else{$WH.ae(m,$WH.ct(g_spell_skills[y.skill[q]]))}}}}if(y.specialization&&g_skill_specializations[y.specialization]){var l=v.href;if(l){v=$WH.ce("a");v.className="q1";v.href=l+"."+y.specialization;$WH.ae(m,$WH.ct(": "));$WH.ae(v,$WH.ct(g_skill_specializations[y.specialization]));$WH.ae(m,v)}else{$WH.ae(m,$WH.ct(": "+g_skill_specializations[y.specialization]))}}if(y.learnedat>0){$WH.ae(m,$WH.ct(" ("));var c=$WH.ce("span");if(y.learnedat==9999){c.className="q0";$WH.ae(c,$WH.ct("??"))}else{if(y.learnedat>0){$WH.ae(c,$WH.ct(y.learnedat));c.style.fontWeight="bold"}}$WH.ae(m,c);$WH.ae(m,$WH.ct(")"))}$WH.ae(k,m);if(y.colors!=null){this.columns[n].type=null;var f=y.colors,o=0;for(var q=0;q<f.length;++q){if(f[q]>0){++o;break}}if(o>0){o=0;m=$WH.ce("div");m.className="small";m.style.fontWeight="bold";for(var q=0;q<f.length;++q){if(f[q]>0){if(o++>0){$WH.ae(m,$WH.ct(" "))}var h=$WH.ce("span");h.className="r"+(q+1);$WH.ae(h,$WH.ct(f[q]));$WH.ae(m,h)}}$WH.ae(k,m)}}}else{if((y.reqclass)&&($WH.inArray([-2,7],y.cat)!=-1)){var m=$WH.ce("div"),v;m.className="small";var v=$WH.ce("a");v.className="q1";v.href="/spells="+y.cat+"."+(y.reqclass?(1+Math.log(y.reqclass)/Math.LN2):"");$WH.ae(v,$WH.ct(g_chr_classes[(1+Math.log(y.reqclass)/Math.LN2)]));$WH.ae(m,v);$WH.ae(k,m)}}},getVisibleText:function(b){var c=Listview.funcBox.arrayText(b.skill,g_spell_skills);if(b.specialization){c+=" "+(g_skill_specializations[b.specialization])}if(b.learnedat>0){c+=" "+(b.learnedat==9999?"??":b.learnedat)}return c},sortFunc:function(g,c){if(g.reqclass&&c.reqclass){var k=$WH.stringCompare(g_chr_classes[(1+Math.log(g.reqclass)/Math.LN2)],g_chr_classes[(1+Math.log(c.reqclass)/Math.LN2)]);if(k){return k}}var f=[g.learnedat,c.learnedat];for(var j=0;j<2;++j){var l=(j==0?g:c);if(f[j]==9999&&l.colors!=null){var h=0;while(l.colors[h]==0&&h<l.colors.length){h++}if(h<l.colors.length){f[j]=l.colors[h]}}}var m=$WH.stringCompare(f[0],f[1]);if(m!=0){return m}if(g.colors!=null&&c.colors!=null){for(var h=0;h<4;++h){if(g.hasOwnProperty("colors")&&c.hasOwnProperty("colors")&&g.colors.hasOwnProperty(h)&&c.colors.hasOwnProperty(h)){m=$WH.stringCompare(g.colors[h],c.colors[h])}if(m!=0){return m}}}return Listview.funcBox.assocArrCmp(g.skill,c.skill,g_spell_skills)}},{id:"skillup",name:LANG.skillpoints,width:"10%",value:"nskillup",compute:function(b,c){if(b.nskillup>0){return b.nskillup}},hidden:true},{id:"completed",name:LANG.completion,hidden:true,compute:function(c,g,f,b){if(!c.hasOwnProperty("cat")||!this.template._validCompletionCategory(c.cat)){return}$WH.addCompletionIcons(g,"spell",c.id)},sortFunc:function(f,c,g){return $WH.stringCompare(this.template._spellCompletedFlags(f.id),this.template._spellCompletedFlags(c.id))},getValue:function(f){var h=0;var g=g_completion.spell;if((!f.hasOwnProperty("cat"))||(!this.template._validCompletionCategory(f.cat))){return -1}for(var j in g_user.lists){var b=g_user.lists[j];if(!(b.id in g)){continue}if($WH.inArray(g[b.id],f.id)!=-1){h++}}return h}}],getItemLink:function(b){return"/spell="+b.id},_spellCompletedFlags:function(b){return $WH.getCompletionFlags("spell",b)},_validCompletionCategory:function(b){return $WH.inArray(g_completion_categories[6],b)!=-1},createCbControls:function(f,c){if(!c){return}var b=$WH.ce("input");b.type="button";b.value=(!this.characterSettings||!this.characterSettings.editable?LANG.li_addtolist:LANG.li_addtoanotherlist);b.onclick=(function(g){Listview.cbAddToList.call(this,g,"spell")}).bind(this);$WH.ae(f,b)},createTooltipToggle:function(c,b){if(!b){return}this.addTooltipToggle(c,g_spells)},onBeforeCreate:function(){for(var b in this.columns){if((this.columns[b].id=="completed")&&(this.columns[b].hidden)){if((!(this.hasOwnProperty("completionMode")&&this.completionMode))&&$WH.isSet("g_user")&&("lists" in g_user)&&("spell" in g_completion)&&($WH.inArray(this.hiddenCols,this.columns[b].id)==-1)){var c=0;for(var f in this.data){if(this.data[f].hasOwnProperty("cat")&&this.template._validCompletionCategory(this.data[f].cat)){c++}}if(c>(this.data.length*0.1)){this.visibility.push(parseInt(b))}}}}}};Listview.templates.pet={sort:[1],nItemsPerPage:-1,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",span:2,compute:function(b,l,h){var f=$WH.ce("td");f.style.width="1px";f.style.paddingRight="0";f.style.borderRight="none";$WH.ae(f,Icon.create(b.icon,0));$WH.ae(h,f);l.style.borderLeft="none";var k=$WH.ce("div");var c=$WH.ce("a");c.className="listview-cleartext";c.href=this.getItemLink(b);$WH.ae(c,$WH.ct(b.name));if(b.expansion){var g=$WH.ce("span");g.className=$WH.getExpansionClassName(b.expansion);$WH.ae(g,c);$WH.ae(k,g)}else{$WH.ae(k,c)}if(b.exotic){k.style.position="relative";var j=$WH.ce("div");j.className="listview-name-info q1";var c=$WH.ce("a");c.href="/spell=53270";$WH.ae(c,$WH.ct(LANG.lvpet_exotic));$WH.ae(j,c);$WH.ae(k,j)}$WH.ae(l,k)},getVisibleText:function(b){var c=b.name+Listview.funcBox.getExpansionText(b);if(b.exotic){c+=" "+LANG.lvpet_exotic}return c}},{id:"level",name:LANG.level,type:"range",getMinValue:function(b){return b.minlevel},getMaxValue:function(b){return b.maxlevel},compute:function(b,c){if(b.minlevel>0&&b.maxlevel>0){if(b.minlevel!=b.maxlevel){return b.minlevel+LANG.hyphen+b.maxlevel}else{return b.minlevel}}else{return -1}},sortFunc:function(f,c,g){if(g>0){return $WH.stringCompare(f.minlevel,c.minlevel)||$WH.stringCompare(f.maxlevel,c.maxlevel)}else{return $WH.stringCompare(f.maxlevel,c.maxlevel)||$WH.stringCompare(f.minlevel,c.minlevel)}}},{id:"abilities",name:LANG.abilities,type:"text",getValue:function(c){if(!c.spells){return""}if(c.spells.length>0){var g="";for(var f=0,b=c.spells.length;f<b;++f){if(c.spells[f]){g+=g_spells[c.spells[f]]["name_"+Locale.getName()]}}return g}},compute:function(b,c){if(!b.spells){return""}if(b.spells.length>0){c.style.padding="0";Listview.funcBox.createCenteredIcons(b.spells,c,"",1)}},sortFunc:function(f,c){if(!f.spells||!c.spells){return 0}return $WH.stringCompare(f.spellCount,c.spellCount)||$WH.stringCompare(f.spells,c.spells)},hidden:true},{id:"diet",name:LANG.diet,type:"text",compute:function(b,h){if(h){h.className="small";h.style.minWidth="110px"}var c=0,f="";for(var g in g_pet_foods){if(b.diet&g){if(c++>0){f+=LANG.comma}f+=g_pet_foods[g]}}return f},sortFunc:function(f,c){return $WH.stringCompare(c.foodCount,f.foodCount)||Listview.funcBox.assocArrCmp(f.diet,c.diet,g_pet_foods)}},{id:"type",name:LANG.type,type:"text",compute:function(b,f){if(b.type!=null){f.className="small q1";var c=$WH.ce("a");c.href="/pets="+b.type;$WH.ae(c,$WH.ct(g_pet_types[b.type]));$WH.ae(f,c)}},getVisibleText:function(b){if(b.type!=null){return g_pet_types[b.type]}},sortFunc:function(f,c,g){return $WH.stringCompare(g_pet_types[f.type],g_pet_types[c.type])}}],getItemLink:function(b){return"/pet="+b.id},getStatPct:function(c){var b=$WH.ce("span");if(!isNaN(c)&&c>0){b.className="q2";$WH.ae(b,$WH.ct("+"+c+"%"))}else{if(!isNaN(c)&&c<0){b.className="q10";$WH.ae(b,$WH.ct(c+"%"))}}return b}};Listview.templates["pet-ability"]={sort:[1],nItemsPerPage:100,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",span:2,compute:function(h,g,f){var c=$WH.ce("td");c.style.width="1px";c.style.padding="3px 0 3px 12px";c.style.borderRight="none";if(h.icon){$WH.ae(c,Icon.create(h.icon,(this.iconSize==null?1:this.iconSize),null,"/pet-ability="+h.id))}else{$WH.ae(c,Icon.create("inv_misc_questionmark",(this.iconSize==null?1:this.iconSize),null,"/pet-ability="+h.id))}$WH.ae(f,c);g.style.borderLeft="none";var b=$WH.ce("a");b.className="listview-cleartext";b.href=this.getItemLink(h);$WH.ae(b,$WH.ct(h.name));$WH.ae(g,b)},getVisibleText:function(c){var b=c.name;return b},sortFunc:function(f,c,g){return $WH.stringCompare(f.name,c.name)}},{id:"level",name:LANG.level,value:"level",hidden:true},{id:"damage",name:LANG.damage,value:"damage"},{id:"healing",name:LANG.healing,value:"healing"},{id:"duration",name:LANG.duration,value:"duration",compute:function(c,b){if(c.duration){return $WH.sprintf(LANG.durationturns_format,c.duration)}}},{id:"cooldown",name:LANG.cooldown,value:"cooldown",compute:function(c,b){if(c.cooldown){return $WH.sprintf(LANG.cooldownturns_format,c.cooldown)}}},{id:"accuracy",name:LANG.accuracy,value:"accuracy",compute:function(c,b){if(c.accuracy){return $WH.sprintf(LANG.accuracy_format,c.accuracy)}}},{id:"type",name:LANG.type,type:"text",width:"12%",compute:function(g,f){f.className="small q1";var b=$WH.ce("a");b.href="/pet-abilities="+g.type;var c=g.type!=-1?g_battlepetability_types[g.type+1]:"Aura";$WH.ae(b,$WH.ct(c));$WH.ae(f,b)},getVisibleText:function(b){return g_battlepetability_types[b.type+1]},sortFunc:function(f,c,g){return $WH.stringCompare(g_battlepetability_types[f.type+1],g_battlepetability_types[c.type+1])}}],getItemLink:function(b){return"/pet-ability="+b.id}};Listview.templates.petability=Listview.templates["pet-ability"];Listview.templates["pet-species"]={sort:[1],mode:1,nItemsPerPage:100,searchable:1,filtrable:1,completionText:LANG.lvcompletion_battlepet,columns:[{id:"name",name:LANG.name,type:"text",align:"left",span:2,compute:function(n,f,l){var j=$WH.validateBpet(n,n.bpet),h=$WH.calcBattlePetStats(n,j.breed,j.quality,j.level,n.elite);var g=$WH.ce("td");g.style.width="1px";g.style.padding="3px 0 3px 3px";g.style.borderRight="none";$WH.ae(g,Icon.create(n.icon,1,null,this.getItemLink(n)));$WH.ae(l,g);f.style.borderLeft="none";if(n.elite){f.className="icon-boss-padded"}var b=$WH.ce("div");b.className="expanded-pet-view-wrapper";var o=$WH.ce("span");var m=$WH.ce("a");m.className="q"+j.quality+" listview-cleartext";m.href=this.getItemLink(n);if(n.name&&n.name!=n.npc.name){$WH.ae(m,$WH.ct(n.name+" <"+n.npc.name+">"))}else{$WH.ae(m,$WH.ct(n.npc.name))}$WH.ae(o,m);if(n.expansion){var c=$WH.ce("span");c.className=$WH.getExpansionClassName(n.expansion);$WH.ae(c,o);$WH.ae(b,c)}else{$WH.ae(b,o)}if(n.untameable){var k=$WH.ce("div");k.className="listview-name-info q10";$WH.ae(k,$WH.ct(LANG.lvspecies_untameable));$WH.aef(b,k)}else{if(n.companion){var k=$WH.ce("div");k.className="listview-name-info q1";$WH.ae(k,$WH.ct(LANG.lvspecies_companion));$WH.aef(b,k)}}if(j.hasOwnProperty("team")&&j.team){var k=$WH.ce("div");k.className="listview-name-info fa fa-users";$WH.Tooltip.simple(k,LANG.filters_pet_abilities.team);$WH.aef(b,k)}if(j.hasOwnProperty("favorite")&&j.favorite){var k=$WH.ce("div");k.className="listview-name-info fa fa-star";$WH.Tooltip.simple(k,LANG.favorite);$WH.aef(b,k)}$WH.ae(f,b)},getVisibleText:function(b){var c="";if(b.name&&b.name!=b.npc.name){c+=b.name+" <"+b.npc.name+">"}else{c+=b.npc.name}c+=Listview.funcBox.getExpansionText(b);if(b.companion){c+=" "+LANG.lvspecies_companion}if(b.untameable){c+=" "+LANG.lvspecies_untameable}if(b.elite){c+=" "+LANG.lvspecies_elite}return c},sortFunc:function(f,c){return $WH.stringCompare(f.name,c.name)||$WH.stringCompare(f.npc.name,c.npc.name)}},{id:"level",name:LANG.level,getValue:function(c){var b=$WH.validateBpet(c,c.bpet);return b.level},compute:function(c,g){var b=$WH.validateBpet(c,c.bpet);if(c.elite){$WH.ae(g,$WH.ct(b.level));var f=$WH.ce("div");f.className="small";f.innerHTML=LANG.lvspecies_elite;$WH.ae(g,f);return}return b.level},sortFunc:function(f,c){var h=$WH.validateBpet(f,f.bpet);var g=$WH.validateBpet(c,c.bpet);return $WH.stringCompare(h.level,g.level)}},{id:"health",name:LANG.health,getValue:function(c){var b=$WH.validateBpet(c,c.bpet),f=$WH.calcBattlePetStats(c,b.breed,b.quality,b.level,c.elite);return f.health},compute:function(c,g){if(c.companion){return}var b=$WH.validateBpet(c,c.bpet),f=$WH.calcBattlePetStats(c,b.breed,b.quality,b.level,c.elite);return f.health},sortFunc:function(f,c){var k=$WH.validateBpet(f,f.bpet);var j=$WH.validateBpet(c,c.bpet);var g=$WH.calcBattlePetStats(f,k.breed,k.quality,k.level,f.elite);var h=$WH.calcBattlePetStats(c,j.breed,j.quality,j.level,c.elite);return $WH.stringCompare(g.health,h.health)}},{id:"power",name:LANG.power,getValue:function(c){var b=$WH.validateBpet(c,c.bpet),f=$WH.calcBattlePetStats(c,b.breed,b.quality,b.level,c.elite);return f.power},compute:function(c,g){if(c.companion){return}var b=$WH.validateBpet(c,c.bpet),f=$WH.calcBattlePetStats(c,b.breed,b.quality,b.level,c.elite);return f.power},sortFunc:function(f,c){var k=$WH.validateBpet(f,f.bpet);var j=$WH.validateBpet(c,c.bpet);var g=$WH.calcBattlePetStats(f,k.breed,k.quality,k.level,f.elite);var h=$WH.calcBattlePetStats(c,j.breed,j.quality,j.level,c.elite);return $WH.stringCompare(g.power,h.power)}},{id:"speed",name:LANG.speed,getValue:function(c){var b=$WH.validateBpet(c,c.bpet),f=$WH.calcBattlePetStats(c,b.breed,b.quality,b.level,c.elite);return f.speed},compute:function(c,g){if(c.companion){return}var b=$WH.validateBpet(c,c.bpet),f=$WH.calcBattlePetStats(c,b.breed,b.quality,b.level,c.elite);return f.speed},sortFunc:function(f,c){var k=$WH.validateBpet(f,f.bpet);var j=$WH.validateBpet(c,c.bpet);var g=$WH.calcBattlePetStats(f,k.breed,k.quality,k.level,f.elite);var h=$WH.calcBattlePetStats(c,j.breed,j.quality,j.level,c.elite);return $WH.stringCompare(g.speed,h.speed)}},{id:"breeds",name:LANG.breed,compute:function(l,f){if(l.companion){return}var h=$WH.validateBpet(l,l.bpet);var k=[];for(var g=1;g<=10;g++){if(l.breeds&1<<g-1){k.push(g+2)}}if(k.length==0){return}if(k.length==1){return"#"+k[0]+(g_pet_breed_abbrev[k[0]]?(" "+g_pet_breed_abbrev[k[0]]):"")}var m;if(!(m=f.getElementsByTagName("span")[0])){m=$WH.ce("span");m.style.borderBottom="1px dotted";$WH.aE(m,"mouseover",function(n){Menu.showAtCursor(this.menu,n)});$WH.aE(m,"mouseout",function(n){Menu.hide()});$WH.ae(f,m)}var j=this,c=false;m.menu=[[,LANG.breed]];for(var g in k){var b="#"+k[g]+(g_pet_breed_abbrev[k[g]]?(" "+g_pet_breed_abbrev[k[g]]):"");m.menu.push([k[g],b,(function(n){return function(){if(!l.bpet){l.bpet={}}l.bpet.breed=n;delete l.__tr;j.refreshRows()}})(k[g])]);if(h.breed==k[g]){$WH.ee(m);$WH.ae(m,$WH.ct(b));c=true}}if((!c)&&k[0]){$WH.ee(m);$WH.ae(m,$WH.ct("#"+k[0]+(g_pet_breed_abbrev[k[0]]?(" "+g_pet_breed_abbrev[k[0]]):"")))}},getValue:function(c){var b=$WH.validateBpet(c,c.bpet);return b.breed},sortFunc:function(f,c){var h=$WH.validateBpet(f,f.bpet);var g=$WH.validateBpet(c,c.bpet);return $WH.stringCompare(h.breed,g.breed)}},{id:"abilities",name:LANG.abilities,type:"text",compute:function(c,g){g.style.padding="0";if(!c.abilities){return}var b=[];for(var f=0;f<c.abilities.length;f++){b.push(c.abilities[f])}Listview.funcBox.createCenteredIcons(b,g,"",3)},getVisibleText:function(c){var g="";if(!c.abilities){return g}for(var f=0,b=c.abilities.length;f<b;++f){if(g_petabilities[c.abilities[f]]){g+=" "+g_petabilities[c.abilities[f]]["name_"+Locale.getName()]}}return g},sortFunc:function(g,c){var h=g.abilities?g.abilities.length:0;var f=c.abilities?c.abilities.length:0;return $WH.stringCompare(h,f)}},{id:"source",name:LANG.source,type:"text",compute:function(c,h){$WH.noWrap(h);$WH.ae(h,$WH.ct(g_battlepet_sources[c.category]));var g=$WH.ce("div");g.className="small2";if(c.category==4&&c.npc){Listview.funcBox.location(c.npc,g,2)}else{if(c.source!=null){var f=(c.sourcemore?c.sourcemore[0]:{});if(f.t){var b=$WH.ce("a");if(f.q!=null){b.className="q"+f.q}else{b.className="q1"}b.href="/"+g_types[f.t]+"="+f.ti;b.style.whiteSpace="nowrap";if(f.icon){b.className+=" icontiny tinyspecial";b.style.backgroundImage='url("'+g_staticUrl+"/images/wow/icons/tiny/"+f.icon.toLowerCase()+'.gif")'}$WH.ae(b,$WH.ct(f.n));$WH.ae(g,b)}}}if(!$(g).is(":empty")){$WH.ae(h,g)}},getVisibleText:function(b){var f="";f+=g_battlepet_sources[b.category];if(b.category==4&&b.npc){f+=Listview.funcBox.arrayText(b.npc.location,g_zones)}else{if(b.source!=null){var c=(b.sourcemore?b.sourcemore[0]:{});if(c.t){f+=" "+c.n}}}return f},sortFunc:function(f,c){return $WH.stringCompare(g_battlepet_sources[f.category],g_battlepet_sources[c.category])}},{id:"type",name:LANG.type,type:"text",compute:function(c,f){f.className="small q1";var b=$WH.ce("a");b.href="/pet-species="+c.type;$WH.ae(b,$WH.ct(g_battlepetability_types[c.type]));$WH.ae(f,b)},getVisibleText:function(b){return g_battlepetability_types[b.type]},sortFunc:function(f,c,g){return $WH.stringCompare(g_battlepetability_types[f.type],g_battlepetability_types[c.type])}},{id:"completed",name:LANG.completion,hidden:true,compute:function(b,c){$WH.addCompletionIcons(c,"npc",b.npc.id)},sortFunc:function(f,c,g){return $WH.stringCompare(this._speciesDoneFlags(f.npc.id),this._speciesDoneFlags(c.npc.id))},getValue:function(f){var h=0;var g=g_completion.npc;for(var j in g_user.lists){var b=g_user.lists[j];if(!(b.id in g)){continue}if($WH.inArray(g[b.id],f.npc.id)!=-1){h++}}return h},_speciesDoneFlags:function(b){return $WH.getCompletionFlags("npc",b)}}],getItemLink:function(b){return"/npc="+(b.npc?b.npc.id:b.id)},createCbControls:function(f,c){if(!c){return}var b=$WH.ce("input");b.type="button";b.value=(!this.characterSettings||!this.characterSettings.editable?LANG.li_addtolist:LANG.li_addtoanotherlist);b.onclick=(function(g){Listview.cbAddToList.call(this,g,"npc")}).bind(this);$WH.ae(f,b)},onBeforeCreate:function(){for(var b in this.columns){if((this.columns[b].id=="completed")&&(this.columns[b].hidden)){if((!(this.hasOwnProperty("completionMode")&&this.completionMode))&&$WH.isSet("g_user")&&("lists" in g_user)&&("npc" in g_completion)&&($WH.inArray(this.hiddenCols,this.columns[b].id)==-1)){this.visibility.push(parseInt(b))}}}}};Listview.templates.petspecies=Listview.templates["pet-species"];Listview.templates.petspeciesgallery={sort:[1],mode:3,nItemsPerPage:40,nItemsPerRow:4,searchable:1,poundable:1,sortOptions:[{id:"name",name:LANG.name,type:"text",sortFunc:function(f,c){return $WH.stringCompare(f.name,c.name)}},{id:"level",name:LANG.level,getValue:function(c){var b=$WH.validateBpet(c,c.bpet);return b.level},sortFunc:function(f,c){var h=$WH.validateBpet(f,f.bpet);var g=$WH.validateBpet(c,c.bpet);return $WH.stringCompare(h.level,g.level)}},{id:"health",name:LANG.health,getValue:function(c){var b=$WH.validateBpet(c,c.bpet),f=$WH.calcBattlePetStats(c,b.breed,b.quality,b.level,c.elite);return f.health},sortFunc:function(f,c){var k=$WH.validateBpet(f,f.bpet);var j=$WH.validateBpet(c,c.bpet);var g=$WH.calcBattlePetStats(f,k.breed,k.quality,k.level,f.elite);var h=$WH.calcBattlePetStats(c,j.breed,j.quality,j.level,c.elite);return $WH.stringCompare(g.health,h.health)}},{id:"power",name:LANG.power,getValue:function(c){var b=$WH.validateBpet(c,c.bpet),f=$WH.calcBattlePetStats(c,b.breed,b.quality,b.level,c.elite);return f.power},sortFunc:function(f,c){var k=$WH.validateBpet(f,f.bpet);var j=$WH.validateBpet(c,c.bpet);var g=$WH.calcBattlePetStats(f,k.breed,k.quality,k.level,f.elite);var h=$WH.calcBattlePetStats(c,j.breed,j.quality,j.level,c.elite);return $WH.stringCompare(g.power,h.power)}},{id:"speed",name:LANG.speed,getValue:function(c){var b=$WH.validateBpet(c,c.bpet),f=$WH.calcBattlePetStats(c,b.breed,b.quality,b.level,c.elite);return f.speed},sortFunc:function(f,c){var k=$WH.validateBpet(f,f.bpet);var j=$WH.validateBpet(c,c.bpet);var g=$WH.calcBattlePetStats(f,k.breed,k.quality,k.level,f.elite);var h=$WH.calcBattlePetStats(c,j.breed,j.quality,j.level,c.elite);return $WH.stringCompare(g.speed,h.speed)}},{id:"breeds",name:LANG.breed,getValue:function(c){var b=$WH.validateBpet(c,c.bpet);return b.breed},sortFunc:function(f,c){var h=$WH.validateBpet(f,f.bpet);var g=$WH.validateBpet(c,c.bpet);return $WH.stringCompare(h.breed,g.breed)}},{id:"abilities",name:LANG.abilities,type:"text",sortFunc:function(g,c){var h=g.abilities?g.abilities.length:0;var f=c.abilities?c.abilities.length:0;return $WH.stringCompare(h,f)}},{id:"source",name:LANG.source,type:"text",sortFunc:function(f,c){return $WH.stringCompare(g_battlepet_sources[f.category],g_battlepet_sources[c.category])}},{id:"type",name:LANG.type,type:"text",sortFunc:function(f,c,g){return $WH.stringCompare(g_battlepetability_types[f.type],g_battlepetability_types[c.type])}},{id:"completed",name:LANG.completion,type:"text",hidden:true,sortFunc:function(f,c,g){return $WH.stringCompare(this._speciesDoneFlags(f.npc.id),this._speciesDoneFlags(c.npc.id))},_speciesDoneFlags:function(b){return $WH.getCompletionFlags("npc",b)}}],columns:[{value:"name",sortFunc:function(f,c){return Listview.templates.petspeciesgallery.sortFunc(f,c)}}],compute:function(f,l,p){l.className="bpet-listview-cell";l.vAlign="bottom";var o=$WH.validateBpet(f,f.bpet),s=$WH.calcBattlePetStats(f,o.breed,o.quality,o.level,f.elite);var h=$WH.ce("div");h.className="cell-wrapper";if(this.createModifyButton){var t=$WH.ce("a");t.href="javascript:;";t.className="modify-cell icon-edit";t.innerHTML=LANG.li_menu_modify;$WH.ae(h,this.createModifyButton(f,t))}var r=$WH.ce("div");r.className="preview-wrapper";if(f.compare){$WH.ae(r,Listview.funcBox.getComparisonText(f.compare,this.completionMode,this.dataSource,this.completionText))}var j=$WH.ce("div");j.className="expand-wrapper expanded-pet-view-wrapper";var v=$WH.ce("img");v.src=g_staticUrl+ModelViewer.getStaticBase()+"/thumbs/npc/"+f.model+".png";v.height=v.width=150;$WH.ae(j,v);if(f.elite||f.untameable||f.companion){var b="untameable";if(f.companion){b="companion"}var q=$WH.ce("span");q.className="banner";q.style.backgroundImage="url("+g_staticUrl+"/images/"+Locale.getName()+"/banner-"+b+".png)";$WH.ae(j,q)}if(g_battlepetability_types[f.type]&&f.npc){Listview.funcBox.addBattlePetExpandedView.call(this,j,f,o,s)}$WH.ae(r,j);if(this.showSideData&&f.npc){var m={family:f.type};if(!f.companion){m.breed="#"+o.breed;m.level=LANG.lvspecies_sidelevel+o.level;m.health=s.health;m.power=s.power;m.speed=s.speed}if(!$.isEmptyObject(m)){var n=$WH.ce("div");var g=$WH.ce("div");n.className="side-left";g.className="side-right";var k=0;for(var p in m){k++;q=$WH.ce("span");q.className="side-"+p;if(p=="family"){var c=g_battlepetability_types[m[p]]+(f.companion?" "+LANG.lvspecies_companion:"");q.style.backgroundPosition=((m[p]-1)*-16)+"px 0"}else{if(p=="breed"){var c=$WH.sprintf(LANG.lvspecies_breedtip,o.breed,$WH.battlePetBreedStats[o.breed][0]*50+"%",$WH.battlePetBreedStats[o.breed][1]*50+"%",$WH.battlePetBreedStats[o.breed][2]*50+"%");q.className+=" tip";q.innerHTML=m[p]}else{var c=LANG[p];q.innerHTML=m[p]}}q.onmouseover=(function(y,w){$WH.Tooltip.showAtCursor(w,y,0,0,"q")}).bind(null,c);q.onmousemove=$WH.Tooltip.cursorUpdate;q.onmouseout=$WH.Tooltip.hide;$WH.ae(k>3?g:n,q)}$WH.ae(r,n);$WH.ae(r,g)}}$WH.ae(h,r);var u=$WH.ce("div");u.className="name";if(f.elite){v=$WH.ce("img");v.src=g_staticUrl+"/images/icons/boss.gif";v.height=16;v.width=12;v.style.verticalAlign="middle";v.onmouseover=function(w){$WH.Tooltip.showAtCursor(w,LANG.lvspecies_elite,0,0,"q")};v.onmousemove=$WH.Tooltip.cursorUpdate;v.onmouseout=$WH.Tooltip.hide;$WH.ae(u,v);$WH.ae(u,$WH.ct(" "))}t=$WH.ce("a");t.href=this.getItemLink(f);t.className="q"+o.quality;t.innerHTML=f.name;$WH.ae(u,t);$WH.ae(h,u);$WH.ae(l,h)},getVisibleText:function(c){var g=c.name;if(g_battlepetability_types[c.type]&&c.npc){g+=" "+g_battlepetability_types[c.type]+" "+c.npc.name}if(c.companion){g+=" "+LANG.lvspecies_companion}if(c.untameable){g+=" "+LANG.lvspecies_untameable}if(c.elite){g+=" "+LANG.lvspecies_elite}if(!c.abilities){return g}for(var f=0,b=c.abilities.length;f<b;++f){if(g_petabilities[c.abilities[f]]){g+=" "+g_petabilities[c.abilities[f]]["name_"+Locale.getName()]}}return g},sortFunc:function(f,c){return $WH.stringCompare(f.name,c.name)},getItemLink:function(b){return"/npc="+(b.npc?b.npc.id:b.id)}};Listview.templates.achievement={sort:[1,2],mode:1,nItemsPerPage:100,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",span:2,compute:function(c,k,h){var b=null;if(c.who&&c.completed){b="who="+c.who+"&when="+c.completed.getTime()}var g=$WH.ce("td");g.style.width="1px";g.style.paddingRight="0";g.style.borderRight="none";$WH.ae(g,g_achievements.createIcon(c.id,1));Icon.getLink(g.firstChild).href=this.getItemLink(c);Icon.getLink(g.firstChild).rel=b;$WH.ae(h,g);k.style.borderLeft="none";var f=$WH.ce("a");f.className="listview-cleartext";f.href=this.getItemLink(c);f.rel=b;$WH.ae(f,$WH.ct(c.name));$WH.ae(k,f);if(c.description!=null){var j=$WH.ce("div");j.className="listview-blurb small";$WH.ae(j,$WH.ct(c.description));$WH.ae(k,j)}},getVisibleText:function(b){var c=b.name;if(b.description){c+=" "+b.description}return c}},{id:"side",name:LANG.side,type:"text",compute:function(b,f){if(b.side&&b.side!=3){var c=$WH.ce("span");c.className=(b.side==1?"icon-alliance":"icon-horde");c.onmouseover=function(g){$WH.Tooltip.showAtCursor(g,g_sides[b.side],0,0,"q")};c.onmousemove=$WH.Tooltip.cursorUpdate;c.onmouseout=$WH.Tooltip.hide;$WH.ae(f,c)}},getVisibleText:function(b){if(b.side){return g_sides[b.side]}},sortFunc:function(f,c,g){return $WH.stringCompare(g_sides[f.side],g_sides[c.side])}},{id:"points",name:LANG.points,type:"number",width:"10%",value:"points",compute:function(b,c){if(b.points){Listview.funcBox.appendMoney(c,0,null,0,0,b.points)}}},{id:"rewards",name:LANG.rewards,type:"text",width:"20%",compute:function(n,g){if(n.rewards){var f=[];var c=[];var k=[];var j=[];for(var h=0;h<n.rewards.length;h++){if(n.rewards[h][0]==11){k.push(n.rewards[h][1])}else{if(n.rewards[h][0]==3){f.push(n.rewards[h][1])}else{if(n.rewards[h][0]==6){c.push(n.rewards[h][1])}else{if(n.rewards[h][0]==21){j.push(n.rewards[h][1])}}}}}if(f.length>0){for(var h=0;h<f.length;h++){if(!g_items[f[h]]){return}var p=g_items[f[h]];var m=$WH.ce("a");m.href="/item="+f[h];m.className="q"+p.quality+" icontiny tinyspecial";m.style.backgroundImage="url("+g_staticUrl+"/images/wow/icons/tiny/"+p.icon.toLowerCase()+".gif)";$WH.ae(m,$WH.ct(p["name_"+Locale.getName()]));var o=$WH.ce("span");$WH.ae(o,m);$WH.ae(g,o);$WH.ae(g,$WH.ce("br"))}}if(c.length>0){for(var h=0;h<c.length;h++){if(!g_spells[c[h]]){return}var p=g_spells[c[h]];var m=$WH.ce("a");m.href="/spell="+c[h];m.className="q13 icontiny tinyspecial";m.style.backgroundImage="url("+g_staticUrl+"/images/wow/icons/tiny/"+p.icon.toLowerCase()+".gif)";$WH.ae(m,$WH.ct(p["name_"+Locale.getName()]));var o=$WH.ce("span");$WH.ae(o,m);$WH.ae(g,o);$WH.ae(g,$WH.ce("br"))}}if(k.length>0){for(var h=0;h<k.length;h++){if(!g_titles[k[h]]){return}var l=g_titles[k[h]]["name_"+Locale.getName()];l=l.replace("%s",'<span class="q0">&lt;'+LANG.name+"&gt;</span>");var o=$WH.ce("a");o.className="q1";o.href="/title="+k[h];o.innerHTML=l;$WH.ae(g,o);$WH.ae(g,$WH.ce("br"))}}if(j.length>0){for(var h=0;h<j.length;h++){if(!g_followers[j[h]]){return}var b=g_followers[j[h]]["name_"+Locale.getName()];var o=$WH.ce("a");o.className="q1";o.href="/follower="+j[h];o.innerHTML=b;$WH.ae(g,o);$WH.ae(g,$WH.ce("br"))}}}else{if(n.reward){var o=$WH.ce("span");o.className="q1";$WH.ae(o,$WH.ct(n.reward));$WH.ae(g,o)}}},getVisibleText:function(b){var f="";if(b.rewards){for(var c=0;c<b.rewards.length;c++){if(b.rewards[c][0]==11&&g_titles[b.rewards[c][1]]){f+=" "+g_titles[b.rewards[c][1]]["name_"+Locale.getName()].replace("%s","<"+LANG.name+">")}else{if(b.rewards[c][0]==3&&g_items[b.rewards[c][1]]){f+=" "+g_items[b.rewards[c][1]]["name_"+Locale.getName()]}else{if(b.rewards[c][0]==6&&g_spells[b.rewards[c][1]]){f+=" "+g_spells[b.rewards[c][1]]["name_"+Locale.getName()]}}}}}else{if(b.reward){f+=" "+b.reward}}return f},sortFunc:function(f,c){var h=this.getVisibleText(f);var g=this.getVisibleText(c);if(h!=""&&g==""){return -1}if(g!=""&&h==""){return 1}return $WH.stringCompare(h,g)}},{id:"category",name:LANG.category,type:"text",width:"15%",compute:function(f,j){j.className="small";var c={"1":-1,"2":1,"3":15076},h="/achievements=";if(f.category!=c[f.type]&&f.parentcat!=c[f.type]){var b=$WH.ce("a");b.className="q0";b.href="/achievements="+f.type+"."+f.parentcat;$WH.ae(b,$WH.ct(g_achievement_categories[f.parentcat]));$WH.ae(j,b);$WH.ae(j,$WH.ce("br"));h=b.href+"."}var g=$WH.ce("a");g.className="q1";g.href=h+f.category;$WH.ae(g,$WH.ct(g_achievement_categories[f.category]));$WH.ae(j,g)},getVisibleText:function(b){return g_achievement_categories[b.category]},sortFunc:function(f,c,g){return $WH.stringCompare(g_achievement_categories[f.category],g_achievement_categories[c.category])},hidden:true},{id:"completed",name:LANG.completion,hidden:true,compute:function(b,c){$WH.addCompletionIcons(c,"achievement",b.id)},sortFunc:function(f,c,g){return $WH.stringCompare(this._achievementDoneFlags(f.id),this._achievementDoneFlags(c.id))},getValue:function(f){var h=0;var g=g_completion.achievement;for(var j in g_user.lists){var b=g_user.lists[j];if(!(b.id in g)){continue}if($WH.inArray(g[b.id],f.id)!=-1){h++}}return h},_achievementDoneFlags:function(b){return $WH.getCompletionFlags("achievement",b)}}],getItemLink:function(b){return"/achievement="+b.id},createCbControls:function(f,c){if(!c){return}var b=$WH.ce("input");b.type="button";b.value=(!this.characterSettings||!this.characterSettings.editable?LANG.li_addtolist:LANG.li_addtoanotherlist);b.onclick=(function(g){Listview.cbAddToList.call(this,g,"achievement")}).bind(this);$WH.ae(f,b)},onBeforeCreate:function(){for(var b in this.columns){if((this.columns[b].id=="completed")&&(this.columns[b].hidden)){if((!(this.hasOwnProperty("completionMode")&&this.completionMode))&&$WH.isSet("g_user")&&("lists" in g_user)&&("achievement" in g_completion)&&($WH.inArray(this.hiddenCols,this.columns[b].id)==-1)){this.visibility.push(parseInt(b))}}}}};Listview.templates.title={sort:[1],mode:1,nItemsPerPage:-1,searchable:1,filtrable:1,completionText:LANG.lvcompletion_collection,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",compute:function(h,k,g){var f=$WH.ce("a"),j=$WH.ce("span"),c=$WH.ct($WH.stringReplace(h.name,"%s",""));f.className="listview-cleartext";f.href=this.getItemLink(h);if(h.who){$WH.ae(j,$WH.ct(h.who))}else{$WH.ae(j,$WH.ct("<"+LANG.name+">"));j.className="q0"}if(h.name.indexOf("%s")>0){$WH.ae(f,c);$WH.ae(f,j)}else{if(h.name.indexOf("%s")==0){$WH.ae(f,j);$WH.ae(f,c)}}if(h.expansion){var b=$WH.ce("span");b.className=$WH.getExpansionClassName(h.expansion);$WH.ae(b,f);$WH.ae(k,b)}else{$WH.ae(k,f)}},sortFunc:function(f,c,g){var h=$WH.trim(f.name.replace("%s","").replace(/^[\s,]*(,|the |of the |of )/i,""));bName=$WH.trim(c.name.replace("%s","").replace(/^[\s,]*(,|the |of the |of )/i,""));return $WH.stringCompare(h,bName)},getVisibleText:function(b){var c=b.name+Listview.funcBox.getExpansionText(b);return c}},{id:"gender",name:LANG.gender,type:"text",value:"gender",compute:function(f,g){if(f.gender&&f.gender!=3){var b=g_file_genders[f.gender-1];var c=$WH.ce("span");c.className="icon-"+b;c.onmouseover=function(h){$WH.Tooltip.showAtCursor(h,LANG[b],0,0,"q")};c.onmousemove=$WH.Tooltip.cursorUpdate;c.onmouseout=$WH.Tooltip.hide;$WH.ae(g,c)}},getVisibleText:function(b){if(b.gender&&b.gender!=3){return LANG[g_file_genders[b.gender-1]]}},sortFunc:function(f,c,g){return $WH.stringCompare(f.gender,c.gender)}},{id:"side",name:LANG.side,type:"text",compute:function(c,f){if(c.side&&c.side!=3){var b=$WH.ce("span");b.className=(c.side==1?"icon-alliance":"icon-horde");b.onmouseover=function(g){$WH.Tooltip.showAtCursor(g,g_sides[c.side],0,0,"q")};b.onmousemove=$WH.Tooltip.cursorUpdate;b.onmouseout=$WH.Tooltip.hide;$WH.ae(f,b)}},getVisibleText:function(b){if(b.side){return g_sides[b.side]}},sortFunc:function(f,c,g){return $WH.stringCompare(g_sides[f.side],g_sides[c.side])}},{id:"source",name:LANG.source,type:"text",compute:function(l,f){if(l.source){$WH.noWrap(f);f.className="small";f.style.lineHeight="18px";var b=0;for(var m in l.source){l.source[m].sort(function(o,n){return n.s-o.s});for(var g=0,h=l.source[m].length;g<h;++g){var c=l.source[m][g];var j=0;if(l.faction&&typeof c!="string"&&c.s!==undefined&&c.s!=-1&&c.s!=2-l.faction){continue}if(b>0){$WH.ae(f,$WH.ce("br"))}if(typeof c=="string"){$WH.ae(f,$WH.ct(c))}else{if(c.t&&c.n){j=c.t;var k=$WH.ce("a");k.href="/"+g_types[c.t]+"="+c.ti;k.className="q1";if(c.s==1){k.className+=" icon-alliance"}if(c.s==0){k.className+=" icon-horde"}if(c.t==5){k.className+=" icontiny tinyspecial";k.style.backgroundImage="url("+g_staticUrl+"/images/wow/icons/tiny/quest_start.gif)"}$WH.ae(k,$WH.ct(c.n));$WH.ae(f,k)}else{continue}}b++}}}},getVisibleText:function(g){var j="";if(g.source){for(var f in g.source){for(var c=0,b=g.source[f].length;c<b;++c){var h=g.source[f][c];if(typeof h=="string"){j+=" "+h}else{if(h.t){j+=" "+h.n}}}}}return j},sortFunc:function(f,c,g){return $WH.stringCompare(this.getVisibleText(f),this.getVisibleText(c))}},{id:"category",name:LANG.category,type:"text",width:"15%",compute:function(c,f){$WH.noWrap(f);f.className="small q1";var b=$WH.ce("a");b.href="/titles="+c.category;$WH.ae(b,$WH.ct(g_title_categories[c.category]));$WH.ae(f,b)},getVisibleText:function(b){return g_title_categories[b.category]},sortFunc:function(f,c,g){return $WH.stringCompare(g_title_categories[f.category],g_title_categories[c.category])},hidden:true},{id:"completed",name:LANG.completion,hidden:true,compute:function(b,c){$WH.addCompletionIcons(c,"title",b.id)},sortFunc:function(f,c,g){return $WH.stringCompare(this._titleDoneFlags(f.id),this._titleDoneFlags(c.id))},getValue:function(f){var h=0;var g=g_completion.title;for(var j in g_user.lists){var b=g_user.lists[j];if(!(b.id in g)){continue}if($WH.inArray(g[b.id],f.id)!=-1){h++}}return h},_titleDoneFlags:function(b){return $WH.getCompletionFlags("title",b)}}],getItemLink:function(b){return"/title="+b.id},createCbControls:function(f,c){if(!c){return}var b=$WH.ce("input");b.type="button";b.value=(!this.characterSettings||!this.characterSettings.editable?LANG.li_addtolist:LANG.li_addtoanotherlist);b.onclick=(function(g){Listview.cbAddToList.call(this,g,"title")}).bind(this);$WH.ae(f,b)},onBeforeCreate:function(){for(var b in this.columns){if((this.columns[b].id=="completed")&&(this.columns[b].hidden)){if((!(this.hasOwnProperty("completionMode")&&this.completionMode))&&$WH.isSet("g_user")&&("lists" in g_user)&&("title" in g_completion)&&($WH.inArray(this.hiddenCols,this.columns[b].id)==-1)){this.visibility.push(parseInt(b))}}}}};Listview.templates.classs={sort:[1],searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",span:2,value:"name",compute:function(f,l,h){var c=$WH.ce("td");c.style.width="1px";c.style.paddingRight="0";c.style.borderRight="none";$WH.ae(c,Icon.create("class_"+g_file_classes[f.id],0,null,this.getItemLink(f)));$WH.ae(h,c);l.style.borderLeft="none";var k=$WH.ce("div");var b=$WH.ce("a");b.className="c"+f.id+" listview-cleartext";b.href=this.getItemLink(f);$WH.ae(b,$WH.ct(f.name));if(f.expansion){var g=$WH.ce("span");g.className=$WH.getExpansionClassName(f.expansion);$WH.ae(g,b);$WH.ae(k,g)}else{$WH.ae(k,b)}if(f.hero){k.style.position="relative";var j=$WH.ce("div");j.className="listview-name-info";$WH.ae(j,$WH.ct(LANG.lvclass_hero));$WH.aef(k,j)}$WH.ae(l,k)}},{id:"races",name:LANG.races,type:"text",compute:function(g,j){if(g.races){var h=Listview.funcBox.assocBinFlags(g.races,g_chr_races);j.className="q1";for(var f=0,b=h.length;f<b;++f){if(f>0){$WH.ae(j,$WH.ct(LANG.comma))}var c=$WH.ce("a");c.href="/race="+h[f];$WH.ae(c,$WH.ct(g_chr_races[h[f]]));$WH.ae(j,c)}}},getVisibleText:function(b){if(b.races){return Listview.funcBox.arrayText(Listview.funcBox.assocBinFlags(b.races,g_chr_races),g_chr_races)}},sortFunc:function(f,c,g){return Listview.funcBox.assocArrCmp(Listview.funcBox.assocBinFlags(f.races,g_chr_races),Listview.funcBox.assocBinFlags(c.races,g_chr_races),g_chr_races)}}],getItemLink:function(b){return"/class="+b.id}};Listview.templates.race={sort:[1],searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",span:2,value:"name",compute:function(h,f,k){var j=$WH.ce("div"),l;j.style.margin="0 auto";j.style.textAlign="left";j.style.width="52px";l=Icon.create("race_"+g_file_races[h.id]+"_"+g_file_genders[0],0,null,this.getItemLink(h));l.style.cssFloat=l.style.styleFloat="left";$WH.ae(j,l);l=Icon.create("race_"+g_file_races[h.id]+"_"+g_file_genders[1],0,null,this.getItemLink(h));l.style.cssFloat=l.style.styleFloat="left";$WH.ae(j,l);var g=$WH.ce("td");g.style.width="1px";g.style.paddingRight="0";g.style.borderRight="none";$WH.ae(g,j);$WH.ae(k,g);f.style.borderLeft="none";var b=$WH.ce("div");var m=$WH.ce("a");m.className="listview-cleartext";m.href=this.getItemLink(h);$WH.ae(m,$WH.ct(h.name));if(h.expansion){var c=$WH.ce("span");c.className=$WH.getExpansionClassName(h.expansion);$WH.ae(c,m);$WH.ae(b,c)}else{$WH.ae(b,m)}$WH.ae(f,b)}},{id:"side",name:LANG.side,type:"text",compute:function(b,f){if(b.side&&b.side!=3){var c=$WH.ce("span");c.className=(b.side==1?"icon-alliance":"icon-horde");c.onmouseover=function(g){$WH.Tooltip.showAtCursor(g,g_sides[b.side],0,0,"q")};c.onmousemove=$WH.Tooltip.cursorUpdate;c.onmouseout=$WH.Tooltip.hide;$WH.ae(f,c)}},getVisibleText:function(b){if(b.side){return g_sides[b.side]}},sortFunc:function(f,c,g){return $WH.stringCompare(g_sides[f.side],g_sides[c.side])}},{id:"classes",name:LANG.classes,type:"text",compute:function(g,l){if(g.classes){var f=Listview.funcBox.assocBinFlags(g.classes,g_chr_classes);var k=$WH.ce("div");k.style.width=(26*f.length)+"px";k.style.margin="0 auto";for(var c=0,b=f.length;c<b;++c){var h=Icon.create("class_"+g_file_classes[f[c]],0,null,"/class="+f[c]);var j=g_chr_classes[f[c]];$(h).mouseover((function(n,m){$WH.Tooltip.showAtCursor(m,n,0,0,"q")}).bind(h,j));$(h).mousemove(function(m){$WH.Tooltip.cursorUpdate(m)}).mouseout(function(){$WH.Tooltip.hide()}).css("float","left").appendTo(k)}$WH.ae(l,k)}},getVisibleText:function(b){if(b.classes){return Listview.funcBox.arrayText(Listview.funcBox.assocBinFlags(b.classes,g_chr_classes),g_chr_classes)}},sortFunc:function(f,c,g){return Listview.funcBox.assocArrCmp(Listview.funcBox.assocBinFlags(f.classes,g_chr_classes),Listview.funcBox.assocBinFlags(c.classes,g_chr_classes),g_chr_classes)}}],getItemLink:function(b){return"/race="+b.id}};Listview.templates.betatalents={nItemsPerPage:100,mode:Listview.MODE_CHECKBOX,sortable:false,columns:[{id:"row",name:"Row",value:"row",compute:function(c,b){$(b).html(parseInt(c.row)+1)}},{id:"col",name:"Column",value:"col",compute:function(c,b){$(b).html(parseInt(c.col)+1)}},{id:"name",name:LANG.name,type:"text",align:"left",value:"name_enus",span:2,compute:function(g,f,c){var b=g.tooltip_enus;$(f).mouseover((function(h,j){$WH.Tooltip.showAtCursor(j,h,0,0)}).bind(f,b));$(f).mousemove(function(h){$WH.Tooltip.cursorUpdate(h)}).mouseout(function(){$WH.Tooltip.hide()});$(f).html(g.name_enus)}}],createCbControls:function(c){var b=$WH.ce("input");b.type="button";b.value="Edit";b.onclick=(function(){var f=this.getCheckedRows();if(!f.length){alert("No talent selected.")}else{if(f.length>1){alert("You can only edit one talent at a time.")}else{if(confirm("Are you sure that you want to edit this talent?")){enableEditMode(f[0])}}}}).bind(this);$WH.ae(c,b);var b=$WH.ce("input");b.type="button";b.value="Delete";b.onclick=(function(){var g=this.getCheckedRows();if(!g.length){alert("No talents selected.")}else{if(confirm("Are you sure that you want to delete "+(g.length==1?"this talent":"these "+g.length+" talents")+"?")){var f="";$WH.arrayWalk(g,function(h){f+=h.id+","});f=$WH.rtrim(f,",");if(f!=""){$.post("/admin=beta-talents&delete="+f+"&classid="+g[0].classid)}this.deleteRows(g);this.resetCheckedRows()}}}).bind(this);$WH.ae(c,b)}};Listview.templates.item={sort:[-2],mode:1,searchable:1,filtrable:1,completionText:LANG.lvcompletion_collection,sortNameUseQuality:true,beforeSort:function(){var c,g;for(var b=0;!c&&b<this.columns.length;b++){if(this.columns[b].id=="name"){c=this.columns[b];g=b+1}}var f=g-1;if(Listview.sort.length&&(Listview.sort[0]==g)){this.template.sortNameUseQuality=!this.template.sortNameUseQuality;c.name=this.template.sortNameUseQuality?(LANG.name+" + "+LANG.quality):LANG.name;if(!this.thead){return}if(this.mode==Listview.MODE_CHECKBOX&&f<this.thead.firstChild.childNodes.length-1){f+=1}var h=this.thead.firstChild.childNodes[f].firstChild.firstChild.firstChild.firstChild;$WH.st(h,c.name)}},columns:[{id:"name",name:LANG.name,type:"text",align:"left",span:2,value:"name",compute:function(w,h,b){if(w.upgraded){b.className="upgraded"}w=$WH.applyStatModifications(w,null,null,null,Listview.funcBox.getCurrentItemBonuses.call(this,w));var q=$WH.ce("td");q.style.width="1px";q.style.padding="4px 0 4px 10px";q.style.borderRight="none";var j=null,l=null;if(w.stack!=null){j=Listview.funcBox.createTextRange(w.stack[0],w.stack[1])}if(w.avail!=null){l=w.avail}if(w.id){$WH.ae(q,g_items.createIcon(w.id,(this.iconSize==null?1:this.iconSize),j,l,w.bonuses))}$WH.ae(b,q);h.style.borderLeft="none";var z,o;if(!isNaN(parseInt(w.name.charAt(0)))){z=w.name.substring(1);o=8-parseInt(w.name.charAt(0))}else{z=w.name;o=1;if(w.hasOwnProperty("quality")){o=w.quality}}var y=$WH.ce("a");y.className="q"+o+" listview-cleartext";y.href=this.getItemLink(w);if(w.frommerge==1){y.className+=" icon-merge-right"}if(w.rel){Icon.getLink(q.firstChild).rel=w.rel;y.rel=w.rel}var k="";if(w.nameSuffix){k=" "+w.nameSuffix}$WH.ae(y,$WH.ct(z+k));var f=$WH.ce("div");$WH.ae(f,y);if(w.reqclass){var v=$WH.ce("div");v.className="small2";var u=Listview.funcBox.assocBinFlags(w.reqclass,g_chr_classes);for(var q=0,r=u.length;q<r;++q){if(q>0){$WH.ae(v,$WH.ct(", "))}var y=$WH.ce("a");y.href="/class="+u[q];y.className="c"+u[q];$WH.st(y,g_chr_classes[u[q]]);$WH.ae(v,y)}$WH.ae(f,v)}var m=typeof Filter!="undefined"?Filter.listview_getExtraItemColumnCount():null;if(typeof m=="number"&&m>=5){if(w.source!=null&&w.source.length==1){if(w.reqclass){$WH.ae(v,$WH.ct(LANG.dash))}else{var v=$WH.ce("div");v.className="small2"}var t=(w.sourcemore?w.sourcemore[0]:{});var c=0;if(t.t){c=t.t;var y=$WH.ce("a");if(t.q!=null){y.className="q"+t.q}else{y.className="q1"}y.href="/"+g_types[t.t]+"="+t.ti;if(t.n.length<=30){$WH.ae(y,$WH.ct(t.n))}else{y.title=t.n;$WH.ae(y,$WH.ct($WH.trim(t.n.substr(0,27))+"..."))}$WH.ae(v,y)}else{$WH.ae(v,$WH.ct(Listview.funcBox.getUpperSource(w.source[0],t)))}var g=Listview.funcBox.getLowerSource(w.source[0],t,c);if(g!=null){$WH.ae(v,$WH.ct(LANG.hyphen));if(g.pretext){$WH.ae(v,$WH.ct(g.pretext))}if(g.url){var y=$WH.ce("a");y.className="q1";y.href=g.url;$WH.ae(y,$WH.ct(g.text));$WH.ae(v,y)}else{$WH.ae(v,$WH.ct(g.text))}if(g.posttext){$WH.ae(v,$WH.ct(g.posttext))}}$WH.ae(f,v)}}if(w.namedesc||w.heroic||w.reqrace||w.raidfinder||w.thunderforged||w.warforged||w.flexible){f.style.position="relative";var v=$WH.ce("div");v.className="listview-name-info";var p=$WH.ce("span");p.className="q2";if(w.namedesc){$WH.ae(p,$WH.ct(w.namedesc))}else{if(w.raidfinder){$WH.ae(p,$WH.ct(LANG.lvitem_raidfinderitem))}else{if(w.flexible){$WH.ae(p,$WH.ct(LANG.lvitem_flexibleitem))}else{if(w.thunderforged){if(w.heroic){$WH.ae(p,$WH.ct(LANG.lvitem_heroicitem+" "+LANG.lvitem_thunderforgeditem))}else{$WH.ae(p,$WH.ct(LANG.lvitem_thunderforgeditem))}}else{if(w.warforged){if(w.heroic){$WH.ae(p,$WH.ct(LANG.lvitem_heroicitem+" "+LANG.lvitem_warforgeditem))}else{$WH.ae(p,$WH.ct(LANG.lvitem_warforgeditem))}}else{if(w.heroic){$WH.ae(p,$WH.ct(LANG.lvitem_heroicitem))}}}}}}if(!$(p).is(":empty")){$WH.ae(v,p)}if(w.reqrace){if((w.reqrace&1791)!=1101&&(w.reqrace&1791)!=690){if(w.namedesc||w.heroic||w.raidfinder||w.thunderforged||w.warforged||w.flexible){$WH.ae(v,$WH.ce("br"));v.style.bottom="-6px"}var n=Listview.funcBox.assocBinFlags(w.reqrace,g_chr_races);for(var q=0,r=n.length;q<r;++q){if(q>0){$WH.ae(v,$WH.ct(", "))}var y=$WH.ce("a");y.href="/race="+n[q];$WH.st(y,g_chr_races[n[q]]);$WH.ae(v,y)}v.className+=" q1"}}$WH.aef(f,v)}$WH.ae(h,f)},getVisibleText:function(h){var f,l;if(!isNaN(parseInt(h.name.charAt(0)))){f=h.name.substring(1);l=8-parseInt(h.name.charAt(0))}else{f=h.name;l=1;if(h.hasOwnProperty("quality")){l=h.quality}}var k=f;h=$WH.applyStatModifications(h,null,null,null,Listview.funcBox.getCurrentItemBonuses.call(this,h));if(h.nameSuffix){k+=" "+h.nameSuffix}if(h.namedesc){k+=" "+h.namedesc}else{if(h.heroic){k+=" "+LANG.lvitem_heroicitem}if(h.warforged){k+=" "+LANG.lvitem_warforgeditem}if(h.thunderforged){k+=" "+LANG.lvitem_thunderforgeditem}if(h.raidfinder){k+=" "+LANG.lvitem_raidfinderitem}if(h.flexible){k+=" "+LANG.lvitem_flexibleitem}}if(h.reqrace){k+=" "+Listview.funcBox.arrayText(Listview.funcBox.assocBinFlags(h.reqrace,g_chr_races),g_chr_races)}if(h.reqclass){k+=" "+Listview.funcBox.arrayText(Listview.funcBox.assocBinFlags(h.reqclass,g_chr_classes),g_chr_classes)}var c=typeof Filter!="undefined"?Filter.listview_getExtraItemColumnCount():null;if(typeof c=="number"&&c>=5){if(h.source!=null&&h.source.length==1){var j=(h.sourcemore?h.sourcemore[0]:{});var g=0;if(j.t){g=j.t;k+=" "+j.n}else{k+=" "+Listview.funcBox.getUpperSource(h.source[0],j)}var b=Listview.funcBox.getLowerSource(h.source[0],j,g);if(b!=null){if(b.pretext){k+=" "+b.pretext}k+=" "+b.text;if(b.posttext){k+=" "+b.posttext}}}}return k},sortFunc:function(g,f){var c=this.template.sortNameUseQuality?0:1;return $WH.stringCompare(g.name.substr(c),f.name.substr(c))}},{id:"level",name:LANG.itemlevelshort,type:"range",getMinValue:function(b){if(this.ilvlOverride){return typeof this.ilvlOverride.value=="function"?this.ilvlOverride.value.call(this,b):this.ilvlOverride.value}return b.minlevel?b.minlevel:Listview.funcBox.getItemLevelWithBonuses.call(this,b)},getMaxValue:function(b){if(this.ilvlOverride){return typeof this.ilvlOverride.value=="function"?this.ilvlOverride.value.call(this,b):this.ilvlOverride.value}return b.maxlevel?b.maxlevel:Listview.funcBox.getItemLevelWithBonuses.call(this,b)},compute:function(b,c){if(this.ilvlOverride){return typeof this.ilvlOverride.value=="function"?this.ilvlOverride.value.call(this,b):this.ilvlOverride.value}if(b.minlevel&&b.maxlevel){if(b.minlevel!=b.maxlevel){return b.minlevel+LANG.hyphen+b.maxlevel}else{return b.minlevel}}else{return Listview.funcBox.getItemLevelWithBonuses.call(this,b)}},sortFunc:function(f,c,g){if(g>0){return $WH.stringCompare(f.minlevel,c.minlevel)||$WH.stringCompare(f.maxlevel,c.maxlevel)||$WH.stringCompare(Listview.funcBox.getItemLevelWithBonuses.call(this,f),Listview.funcBox.getItemLevelWithBonuses.call(this,c))}else{return $WH.stringCompare(f.maxlevel,c.maxlevel)||$WH.stringCompare(f.minlevel,c.minlevel)||$WH.stringCompare(Listview.funcBox.getItemLevelWithBonuses.call(this,f),Listview.funcBox.getItemLevelWithBonuses.call(this,c))}}},{id:"reqlevel",name:LANG.req,tooltip:LANG.tooltip_reqlevel,value:"reqlevel",compute:function(b,c){b=$WH.applyStatModifications(b,null,null,null,Listview.funcBox.getCurrentItemBonuses.call(this,b));if(b.reqlevel>1){return b.reqlevel}}},{id:"bonuses",name:LANG.versions,compute:function(t,g){var n=[];var s=(t.bonustrees!=null&&t.bonustrees.length>0);var q=false;var j=0;if(s&&$WH.isSet("g_item_bonuscontexts")){var c=[];for(var l in t.bonustrees){var v=t.bonustrees[l];for(var f in g_item_bonuscontexts){var u=g_item_bonuscontexts[f];for(var h in u){var p=u[h];if(p[0]==v&&p[1]!=0){c.push([p[1]]);switch(f){case"1":case"3":q=true;break;case"2":j=2;break;case"5":case"6":case"4":j=3;break;default:break}}}}}if(!q&&j){c.push(0)}c.sort();var m={},r=0;for(var l=0;l<c.length;++l){if(m.hasOwnProperty(c[l][0])){continue}m[c[l][0]]=true;var b=$.extend({},t);b.bonuses=c[l];var o=this.getItemLink(b);n.push({0:g_items.getIcon(t.id,c[l]),1:1,2:o});if(++r>=4){break}}}else{if(t.heirloombonuses){for(var l=0;l<t.heirloombonuses.length;++l){var b=$.extend({},t);b.bonuses=[t.heirloombonuses[l]];var o=this.getItemLink(b);n.push({0:g_items.getIcon(t.id,[t.heirloombonuses[l]]),1:1,2:o})}}else{if($WH.isSet("g_artifact_bonuses")&&g_artifact_bonuses.hasOwnProperty(t.id)){for(var l=0;l<g_artifact_bonuses[t.id].length;++l){var b=$.extend({},t);b.bonuses=[g_artifact_bonuses[t.id][l]];var o=this.getItemLink(b);n.push({0:g_items.getIcon(t.id,[g_artifact_bonuses[t.id][l]]),1:1,2:o})}}}}Listview.funcBox.createCenteredIcons(n,g,null,null,null,8)},sortFunc:function(f,c,g){var h=f.bonustrees?f.bonustrees.length:0;var j=c.bonustrees?c.bonustrees.length:0;return $WH.stringCompare(h,j)}},{id:"side",name:LANG.side,type:"text",compute:function(b,f){if(b.side&&b.side!=3){var c=$WH.ce("span");c.className=(b.side==1?"icon-alliance":"icon-horde");c.onmouseover=function(g){$WH.Tooltip.showAtCursor(g,g_sides[b.side],0,0,"q")};c.onmousemove=$WH.Tooltip.cursorUpdate;c.onmouseout=$WH.Tooltip.hide;$WH.ae(f,c)}},getVisibleText:function(b){if(b.side){return g_sides[b.side]}},sortFunc:function(f,c,g){return $WH.stringCompare(g_sides[f.side],g_sides[c.side])}},{id:"dps",name:LANG.dps,value:"dps",compute:function(b,c){return(b.dps||0).toFixed(2)},hidden:true},{id:"speed",name:LANG.speed,value:"speed",compute:function(b,c){return(b.speed||0).toFixed(2)},hidden:true},{id:"armor",name:LANG.armor,value:"armor",compute:function(b,f){var c=this.ilvlOverride?(typeof this.ilvlOverride.value=="function"?this.ilvlOverride.value.call(this,b):this.ilvlOverride.value):null;b=$WH.applyStatModifications(b,null,null,c,Listview.funcBox.getCurrentItemBonuses.call(this,b));if(b.armor>0){return b.armor}},hidden:true},{id:"slot",name:LANG.slot,type:"text",compute:function(b,c){$WH.noWrap(c);return g_item_slots[b.slot]},getVisibleText:function(b){return g_item_slots[b.slot]},sortFunc:function(f,c,g){return $WH.stringCompare(g_item_slots[f.slot],g_item_slots[c.slot])}},{id:"slots",name:LANG.slots,value:"nslots",hidden:true},{id:"skill",name:LANG.skill,value:"skill",hidden:true},{id:"glyph",name:LANG.glyphtype,type:"text",value:"glyph",compute:function(b,c){if(b.glyph){return g_item_glyphs[b.glyph]}},getVisibleText:function(b){return g_item_glyphs[b.glyph]},sortFunc:function(f,c,g){return $WH.stringCompare(g_item_glyphs[f.glyph],g_item_glyphs[c.glyph])},hidden:true},{id:"source",name:LANG.source,type:"text",compute:function(m,f){if(this.iconSize==0){f.className="small"}if(m.attainable){return LANG.unavailable}else{if(m.source!=null){if(m.source.length==1){$WH.noWrap(f);var c=(m.sourcemore?m.sourcemore[0]:{});var k=0;if(c.t){k=c.t;var l=$WH.ce("a");if(c.q!=null){l.className="q"+c.q}else{l.className="q1"}l.href="/"+g_types[c.t]+"="+c.ti;l.style.whiteSpace="nowrap";if(c.icon){l.className+=" icontiny tinyspecial";l.style.backgroundImage='url("'+g_staticUrl+"/images/wow/icons/tiny/"+c.icon.toLowerCase()+'.gif")'}$WH.ae(l,$WH.ct(c.n));$WH.ae(f,l)}else{$WH.ae(f,$WH.ct(Listview.funcBox.getUpperSource(m.source[0],c)))}var h=Listview.funcBox.getLowerSource(m.source[0],c,k);if(this.iconSize!=0&&h!=null){var b=$WH.ce("div");b.className="small2";if(h.pretext){$WH.ae(b,$WH.ct(h.pretext))}if(h.url){var l=$WH.ce("a");l.className="q1";l.href=h.url;$WH.ae(l,$WH.ct(h.text));$WH.ae(b,l)}else{$WH.ae(b,$WH.ct(h.text))}if(h.posttext){$WH.ae(b,$WH.ct(h.posttext))}$WH.ae(f,b)}}else{var n="";for(var g=0,j=m.source.length;g<j;++g){if(g>0){n+=LANG.comma}n+=g_sources[m.source[g]]}return n}}}},getVisibleText:function(f){if(f.attainable){return LANG.unavailable}else{if(f.source!=null){if(f.source.length==1){var h="";var g=(f.sourcemore?f.sourcemore[0]:{});var c=0;if(g.t){c=g.t;h+=" "+g.n}else{h+=" "+Listview.funcBox.getUpperSource(f.source[0],g)}var b=Listview.funcBox.getLowerSource(f.source[0],g,c);if(b!=null){if(b.pretext){h+=" "+b.pretext}h+=" "+b.text;if(b.posttext){h+=" "+b.posttext}}return h}else{return Listview.funcBox.arrayText(f.source,g_sources)}}}},sortFunc:function(h,f){var j=Listview.funcBox.assocArrCmp(h.source,f.source,g_sources);if(j!=0){return j}var g=(h.sourcemore&&h.source.length==1?h.sourcemore[0].n:null),c=(f.sourcemore&&f.source.length==1?f.sourcemore[0].n:null);return $WH.stringCompare(g,c)}},{id:"type",name:LANG.type,type:"text",compute:function(t,f){f.className="small q1";$WH.noWrap(f);var r=$WH.ce("a");var n=Listview.funcBox.getItemType(t.classs,t.subclass,t.subsubclass);r.href=n.url;$WH.ae(r,$WH.ct(n.text));if(this.classFilter!==null){var q=parseInt($("#class-selector div.active a").attr("data-classid"));var s=null;var l=[];var c=[];var o=Menu.findItem(mn_spells,[-12]);for(var m in t.specs){if($WH.inArray(g_chr_specs_by_class[q],t.specs[m])!=-1){if(!s&&o){for(var h in o[3]){if(o[3][h][0]==q){s=o[3][h];break}}}var b="";var p="";for(var g in s){if(s[3][g][0]==t.specs[m]){b=s[3][g][4].tinyIcon.toLowerCase();p=s[3][g][1];break}}c.push({0:b,1:null,2:"/spells=-12."+q+"."+t.specs[m]});l.push(p)}}Listview.funcBox.createCenteredIcons(c,f);$(f).find("div.iconsmall").each(function(j){$(this).bind("mouseover",function(k){$WH.Tooltip.showAtCursor(k,l[j],0,0,"q")});$(this).bind("mouseout",function(k){$WH.Tooltip.hide()})})}$WH.ae(f,r)},getVisibleText:function(b){return Listview.funcBox.getItemType(b.classs,b.subclass,b.subsubclass).text},sortFunc:function(f,c,h){var g=Listview.funcBox.getItemType;return $WH.stringCompare(g(f.classs,f.subclass,f.subsubclass).text,g(c.classs,c.subclass,c.subsubclass).text)}},{id:"qty",name:LANG.amount,tooltip:LANG.amount,value:"qty",compute:function(b,c){return(b.qty||1)},hidden:true},{id:"completed",name:LANG.completion,hidden:true,compute:function(f,h,g,c){var b=!f.hasOwnProperty("classs")||(!this.template._validCompletionCategory(f.classs,f.subclass,isNaN(parseInt(f.name.charAt(0)))?f.quality:7-parseInt(f.name.charAt(0))));$WH.addCompletionIcons(h,"item",f.id,b)},sortFunc:function(f,c,g){return $WH.stringCompare(this.template._itemCompletedFlags(f.id),this.template._itemCompletedFlags(c.id))},getValue:function(f){var h=0;var g=g_completion.item;if((!f.hasOwnProperty("classs"))||(!this.template._validCompletionCategory(f.classs,f.subclass,isNaN(parseInt(f.name.charAt(0)))?f.quality:7-parseInt(f.name.charAt(0))))){return -1}for(var j in g_user.lists){var b=g_user.lists[j];if(!(b.id in g)){continue}if($WH.inArray(g[b.id],f.id)!=-1){h++}}return h}}],getItemLink:function(f){var g=Listview.funcBox.getCurrentItemBonuses.call(this,f);var b=g.length>0?("&bonus="+g.join(":")):"";var c=this.ilvlOverride?("&"+this.ilvlOverride.name):"";return"/item="+f.id+b+c},_itemCompletedFlags:function(b){return $WH.getCompletionFlags("item",b)},_validCompletionCategory:function(b,f,c){return($WH.inArray(g_completion_categories[3],b)!=-1)||($WH.inArray(g_completion_categories[3],""+b+"-"+f)!=-1)||($WH.inArray(g_completion_categories[3],""+b+"q"+c)!=-1)},onBeforeCreate:function(){var g=false;for(var h=0,c=this.data.length;h<c;++h){var j=this.data[h];if((j.slot>0&&j.slot!=18)||($WH.inArray(ModelViewer.validSlots,j.slotbak)>=0&&j.displayid>0)||j.modelviewer){++g}}if(g>0){this.mode=1;this._nComparable=g}for(var b in this.columns){if((this.columns[b].id=="completed")&&(this.columns[b].hidden)){if((!(this.hasOwnProperty("completionMode")&&this.completionMode))&&$WH.isSet("g_user")&&("lists" in g_user)&&("item" in g_completion)&&($WH.inArray(this.hiddenCols,this.columns[b].id)==-1)){var f=0;for(var k in this.data){if(this.data[k].hasOwnProperty("classs")&&this.template._validCompletionCategory(this.data[k].classs,this.data[k].subclass,isNaN(parseInt(this.data[k].name.charAt(0)))?this.data[k].quality:7-parseInt(this.data[k].name.charAt(0)))){f++}}if(f>(this.data.length*0.1)){this.visibility.push(parseInt(b))}}}}},createCbControls:function(j,h){if(!h){return}var g=$WH.ce("input"),b=$WH.ce("input"),f=$WH.ce("input"),c=$WH.ce("input");g.type=b.type=f.type=c.type="button";g.value=LANG.button_compare;b.value=(!this.characterSettings||!this.characterSettings.editable?LANG.li_addtolist:LANG.li_addtoanotherlist);f.value=LANG.button_viewin3d;c.value=LANG.button_scaleilvl;g.onclick=this.template.compareItems.bind(this);b.onclick=(function(k){Listview.cbAddToList.call(this,k,"item")}).bind(this);f.onclick=this.template.viewIn3d.bind(this);this.template.buildScalingMenu.call(this,c);if(this._nComparable==0||typeof this._nComparable=="undefined"){g.disabled="disabled";f.disabled="disabled"}$WH.ae(j,g);$WH.ae(j,b);$WH.ae(j,f);$WH.ae(j,c)},createTooltipToggle:function(c,b){if(!b){return}this.addTooltipToggle(c,g_items)},compareItems:function(){var c=this.getCheckedRows();if(!c.length){return}var b="";var f=this;$WH.arrayWalk(c,function(g){if(g.slot==0||g.slot==18){return}b+=g.id;var k=Listview.funcBox.getCurrentItemBonuses.call(f,g);var j=[];while(j.length<9){j.push(0)}for(var h=0;h<k.length;++h){j.push(k[h])}b+="."+j.join(".");b+=";"});su_addToSaved($WH.rtrim(b,";"),c.length)},buildScalingMenu:function(g){var b=[{name:LANG.normal,mode:null},{name:LANG.su_menu_challengemode,mode:{name:"chal",value:function(j){var k=Listview.funcBox.getItemLevelWithBonuses.call(this,j);if(k>$WH.applyStatModifications.ITEM_CHALLENGEMODE_LEVEL){return $WH.applyStatModifications.ITEM_CHALLENGEMODE_LEVEL}return k}}},{name:g_difficulty_names[24]+" "+LANG.su_note_wotlk,mode:{name:"twwotlk",value:function(j){var k=Listview.funcBox.getItemLevelWithBonuses.call(this,j);if(k>$WH.applyStatModifications.ITEM_TIMEWALKINGMODE_WOTLK_LEVEL){return $WH.applyStatModifications.ITEM_TIMEWALKINGMODE_WOTLK_LEVEL}return k}}},{name:g_difficulty_names[24]+" "+LANG.su_note_bc,mode:{name:"twtbc",value:function(j){var k=Listview.funcBox.getItemLevelWithBonuses.call(this,j);if(k>$WH.applyStatModifications.ITEM_TIMEWALKINGMODE_TBC_LEVEL){return $WH.applyStatModifications.ITEM_TIMEWALKINGMODE_TBC_LEVEL}return k}}},{name:g_difficulty_names[24]+" "+LANG.su_note_cata,mode:{name:"twcata",value:function(j){var k=Listview.funcBox.getItemLevelWithBonuses.call(this,j);if(k>$WH.applyStatModifications.ITEM_TIMEWALKINGMODE_CATA_LEVEL){return $WH.applyStatModifications.ITEM_TIMEWALKINGMODE_CATA_LEVEL}return k}}},{name:LANG.su_menu_pvpmode+" ("+$WH.sprintf(LANG.tc_level.replace("%s","$1"),100)+")",mode:{name:"pvp",value:function(j){var k=Listview.funcBox.getItemLevelWithBonuses.call(this,j);var l=k;if(j.pvpUpgrade){l=k+j.pvpUpgrade}else{if(k>=560&&k<=690){l=690}else{if(k>715){l=715}}}return l}}}];var h=[];var c=this;for(var f=0;f<b.length;++f){h.push([f,b[f].name,(function(j){return function(){this.checked=true;if($WH.isSet("g_listviews")&&g_listviews){for(var l in g_listviews){var k=g_listviews[l];k.ilvlOverride=j;Filter.listview_computeItemScores(k);k.applySort();k.updateFilters(1)}}}})(b[f].mode),null,{checkedFunc:function(j){var k=b[j[0]].mode;if(!k&&!c.ilvlOverride){return true}return k&&c.ilvlOverride&&k.name==c.ilvlOverride.name}}])}Menu.add(g,h)},viewIn3d:function(){var o=this.getCheckedRows();if(!o.length){return}var c=this;var m=false,k=false,l=false;var h={};var j=null;$WH.arrayWalk(o,function(p){p.currentDisplayId=p.displayid;var r=Listview.funcBox.getCurrentItemBonuses.call(c,p);var q=g_items.getAppearance(p.id,r);if(q!=null&&q[0]){p.currentDisplayId=q[0]}if($WH.inArray(ModelViewer.validSlots,p.slotbak)>=0&&p.currentDisplayId>0){var s=ModelViewer.slotMap[p.slotbak];if(h[s]){k=true}h[s]={displayId:p.currentDisplayId,typeId:p.id,bonus:r.length?r[0]:0};m=true}else{if(p.modelviewer){j=p.modelviewer}else{l=true}}});var n=null;if(j){if(m||l){n=LANG.dialog_cantdisplay}ModelViewer.show({type:j.type,displayId:j.displayid,slot:j.slot,message:n})}else{if(k||l){n=LANG.dialog_cantdisplay}var b=[];var f=[];for(var g in h){b.push(parseInt(g));b.push(h[g].displayId);f.push([h[g].typeId,h[g].bonus,parseInt(g)])}if(b.length>0){ModelViewer.show({type:4,equipList:b,message:n,itemData:f})}else{alert(LANG.message_nothingtoviewin3d)}}}};Listview.templates["item-set"]={sort:[-2,-4,-5,1],nItemsPerPage:75,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",compute:function(f,j){var b=$WH.ce("a");b.className="q"+(8-parseInt(f.name.charAt(0)))+" listview-cleartext";b.href=this.getItemLink(f);$WH.ae(b,$WH.ct(f.name.substring(1)));var h=$WH.ce("div");h.style.position="relative";$WH.ae(h,b);var g=$WH.ce("div");g.className="listview-name-info q2";var c="";if(f.heroic){c=LANG.lvitem_heroicitem}else{if(f.elite){c=LANG.lvitem_eliteitem}else{if(f.raidfinder){c=LANG.lvitem_raidfinderitem}else{if(f.flexible){c=LANG.lvitem_flexibleitem}}}}if(c!=""){$WH.ae(g,$WH.ct(c));$WH.ae(h,g)}$WH.ae(j,h);if(f.note){var g=$WH.ce("div");g.className="small";$WH.ae(g,$WH.ct(g_itemset_notes[f.note]));$WH.ae(j,g)}},getVisibleText:function(b){var c=b.name.substring(1);if(b.note){c+=" "+g_itemset_notes[b.note]}return c}},{id:"level",name:LANG.level,type:"range",getMinValue:function(b){return b.minlevel},getMaxValue:function(b){return b.maxlevel},compute:function(b,c){if(b.minlevel>0&&b.maxlevel>0){if(b.minlevel!=b.maxlevel){return b.minlevel+LANG.hyphen+b.maxlevel}else{return b.minlevel}}else{return -1}},sortFunc:function(f,c,g){if(g>0){return $WH.stringCompare(f.minlevel,c.minlevel)||$WH.stringCompare(f.maxlevel,c.maxlevel)}else{return $WH.stringCompare(f.maxlevel,c.maxlevel)||$WH.stringCompare(f.minlevel,c.minlevel)}}},{id:"pieces",name:LANG.pieces,getValue:function(b){return b.pieces.length},compute:function(h,l){l.style.padding="0";var b=(h.pieces!=null&&h.pieces.length>0);if(b){var g=Listview.funcBox.getCurrentItemBonuses(h);var c=g.length>0?("&bonus="+g.join(":")):"";var j=[];for(var f=0;f<h.pieces.length;++f){var k=h.pieces[f];j.push({0:g_items.getIcon(k,g),1:1,2:"/item="+k+c})}Listview.funcBox.createCenteredIcons(j,l)}},sortFunc:function(f,c){var h=(f.pieces!=null?f.pieces.length:0);var g=(c.pieces!=null?c.pieces.length:0);return $WH.stringCompare(h,g)}},{id:"type",name:LANG.type,type:"text",compute:function(b,c){return g_itemset_types[b.type]},sortFunc:function(f,c,g){return $WH.stringCompare(g_itemset_types[f.type],g_itemset_types[c.type])}},{id:"classes",name:LANG.classes,type:"text",width:"20%",getVisibleText:function(g){var h="";if(g.reqclass){var f=Listview.funcBox.assocBinFlags(g.reqclass,g_chr_classes);for(var c=0,b=f.length;c<b;++c){if(c>0){h+=LANG.comma}h+=g_chr_classes[f[c]]}}return h},compute:function(j,l){if(j.reqclass){var g=Listview.funcBox.assocBinFlags(j.reqclass,g_chr_classes);var k=$WH.ce("div");k.style.width=(26*g.length)+"px";k.style.margin="0 auto";for(var f=0,b=g.length;f<b;++f){var h=Icon.create("class_"+g_file_classes[g[f]],0,null,"/class="+g[f]);h.style.cssFloat=h.style.styleFloat="left";var c=g_chr_classes[g[f]];$(h).mouseover((function(m){return function(n){$WH.Tooltip.showAtCursor(n,m,0,0,"q")}})(c)).mousemove(function(m){$WH.Tooltip.cursorUpdate(m)}).mouseout(function(){$WH.Tooltip.hide()});$WH.ae(k,h)}$WH.ae(l,k)}},sortFunc:function(f,c,g){return Listview.funcBox.assocArrCmp(Listview.funcBox.assocBinFlags(f.reqclass,g_chr_classes),Listview.funcBox.assocBinFlags(c.reqclass,g_chr_classes),g_chr_classes)}}],getItemLink:function(b){return"/item-set="+b.id}};Listview.templates.itemset=Listview.templates["item-set"];Listview.templates.transmogset={sort:[1],nItemsPerPage:75,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",compute:function(b,j){var c=$WH.ce("a");c.className="q"+(8-parseInt(b.name.charAt(0)))+" listview-cleartext";c.href=this.getItemLink(b);$WH.ae(c,$WH.ct(b.name.substring(1)));var h=$WH.ce("div");h.style.position="relative";$WH.ae(h,c);var g=$WH.ce("div");g.className="listview-name-info q2";var f="";if(b.heroic){f=LANG.lvitem_heroicitem}else{if(b.elite){f=LANG.lvitem_eliteitem}else{if(b.raidfinder){f=LANG.lvitem_raidfinderitem}}}if(f!=""){$WH.ae(g,$WH.ct(f));$WH.ae(h,g)}j.className="listview-blurb";$WH.ae(j,h);if(b.note||b._note){var g=$WH.ce("div");g.className="small";if(b.note){$WH.ae(g,$WH.ct(b.note))}else{$WH.ae(g,$WH.ct(g_itemset_notes[b._note]))}$WH.ae(j,g)}},getVisibleText:function(b){var c=b.name.substring(1);if(b.note){c+=" "+b.note}else{if(b._note){c+=" "+g_itemset_notes[b._note]}}return c},sortFunc:function(g,f,h){var c=(8-parseInt(g.name.charAt(0)));var j=(8-parseInt(f.name.charAt(0)));if(c==4){c=3}if(j==4){j=3}if(c!=j){return $WH.stringCompare(j,c)}return $WH.stringCompare(g.name.substring(1),f.name.substring(1))}},{id:"level",name:LANG.req,tooltip:LANG.tooltip_reqlevel,type:"range",getMinValue:function(b){return b.maxlevel},getMaxValue:function(b){return b.maxlevel},compute:function(b,c){if(b.maxlevel>0){return b.maxlevel}else{return -1}},sortFunc:function(f,c,g){return $WH.stringCompare(f.maxlevel,c.maxlevel)}},{id:"pieces",name:LANG.pieces,getValue:function(b){return b.pieces.length},compute:function(b,l){l.style.padding="0";var c=(b.pieces!=null&&b.pieces.length>0);if(c){var j=[];for(var g=0;g<b.pieces.length;++g){var k=b.pieces[g];var h=b.pcbonus?b.pcbonus[g]:[];var f=h.length>0?("&bonus="+h.join(":")):"";j.push({0:g_items.getIcon(k,h),1:1,2:"/item="+k+f})}Listview.funcBox.createCenteredIcons(j,l)}},sortFunc:function(f,c){var h=(f.pieces!=null?f.pieces.length:0);var g=(c.pieces!=null?c.pieces.length:0);return $WH.stringCompare(h,g)}},{id:"armortype",name:LANG.type,type:"text",width:"15%",getVisibleText:function(b){return b.armorType?g_itemset_types[b.armorType]:"???"},compute:function(b){return b.armorType?g_itemset_types[b.armorType]:"???"},sortFunc:function(f,c){return $WH.stringCompare(f.armorType,c.armorType)}},{id:"style",name:LANG.style,type:"text",getVisibleText:function(b){return g_transmog_notes_to_styles[b._note]?g_transmog_styles[g_transmog_notes_to_styles[b._note]]:"???"},compute:function(b){return g_transmog_notes_to_styles[b._note]?g_transmog_styles[g_transmog_notes_to_styles[b._note]]:"???"},sortFunc:function(f,c){return $WH.stringCompare(g_transmog_notes_to_styles[f._note],g_transmog_notes_to_styles[c._note])}}],getItemLink:function(b){return"/transmog-set="+b.id}};Listview.templates.outfit={sort:["name"],searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",compute:function(b,h,f){var g=$WH.ce("div");var c=$WH.ce("a");$WH.ae(g,c);c.className=(b.classs?"c"+b.classs:"q0")+" listview-cleartext";$WH.st(c,b.name);c.href=this.getItemLink(b);if(b.nvotes<5){c.className+=" guide-new"}$WH.ae(h,g)},getVisibleText:function(b){return b.name},sortFunc:function(g,f,h){var c,j;c=g.name.toString().replace(/^\s*[\[\(]+[^\]\)]*[\]\)]/,"").replace(/^\W+/,"").replace(/^An?\s+/,"");j=f.name.toString().replace(/^\s*[\[\(]+[^\]\)]*[\]\)]/,"").replace(/^\W+/,"").replace(/^An?\s+/,"");if(c==""){c=g.name}if(j==""){j=f.name}return $WH.stringCompare(c,j)||$WH.stringCompare(g.name,f.name)}},{id:"classs",name:LANG.classs,type:"text",compute:function(b,j){if(b.classs){var h=$WH.ce("div"),g=$WH.ce("div"),f;f=Icon.create("class_"+g_file_classes[b.classs],0,null,"/class="+b.classs);var c=Icon.getLink(f);$WH.Tooltip.simple(c,g_chr_classes[b.classs],"c"+b.classs,true);f.style.cssFloat=f.style.syleFloat="left";h.style.margin="0 auto";h.style.textAlign="left";h.style.width="26px";g.className="clear";$WH.ae(h,f);$WH.ae(j,h);$WH.ae(j,g)}},getVisibleText:function(b){return b.classs?g_chr_classes[b.classs]:""},sortFunc:function(f,c,g){return $WH.stringCompare(f.classs?g_chr_classes[f.classs]:"",c.classs?g_chr_classes[c.classs]:"")}},{id:"race",name:LANG.race,type:"text",compute:function(b,j){if(b.race){var h=$WH.ce("div"),g=$WH.ce("div"),f;f=Icon.create("race_"+g_file_races[b.race]+"_"+g_file_genders[b.gender||0],0,null,"/race="+b.race);var c=Icon.getLink(f);$WH.Tooltip.simple(c,g_chr_races[b.race],"q",true);f.style.cssFloat=f.style.syleFloat="left";h.style.margin="0 auto";h.style.textAlign="left";h.style.width="26px";g.className="clear";$WH.ae(h,f);$WH.ae(j,h);$WH.ae(j,g)}},getVisibleText:function(b){return b.race?g_chr_races[b.race]:""},sortFunc:function(f,c,g){return $WH.stringCompare(f.race?g_chr_races[f.race]:"",c.race?g_chr_races[c.race]:"")}},{id:"user",name:LANG.author,type:"text",compute:function(b,g){var f=$("<a/>",{html:b.user,href:"/user="+b.user+"#outfits"});var c=$WH.getStaffColorFromRoles(b.userroles|0);if(c!=""){f.addClass(c)}else{f.css("color","white")}$(g).append(f)},getVisibleText:function(b){return b.user},sortFunc:function(f,c){return $WH.stringCompare(f.user,c.user)}},{id:"rating",name:LANG.rating,value:"score"},{id:"views",name:LANG.views,value:"nviews",type:"text",compute:function(b,f){var c=$("<span>");c.text($WH.getN5(b.nviews));Listview.funcBox.viewColors(c,b.nviews);$(f).append(c)}},{id:"comments",name:LANG.comments,value:"ncomments",compute:function(b){return $WH.getN5(b.ncomments|0)}}],getItemLink:function(b){return"/outfit="+b.id+"/"+b.url}};Listview.templates.outfitgallery={sort:[1],mode:3,nItemsPerPage:40,nItemsPerRow:4,poundable:1,sortOptions:[{id:"name",name:LANG.name,type:"text",value:"name",sortFunc:function(g,f){var c,h;c=g.name.toString().replace(/^\s*[\[\(]+[^\]\)]*[\]\)]/,"").replace(/^\W+/,"").replace(/^An?\s+/,"");h=f.name.toString().replace(/^\s*[\[\(]+[^\]\)]*[\]\)]/,"").replace(/^\W+/,"").replace(/^An?\s+/,"");if(c==""){c=g.name}if(h==""){h=f.name}return $WH.stringCompare(c,h)||$WH.stringCompare(g.name,f.name)}},{id:"class",name:LANG.classs,type:"text",value:"name",sortFunc:function(f,c){return $WH.stringCompare(f.classs?g_chr_classes[f.classs]:"",c.classs?g_chr_classes[c.classs]:"")}},{id:"race",name:LANG.race,type:"text",value:"name",sortFunc:function(f,c){return $WH.stringCompare(f.race?g_chr_races[f.race]:"",c.race?g_chr_races[c.race]:"")}}],columns:[],compute:function(b,l,g){l.className="screenshot-cell";l.vAlign="bottom";var c=$WH.ce("a");c.href=this.getItemLink(b);var f=$WH.ce("img");if(b.screenshot){f.src=g_staticUrl+"/uploads/screenshots/small/"+b.screenshot+".jpg"}f.style.height="254px";$WH.ae(c,f);$WH.ae(l,c);var j=$WH.ce("div");j.className="screenshot-caption-wrapper";j.style.position="relative";j.style.height="1em";var h=$WH.ce("div");h.className="screenshot-caption";$WH.aE(l,"mouseover",Listview.funcBox.ssCellOver.bind(h));$WH.aE(l,"mouseout",Listview.funcBox.ssCellOut.bind(h));var k=$WH.ce("a");k.href=this.getItemLink(b);$WH.st(k,b.name);$WH.ae(h,k);$WH.ae(j,h);$WH.ae(l,j)},sortFunc:function(g,f,h){var c,j;c=g.name.toString().replace(/^\s*[\[\(]+[^\]\)]*[\]\)]/,"").replace(/^\W+/,"").replace(/^An?\s+/,"");j=f.name.toString().replace(/^\s*[\[\(]+[^\]\)]*[\]\)]/,"").replace(/^\W+/,"").replace(/^An?\s+/,"");if(c==""){c=g.name}if(j==""){j=f.name}return $WH.stringCompare(c,j)||$WH.stringCompare(g.name,f.name)},getItemLink:function(b){return"/outfit="+b.id+"/"+b.url}};Listview.templates.bagscan={sort:[1],columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",compute:function(g,j,c){var h=$WH.ce("div");var b=$WH.ce("a");b.href=this.getItemLink(g);b.className="listview-cleartext";$WH.ae(b,$WH.ct(g.name));$WH.ae(h,b);if(g["private"]){h.style.position="relative";var f=$WH.ce("div");f.className="listview-name-info q0";$WH.ae(f,$WH.ct(LANG["private"]));$WH.aef(h,f)}$WH.ae(j,h)}},{id:"backpack",name:LANG.backpack,type:"number",value:"backpack"},{id:"bank",name:LANG.bank,type:"number",value:"bank"},{id:"voidstorage",name:LANG.voidstorage,type:"number",value:"voidstorage"},{id:"guildbank",name:LANG.guildbank,type:"number",value:"guild"},{id:"posted",name:LANG.posted,type:"text",compute:function(f,g){var b=new Date(parseInt(f.when)),c=(g_serverTime-b)/1000;a=$WH.ce("span");$WH.formatDate(a,c,b);$WH.ae(g,a)},sortFunc:function(f,c){if(f.when==c.when){return 0}return f.when<c.when?1:-1}},{id:"delete",name:LANG["delete"],type:"text",hidden:true,compute:function(c,f){var b=$WH.ce("a");b.className="fa fa-times";$WH.st(b,LANG["delete"]);b.href="javascript:;";$WH.aE(b,"click",DeleteBagScan.bind(c));$WH.ae(f,b)}}],getItemLink:function(b){return"/bagscanner="+b.id}};Listview.templates.transmogsetgallery={sort:[1],mode:3,nItemsPerPage:40,nItemsPerRow:4,poundable:1,sortOptions:[{id:"name",name:LANG.name,type:"text",value:"name",sortFunc:function(g,f){var c=(8-parseInt(g.name.charAt(0)));var h=(8-parseInt(f.name.charAt(0)));if(c==4){c=3}if(h==4){h=3}if(c!=h){return $WH.stringCompare(h,c)}return $WH.stringCompare(g.name.substring(1),f.name.substring(1))}},{id:"level",name:LANG.tooltip_reqlevel,type:"range",sortFunc:function(f,c){return $WH.stringCompare(f.maxlevel,c.maxlevel)}},{id:"pieces",name:LANG.pieces,getValue:function(b){return b.pieces.length},sortFunc:function(f,c){var h=(f.pieces!=null?f.pieces.length:0);var g=(c.pieces!=null?c.pieces.length:0);return $WH.stringCompare(h,g)}},{id:"armortype",name:LANG.type,type:"text",sortFunc:function(f,c){return $WH.stringCompare(f.armorType,c.armorType)}},{id:"style",name:LANG.style,getValue:function(b){return g_transmog_notes_to_styles[b._note]},sortFunc:function(f,c){return $WH.stringCompare(g_transmog_notes_to_styles[f._note],g_transmog_notes_to_styles[c._note])}}],columns:[],compute:function(m,f,h){f.className="screenshot-cell";f.vAlign="bottom";var l=$WH.ce("a");l.href="/transmog-set="+m.id;var n=$WH.getPreferredTransmogRace();var g=$WH.ce("img");g.src=g_staticUrl+ModelViewer.getStaticBase()+"/transmog/"+n.race+"/"+(n.gender-1)+"/"+m.id+".jpg";g.style.height="254px";$WH.ae(l,g);$WH.ae(f,l);if(true){var j=$WH.ce("div");j.className="screenshot-caption-wrapper";j.style.position="relative";j.style.height="1em";var b=$WH.ce("div");b.className="screenshot-caption";$(b).click(function(){location.href="/transmog-set="+m.id});$WH.aE(f,"mouseover",Listview.funcBox.ssCellOver.bind(b));$WH.aE(f,"mouseout",Listview.funcBox.ssCellOut.bind(b));var k=$WH.ce("span");var c=$WH.sprintf("[color=q$1]$2[/color]",8-parseInt(m.name.charAt(0)),m.name.substring(1));k.innerHTML=Markup.toHtml(c,{mode:Markup.MODE_ARTICLE});$WH.ae(b,k);$WH.ae(j,b);$WH.ae(f,j)}},sortFunc:function(g,f,h){var c=(8-parseInt(g.name.charAt(0)));var j=(8-parseInt(f.name.charAt(0)));if(c==4){c=3}if(j==4){j=3}if(c!=j){return $WH.stringCompare(j,c)}return $WH.stringCompare(g.name.substring(1),f.name.substring(1))}};Listview.templates.icongallery={sort:[1],mode:Listview.MODE_FLEXGRID,clickable:false,nItemsPerPage:170,cellMinWidth:88,poundable:1,sortOptions:[{id:"name",name:LANG.name,sortFunc:function(f,c){return $WH.stringCompare(f.name,c.name)}}],columns:[],value:"name",compute:function(n,q,j){var l=$WH.ce("div");l.className="icon-cell";$(l).mouseenter(function(){setTimeout((function(){this.className+=" animate"}).bind(this),1)}).mouseleave(function(){this.className=this.className.replace(/ *animate\b/,"")});$WH.ae(l,Icon.create(n.icon,2,null,this.getItemLink(n)));var f=$WH.ce("div",{className:"icon-cell-overlay"});$(f).mouseleave(function(){$(".fa-check",this).removeClass("fa-check").addClass("fa-clipboard")});$WH.ae(f,Icon.create(n.icon,2,null,this.getItemLink(n)));var r=$WH.ce("div",{className:"icon-cell-overlay-name"});var o=function(){this.focus();this.select()};$WH.ae(r,$WH.ce("input",{type:"text",value:n.name,onclick:o,onfocus:o}));$WH.ae(r,$WH.createButton(null,null,{"class":"fa fa-fw fa-clipboard","float":false,"no-margin":true,click:function(){var v=$(this);var y=v.siblings('input[type="text"]');y.focus().select();var w=false;try{if(!document.execCommand("copy")){w=true}}catch(u){w=true}y.blur();if(w){v.css({"pointer-events":"none"}).removeClass("fa-clipboard").addClass("fa-exclamation-triangle").blur().effect("shake",{distance:5});setTimeout(function(){$(".icon-cell-overlay-name .btn").fadeOut(1000)},600)}else{v.removeClass("fa-clipboard").addClass("fa-check")}}}));$WH.ae(f,r);var t=$WH.ce("div",{className:"icon-cell-overlay-counts"});var b=[3,6,10,1,200,17,22,20,9,26,13];var c=0;for(var h=0,m;m=b[h];h++){var p=g_types[m]+"count";if(n[p]){c+=n[p];var g=g_types[m];var s=n[p]==1?LANG.types[m][1]:LANG.types[m][3];if(m==1){g="battlepet";s=n[p]==1?LANG.battlepet_lc:LANG.battlepets_lc}$WH.ae(t,$WH.ce("div",null,$WH.ce("a",{href:this.getItemLink(n)+"#used-by-"+g,innerHTML:$WH.sprintf(LANG.entitycount,n[p],s)})))}}if(!c){$WH.ae(t,$WH.ce("div",{innerHTML:LANG.unused}))}$WH.ae(f,t);var k=$WH.ce("div",{className:"icon-cell-overlay-placer"},f);$WH.ae(l,k);$WH.ae(q,l)},sortFunc:function(f,c){return $WH.stringCompare(f.name,c.name)},getItemLink:function(b){return"/icon="+b.id+"/"+$WH.urlize(b.name)}};Listview.templates.guide={sort:["rating"],searchable:1,filtrable:1,columns:[{id:"title",name:"Title",type:"text",align:"left",value:"title",compute:function(b,j,f){if(b.status==5){$(f).addClass("outofdate")}if(!b.title){b.title=b.url}var h=$("<a>").text(b.title).attr("class","listview-cleartext").attr("href",b.url);if(b.sticky){h.addClass("guide-sticky")}else{if(b.nvotes<5){h.addClass("guide-new")}}if(!b.featuredimage){$(j).addClass("guides-list-cell-nameonly").append(h)}else{if(b.hasOwnProperty("spec")&&b.spec){for(var c in g_chr_specs_by_class){if(g_chr_specs_by_class.hasOwnProperty(c)&&$WH.inArray(g_chr_specs_by_class[c],b.spec)>=0){h.addClass("c"+c);break}}}var g=$("<table/>",{"class":"guides-list-name"+(b.title.length>=60?" long-name":"")}).append($("<tr/>").append($("<td/>").append(h)));$(j).addClass("guides-list-cell").append($("<div/>").append($("<div/>",{"class":"guides-list-bg",style:"background-image:url("+g_staticUrl+"/uploads/guide/featuredguides/"+b.featuredimage+")",html:"<div></div>"})).append(g))}},getVisibleText:function(b){return b.title}},{id:"status",name:"Status",type:"text",hidden:1,compute:function(b,f){var c=$("<span>").text(l_guide_states[b.status]).css("color",l_guide_states_color[b.status]);$(f).append(c)},getVisibleText:function(b){return l_guide_states[b.status]},sortFunc:function(f,c){if(f.status==c.status){return 0}return f.status<c.status?-1:1}},{id:"category",name:"Category",type:"text",compute:function(b,c){$(c).append($("<a>").attr("href","/guides="+b.category).text(l_guide_categories[b.category]).css("color","white"))},getVisibleText:function(b){return l_guide_categories[b.category]},sortFunc:function(f,c){if(f.category==c.category){return 0}return f.category<c.category?-1:1}},{id:"author",name:"Author",type:"text",compute:function(b,g){var f=$("<a>").attr("href","/user="+b.author).text(b.author);var c=$WH.getStaffColorFromRoles(b.authorroles);if(c!=""){f.addClass(c)}else{f.css("color","white")}$(g).append(f)},getVisibleText:function(b){return b.author},sortFunc:function(f,c){return $WH.stringCompare(f.author,c.author)}},{id:"rating",name:"Rating",type:"range",width:"200px",compute:function(b,f){$(f).append(GetStars(b.rating));var c=$("<span>").css("font-size","85%");if(b.rating<0){c.text($WH.sprintf(" (needs $1 more $2)",5-b.nvotes,(5-b.nvotes)==1?"vote":"votes"))}else{c.text(" (out of "+$WH.getN5(b.nvotes)+" "+(b.nvotes==1?"vote":"votes")+")")}$(f).append(c)},getMinValue:function(b){return guide.rating},getMaxValue:function(b){return guide.rating},sortFunc:function(f,c,h){if(f.sticky&&!c.sticky){return -1}else{if(!f.sticky&&c.sticky){return 1}}var j=f.rating==-1&&f.author!="Wowhead";var g=c.rating==-1&&c.author!="Wowhead";if(j&&!g){return -1}else{if(g&&!j){return 1}}if(f.rating==c.rating){return 0}return f.rating<c.rating?1:-1}},{id:"comments",name:"Comments",type:"text",width:"120px",compute:function(b){return $WH.getN5(b.comments)},sortFunc:function(f,c){if(f.comments==c.comments){return 0}return f.comments<c.comments?-1:1}},{id:"patch",name:"Expansion",type:"text",width:"120px",compute:function(b,f){var c=$WH.ce("span");c.className=$WH.getExpansionClassName(Math.floor(b.patch/10000)-1);if(c.className.substr(0,12)=="icon-unknown"){c.innerHTML=$WH.formatVersion(b.patch)}else{c.title=$WH.formatVersion(b.patch)}$WH.ae(f,c)},sortFunc:function(f,c){if(f.patch==c.patch){return 0}return f.patch<c.patch?-1:1}}],getItemLink:function(b){return b.url}};Listview.templates.topusers={sort:["reputation"],searchable:1,filtrable:0,columns:[{id:"username",name:LANG.username,type:"text",align:"left",compute:function(c,g){var f=$("<a>");var b=$WH.getStaffColorFromRoles(c.groups);if(b!=""){f.addClass(b)}else{f.css("color","white")}f.text(c.username);f.addClass("listview-cleartext");f.attr("href","/user="+c.username);$(g).append(f);return},getVisibleText:function(b){return b.username},sortFunc:function(f,c){return $WH.stringCompare(f.username,c.username)},getItemLink:function(b){return"/user="+user.username}},{id:"reputation",name:LANG.reputation,type:"text",compute:function(b,c){$(c).append($WH.numberFormat(b.reputation));return},sortFunc:function(f,c){if(f.reputation==c.reputation){return 0}return f.reputation<c.reputation?1:-1}},{id:"achievements",name:LANG.achievements,type:"text",compute:function(b,g){var c=$("<span>").addClass("wsach-pts").css("font-size","inherit");var f="";if(b.gold){f+="<i>"+b.gold+"</i>&middot;"}if(b.silver){f+="<b>"+b.silver+"</b>&middot;"}f+="<u>"+b.copper+"</u>";c.html(f);$(g).append(c);return},sortFunc:function(f,c){var h=(f.gold*1000*1000)+(f.silver*1000)+f.copper;var g=(c.gold*1000*1000)+(c.silver*1000)+c.copper;if(h==g){return 0}return h<g?1:-1}},{id:"comments",name:LANG.comments,type:"text",compute:function(b,c){$(c).append($WH.numberFormat(b.comments));return},sortFunc:function(f,c){if(f.comments==c.comments){return 0}return f.comments<c.comments?1:-1}},{id:"posts",name:LANG.posts,type:"text",compute:function(b,c){$(c).append($WH.numberFormat(b.posts));return},sortFunc:function(f,c){if(f.posts==c.posts){return 0}return f.posts<c.posts?1:-1}},{id:"screenshots",name:LANG.screenshots,type:"text",compute:function(b,c){$(c).append($WH.numberFormat(b.screenshots));return},sortFunc:function(f,c){if(f.screenshots==c.screenshots){return 0}return f.screenshots<c.screenshots?1:-1}},{id:"reports",name:LANG.reports,type:"text",compute:function(b,c){$(c).append($WH.numberFormat(b.reports));return},sortFunc:function(f,c){if(f.reports==c.reports){return 0}return f.reports<c.reports?1:-1}},{id:"votes",name:LANG.votes,type:"text",compute:function(b,c){$(c).append($WH.numberFormat(b.votes));return},sortFunc:function(f,c){if(f.votes==c.votes){return 0}return f.votes<c.votes?1:-1}},{id:"uploads",name:LANG.uploads,type:"text",compute:function(b,c){$(c).append($WH.numberFormat(b.uploads));return},sortFunc:function(f,c){if(f.uploads==c.uploads){return 0}return f.uploads<c.uploads?1:-1}},{id:"created",name:LANG.created,type:"text",hidden:1,compute:function(c,g){var b=new Date(c.creation),f=(g_serverTime-b)/1000;a=$WH.ce("span");$WH.formatDate(a,f,b);$WH.ae(g,a)},sortFunc:function(f,c){if(f.creation==c.creation){return 0}return f.creation<c.creation?1:-1}}],getItemLink:function(b){return"/user="+b.username}};Listview.templates.reputationhistory={sort:["when"],searchable:0,filtrable:0,columns:[{id:"action",value:"action",name:LANG.reputationaction,type:"text",align:"left",compute:function(c,f){if(c.param&&c.param>0){var b=$("<a>").addClass("listview-cleartext").attr("href","/go-to-comment&id="+c.param).text(l_reputation_names[c.action]);if(c.action==11||c.action==12||c.action==13){b.attr("href","/website-achievement="+c.param+(g_user.name?("#user:"+g_user.name):""))}$(f).append(b)}else{$(f).append(l_reputation_names[c.action])}},getVisibleText:function(b){return l_reputation_names[b.action]},sortFunc:function(f,c){return $WH.stringCompare(l_reputation_names[f.action],l_reputation_names[c.action])}},{id:"amount",value:"amount",name:LANG.amount,type:"text",width:"250px",compute:function(c,f){var b=$("<span>").text(c.amount);if(c.amount>0){b.addClass("q2").prepend("+")}else{if(c.amount<0){b.addClass("q10")}}$(f).append(b)},getVisibleText:function(b){return b.amount}},{id:"when",name:LANG.date,type:"text",width:"250px",compute:function(f,g){var b=new Date(f.when),c=(g_serverTime-b)/1000;a=$WH.ce("span");$WH.formatDate(a,c,b);$WH.ae(g,a)},sortFunc:function(f,c){var h=new Date(f.when);var g=new Date(c.when);if(h==g){return 0}return h<g?1:-1}}]};Listview.templates.twitchstream={sort:[-2,1],searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",span:2,compute:function(j,k,h){var c=$WH.ce("td");c.style.width="1px";c.style.paddingRight="0";c.style.borderRight="none";$WH.ae(h,c);if(("logo" in j.channel)&&(j.channel.logo)){var g=Icon.create(j.channel.logo,1,null,this.getItemLink(j));g.getElementsByTagName("ins")[0].style.backgroundSize="36px 36px";$WH.ae(c,g)}else{$WH.ae(c,Icon.create("inv_misc_questionmark",1,null,this.getItemLink(j)))}k.style.borderLeft="none";var b=$WH.ce("a");b.className="listview-cleartext";b.href=this.getItemLink(j);var f=$WH.ce("span");$WH.st(f,j.channel.display_name);$WH.ae(b,f);$WH.ae(k,b);if(j.channel.status){$WH.ae(k,$WH.ce("br"));var f=$WH.ce("span");f.className="small q0";$WH.st(f,j.channel.status);$WH.ae(k,f)}},getVisibleText:function(b){return b.channel.display_name},sortFunc:function(f,c,g){return $WH.stringCompare(f.channel.display_name,c.channel.display_name)}},{id:"viewers",name:"Viewers",type:"number",value:"viewers",compute:function(c,f,b){$WH.st(f,$WH.getN5(c.viewers))}}],getItemLink:function(b){return"/streams#"+b.channel.name}};Listview.templates.comment={sort:[-5,4,6,-3,2],mode:2,nItemsPerPage:40,poundable:2,columns:[{value:"number"},{value:"id"},{value:"rating"},{value:"deleted"},{value:"sticky"},{value:"outofdate"}],compute:function(h,g,c){var f=$("<div></div>");var b=(h.__minPatch&&(h.__minPatch>new Date(h.date)));h.locale=(this.id=="english-comments"?"www":"");f.append('<table><tr><td class="vote-column"><p class="upvote"><span class="fa fa-chevron-up"></span></p><div class="rating-container"></div><p class="downvote"><span class="fa fa-chevron-down"></span></p><p class="comment-sticky" title="'+LANG.stickycomment_tip+'">STICKY</p></td><td class="main-body"><div class="comment-header"><table><tr><td class="comment-author"></td><td class="comment-controls"></td><td class="comment-notification"></td></tr></table></div><div class="text comment-body"></div><div class="comment-replies"></div><p class="comment-replies-control" style="display: none"></p></td></tr></table>');h.colorClass="comment"+(c%2);f.addClass("comment").addClass(h.colorClass);if(h.rating<-4){f.addClass("comment-lowrated")}if(h.deleted){f.addClass("comment-deleted")}if(h.outofdate){f.addClass("comment-outofdate")}h.container=f;h.voteCell=f.find(".vote-column");h.commentCell=f.find(".main-body");h.repliesCell=f.find(".comment-replies");h.repliesControl=f.find(".comment-replies-control");h.headerCell=f.find(".comment-header");h.commentBody=f.find(".comment-body");h.commentAuthor=f.find(".comment-author");h.commentControls=f.find(".comment-controls");this.template.updateVoteCell(h);this.template.updateCommentCell(h);this.template.updateStickyStatus(h);this.template.updateReplies(h);if(h.deleted||h.rating<-4){h.headerCell.css("cursor","pointer");h.headerCell.bind("click",function(){h.voteCell.toggle();h.repliesCell.toggle();h.commentBody.toggle()})}$(g).addClass("comment-wrapper").html(f);if(b){$(g).hide()}else{$(g).show()}},updateReplies:function(g){this.updateRepliesCell(g);this.updateRepliesControl(g);SetupReplies(g.container,g);if(!g.alreadyLoadedBefore){g.alreadyLoadedBefore=true;var f=location.hash.match("#comments:id=([0-9]+):reply=([0-9]+)");if(f){var c=f[1];var b=f[2];if(g.id==c){this.highlightReply(g,b)}}}},highlightReply:function(k,f,g){var j=null;for(var c in k.replies){if(k.replies[c].id==f){j=k.replies[c];break}}if(!j){if(g){return}$.ajax({type:"GET",url:"/comment=show-replies",data:{id:k.id},success:function(l){k.replies=l;Listview.templates.comment.updateReplies(k);Listview.templates.comment.highlightReply(k,f,true)},dataType:"json"});return}var h=k.repliesCell.find(".comment-reply-row[data-replyid="+f+"]");var b="#242424";if(k.deleted){b="#402424"}else{if(k.outofdate){b="#322C1C"}}h.css("background-color","#581111");setTimeout(function(){h.animate({backgroundColor:b},1500)},1500)},updateStickyStatus:function(b){if(b.sticky){b.voteCell.find(".comment-sticky").show()}else{b.voteCell.find(".comment-sticky").hide()}},updateRepliesCell:function(k){var m=k.repliesCell;var q=$("<table></table>");m.html("");if(!k.replies.length){m.append(q).hide();return}for(var j=0;j<k.replies.length;++j){var f=k.replies[j];var t=$('<tr class="comment-reply-row"><td class="reply-controls"><p class="reply-upvote"><span class="fa fa-chevron-up"></span></p><p class="reply-rating"></p><p class="reply-downvote"><span class="fa fa-chevron-down"></span></p></td><td class="reply-text"></td></tr>');var s=$('<p class="comment-reply-author"></p>');var o=$("<a></a>");var h=new Date(f.creationdate);var n=(g_serverTime-h)/1000;var p=t.find(".reply-upvote");var r=t.find(".reply-downvote");var l=(g_user.name==f.username)||(g_user.roles&U_GROUP_COMMENTS_MODERATOR)!=0;var b=l;t.attr("data-replyid",f.id);t.attr("data-idx",j);t.find(".reply-text").addClass($WH.getStaffColorFromRoles(f.roles));var c=$("<a></a>");c.text($WH.formatDate(null,n,h));c.attr("href","#comments:id="+k.id+":reply="+f.id);c.attr("id","comments:id="+k.id+":reply="+f.id);c.addClass("when");o.attr("href","/user="+f.username);o.text(f.username);s.append(o);s.append(" ").append(c).append(" ").append($WH.sprintf(LANG.lvcomment_patch,$WH.getPatchVersion(h)));var g=Markup.toHtml(f.body,{allow:Markup.CLASS_USER,mode:Markup.MODE_REPLY,roles:0,locale:k.locale});if(g_user.canUpvote&&g_user.name!=f.username&&!f.reportedByUser){g+=' <span class="reply-report title="'+LANG.reportthisreply_stc+'"><span class="fa fa-warning"></span></span>'}if(b){g+=' <span class="reply-edit title="'+LANG.editthisreply_stc+'"><span class="fa fa-pencil"></span></span>'}if(l){g+=' <span class="reply-delete title="'+LANG.deletethisreply_stc+'"><span class="fa fa-times"></span></span>'}t.find(".reply-text").html(s).append(g);t.find(".reply-rating").text(f.rating);if(f.votedByUser){p.attr("data-hasvoted","true")}if(g_user.canUpvote&&g_user.name!=f.username&&!f.votedByUser&&!f.downvotedByUser){p.attr("data-canvote","true")}if(f.downvotedByUser){r.attr("data-hasvoted","true")}if(g_user.canDownvote&&g_user.name!=f.username&&!f.votedByUser&&!f.downvotedByUser){r.attr("data-canvote","true")}q.append(t)}m.html(q);if(k.deleted||k.rating<-4){k.repliesCell.hide()}},updateRepliesControl:function(f){var b=f.repliesControl;b.html("").hide().unbind().attr("class","comment-replies-control");var c=Math.max(f.nreplies-f.replies.length,0);if((f.deleted||f.outofdate||f.rating<-4)||(!g_user.canPostReplies&&!c)){return}if(g_user.canPostReplies){if(!c){b.text(LANG.addreply_stc).addClass("add-reply")}else{b.text($WH.sprintf(c==1?LANG.addshow1morereply_stc:LANG.addshowmorereplies_format,c)).addClass("show-more-replies")}}else{b.text($WH.sprintf(c==1?LANG.show1morereply_stc:LANG.showmorereplies_format,c)).addClass("show-more-replies")}b.addClass("btn btn-small");b.show()},updateCommentCell:function(b){b.commentCell.find(".comment-edit").remove();this.updateCommentBody(b,b.commentBody);this.updateCommentAuthor(b,b.commentAuthor);this.updateCommentControls(b,b.commentControls)},updateCommentAuthor:function(h,g){var c=g_users[h.user];var b=new Date(h.date);var f=(g_serverTime-b)/1000;g.html("");g.append(LANG.lvcomment_by);g.append($WH.sprintf('<a href="/user=$1">$2</a>',h.user,h.user));g.append($WH.getReputationPlusAchievementText(c.gold,c.silver,c.copper,c.reputation));g.append($WH.sprintf(' <a class="q0" id="comments:id=$1" href="#comments:id=$2">$3</a>',h.id,h.id,$WH.formatDate(null,f,b)));g.append($WH.sprintf(LANG.lvcomment_patch,$WH.getPatchVersion(b)))},updateCommentControls:function(h,k){var n=[];var b=(g_user.roles&U_GROUP_COMMENTS_MODERATOR)!=0||(h.user.toLowerCase()==g_user.name.toLowerCase()&&!g_user.commentban);var j=(g_user.roles&U_GROUP_COMMENTS_MODERATOR)!=0||(h.user.toLowerCase()==g_user.name.toLowerCase()&&!g_user.commentban);var l=(g_user.roles&U_GROUP_COMMENTS_MODERATOR)!=0;if(b){if(!h.outofdate&&!h.deleted){n.push({extraClass:"fa fa-pencil",name:LANG.lvcomment_edit,func:Listview.funcBox.coEdit.bind(this,h,0,false)})}}if(j&&!h.deleted){n.push({extraClass:"fa fa-times delete",name:LANG.lvcomment_delete,func:Listview.funcBox.coDelete.bind(this,h)})}if(l&&h.deleted){n.push({extraClass:"fa fa-times undelete",name:LANG.lvcomment_undelete,func:Listview.funcBox.coUndelete.bind(this,h)})}if(l&&h.outofdate){n.push({extraClass:"fa fa-clock-o uptodate",name:LANG.lvcomment_uptodate,func:Listview.funcBox.coFlagUpOfDate.bind(this,h)})}if(g_user.id!=0&&!h.outofdate&&!h.deleted){n.push({extraClass:"fa fa-clock-o outofdate",name:LANG.lvcomment_outofdate,func:Listview.funcBox.coFlagOutOfDate.bind(this,h)})}if(l&&!h.sticky&&!h.outofdate&&!h.deleted){n.push({extraClass:"fa fa-thumb-tack sticky",name:"Sticky",func:this.sticky.bind(this,h)})}if(l&&h.sticky&&!h.outofdate&&!h.deleted){n.push({extraClass:"fa fa-thumb-tack unsticky",name:"Unsticky",func:this.sticky.bind(this,h)})}if(!h.outofdate&&!h.deleted){n.push({extraClass:"fa fa-warning",tooltip:LANG.report_tooltip,name:LANG.lvcomment_report,func:ContactTool.show.bind(ContactTool,{mode:1,comment:h})})}k.html("");for(var m in n){var g=n[m];var f=$("<a></a>");var c=$("<span></span>");f.click(g.func);if(g.extraClass){f.addClass(g.extraClass)}if(g.tooltip){$WH.Tooltip.simple(f.get(0),g.tooltip,"q2")}else{if(g.name){$WH.Tooltip.simple(f.get(0),g.name,"q2")}}c.append(f);k.append(c)}},updateCommentBody:function(g,c){var f=Markup.rolesToClass(g.roles);c.removeClass("comment-green");c.addClass(Listview.funcBox.coGetColor(g));c.html(Markup.toHtml(g.body,{allow:f,mode:Markup.MODE_COMMENT,roles:g.roles,locale:g.locale}));if(g.response){var b=$("<div></div>");b.addClass("text comment-body");b.html(Markup.toHtml("[div][/div][wowheadresponse="+g.responseuser+" roles="+g.responseroles+"]"+g.response+"[/wowheadresponse]",{allow:Markup.CLASS_STAFF,roles:g.responseroles,uid:"resp-"+g.id}));c.append(b)}if(g.lastEdit){this.addEditedByOrDeletedByText(c,LANG.lvcomment_lastedit,g.lastEdit[2],g.lastEdit[0])}if(g.deletedInfo){this.addEditedByOrDeletedByText(c,LANG.lvcomment_deletedby,g.deletedInfo[1],g.deletedInfo[0])}g.divBody=c[0];if(g.deleted||g.rating<-4){c.hide()}},addEditedByOrDeletedByText:function(j,k,h,b){var f=new Date(b);var g=(g_serverTime-f)/1000;var c=$("<div></div>");c.addClass("comment-lastedit");c.html($WH.sprintf("$1 <a></a> $2 $3",k,$WH.formatDate(null,g,f),$WH.sprintf(LANG.lvcomment_patch,$WH.getPatchVersion(f))));c.find("a").text(h).attr("href","/user="+h);j.append(c)},updateVoteCell:function(k){var g=k.voteCell.find(".upvote");var f=k.voteCell.find(".downvote");var j=k.voteCell.find(".rating-container");var c=$('<p class="rating"></p>');var b=this;j.html(c);var h=k.hasOwnProperty("langOverride")?k.langOverride:LANG;if(k.userRating>0){g.attr("data-hasvoted","true").attr("title",h.upvoted_tip)}else{g.attr("data-hasvoted","false").attr("title",h.upvote_tip)}if(k.userRating<0){f.attr("data-hasvoted","true").attr("title",h.downvoted_tip)}else{f.attr("data-hasvoted","false").attr("title",h.downvote_tip)}c.unbind();g.unbind();f.unbind();c.text(k.rating);c.click(function(){b.showVoteBreakdown(k,j)});g.click(function(){b.vote(k,1)});f.click(function(){b.vote(k,-1)});if(k.deleted||k.rating<-4){k.voteCell.hide()}},vote:function(k,c){if(!c){return}var h=k.hasOwnProperty("langOverride")?k.langOverride:LANG;if(!g_user.id){this.voteError(k,h.votelogin_tip);return}if(k.deleted){this.voteError(k,h.votedeleted_tip);return}if(g_user.name==k.user){this.voteError(k,h.voteself_tip);return}if(!g_user.canUpvote&&c>0){this.voteError(k,$WH.sprintf(h.upvotenorep_tip,g_user.upvoteRep));return}if(!g_user.canDownvote&&c<0){this.voteError(k,$WH.sprintf(h.downvotenorep_tip,g_user.downvoteRep));return}if(c>0){c=g_user.superCommentVotes?2:1}else{if(c<0){c=g_user.superCommentVotes?-2:-1}else{return}}var j=k.rating;var g=k.userRating;var b=this;if((k.userRating>0&&c>0)||(k.userRating<0&&c<0)){k.rating-=k.userRating;k.userRating=0}else{k.rating-=k.userRating;k.rating+=c;k.userRating=c}this.updateVoteCell(k);var f="/comment=vote";if(k.hasOwnProperty("voteUrl")){f=k.voteUrl}$.get(f,{id:k.id,rating:c},function(l){if(l.error){k.rating=j;k.userRating=g;b.updateVoteCell(k)}if(l.message){b.voteError(k,l.message)}},"json")},voteError:function(c,b){MessageBox(c.voteCell,b)},showVoteBreakdown:function(f,c){c.find("p").html('<img src="'+g_staticUrl+'/images/icons/ajax.gif" />');var b="/comment=rating";if(f.hasOwnProperty("ratingUrl")){b=f.ratingUrl}$.get(b+"&id="+f.id,null,function(g){if(g.success){c.html($WH.sprintf('<p class="rating-up">$1</p><div class="rating-separator"></div><p class="rating-down">$2</p>',(g.up?("+"+g.up):0),-g.down))}else{MessageBox(c,"An error has occurred while fetching vote counts. Try refreshing the page.")}},"json")},sticky:function(c){var b=c.commentCell.find(".comment-notification");c.sticky=!c.sticky;this.updateStickyStatus(c);this.updateCommentCell(c);if(c.sticky){MessageBox(b,"This comment is now sticky.")}else{MessageBox(b,"This comment is no longer sticky.")}$.post("/comment=sticky",{id:c.id,sticky:c.sticky?1:0})},createNote:function(b){var h=$WH.ce("small");if(!g_user.commentban){var o=$WH.ce("a");if(g_user.id>0){o.href="javascript:;";o.onclick=co_addYourComment}else{o.href="/account=signin"}$WH.ae(o,$WH.ct(LANG.lvcomment_add));$WH.ae(h,o);var f=$WH.ce("span");f.style.padding="0 5px";f.style.color="white";$WH.ae(f,$WH.ct("|"));$WH.ae(h,f)}$WH.ae(h,$WH.ct(LANG.sort+": "));var q=$WH.ce("a");q.href="javascript:;";$WH.ae(q,$WH.ct(LANG.newestfirst_stc));q.onclick=Listview.funcBox.coSortNewestFirst.bind(this,q);$WH.ae(h,q);$WH.ae(h,$WH.ct(LANG.comma));var r=$WH.ce("a");r.href="javascript:;";$WH.ae(r,$WH.ct(LANG.oldestfirst_stc));r.onclick=Listview.funcBox.coSortOldestFirst.bind(this,r);$WH.ae(h,r);$WH.ae(h,$WH.ct(LANG.comma));var s=$WH.ce("a");s.href="javascript:;";$WH.ae(s,$WH.ct(LANG.highestrated_stc));s.onclick=Listview.funcBox.coSortHighestRatedFirst.bind(this,s);$WH.ae(h,s);var j=$WH.getCookies()["comments_sort"];switch(j){case"1":q.onclick();break;case"2":r.onclick();break;default:case"3":s.onclick();break}var f=$WH.ce("span");f.style.padding="0 5px";f.style.color="white";$WH.ae(f,$WH.ct("|"));$WH.ae(h,f);var t=$WH.ce("select");var g=$WH.ce("option");g.value=0;g.selected="selected";$WH.ae(t,g);var n={};for(var l=0;l<this.data.length;++l){var k=$WH.getPatchVersionObject(new Date(this.data[l].date).getTime());if(k){n[k.build]=k}}var m=[];for(var c in n){m.push(c)}m.sort(function(u,p){return p-u});for(var c=0;c<m.length;++c){var g=$WH.ce("option");g.value=n[m[c]].timestamp;$WH.ae(g,$WH.ct(n[m[c]].version));$WH.ae(t,g)}t.onchange=Listview.funcBox.coFilterByPatchVersion.bind(this,t);$WH.ae(h,$WH.ct(LANG.lvcomment_patchfilter));$WH.ae(h,t);$WH.ae(b,h);if(this.tabClick){$("a, select",h).click(this.tabClick)}},onNoData:function(f){var b="<b>"+LANG.lvnodata_co1+'</b><div class="pad2"></div>';if(g_user.id>0){var c=LANG.lvnodata_co2;c=c.replace("<a>",'<a href="javascript:;" onclick="co_addYourComment()" onmousedown="return false">');b+=c}else{var c=LANG.lvnodata_co3;c=c.replace("<a>",'<a href="/account=signin">');c=c.replace("<a>",'<a href="/account=signup">');b+=c}f.style.padding="1.5em 0";f.innerHTML=b},onBeforeCreate:function(){if(location.hash&&location.hash.match(/:id=([0-9]+)/)!=null){var b=$WH.getCookies()["comments_sort"];switch(b){case"1":this.setSort([-5,4,-1,-2],false,false);break;case"2":this.setSort([-5,4,1,2],false,false);break;default:case"3":this.setSort([-5,4,-3,2],false,false);break}var c=$WH.inArray(this.data,parseInt(RegExp.$1),function(f){return f.id});this.rowOffset=this.getRowOffset(c);return this.data[c]}},onAfterCreate:function(b){if(b!=null){var c=b.__div;this.tabs.__st=c}}};Listview.templates.commentpreview={sort:[4],nItemsPerPage:75,columns:[{id:"subject",name:LANG.subject,align:"left",value:"subject",compute:function(g,f){var b=$WH.ce("a");b.className="listview-cleartext"+(typeof g.quality=="number"?" q"+g.quality:"");b.href=this.getItemLink(g);if(g.icon){b.className+=" icontiny tinyspecial";b.style.backgroundImage='url("'+g_staticUrl+"/images/wow/icons/tiny/"+g.icon.toLowerCase()+'.gif")'}$WH.ae(b,$WH.ct(g.subject));$WH.ae(f,b);if(LANG.types[g.type]){var c=$WH.ce("div");c.className="small";$WH.ae(c,$WH.ct(LANG.types[g.type][0]));$WH.ae(f,c)}}},{id:"preview",name:LANG.preview,align:"left",width:"50%",value:"preview",compute:function(j,h,c){var f=$WH.ce("div");f.className="crop";if(j.rating>=10){f.className+=" comment-green"}$WH.ae(f,$WH.ct(Markup.removeTags(j.preview,{mode:Markup.MODE_ARTICLE})));$WH.ae(h,f);f=$WH.ce("div");f.className="small3";if(j.rating){$WH.ae(f,$WH.ct(LANG.lvcomment_rating+(j.rating>0?"+":"")+j.rating))}var b=$WH.ce("span"),g="";b.className="q10";if(j.deleted){g=LANG.lvcomment_deleted}$WH.ae(b,$WH.ct(g));$WH.ae(f,b);c.__status=b;$WH.ae(h,f)}},{id:"author",name:LANG.author,value:"user",compute:function(f,c){c.className="q1";var b=$WH.ce("a");b.href="/user="+f.user;$WH.ae(b,$WH.ct(f.user));$WH.ae(c,b)}},{id:"posted",name:LANG.posted,width:"16%",value:"elapsed",compute:function(h,g){var b=new Date(h.date),f=(g_serverTime-b)/1000;var c=$WH.ce("span");$WH.formatDate(c,f,b,0,1);$WH.ae(g,c)}}],getItemLink:function(c){var b=$WH.getCommentDomain(c.domain);if(b==""&&c.hasOwnProperty("locale")&&c.locale!=Locale.getId()){b="//"+Locale.locales[c.locale].domain}if(c.url){return b+"/"+c.url}if(!g_types[c.type]){return b+"/go-to-comment&id="+c.id}return b+"/"+g_types[c.type]+"="+c.typeId+(c.id!=null?"#comments:id="+c.id:"")}};Listview.templates.replypreview={sort:[4],nItemsPerPage:75,columns:[{id:"subject",name:LANG.subject,align:"left",value:"subject",compute:function(c,g){var b=$WH.ce("a");b.className="listview-cleartext";b.href=this.getItemLink(c);$WH.ae(b,$WH.ct(c.subject));$WH.ae(g,b);if(LANG.types[c.type]){var f=$WH.ce("div");f.className="small";$WH.ae(f,$WH.ct(LANG.types[c.type][0]));$WH.ae(g,f)}}},{id:"preview",name:LANG.preview,align:"left",width:"50%",value:"preview",compute:function(c,j,f){var g=$WH.ce("div");g.className="crop";if(c.rating>=10){g.className+=" comment-green"}$WH.ae(g,$WH.ct(Markup.removeTags(c.preview,{mode:Markup.MODE_ARTICLE})));$WH.ae(j,g);g=$WH.ce("div");g.className="small3";if(c.rating){$WH.ae(g,$WH.ct(LANG.lvcomment_rating+(c.rating>0?"+":"")+c.rating))}var b=$WH.ce("span"),h="";if(c.deleted){h=LANG.lvcomment_deleted}b.className="q10";$WH.ae(b,$WH.ct(h));$WH.ae(g,b);f.__status=b;$WH.ae(j,g)}},{id:"author",name:LANG.author,value:"user",compute:function(c,f){f.className="q1";var b=$WH.ce("a");b.href="/user="+c.user;$WH.ae(b,$WH.ct(c.user));$WH.ae(f,b)}},{id:"posted",name:LANG.posted,width:"16%",value:"elapsed",compute:function(f,h){var b=new Date(f.date),g=(g_serverTime-b)/1000;var c=$WH.ce("span");$WH.formatDate(c,g,b,0,1);$WH.ae(h,c)}}],getItemLink:function(b){var c=$WH.getCommentDomain(b.domain);if(c==""&&b.hasOwnProperty("locale")&&b.locale!=Locale.getId()){c="//"+Locale.locales[b.locale].domain}if(b.url){return c+"/"+b.url}if(!g_types[b.type]){return c+"/go-to-reply&id="+b.id}return $WH.sprintf("$1/$2=$3#comments:id=$4:reply=$5",c,g_types[b.type],b.typeId,b.commentid,b.id)}};Listview.templates.screenshot={sort:[],mode:3,nItemsPerPage:40,nItemsPerRow:4,poundable:2,columns:[],compute:function(l,g,m){var v;g.className="screenshot-cell";g.vAlign="bottom";var r=$WH.ce("a");r.href=$WH.getScreenshotUrl(l.id,"normal",ScreenshotViewer.getScreenshotDescription(l));r.onclick=(function(s,y,z){z.stopPropagation();if($WH.isLeftClick(z)){ScreenshotViewer.show({screenshots:this.data,pos:m});z.preventDefault();return false}}).bind(this,this.id,l.id);var w=$WH.ce("img"),u=Math.min(150/l.width,150/l.height);w.src=$WH.getScreenshotUrl(l.id,"small");$WH.ae(r,w);$WH.ae(g,r);var q=$WH.ce("div");q.className="screenshot-cell-user";var n=(l.user!=null&&l.user.length);if(n){r=$WH.ce("a");r.href="/user="+l.user;$WH.ae(r,$WH.ct(l.user));$WH.ae(q,$WH.ct(LANG.lvscreenshot_from));$WH.ae(q,r);$WH.ae(q,$WH.ct(" "))}if(l.date){var p=new Date(l.date);var k=$WH.ce("span");if(n){$WH.formatDate(k,(g_serverTime-p)/1000,p)}else{$WH.formatDate(k,(g_serverTime-p)/1000,p,0,1)}$WH.ae(q,k);$WH.ae(q,$WH.ct(" "+LANG.dash+" "));var r=$WH.ce("a");r.href="javascript:;";r.className="icon-report";if((typeof this.deletefunction!="function")||(!this.deletefunction)){r.onclick=ContactTool.show.bind(ContactTool,{mode:3,screenshot:l});$WH.Tooltip.simple(r,LANG.report_tooltip,"q2");$WH.ae(r,$WH.ct(LANG.report))}else{$WH.aE(r,"click",(function(s,y){return function(){s(y)}})(this.deletefunction,l));$WH.ae(r,$WH.ct("Delete"))}$WH.ae(q,r)}$WH.ae(g,q);q=$WH.ce("div");q.style.position="relative";q.style.height="1em";if(Locale.getId()!=LOCALE_ENUS&&l.caption){l.caption=""}var j=(l.caption!=null&&l.caption.length);var h=(l.subject!=null&&l.subject.length);if(j||h){var t=$WH.ce("div");t.className="screenshot-caption";if(h){var f=$WH.ce("small");var b=LANG.types.hasOwnProperty(l.type)?LANG.types[l.type][0]:("Entity "+l.type);$WH.ae(f,$WH.ct(b+LANG.colon));var c=$WH.ce("a");if(l.hasOwnProperty("subjectQuality")){c.className="q"+l.subjectQuality}if(l.hasOwnProperty("subjectRel")){c.rel=l.subjectRel}$WH.ae(c,$WH.ct(l.subject));c.href=$WH.getCommentDomain(l.domain)+"/"+g_types[l.type]+"="+l.typeId;$WH.ae(f,c);$WH.ae(t,f);if(j&&l.caption.length){$WH.ae(f,$WH.ct(" (...)"))}$WH.ae(f,$WH.ce("br"))}if(j){$WH.aE(g,"mouseover",Listview.funcBox.ssCellOver.bind(t));$WH.aE(g,"mouseout",Listview.funcBox.ssCellOut.bind(t));var o=$WH.ce("span");o.innerHTML=Markup.toHtml(l.caption,{mode:Markup.MODE_SIGNATURE});$WH.ae(t,o)}$WH.ae(q,t)}$WH.aE(g,"click",Listview.funcBox.ssCellClick.bind(this,m));$WH.ae(g,q)},createNote:function(f){if(typeof g_pageInfo=="object"&&g_pageInfo.type>0&&g_pageInfo.type!=150){var c=$WH.ce("small");var b=$WH.ce("a");if(g_user.id>0){b.href="javascript:;";b.onclick=ss_submitAScreenshot}else{b.href="/account=signin"}$WH.ae(b,$WH.ct(LANG.lvscreenshot_submit));$WH.ae(c,b);$WH.ae(f,c)}},onNoData:function(f){if(typeof g_pageInfo=="object"&&g_pageInfo.type>0){var b="<b>"+LANG.lvnodata_ss1+'</b><div class="pad2"></div>';if(g_user.id>0){var c=LANG.lvnodata_ss2;c=c.replace("<a>",'<a href="javascript:;" onclick="ss_submitAScreenshot()" onmousedown="return false">');b+=c}else{var c=LANG.lvnodata_ss3;c=c.replace("<a>",'<a href="/account=signin">');c=c.replace("<a>",'<a href="/account=signup">');b+=c}f.style.padding="1.5em 0";f.innerHTML=b}else{return -1}},onBeforeCreate:function(){if(location.hash&&location.hash.match(/:id=([0-9]+)/)!=null){var b=$WH.inArray(this.data,parseInt(RegExp.$1),function(c){return c.id});this.rowOffset=this.getRowOffset(b);return b}},onAfterCreate:function(b){if(b!=null){setTimeout((function(){ScreenshotViewer.show({screenshots:this.data,pos:b})}).bind(this),1)}}};Listview.templates.video={sort:[],mode:3,nItemsPerPage:40,nItemsPerRow:4,poundable:2,columns:[],compute:function(f,g,k){var r,l=new Date(f.date),t=(g_serverTime-l)/1000;g.className="screenshot-cell";g.vAlign="bottom";var q=$WH.ce("a");q.href="#videos:id="+f.id;q.onclick=$WH.rfWithoutControlKey;var j=$WH.ce("img");j.src=$WH.sprintf(vi_thumbnails[f.videoType],f.videoId);$WH.ae(q,j);$WH.ae(g,q);var m=$WH.ce("div");m.className="screenshot-cell-user";var u=(f.user!=null&&f.user.length);if(u){q=$WH.ce("a");q.href="/user="+f.user;$WH.ae(q,$WH.ct(f.user));$WH.ae(m,$WH.ct(LANG.lvvideo_from));$WH.ae(m,q);$WH.ae(m,$WH.ct(" "))}var v=$WH.ce("span");if(u){$WH.formatDate(v,t,l)}else{$WH.formatDate(v,t,l,0,1)}$WH.ae(m,v);$WH.ae(g,m);m=$WH.ce("div");m.style.position="relative";m.style.height="1em";if(Locale.getId(true)!=LOCALE_ENUS&&f.caption){f.caption=""}var c=(f.caption!=null&&f.caption.length);var h=(f.subject!=null&&f.subject.length);if(c||h){var b=$WH.ce("div");b.className="screenshot-caption";if(h){var p=$WH.ce("small");$WH.ae(p,$WH.ct(LANG.types[f.type][0]+LANG.colon));var o=$WH.ce("a");$WH.ae(o,$WH.ct(f.subject));o.href=$WH.getCommentDomain(f.domain)+"/"+g_types[f.type]+"="+f.typeId;$WH.ae(p,o);$WH.ae(b,p);if(c&&f.caption.length){$WH.ae(p,$WH.ct(" (...)"))}$WH.ae(p,$WH.ce("br"))}if(c){$WH.aE(g,"mouseover",Listview.funcBox.ssCellOver.bind(b));$WH.aE(g,"mouseout",Listview.funcBox.ssCellOut.bind(b));var n=$WH.ce("span");n.innerHTML=Markup.toHtml(f.caption,{mode:Markup.MODE_SIGNATURE});$WH.ae(b,n)}$WH.ae(m,b)}$WH.aE(g,"click",Listview.funcBox.viCellClick.bind(this,k));$WH.ae(g,m)},createNote:function(f){if(g_user&&g_user.roles&(U_GROUP_ADMIN|U_GROUP_BUREAU|U_GROUP_VIDEO)){if(typeof g_pageInfo=="object"&&g_pageInfo.type>0){var c=$WH.ce("small");var b=$WH.ce("a");if(g_user.id>0){b.href="javascript:;";b.onclick=vi_submitAVideo}else{b.href="/account=signin"}$WH.ae(b,$WH.ct(LANG.lvvideo_suggest));$WH.ae(c,b);$WH.ae(f,c)}}},onNoData:function(f){if(typeof g_pageInfo=="object"&&g_pageInfo.type>0){var b="<b>"+LANG.lvnodata_vi1+'</b><div class="pad2"></div>';if(g_user.id>0){var c=LANG.lvnodata_vi2;c=c.replace("<a>",'<a href="javascript:;" onclick="vi_submitAVideo()" onmousedown="return false">');b+=c}else{var c=LANG.lvnodata_vi3;c=c.replace("<a>",'<a href="/account=signin">');c=c.replace("<a>",'<a href="/account=signup">');b+=c}f.style.padding="1.5em 0";f.innerHTML=b}else{return -1}},onBeforeCreate:function(){if(location.hash&&location.hash.match(/:id=([0-9]+)/)!=null){var b=$WH.inArray(this.data,parseInt(RegExp.$1),function(c){return c.id});this.rowOffset=this.getRowOffset(b);return b}},onAfterCreate:function(b){if(b!=null){setTimeout((function(){VideoViewer.show({videos:this.data,pos:b,displayAd:true})}).bind(this),1)}}};Listview.templates.model={sort:[],mode:3,nItemsPerPage:40,nItemsPerRow:4,poundable:2,columns:[],compute:function(f,l,g){l.className="screenshot-cell";l.vAlign="bottom";var b=$WH.ce("a");b.href="javascript:;";b.onclick=this.template.modelShow.bind(this.template,f.npcId,f.displayId,false);var c=$WH.ce("img");c.src=g_staticUrl+ModelViewer.getStaticBase()+"/thumbs/npc/"+f.displayId+".png";$WH.ae(b,c);$WH.ae(l,b);var k=$WH.ce("div");k.className="screenshot-cell-user";b=$WH.ce("a");b.href="/npcs=1?filter="+(f.family?"fa="+f.family+";":"")+"minle=1;cr=35;crs=0;crv="+f.skin;$WH.ae(b,$WH.ct(f.skin));$WH.ae(k,b);$WH.ae(k,$WH.ct(" ("+f.count+")"));$WH.ae(l,k);k=$WH.ce("div");k.style.position="relative";k.style.height="1em";var j=$WH.ce("div");j.className="screenshot-caption";var h=$WH.ce("small");$WH.ae(h,$WH.ct(LANG.level+": "));$WH.ae(h,$WH.ct((f.minLevel==9999?"??":f.minLevel)+(f.minLevel==f.maxLevel?"":LANG.hyphen+(f.maxLevel==9999?"??":f.maxLevel))));$WH.ae(h,$WH.ce("br"));$WH.ae(j,h);$WH.ae(k,j);$WH.ae(l,k);$WH.aE(l,"click",this.template.modelShow.bind(this.template,f.npcId,f.displayId,true))},modelShow:function(g,c,h,k){if(h){k=$WH.normalizeEvent(k);if(k.shiftKey||k.ctrlKey){return}var b=0,f=k._target;while(f&&b<3){if(f.nodeName=="A"){return}if(f.nodeName=="IMG"){break}f=f.parentNode}}ModelViewer.show({type:1,typeId:g,displayId:c,noPound:1})}};Listview.templates.genericmodel={sort:[1],mode:3,nItemsPerPage:40,nItemsPerRow:4,poundable:2,columns:[{value:"name",sortFunc:function(f,c){return Listview.templates.genericmodel.sortFunc(f,c)}}],compute:function(k,g,j){g.className="screenshot-cell";g.vAlign="bottom";var n,r,s,q,m;var p="";var f=("modelviewer" in k)?k.modelviewer:k;if("modelviewer" in k){n=k.modelviewer.displayid;m=k.modelviewer.typeid;r=k.modelviewer.type;q=k.slot}else{if("npcmodel" in k){n=k.npcmodel;m=k.id;r=1}else{if("displayid" in k){n=k.displayid;m=k.id;r=3;q=k.slotbak||k.slot;var c=Listview.funcBox.getCurrentItemBonuses.call(this,k);if(c.length>0){p="&bonus="+c.join(":")}var l=g_items.getAppearance(k.id,c);if(l!=null&&l[0]){n=l[0]}}}}switch(r){case 1:s="npc";break;case 3:s="item";break;default:s="item";break}if(n){var o=$WH.ce("a");o.href="javascript:;";o.rel=this.genericlinktype+"="+k.id+p;o.onclick=this.template.modelShow.bind(this.template,r,m,n,q,false);var h=$WH.ce("img");h.src=g_staticUrl+ModelViewer.getStaticBase()+"/thumbs/"+s+"/"+n+".png";$WH.ae(o,h);$WH.ae(g,o)}d=$WH.ce("div");d.style.position="relative";d.style.height="1em";var b=$WH.ce("div");b.className="screenshot-caption";var o=$WH.ce("a");o.className="q"+((this.genericlinktype=="item")?g_items[k.id].quality:"");o.href="/"+this.genericlinktype+"="+k.id+p;$WH.ae(o,$WH.ct(k.name.substr(1)));$WH.ae(b,o);$WH.ae(d,b);$WH.ae(g,d);if(n){$WH.aE(g,"click",this.template.modelShow.bind(this.template,r,m,n,q,true))}},modelShow:function(l,m,b,n,c,k){if(c){k=$WH.normalizeEvent(k);if(k.shiftKey||k.ctrlKey){return}var h=0,g=k._target;while(g&&h<3){if(g.nodeName=="A"){return}if(g.nodeName=="IMG"){break}g=g.parentNode}}var f={type:l,typeId:m,displayId:b,noPound:1};if(typeof n!="undefined"){f.slot=n}ModelViewer.show(f)},sortFunc:function(f,c,g){return($WH.stringCompare(f.hasOwnProperty("slot")?Listview.templates.genericmodel.translateSlot(f.slot):0,c.hasOwnProperty("slot")?Listview.templates.genericmodel.translateSlot(c.slot):0)||$WH.stringCompare(f.hasOwnProperty("classs")?f.classs:0,c.hasOwnProperty("classs")?c.classs:0)||$WH.stringCompare(f.hasOwnProperty("subclass")?f.subclass:0,c.hasOwnProperty("subclass")?c.subclass:0)||$WH.stringCompare(f.displayid,c.displayid)||$WH.stringCompare(f.name,c.name)||-$WH.stringCompare(f.level,c.level))},translateSlot:function(b){if(g_item_slots_to_character_slots.hasOwnProperty(b)){if($WH.isArray(g_item_slots_to_character_slots[b])){return parseInt(g_item_slots_to_character_slots[b][0],10)}return parseInt(g_item_slots_to_character_slots[b])}return 0},nextRowCheckTypeOrSlot:function(g,c){if(!c||!g){return false}var f,b;f=g.hasOwnProperty("slot")?Listview.templates.genericmodel.translateSlot(g.slot):0;b=c.hasOwnProperty("slot")?Listview.templates.genericmodel.translateSlot(c.slot):0;if(f!=b){return true}f=g.hasOwnProperty("classs")?g.classs:0;b=c.hasOwnProperty("classs")?c.classs:0;if(f!=b){return true}if(f==4){if(g.hasOwnProperty("subclass")){if(!(c.hasOwnProperty("subclass")&&g.subclass==c.subclass)&&(this.breakCosmetic||(g.subclass!=5&&c.subclass!=5))){return true}}}return false}};Listview.templates.changelog={nItemsPerPage:100,sortable:false,columns:[{id:"name",name:"Name",compute:function(b,f){var c=$(b.tooltip).find("b").first().text();$(f).html(c);f.className+=" listview-cleartext"}},{id:"version",name:"Version (mouseover to see tooltip)",compute:function(h,k){var f=h.tooltip;$(k).mouseover((function(l,m){$WH.Tooltip.showAtCursor(m,l,0,0)}).bind(k,f));$(k).mousemove(function(l){$WH.Tooltip.cursorUpdate(l)}).mouseout(function(){$WH.Tooltip.hide()});if(!$WH.getPatchVersionObject.hasOwnProperty("parsed")){$WH.getPatchVersionObject()}var j=(h.build>0?"":"Before ")+"Build "+Math.abs(h.build);if(h.version>0){var g=(parseInt(h.version/10000))+"."+((parseInt(h.version/100))%100)+"."+(h.version%100);j=g+" "+j;var c=false;for(var b in g_wow_builds){if(g_wow_builds[b].versionnum>=h.version&&(!c||c.build>g_wow_builds[b].build)){c=g_wow_builds[b]}}if(c){j=j.replace(g,g+" ("+new Date(c.timestamp).toDateString()+")")}}$(k).html(j)}}]};Listview.templates.affix={sort:[1,3],mode:0,nItemsPerPage:50,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",span:2,compute:function(c,k,h){var f=$WH.ce("td");f.style.width="1px";f.style.paddingRight="0";f.style.borderRight="none";var g=Icon.create(c.icon,(this.iconSize==null?0:this.iconSize),null,this.getItemLink(c));$WH.ae(f,g);$WH.ae(h,f);k.style.borderLeft="none";var j=$WH.ce("div");$WH.ae(k,j);var b=$WH.ce("a");b.className="listview-cleartext";b.href=this.getItemLink(c);$WH.ae(b,$WH.ct(c.name));$WH.ae(j,b)},getVisibleText:function(b){return b.name}},{id:"description",name:LANG.description,type:"text",align:"left",compute:function(b,c){c.innerHTML=b.description},getVisibleText:function(b){return b.description},sortFunc:function(f,c){return $WH.stringCompare(f.description,c.description)}}],getItemLink:function(b){return"/affix="+b.id}};Listview.templates.building={sort:[1,2],searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",span:2,value:"name",compute:function(f,j,h){var g=$WH.ce("td");g.style.width="1px";g.style.paddingRight="0";g.style.borderRight="none";if(f.icon){$WH.ae(g,Icon.create(f.icon,(this.iconSize==null?0:this.iconSize),null,this.getItemLink(f),1))}else{$WH.ae(g,Icon.create("inv_misc_questionmark",(this.iconSize==null?0:this.iconSize),null,this.getItemLink(f),1))}$WH.ae(h,g);j.style.borderLeft="none";var c=f.name;if(f.levelname!=f.name){c+=" / "+f.levelname}var b=$WH.ce("a");b.className="listview-cleartext";b.href=this.getItemLink(f);$WH.ae(b,$WH.ct(c));$WH.ae(j,b)}},{id:"level",name:LANG.level,type:"number",value:"level",width:"5%"},{id:"leveldescription",name:LANG.description,type:"text",align:"left",width:"50%",sortable:false,filtrable:false,value:"leveldescription",compute:function(b,c){$WH.ae(c,$WH.ce("div",{className:"listview-blurb small",innerHTML:b.leveldescription}))}},{id:"plot",name:LANG.plot,type:"text",compute:function(c,j){var f=0;for(var h in c.plots){if(!c.plots.hasOwnProperty(h)){continue}if(f++>0){$WH.ae(j,$WH.ct(", "))}var g=c.plots[h];if(g_garrison_plots.hasOwnProperty(g.id)){var b=$WH.ce("a");b.href="/buildings="+g.id;$WH.st(b,g_garrison_plots[g.id])}else{var b=$WH.ce("span");$WH.st(b,g.plotname)}$WH.ae(j,b)}},sortFunc:function(f,c,g){var h="",k="";for(var j in f.plots){if(f.plots.hasOwnProperty(j)){h=g_garrison_plots.hasOwnProperty(f.plots[j].id)?g_garrison_plots[f.plots[j].id]:f.plots[j].plotname;break}}for(var j in c.plots){if(c.plots.hasOwnProperty(j)){k=g_garrison_plots.hasOwnProperty(c.plots[j].id)?g_garrison_plots[c.plots[j].id]:c.plots[j].plotname;break}}return $WH.stringCompare(h,k)}}],getItemLink:function(b){return"/building="+b.id}};Listview.templates.buildinggallery={sort:[1,2],mode:3,nItemsPerPage:24,nItemsPerRow:3,poundable:1,sortOptions:[{id:"name",name:LANG.name,sortFunc:function(f,c){var g=this.id.indexOf("horde")>=0?"horde":"alliance";return $WH.stringCompare(f[g=="alliance"?"name":"levelname"],c[g=="alliance"?"name":"levelname"])||(f.level-c.level)}},{id:"level",name:LANG.level,value:"level"},{id:"plot",name:LANG.plot,sortFunc:function(f,c,g){var h="",k="";for(var j in f.plots){if(f.plots.hasOwnProperty(j)){h=g_garrison_plots.hasOwnProperty(f.plots[j].id)?g_garrison_plots[f.plots[j].id]:f.plots[j].plotname;break}}for(var j in c.plots){if(c.plots.hasOwnProperty(j)){k=g_garrison_plots.hasOwnProperty(c.plots[j].id)?g_garrison_plots[c.plots[j].id]:c.plots[j].plotname;break}}return $WH.stringCompare(h,k)}}],columns:[],value:"name",compute:function(f,l,g){var k=this.id.indexOf("horde")>=0?"horde":"alliance";l.className="building-cell";var b=$WH.ce("a");b.className="building-cell-building";b.href="/building="+f.id;if(k=="horde"){b.rel="buff"}var c=$WH.ce("span");c.style.backgroundImage='url("'+g_staticUrl+"/images/wow/garr/"+f[k+"_file"]+'.png")';c.style.backgroundPosition="-"+f[k+"_x1"]+"px -"+f[k+"_y1"]+"px";c.style.width=""+(parseInt(f[k+"_x2"],10)-parseInt(f[k+"_x1"],10))+"px";c.style.height=""+(parseInt(f[k+"_y2"],10)-parseInt(f[k+"_y1"],10))+"px";$WH.ae(b,c);$WH.ae(l,b);var j=$WH.ce("div");j.className="building-cell-name";var h=$WH.ce("div");h.className="screenshot-caption";$(h).click(function(){location.href="/building="+f.id});$WH.aE(l,"mouseover",Listview.funcBox.ssCellOver.bind(h));$WH.aE(l,"mouseout",Listview.funcBox.ssCellOut.bind(h));$WH.ae(h,$WH.ct(f[k=="alliance"?"name":"levelname"]+" "+LANG.level+" "+f.level));$WH.ae(j,h);$WH.ae(l,j)},sortFunc:function(f,c){return $WH.stringCompare(f.name,c.name)}};Listview.templates.champion={sort:[5,1],mode:1,searchable:1,filtrable:1,completionText:LANG.lvcompletion_collection,columns:[{id:"namealliance",name:LANG.som.alliance+" "+LANG.name,type:"text",align:"left",value:"namealliance",compute:function(c,j,f){var b=$WH.ce("a");b.className="q"+c.quality+" listview-cleartext";b.href=this.getItemLink(c,1);if(c.hasOwnProperty("abilities")&&$WH.isArray(c.abilities)&&c.hasOwnProperty("custom")&&c.custom){b.rel="q="+c.quality+"&level="+c.level+"&abil="+c.abilities.join(":")}j.style.paddingLeft="2.5em";if(c.portraitalliance){j.style.backgroundImage='url("'+g_staticUrl+"/images/wow/garr/"+c.portraitalliance+'.png")';j.style.backgroundRepeat="no-repeat";j.style.backgroundSize="3em 3em";j.style.backgroundPosition="-0.75em -0.25em"}$WH.ae(b,$WH.ct(c.namealliance));var h=$WH.ce("div");$WH.ae(j,h);$WH.ae(h,b);if(c.hasOwnProperty("active")&&!parseInt(c.active)){h.style.position="relative";var g=$WH.ce("div");g.className="listview-name-info q10";$WH.ae(g,$WH.ct(LANG.inactive));$WH.aef(h,g)}$WH.ae(j,h)}},{id:"classalliance",name:LANG.som.alliance+" "+LANG.classs,type:"text",align:"left",value:"classalliance",width:"20%",compute:function(b,f,c){$WH.st(f,b.classalliance)}},{id:"namehorde",name:LANG.som.horde+" "+LANG.name,type:"text",align:"left",value:"namehorde",compute:function(c,j,f){var b=$WH.ce("a");b.className="q"+c.quality+" listview-cleartext";b.href=this.getItemLink(c,2);if(c.hasOwnProperty("abilities")&&$WH.isArray(c.abilities)&&c.hasOwnProperty("custom")&&c.custom){b.rel="q="+c.quality+"&level="+c.level+"&abil="+c.abilities.join(":")}j.style.paddingLeft="2.5em";if(c.portraithorde){j.style.backgroundImage='url("'+g_staticUrl+"/images/wow/garr/"+c.portraithorde+'.png")';j.style.backgroundRepeat="no-repeat";j.style.backgroundSize="3em 3em";j.style.backgroundPosition="-0.75em -0.25em"}$WH.ae(b,$WH.ct(c.namehorde));var h=$WH.ce("div");$WH.ae(j,h);$WH.ae(h,b);if(c.hasOwnProperty("active")&&!c.active){h.style.position="relative";var g=$WH.ce("div");g.className="listview-name-info q10";$WH.ae(g,$WH.ct(LANG.inactive));$WH.aef(h,g)}$WH.ae(j,h)}},{id:"classhorde",name:LANG.som.horde+" "+LANG.classs,type:"text",align:"left",value:"classhorde",width:"20%",compute:function(b,f,c){$WH.st(f,b.classhorde)}},{id:"type",name:LANG.type,type:"text",width:"10%",compute:function(c,f){var b=$WH.ce("span");$WH.st(b,(c.flags&1)?LANG.types[28][0]:LANG.troop);$WH.ae(f,b)},sortFunc:function(f,c){return $WH.stringCompare(c.flags&1,f.flags&1)}},{id:"counters",name:LANG.counters,hidden:1,type:"text",width:"168px",compute:function(c,h){if(!c.hasOwnProperty("abilities")){return}var k=c.abilities;if(!$WH.isArray(k)){if(($WH.inArray(this.hiddenCols,"namehorde")!=-1)&&k.hasOwnProperty("1")){k=k["1"]}else{if(($WH.inArray(this.hiddenCols,"namealliance")!=-1)&&k.hasOwnProperty("2")){k=k["2"]}else{return}}}h.style.padding="0 6px";h.style.textAlign="left";for(var m=0;m<k.length;m++){var g=g_mission_abilities[k[m]];for(var f in g.counters){if(!g.counters.hasOwnProperty(f)){continue}if(!g_garrison_mechanics.hasOwnProperty(g.counters[f])){continue}var b=g_garrison_mechanics[g.counters[f]];var l=$WH.ce("div");l.style.display="inline-block";if(b.hasOwnProperty("icon")){var j=Icon.create(b.icon,0,null,"/mission-ability="+g.id);j.className+=" garrison-ability";j.style.cssFloat="left";$WH.ae(l,j)}$WH.ae(h,l)}}},getVisibleText:function(f){var g="";if(!f.hasOwnProperty("abilities")){return g}var j=f.abilities;if(!$WH.isArray(j)){if(($WH.inArray(this.hiddenCols,"namehorde")!=-1)&&j.hasOwnProperty("1")){j=j["1"]}else{if(($WH.inArray(this.hiddenCols,"namealliance")!=-1)&&j.hasOwnProperty("2")){j=j["2"]}else{return g}}}for(var b=0;b<j.length;b++){var c=g_mission_abilities[j[b]];for(var h in c.counters){if(!c.counters.hasOwnProperty(h)){continue}g+=c.counters[h].name+" "}}return g}},{id:"quality",name:LANG.quality,type:"text",value:"quality",width:"10%",compute:function(c,f){var b=$WH.ce("span");b.className="q"+c.quality;$WH.st(b,g_item_qualities[c.quality]);$WH.ae(f,b)},sortFunc:function(f,c){return $WH.stringCompare(f.quality,c.quality)}},{id:"level",name:LANG.level,hidden:1,type:"number",value:"level",width:"5%"},{id:"itemlevelaverage",name:LANG.avg,type:"number",value:"avgilvl",width:"5%",hidden:1},{id:"itemlevelweapon",name:g_item_classes[2],hidden:1,type:"number",value:"itemlevelweapon",width:"5%"},{id:"itemlevelarmor",name:g_item_classes[4],hidden:1,type:"number",value:"itemlevelarmor",width:"5%"},{id:"completed",name:LANG.completion,width:"10%",hidden:true,compute:function(b,f,k,n){var j=3;if(this.hiddenCols){for(var m=0;m<this.hiddenCols.length;m++){if(this.hiddenCols[m]=="namealliance"){j=2;break}if(this.hiddenCols[m]=="namehorde"){j=1;break}}}if(b.npcalliance==b.npchorde){j=false}for(var g in g_user.lists){var h=g_user.lists[g];if(!(h.id in g_completion.champion)||!h.character){continue}var c=($WH.inArray(g_completion.champion[h.id],b.id)!=-1);if(j){if(j!=3){c|=($WH.inArray(g_completion.champion[h.id],""+b.id+"."+j)!=-1)}else{c|=($WH.inArray(g_completion.champion[h.id],""+b.id+".1")!=-1);c|=($WH.inArray(g_completion.champion[h.id],""+b.id+".2")!=-1)}}var l=$WH.ce("a");l.href="/list="+h.id+"/"+h.url;l.className="progress-icon "+(c?"progress-8":"progress-0");$WH.Tooltip.simple(l,$WH.getCompletionTooltip(h,c),"",true);$WH.ae(f,l)}},sortFunc:function(j,g,k){var l=3;if(this.hiddenCols){for(var f=0;f<this.hiddenCols.length;f++){if(this.hiddenCols[f]=="namealliance"){l=2;break}if(this.hiddenCols[f]=="namehorde"){l=1;break}}}var c=l,m=l;if(j.npcalliance==j.npchorde){c=false}if(g.npcalliance==g.npchorde){m=false}var h=function(q,p){var b=0;if(!g_user.lists){return b}for(var o=g_user.lists.length-1;o>=0;o--){var r=g_user.lists[o];if(!(r.id in g_completion.champion)||!r.character){continue}var n=$WH.inArray(g_completion.champion[r.id],q)!=-1;if(p){if(p!=3){n|=($WH.inArray(g_completion.champion[r.id],""+q+"."+p)!=-1)}else{n|=($WH.inArray(g_completion.champion[r.id],""+q+".1")!=-1);n|=($WH.inArray(g_completion.champion[r.id],""+q+".2")!=-1)}}b=(b<<1)|(n?1:0)}return b};return $WH.stringCompare(h(j.id,c),h(g.id,m))}}],getItemLink:function(f,c){if(!c&&this.hiddenCols){for(var b=0;b<this.hiddenCols.length;b++){if(this.hiddenCols[b]=="namealliance"){c=2;break}if(this.hiddenCols[b]=="namehorde"){c=1;break}}}if(f.npcalliance==f.npchorde){c=false}return"/champion="+f.id+(c?("."+c):"")},onBeforeCreate:function(){for(var b in this.columns){if((this.columns[b].id=="completed")&&(this.columns[b].hidden)){if((!(this.hasOwnProperty("completionMode")&&this.completionMode))&&$WH.isSet("g_user")&&("lists" in g_user)&&("champion" in g_completion)&&($WH.inArray(this.hiddenCols,this.columns[b].id)==-1)){this.visibility.push(parseInt(b));break}}}}};Listview.templates.championgallery={sort:[1,2],mode:3,nItemsPerPage:48,nItemsPerRow:4,poundable:1,sortOptions:[{id:"name",name:LANG.name,sortFunc:function(f,c){var g=this.id.indexOf("horde")>=0?"horde":"alliance";return $WH.stringCompare(f["name"+g],c["name"+g])}},{id:"level",name:LANG.level,value:"level"}],columns:[],value:"name",compute:function(c,g,j){var f=this.id.indexOf("horde")>=0?"horde":"alliance";var k=(f=="horde"?"2":"1");g.className="follower-cell";var m=$WH.ce("a");m.className="follower-cell-follower";m.href="/champion="+c.id+"."+k;var h=$WH.ce("span");h.style.backgroundImage='url("'+g_staticUrl+"/images/wow/garr/npcmodels/"+c["npc"+f]+'.jpg"),url("'+g_staticUrl+"/images/wow/garr/"+c["portrait"+f]+'.png")';h.style.backgroundSize="cover, 128px 128px";h.style.backgroundPosition="center";h.style.width="160px";h.style.height="224px";$WH.ae(m,h);$WH.ae(g,m);var l=$WH.ce("div");l.className="follower-cell-name q"+c.quality;var b=$WH.ce("div");b.className="screenshot-caption";$(b).click(function(){location.href="/champion="+c.id+"."+k});$WH.aE(g,"mouseover",Listview.funcBox.ssCellOver.bind(b));$WH.aE(g,"mouseout",Listview.funcBox.ssCellOut.bind(b));$WH.ae(b,$WH.ct(c["name"+f]));$WH.ae(l,b);$WH.ae(g,l)}};Listview.templates.faction={sort:[1],mode:1,nItemsPerPage:-1,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",compute:function(f,g){var b=$WH.ce("a");b.className="listview-cleartext";b.href=this.getItemLink(f);$WH.ae(b,$WH.ct(f.name));if(f.expansion){var c=$WH.ce("span");c.className=$WH.getExpansionClassName(f.expansion);$WH.ae(c,b);$WH.ae(g,c)}else{$WH.ae(g,b)}},getVisibleText:function(b){var c=b.name+Listview.funcBox.getExpansionText(b);return c}},{id:"side",name:LANG.side,type:"text",compute:function(b,f){if(b.side&&b.side!=3){var c=$WH.ce("span");c.className=(b.side==1?"icon-alliance":"icon-horde");c.onmouseover=function(g){$WH.Tooltip.showAtCursor(g,g_sides[b.side],0,0,"q")};c.onmousemove=$WH.Tooltip.cursorUpdate;c.onmouseout=$WH.Tooltip.hide;$WH.ae(f,c)}},getVisibleText:function(b){if(b.side){return g_sides[b.side]}},sortFunc:function(f,c,g){return $WH.stringCompare(g_sides[f.side],g_sides[c.side])}},{id:"standing",name:LANG.reputation,value:"standing",compute:function(b,c){c.style.padding=0;$WH.ae(c,$WH.createReputationBar(b.standing,b.friendshiprep))},hidden:1},{id:"category",name:LANG.category,type:"text",width:"16%",compute:function(f,g){if(f.category2!=null){g.className="small q1";var b=$WH.ce("a"),c="/factions="+f.category2;if(f.category){c+="."+f.category}b.href=c;$WH.ae(b,$WH.ct(Listview.funcBox.getFactionCategory(f.category,f.category2)));$WH.ae(g,b)}},getVisibleText:function(b){return Listview.funcBox.getFactionCategory(b.category,b.category2)},sortFunc:function(f,c,h){var g=Listview.funcBox.getFactionCategory;return $WH.stringCompare(g(f.category,f.category2),g(c.category,c.category2))}}],getItemLink:function(b){return"/faction="+b.id},createCbControls:function(f,c){if(!c){return}var b=$WH.ce("input");b.type="button";b.value=(!this.characterSettings||!this.characterSettings.editable?LANG.li_addtolist:LANG.li_addtoanotherlist);b.onclick=(function(g){Listview.cbAddToList.call(this,g,"faction")}).bind(this);$WH.ae(f,b)}};Listview.templates.follower={sort:[-5,1],mode:1,searchable:1,filtrable:1,completionText:LANG.lvcompletion_collection,columns:[{id:"namealliance",name:LANG.som.alliance+" "+LANG.name,type:"text",align:"left",value:"namealliance",compute:function(f,j,c){var b=$WH.ce("a");b.className="q"+f.quality+" listview-cleartext";b.href=this.getItemLink(f,1);if(f.hasOwnProperty("abilities")&&$WH.isArray(f.abilities)&&f.hasOwnProperty("custom")&&f.custom){b.rel="q="+f.quality+"&level="+f.level+"&abil="+f.abilities.join(":")}j.style.paddingLeft="2.5em";if(f.portraitalliance){j.style.backgroundImage='url("'+g_staticUrl+"/images/wow/garr/"+f.portraitalliance+'.png")';j.style.backgroundRepeat="no-repeat";j.style.backgroundSize="3em 3em";j.style.backgroundPosition="-0.75em -0.25em"}$WH.ae(b,$WH.ct(f.namealliance));var h=$WH.ce("div");$WH.ae(j,h);$WH.ae(h,b);if(f.hasOwnProperty("active")&&!parseInt(f.active)){h.style.position="relative";var g=$WH.ce("div");g.className="listview-name-info q10";$WH.ae(g,$WH.ct(LANG.inactive));$WH.aef(h,g)}$WH.ae(j,h)}},{id:"classalliance",name:LANG.som.alliance+" "+LANG.classs,type:"text",align:"left",value:"classalliance",width:"20%",compute:function(c,f,b){$WH.st(f,c.classalliance)}},{id:"namehorde",name:LANG.som.horde+" "+LANG.name,type:"text",align:"left",value:"namehorde",compute:function(f,j,c){var b=$WH.ce("a");b.className="q"+f.quality+" listview-cleartext";b.href=this.getItemLink(f,2);if(f.hasOwnProperty("abilities")&&$WH.isArray(f.abilities)&&f.hasOwnProperty("custom")&&f.custom){b.rel="q="+f.quality+"&level="+f.level+"&abil="+f.abilities.join(":")}j.style.paddingLeft="2.5em";if(f.portraithorde){j.style.backgroundImage='url("'+g_staticUrl+"/images/wow/garr/"+f.portraithorde+'.png")';j.style.backgroundRepeat="no-repeat";j.style.backgroundSize="3em 3em";j.style.backgroundPosition="-0.75em -0.25em"}$WH.ae(b,$WH.ct(f.namehorde));var h=$WH.ce("div");$WH.ae(j,h);$WH.ae(h,b);if(f.hasOwnProperty("active")&&!f.active){h.style.position="relative";var g=$WH.ce("div");g.className="listview-name-info q10";$WH.ae(g,$WH.ct(LANG.inactive));$WH.aef(h,g)}$WH.ae(j,h)}},{id:"classhorde",name:LANG.som.horde+" "+LANG.classs,type:"text",align:"left",value:"classhorde",width:"20%",compute:function(c,f,b){$WH.st(f,c.classhorde)}},{id:"counters",name:LANG.counters,hidden:1,type:"text",width:"168px",compute:function(k,g){if(!k.hasOwnProperty("abilities")){return}var j=k.abilities;if(!$WH.isArray(j)){if(($WH.inArray(this.hiddenCols,"namehorde")!=-1)&&j.hasOwnProperty("1")){j=j["1"]}else{if(($WH.inArray(this.hiddenCols,"namealliance")!=-1)&&j.hasOwnProperty("2")){j=j["2"]}else{return}}}g.style.padding="0 6px";g.style.textAlign="left";for(var m=0;m<j.length;m++){var f=g_mission_abilities[j[m]];for(var c in f.counters){if(!f.counters.hasOwnProperty(c)){continue}if(!g_garrison_mechanics.hasOwnProperty(f.counters[c])){continue}var b=g_garrison_mechanics[f.counters[c]];var l=$WH.ce("div");l.style.display="inline-block";if(b.hasOwnProperty("icon")){var h=Icon.create(b.icon,0,null,"/mission-ability="+f.id);h.className+=" garrison-ability";h.style.cssFloat="left";$WH.ae(l,h)}$WH.ae(g,l)}}},getVisibleText:function(g){var f="";if(!g.hasOwnProperty("abilities")){return f}var j=g.abilities;if(!$WH.isArray(j)){if(($WH.inArray(this.hiddenCols,"namehorde")!=-1)&&j.hasOwnProperty("1")){j=j["1"]}else{if(($WH.inArray(this.hiddenCols,"namealliance")!=-1)&&j.hasOwnProperty("2")){j=j["2"]}else{return f}}}for(var b=0;b<j.length;b++){var c=g_mission_abilities[j[b]];for(var h in c.counters){if(!c.counters.hasOwnProperty(h)){continue}f+=c.counters[h].name+" "}}return f}},{id:"quality",name:LANG.quality,type:"text",value:"quality",width:"10%",compute:function(c,f){var b=$WH.ce("span");b.className="q"+c.quality;$WH.st(b,g_item_qualities[c.quality]);$WH.ae(f,b)},sortFunc:function(f,c){return $WH.stringCompare(f.quality,c.quality)}},{id:"level",name:LANG.level,type:"number",value:"level",width:"5%"},{id:"itemlevelaverage",name:LANG.avg,type:"number",value:"avgilvl",width:"5%",hidden:1},{id:"itemlevelweapon",name:g_item_classes[2],type:"number",value:"itemlevelweapon",width:"5%"},{id:"itemlevelarmor",name:g_item_classes[4],type:"number",value:"itemlevelarmor",width:"5%"},{id:"completed",name:LANG.completion,width:"10%",hidden:true,compute:function(g,c,k,n){var j=3;if(this.hiddenCols){for(var m=0;m<this.hiddenCols.length;m++){if(this.hiddenCols[m]=="namealliance"){j=2;break}if(this.hiddenCols[m]=="namehorde"){j=1;break}}}if(g.npcalliance==g.npchorde){j=false}for(var f in g_user.lists){var h=g_user.lists[f];if(!(h.id in g_completion.follower)||!h.character){continue}var b=($WH.inArray(g_completion.follower[h.id],g.id)!=-1);if(j){if(j!=3){b|=($WH.inArray(g_completion.follower[h.id],""+g.id+"."+j)!=-1)}else{b|=($WH.inArray(g_completion.follower[h.id],""+g.id+".1")!=-1);b|=($WH.inArray(g_completion.follower[h.id],""+g.id+".2")!=-1)}}var l=$WH.ce("a");l.href="/list="+h.id+"/"+h.url;l.className="progress-icon "+(b?"progress-8":"progress-0");$WH.Tooltip.simple(l,$WH.getCompletionTooltip(h,b),"",true);$WH.ae(c,l)}},sortFunc:function(h,g,j){var k=3;if(this.hiddenCols){for(var f=0;f<this.hiddenCols.length;f++){if(this.hiddenCols[f]=="namealliance"){k=2;break}if(this.hiddenCols[f]=="namehorde"){k=1;break}}}var c=k,m=k;if(h.npcalliance==h.npchorde){c=false}if(g.npcalliance==g.npchorde){m=false}var l=function(r,p){var b=0;if(!g_user.lists){return b}for(var o=g_user.lists.length-1;o>=0;o--){var q=g_user.lists[o];if(!(q.id in g_completion.follower)||!q.character){continue}var n=$WH.inArray(g_completion.follower[q.id],r)!=-1;if(p){if(p!=3){n|=($WH.inArray(g_completion.follower[q.id],""+r+"."+p)!=-1)}else{n|=($WH.inArray(g_completion.follower[q.id],""+r+".1")!=-1);n|=($WH.inArray(g_completion.follower[q.id],""+r+".2")!=-1)}}b=(b<<1)|(n?1:0)}return b};return $WH.stringCompare(l(h.id,c),l(g.id,m))}}],getItemLink:function(f,c){if(!c&&this.hiddenCols){for(var b=0;b<this.hiddenCols.length;b++){if(this.hiddenCols[b]=="namealliance"){c=2;break}if(this.hiddenCols[b]=="namehorde"){c=1;break}}}if(f.npcalliance==f.npchorde){c=false}return"/follower="+f.id+(c?("."+c):"")},onBeforeCreate:function(){for(var b in this.columns){if((this.columns[b].id=="completed")&&(this.columns[b].hidden)){if((!(this.hasOwnProperty("completionMode")&&this.completionMode))&&$WH.isSet("g_user")&&("lists" in g_user)&&("follower" in g_completion)&&($WH.inArray(this.hiddenCols,this.columns[b].id)==-1)){this.visibility.push(parseInt(b));break}}}}};Listview.templates.followergallery={sort:[1,2],mode:3,nItemsPerPage:48,nItemsPerRow:4,poundable:1,sortOptions:[{id:"name",name:LANG.name,sortFunc:function(f,c){var g=this.id.indexOf("horde")>=0?"horde":"alliance";return $WH.stringCompare(f["name"+g],c["name"+g])}},{id:"level",name:LANG.level,value:"level"}],columns:[],value:"name",compute:function(j,f,h){var c=this.id.indexOf("horde")>=0?"horde":"alliance";var k=(c=="horde"?"2":"1");f.className="follower-cell";var m=$WH.ce("a");m.className="follower-cell-follower";m.href="/follower="+j.id+"."+k;var g=$WH.ce("span");g.style.backgroundImage='url("'+g_staticUrl+"/images/wow/garr/npcmodels/"+j["npc"+c]+'.jpg"),url("'+g_staticUrl+"/images/wow/garr/"+j["portrait"+c]+'.png")';g.style.backgroundSize="cover, 128px 128px";g.style.backgroundPosition="center";g.style.width="160px";g.style.height="224px";$WH.ae(m,g);$WH.ae(f,m);var l=$WH.ce("div");l.className="follower-cell-name q"+j.quality;var b=$WH.ce("div");b.className="screenshot-caption";$(b).click(function(){location.href="/follower="+j.id+"."+k});$WH.aE(f,"mouseover",Listview.funcBox.ssCellOver.bind(b));$WH.aE(f,"mouseout",Listview.funcBox.ssCellOut.bind(b));$WH.ae(b,$WH.ct(j["name"+c]));$WH.ae(l,b);$WH.ae(f,l)}};Listview.templates.missionability={sort:[1,2],mode:0,nItemsPerPage:100,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",span:2,compute:function(g,l,h){var c=$WH.ce("td");c.style.width="1px";c.style.paddingRight="0";c.style.borderRight="none";var f=Icon.create(g.icon,(this.iconSize==null?0:this.iconSize),null,this.getItemLink(g));f.className+=" garrison-ability";$WH.ae(c,f);$WH.ae(h,c);l.style.borderLeft="none";var k=$WH.ce("div");$WH.ae(l,k);var b=$WH.ce("a");b.className="listview-cleartext";b.href=this.getItemLink(g);$WH.ae(b,$WH.ct(g.name));$WH.ae(k,b);if((g.flags&2)&&g.hasOwnProperty("byclass")&&(g.byclass==1)){k.style.position="relative";var j=$WH.ce("div");j.className="listview-name-info q10";$WH.ae(j,$WH.ct(LANG.lvmissionability_innonly));$WH.aef(k,j)}if(g.description!=null){var j=$WH.ce("div");j.className="listview-blurb small";j.innerHTML=g.description;$WH.ae(l,j)}},getVisibleText:function(b){return b.name}},{id:"side",hidden:1,name:LANG.side,type:"text",compute:function(b,g){if(b.hasOwnProperty("side")){for(var f=1;f<=2;f++){if((b.side&f)==0){continue}var c=$WH.ce("span");c.className=(f==1?"icon-alliance":"icon-horde");c.onmouseover=function(h){$WH.Tooltip.showAtCursor(h,g_sides[b.side],0,0,"q")};c.onmousemove=$WH.Tooltip.cursorUpdate;c.onmouseout=$WH.Tooltip.hide;$WH.ae(g,c)}}},getVisibleText:function(b){if(b.hasOwnProperty("side")){return g_sides[b.side]}return""},sortFunc:function(f,c){return $WH.stringCompare(f.hasOwnProperty("side")?g_sides[f.side]:"",c.hasOwnProperty("side")?g_sides[c.side]:"")}},{id:"type",name:LANG.type,type:"text",compute:function(c,f){var b=$WH.ce("a");b.href="/mission-abilities="+c.followertype+"."+c.type;$WH.st(b,g_mission_ability_types[c.followertype][c.type]);$WH.ae(f,b)},getVisibleText:function(b){return g_mission_ability_types[b.followertype][b.type]},sortFunc:function(f,c){return $WH.stringCompare(f.followertype,c.followertype)||$WH.stringCompare(g_mission_ability_types[f.followertype][f.type],g_mission_ability_types[c.followertype][c.type])}},{id:"category",name:LANG.category,type:"text",compute:function(b,c){if(g_mission_ability_categories.hasOwnProperty(b.category)){$WH.st(c,g_mission_ability_categories[b.category])}},getVisibleText:function(b){if(g_mission_ability_categories.hasOwnProperty(b.category)){return g_mission_ability_categories[b.category]}return""},sortFunc:function(f,c){return $WH.stringCompare(g_mission_ability_categories.hasOwnProperty(f.category)?g_mission_ability_categories[f.category]:"",g_mission_ability_categories.hasOwnProperty(c.category)?g_mission_ability_categories[c.category]:"")}},{id:"counters",name:LANG.counters,type:"text",compute:function(g,l){if(!g.hasOwnProperty("counters")){return}var h=0;for(var k in g.counters){if(!g.counters.hasOwnProperty(k)){continue}var c=g.counters[k];var j=$WH.ce("div");j.style.display="inline-block";if(c.hasOwnProperty("icon")){var f=Icon.create(c.icon,0,null,"/threat="+k);f.className+=" garrison-ability";f.style.display="inline-block";f.style.verticalAlign="middle";$WH.ae(j,f);$WH.ae(j,$WH.ct(" "))}var b=$WH.ce("a");b.href="/threat="+k;$WH.st(b,c.name);$WH.ae(j,b);if(h++%3==0&&h>1){$WH.ae(l,$WH.ce("br"))}else{$WH.ae(l,$WH.ce("span",{innerHTML:" &nbsp; "}))}$WH.ae(l,j)}},getVisibleText:function(b){var c="";for(var f in b.counters){if(!b.counters.hasOwnProperty(f)){continue}c+=b.counters[f].name+" "}return c},sortFunc:function(g,f){var h=this.getVisibleText(g);var c=this.getVisibleText(f);return $WH.stringCompare(h,c)}}],getItemLink:function(b){return"/mission-ability="+b.id}};Listview.templates.mission={sort:[-3,-4,1],mode:0,nItemsPerPage:100,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",width:"50%",compute:function(k,j,f){var h=$WH.ce("div");$WH.ae(j,h);var b=$WH.ce("a");b.className="listview-cleartext";b.href=this.getItemLink(k);$WH.ae(b,$WH.ct(k.name));$WH.ae(h,b);var c=$WH.ce("div");$WH.ae(h,c);c.className="listview-blurb small";$WH.st(c,k.description);if(k.flags&5){h.style.position="relative";var g=$WH.ce("div");g.className="listview-name-info";if(k.flags&1){c=$WH.ce("span");c.className="q3";$WH.ae(c,$WH.ct(g_item_qualities[3]));$WH.ae(g,c)}if(k.flags&4){c=$WH.ce("span");c.className="q5";c.style.marginLeft="3px";$WH.ae(c,$WH.ct(LANG.exhausting));$WH.ae(g,c)}$WH.aef(h,g)}},getVisibleText:function(b){return b.name}},{id:"type",name:LANG.type,type:"text",compute:function(c,b){if(g_garrison_mission_types.hasOwnProperty(c.missiontype)){$WH.ae(b,$WH.ct(g_garrison_mission_types[c.missiontype]))}},getVisibleText:function(b){if(g_garrison_mission_types.hasOwnProperty(b.missiontype)){return g_garrison_mission_types[b.missiontype]}return""},sortFunc:function(f,c){return $WH.stringCompare(g_garrison_mission_types.hasOwnProperty(f.missiontype)?g_garrison_mission_types[f.missiontype]:"",g_garrison_mission_types.hasOwnProperty(c.missiontype)?g_garrison_mission_types[c.missiontype]:"")}},{id:"level",name:LANG.level,type:"number",value:"level",compute:function(c,b){if(!c.hasOwnProperty("followertype")||c.followertype!=2){$WH.st(b,c.level)}},sortFunc:function(f,c){return $WH.stringCompare(f.level,c.level)}},{id:"itemlevel",name:LANG.itemlevel,type:"number",value:"itemlevel",compute:function(c,b){if(c.itemlevel&&(!c.hasOwnProperty("followertype")||c.followertype!=2)){$WH.st(b,c.itemlevel)}},sortFunc:function(f,c){return $WH.stringCompare(f.itemlevel,c.itemlevel)}},{id:"followers",name:LANG.tab_followers,type:"number",value:"followers"},{id:"ships",name:LANG.tab_ships,type:"number",value:"followers",hidden:true},{id:"cost",name:LANG.cost,type:"number",value:"cost",compute:function(c,b){if(c.cost){Listview.funcBox.appendMoney(b,null,null,null,[[c.currency||824,c.cost]])}},sortFunc:function(f,c,g){return $WH.stringCompare(f.cost,c.cost)}},{id:"traveltime",name:LANG.travel,type:"number",value:"traveltime",hidden:true,compute:function(c,b){$WH.st(b,$WH.formatTimeElapsed(c.traveltime))},sortFunc:function(f,c){return $WH.stringCompare(f.traveltime,c.traveltime)}},{id:"missiontime",name:LANG.types[23][0],type:"number",value:"missiontime",hidden:true,compute:function(c,b){$WH.st(b,$WH.formatTimeElapsed(c.missiontime))},sortFunc:function(f,c){return $WH.stringCompare(f.missiontime,c.missiontime)}},{id:"duration",name:LANG.duration,type:"number",compute:function(f,c){var b=$WH.ce("span");$WH.ae(c,b);$WH.st(b,$WH.formatTimeElapsed(f.traveltime+f.missiontime));if(f.traveltime&&f.missiontime){b.className="tip";$WH.Tooltip.simple(b,LANG.tooltip_travel+$WH.formatTimeElapsed(f.traveltime)+"<br>"+LANG.tooltip_mission+$WH.formatTimeElapsed(f.missiontime))}},sortFunc:function(f,c){return $WH.stringCompare(f.traveltime+f.missiontime,c.traveltime+c.missiontime)}},{id:"experience",name:LANG.exp,type:"number",value:"experience"},{id:"reward",name:LANG.reward,type:"number",compute:function(k,j){var f=0,g=[],c=[];if(k.rewards.experience.length){var h=$WH.ce("div");$WH.ae(j,h);$WH.ae(h,$WH.ct($WH.numberFormat(k.rewards.experience[0])+" "+LANG.exp))}for(var b=0;b<k.rewards.currency.length;b++){if(k.rewards.currency[b].currency==0){f+=k.rewards.currency[b].amount}else{g.push([k.rewards.currency[b].currency,k.rewards.currency[b].amount])}}for(var b=0;b<k.rewards.item.length;b++){c.push([k.rewards.item[b].item,k.rewards.item[b].amount])}if(f+g.length+c.length){Listview.funcBox.appendMoney(j,f,null,c,g)}},sortFunc:function(f,c,j){var g=f.rewards.experience.length+f.rewards.currency.length+f.rewards.item.length;var h=f.rewards.experience.length+c.rewards.currency.length+c.rewards.item.length;return $WH.stringCompare(g,h)||$WH.stringCompare(f.rewards.experience.length,c.rewards.experience.length)||(f.rewards.experience.length?$WH.stringCompare(f.rewards.experience[0],c.rewards.experience[0]):0)}}],getItemLink:function(b){return"/mission="+b.id}};Listview.templates.npc={sort:[1],mode:1,nItemsPerPage:100,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",compute:function(c,g){if(c.boss){g.className="icon-boss-padded"}var b=$WH.ce("a");b.className="listview-cleartext";b.href=this.getItemLink(c);$WH.ae(b,$WH.ct(c.name));if(c.hasQuests!=null){b.className+=" icontiny tinyspecial";b.style.backgroundImage="url("+g_staticUrl+"/images/wow/icons/tiny/quest_start.gif)"}$WH.ae(g,b);if(c.tag!=null){var f=$WH.ce("div");f.className="small";$WH.ae(f,$WH.ct("<"+c.tag+">"));$WH.ae(g,f)}},getVisibleText:function(b){var c=b.name;if(b.tag){c+=" <"+b.tag+">"}if(b.boss){c+=" boss skull"}return c},sortFunc:function(f,c,g){return $WH.stringCompare(c.boss,f.boss)||$WH.stringCompare(f.name,c.name)||$WH.stringCompare(c.hasQuests,f.hasQuests)}},{id:"level",name:LANG.level,type:"range",width:"10%",getMinValue:function(b){return b.minlevel},getMaxValue:function(b){return b.maxlevel},compute:function(b,f){if(b.classification){var c=$WH.ce("div");c.className="small";$WH.ae(c,$WH.ct(g_npc_classifications[b.classification]));$WH.ae(f,c)}if(b.classification==3||b.maxlevel==9999){return"??"}if(b.minlevel>0&&b.maxlevel>0){if(b.minlevel!=b.maxlevel){return b.minlevel+LANG.hyphen+b.maxlevel}else{return b.minlevel}}return -1},getVisibleText:function(b){var c="";if(b.classification){c+=" "+g_npc_classifications[b.classification]}if(b.minlevel>0&&b.maxlevel>0){c+=" ";if(b.maxlevel==9999){c+="??"}else{if(b.minlevel!=b.maxlevel){c+=b.minlevel+LANG.hyphen+b.maxlevel}else{c+=b.minlevel}}}return c},sortFunc:function(f,c,g){if(g>0){return $WH.stringCompare(f.minlevel,c.minlevel)||$WH.stringCompare(f.maxlevel,c.maxlevel)||$WH.stringCompare(f.classification,c.classification)}else{return $WH.stringCompare(f.maxlevel,c.maxlevel)||$WH.stringCompare(f.minlevel,c.minlevel)||$WH.stringCompare(f.classification,c.classification)}}},{id:"location",name:LANG.location,type:"text",compute:function(b,c){return Listview.funcBox.location(b,c)},getVisibleText:function(b){return Listview.funcBox.arrayText(b.location,g_zones)},sortFunc:function(f,c,g){return Listview.funcBox.assocArrCmp(f.location,c.location,g_zones)}},{id:"react",name:LANG.react,type:"text",width:"10%",value:"react",filtrable:0,compute:function(f,l){if(f.react==null){return -1}var g=[LANG.lvnpc_alliance,LANG.lvnpc_horde];var j=0;for(var b=0;b<2;++b){if(f.react[b]!=null){if(j++>0){$WH.ae(l,$WH.ct(" "))}var h=$WH.ce("span");h.className=(f.react[b]<0?"q10":(f.react[b]>0?"q2":"q"));$WH.ae(h,$WH.ct(g[b]));$WH.ae(l,h)}}}},{id:"skin",name:LANG.skin,type:"text",value:"skin",compute:function(c,f){if(c.skin){var b=$WH.ce("a");b.className="q1";b.href="/npcs?filter=cr=35;crs=0;crv="+c.skin;$WH.ae(b,$WH.ct(c.skin));$WH.ae(f,b)}},hidden:1},{id:"petfamily",name:LANG.petfamily,type:"text",width:"12%",compute:function(c,f){f.className="q1";var b=$WH.ce("a");b.href="/pet="+c.family;$WH.ae(b,$WH.ct(g_pet_families[c.family]));$WH.ae(f,b)},getVisibleText:function(b){return g_pet_families[b.family]},sortFunc:function(f,c,g){return $WH.stringCompare(g_pet_families[f.family],g_pet_families[c.family])},hidden:1},{id:"type",name:LANG.type,type:"text",width:"12%",compute:function(c,f){f.className="small q1";var b=$WH.ce("a");b.href="/npcs="+c.type;$WH.ae(b,$WH.ct(g_npc_types[c.type]));$WH.ae(f,b)},getVisibleText:function(b){return g_npc_types[b.type]},sortFunc:function(f,c,g){return $WH.stringCompare(g_npc_types[f.type],g_npc_types[c.type])}},{id:"completed",name:LANG.completion,hidden:true,compute:function(c,g,f,b){if((!c.hasOwnProperty("type"))||(!this.template._validCompletionCategory(c.type))){return}$WH.addCompletionIcons(g,"npc",c.id)},sortFunc:function(f,c,g){return $WH.stringCompare(this.template._npcCompletedFlags(f.id),this.template._npcCompletedFlags(c.id))},getValue:function(f){var h=0;var g=g_completion.npc;if((!f.hasOwnProperty("type"))||(!this.template._validCompletionCategory(f.type))){return -1}for(var j in g_user.lists){var b=g_user.lists[j];if(!(b.id in g)){continue}if($WH.inArray(g[b.id],f.id)!=-1){h++}}return h}}],getItemLink:function(b){return"/npc="+b.id},_npcCompletedFlags:function(b){return $WH.getCompletionFlags("npc",b)},_validCompletionCategory:function(b){return $WH.inArray(g_completion_categories[1],b)!=-1},createCbControls:function(f,c){if(!c){return}var b=$WH.ce("input");b.type="button";b.value=(!this.characterSettings||!this.characterSettings.editable?LANG.li_addtolist:LANG.li_addtoanotherlist);b.onclick=(function(g){Listview.cbAddToList.call(this,g,"npc")}).bind(this);$WH.ae(f,b)},onBeforeCreate:function(){for(var b in this.columns){if((this.columns[b].id=="completed")&&(this.columns[b].hidden)){if((!(this.hasOwnProperty("completionMode")&&this.completionMode))&&$WH.isSet("g_user")&&("lists" in g_user)&&("npc" in g_completion)&&($WH.inArray(this.hiddenCols,this.columns[b].id)==-1)){var c=0;for(var f in this.data){if(this.data[f].hasOwnProperty("type")&&this.template._validCompletionCategory(this.data[f].type)){c++}}if(c>(this.data.length*0.1)){this.visibility.push(parseInt(b))}}}}}};Listview.templates.object={sort:[1],mode:1,nItemsPerPage:100,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",compute:function(c,f){var b=$WH.ce("a");b.className="listview-cleartext";b.href=this.getItemLink(c);$WH.ae(b,$WH.ct(c.name));$WH.ae(f,b)}},{id:"location",name:LANG.location,type:"text",compute:function(b,c){return Listview.funcBox.location(b,c)},getVisibleText:function(b){return Listview.funcBox.arrayText(b.location,g_zones)},sortFunc:function(f,c,g){return Listview.funcBox.assocArrCmp(f.location,c.location,g_zones)}},{id:"skill",name:LANG.skill,width:"10%",value:"skill",hidden:true},{id:"type",name:LANG.type,type:"text",width:"12%",compute:function(c,f){f.className="small q1";var b=$WH.ce("a");b.href="/objects="+c.type;$WH.ae(b,$WH.ct(g_object_types[c.type]));$WH.ae(f,b)},getVisibleText:function(b){return g_object_types[b.type]},sortFunc:function(f,c,g){return $WH.stringCompare(g_object_types[f.type],g_object_types[c.type])}}],getItemLink:function(b){return"/object="+b.id},createCbControls:function(f,c){if(!c){return}var b=$WH.ce("input");b.type="button";b.value=(!this.characterSettings||!this.characterSettings.editable?LANG.li_addtolist:LANG.li_addtoanotherlist);b.onclick=(function(g){Listview.cbAddToList.call(this,g,"object")}).bind(this);$WH.ae(f,b)}};Listview.templates.quest={sort:[1,2],mode:1,nItemsPerPage:100,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",compute:function(k,g){var m=$("<a/>",{"class":"listview-cleartext",href:this.getItemLink(k),text:k.name});var b=$("<div/>");b.append(m);if(k.reqclass){var l=$("<div/>",{"class":"small2"});var f=Listview.funcBox.assocBinFlags(k.reqclass,g_chr_classes);for(var h=0,j=f.length;h<j;++h){if(h>0){l.append(", ")}var m=$("<a/>",{href:"/class="+f[h],"class":"c"+f[h],text:g_chr_classes[f[h]]});l.append(m)}b.append(l)}if(k.historical||(k.wflags&32)||(k.reqrace&&k.reqrace!=-1)){b.css("position","relative");var l=$("<div/>",{"class":"listview-name-info"});if(k.historical){var n=$("<span/>",{css:{color:"red"},text:LANG.lvquest_removed});l.append(n)}if(k.wflags&32){if(k.historical){l.append($("<br/>"));b.css("height","33px")}var n=$("<span/>",{text:LANG.lvquest_autoaccept});if(k.wflags&64){n.css("color","red").append(" "+LANG.lvquest_hostile)}l.append(n)}if(k.reqrace&&k.reqrace!=-1){var c=Listview.funcBox.assocBinFlags(k.reqrace,g_chr_races);if(c.length&&(k.historical||(k.wflags&32))){l.append($("<br/>"));b.css("height","33px")}for(var h=0,j=c.length;h<j;++h){if(h>0){l.append(", ")}var m=$("<a/>",{href:"/race="+c[h],"class":"q1",text:g_chr_races[c[h]]});l.append(m)}}b.append(l)}$(g).append(b)}},{id:"level",name:LANG.level,value:"level",compute:function(b,f){if(b.type||b.daily||b.weekly){var c=$WH.ce("div");c.className="small";$WH.noWrap(c);if(b.daily){if(b.type){$WH.ae(c,$WH.ct($WH.sprintf(LANG.lvquest_daily,g_quest_types[b.type])))}else{$WH.ae(c,$WH.ct(LANG.daily))}}else{if(b.weekly){if(b.type){$WH.ae(c,$WH.ct($WH.sprintf(LANG.lvquest_weekly,g_quest_types[b.type])))}else{$WH.ae(c,$WH.ct(LANG.weekly))}}else{if(b.type){$WH.ae(c,$WH.ct(g_quest_types[b.type]))}}}$WH.ae(f,c)}return b.level},getVisibleText:function(b){var c="";if(b.type){c+=" "+g_quest_types[b.type]}if(b.daily){c+=" "+LANG.daily}else{if(b.weekly){c+=" "+LANG.weekly}}if(b.level){c+=" "+b.level}return c},sortFunc:function(f,c,g){return $WH.stringCompare(f.level,c.level)||$WH.stringCompare(f.type,c.type)}},{id:"reqlevel",name:LANG.req,tooltip:LANG.tooltip_reqlevel,value:"reqlevel"},{id:"side",name:LANG.side,type:"text",compute:function(b,f){if(b.side&&b.side!=3){var c=$WH.ce("span");c.className=(b.side==1?"icon-alliance":"icon-horde");c.onmouseover=function(g){$WH.Tooltip.showAtCursor(g,g_sides[b.side],0,0,"q")};c.onmousemove=$WH.Tooltip.cursorUpdate;c.onmouseout=$WH.Tooltip.hide;$WH.ae(f,c)}else{if(!b.side){$WH.ae(f,$WH.ct("??"))}}},getVisibleText:function(b){if(b.side){return g_sides[b.side]}},sortFunc:function(f,c,g){return $WH.stringCompare(g_sides[f.side],g_sides[c.side])}},{id:"rewards",name:LANG.rewards,compute:function(c,k){var b=(c.itemchoices!=null||c.itemrewards!=null);if(b){var j,h;if(c.itemchoices&&c.itemchoices.length>1){j=LANG.lvquest_pickone;if(c.itemrewards&&c.itemrewards.length>0){h=LANG.lvquest_alsoget}}Listview.funcBox.createCenteredIcons(c.itemchoices,k,j,2);Listview.funcBox.createCenteredIcons(c.itemrewards,k,h,2)}if(c.titlereward&&g_titles[c.titlereward]){var g=g_titles[c.titlereward]["name_"+Locale.getName()];g=g.replace("%s",'<span class="q0">&lt;'+LANG.name+"&gt;</span>");var f=$WH.ce("a");f.className="q1";f.href="/title="+c.titlereward;f.innerHTML=g;$WH.ae(k,f);$WH.ae(k,$WH.ce("br"))}},getVisibleText:function(b){var c="";if(b.itemchoices&&b.itemchoices.length){c+=" "+LANG.lvquest_pickone;if(b.itemrewards&&b.itemrewards.length){c+=" "+LANG.lvquest_alsoget}}if(b.titlereward&&g_titles[b.titlereward]){c+=" "+g_titles[b.titlereward]["name_"+Locale.getName()]}return c},sortFunc:function(f,c,h){var l=(f.itemchoices!=null?f.itemchoices.length:0)+(f.itemrewards!=null?f.itemrewards.length:0);var k=(c.itemchoices!=null?c.itemchoices.length:0)+(c.itemrewards!=null?c.itemrewards.length:0);var g=(f.titlereward&&g_titles[f.titlereward]?g_titles[f.titlereward]["name_"+Locale.getName()]:"");var j=(c.titlereward&&g_titles[c.titlereward]?g_titles[c.titlereward]["name_"+Locale.getName()]:"");return $WH.stringCompare(l,k)||$WH.stringCompare(g,j)}},{id:"experience",name:LANG.exp,value:"xp"},{id:"money",name:LANG.money,compute:function(b,c){if(b.money>0||b.currencyrewards!=null){if(b.money>0){Listview.funcBox.appendMoney(c,b.money);if(b.currencyrewards!=null){$WH.ae(c,$WH.ct(" + "))}}if(b.currencyrewards!=null){Listview.funcBox.appendMoney(c,null,b.side,null,b.currencyrewards)}}},getVisibleText:function(b){var f="";for(var c=0;b.currencyrewards&&c<b.currencyrewards.length;++c){if(g_gatheredcurrencies[b.currencyrewards[c][0]]){f+=" "+g_gatheredcurrencies[b.currencyrewards[c][0]]["name_"+Locale.getName()]}}return f},sortFunc:function(f,c,g){var j=0,h=0;if(f.currencyrewards&&f.currencyrewards.length){$.each(f.currencyrewards,function(b,k){j+=k[1]})}if(c.currencyrewards&&c.currencyrewards.length){$.each(c.currencyrewards,function(b,k){h+=k[1]})}return $WH.stringCompare(j,h)||$WH.stringCompare(f.money,c.money)}},{id:"reputation",name:LANG.reputation,width:"14%",value:"id",hidden:true},{id:"category",name:LANG.category,type:"text",compute:function(c,f){if(c.category!=0){f.className="small q1";var b=$WH.ce("a");b.href="/quests="+c.category2+"."+c.category;$WH.ae(b,$WH.ct(Listview.funcBox.getQuestCategory(c.category)));$WH.ae(f,b)}},getVisibleText:function(b){return Listview.funcBox.getQuestCategory(b.category)},sortFunc:function(f,c,h){var g=Listview.funcBox.getQuestCategory;return $WH.stringCompare(g(f.category),g(c.category))}},{id:"completed",name:LANG.completion,hidden:true,compute:function(b,c){$WH.addCompletionIcons(c,"quest",b.id)},sortFunc:function(f,c,g){return $WH.stringCompare(this._questDoneFlags(f.id),this._questDoneFlags(c.id))},getValue:function(f){var h=0;var g=g_completion.quest;for(var j in g_user.lists){var b=g_user.lists[j];if(!(b.id in g)){continue}if($WH.inArray(g[b.id],f.id)!=-1){h++}}return h},_questDoneFlags:function(b){return $WH.getCompletionFlags("quest",b)}}],getItemLink:function(b){return"/quest="+b.id},createCbControls:function(f,c){if(!c){return}var b=$WH.ce("input");b.type="button";b.value=(!this.characterSettings||!this.characterSettings.editable?LANG.li_addtolist:LANG.li_addtoanotherlist);b.onclick=(function(g){Listview.cbAddToList.call(this,g,"quest")}).bind(this);$WH.ae(f,b)},onBeforeCreate:function(){for(var b in this.columns){if((this.columns[b].id=="completed")&&(this.columns[b].hidden)){if((!(this.hasOwnProperty("completionMode")&&this.completionMode))&&$WH.isSet("g_user")&&("lists" in g_user)&&("quest" in g_completion)&&($WH.inArray(this.hiddenCols,this.columns[b].id)==-1)){this.visibility.push(parseInt(b))}}}}};Listview.templates.ship={sort:[-5,1],mode:1,searchable:1,filtrable:1,completionText:LANG.lvcompletion_collection,columns:[{id:"namealliance",name:LANG.som.alliance+" "+LANG.name,type:"text",align:"left",value:"namealliance",compute:function(f,j,c){var b=$WH.ce("a");b.className="q"+f.quality+" listview-cleartext";b.href=this.getItemLink(f,1);if(f.hasOwnProperty("abilities")&&$WH.isArray(f.abilities)&&f.hasOwnProperty("custom")&&f.custom){b.rel="q="+f.quality+"&abil="+f.abilities.join(":")}$WH.ae(b,$WH.ct(f.namealliance));var h=$WH.ce("div");$WH.ae(j,h);$WH.ae(h,b);if(f.hasOwnProperty("active")&&!parseInt(f.active)){h.style.position="relative";var g=$WH.ce("div");g.className="listview-name-info q10";$WH.ae(g,$WH.ct(LANG.inactive));$WH.aef(h,g)}$WH.ae(j,h)}},{id:"classalliance",name:LANG.som.alliance+" "+LANG.classs,type:"text",align:"left",value:"classalliance",width:"20%",compute:function(c,f,b){$WH.st(f,c.classalliance)}},{id:"namehorde",name:LANG.som.horde+" "+LANG.name,type:"text",align:"left",value:"namehorde",compute:function(f,j,c){var b=$WH.ce("a");b.className="q"+f.quality+" listview-cleartext";b.href=this.getItemLink(f,2);if(f.hasOwnProperty("abilities")&&$WH.isArray(f.abilities)&&f.hasOwnProperty("custom")&&f.custom){b.rel="q="+f.quality+"&abil="+f.abilities.join(":")}$WH.ae(b,$WH.ct(f.namehorde));var h=$WH.ce("div");$WH.ae(j,h);$WH.ae(h,b);if(f.hasOwnProperty("active")&&!f.active){h.style.position="relative";var g=$WH.ce("div");g.className="listview-name-info q10";$WH.ae(g,$WH.ct(LANG.inactive));$WH.aef(h,g)}$WH.ae(j,h)}},{id:"classhorde",name:LANG.som.horde+" "+LANG.classs,type:"text",align:"left",value:"classhorde",width:"20%",compute:function(c,f,b){$WH.st(f,c.classhorde)}},{id:"counters",name:LANG.counters,hidden:1,type:"text",width:"168px",compute:function(g,h){if(!g.hasOwnProperty("abilities")){return}var k=g.abilities;if(!$WH.isArray(k)){if(($WH.inArray(this.hiddenCols,"namehorde")!=-1)&&k.hasOwnProperty("1")){k=k["1"]}else{if(($WH.inArray(this.hiddenCols,"namealliance")!=-1)&&k.hasOwnProperty("2")){k=k["2"]}else{return}}}h.style.padding="0 6px";h.style.textAlign="left";for(var m=0;m<k.length;m++){var f=g_mission_abilities[k[m]];for(var c in f.counters){if(!f.counters.hasOwnProperty(c)){continue}if(!g_garrison_mechanics.hasOwnProperty(f.counters[c])){continue}var b=g_garrison_mechanics[f.counters[c]];var l=$WH.ce("div");l.style.display="inline-block";if(b.hasOwnProperty("icon")){var j=Icon.create(b.icon,0,null,"/mission-ability="+f.id);j.className+=" garrison-ability";j.style.cssFloat="left";$WH.ae(l,j)}$WH.ae(h,l)}}},getVisibleText:function(g){var f="";if(!g.hasOwnProperty("abilities")){return f}var j=g.abilities;if(!$WH.isArray(j)){if(($WH.inArray(this.hiddenCols,"namehorde")!=-1)&&j.hasOwnProperty("1")){j=j["1"]}else{if(($WH.inArray(this.hiddenCols,"namealliance")!=-1)&&j.hasOwnProperty("2")){j=j["2"]}else{return f}}}for(var b=0;b<g.abilities.length;b++){var c=g_mission_abilities[g.abilities[b]];for(var h in c.counters){if(!c.counters.hasOwnProperty(h)){continue}f+=c.counters[h].name+" "}}return f}},{id:"quality",name:LANG.quality,type:"text",value:"quality",width:"10%",compute:function(c,f){var b=$WH.ce("span");b.className="q"+c.quality;$WH.st(b,g_item_qualities[c.quality]);$WH.ae(f,b)},sortFunc:function(f,c){return $WH.stringCompare(f.quality,c.quality)}},{id:"completed",name:LANG.completion,width:"10%",hidden:true,compute:function(b,f,k,n){var j=3;if(this.hiddenCols){for(var m=0;m<this.hiddenCols.length;m++){if(this.hiddenCols[m]=="namealliance"){j=2;break}if(this.hiddenCols[m]=="namehorde"){j=1;break}}}if(b.npcalliance==b.npchorde){j=false}for(var g in g_user.lists){var h=g_user.lists[g];if(!g_completion.hasOwnProperty("ship")||(!(h.id in g_completion.ship))||!h.character){continue}var c=($WH.inArray(g_completion.ship[h.id],b.id)!=-1);if(j){if(j!=3){c|=($WH.inArray(g_completion.ship[h.id],""+b.id+"."+j)!=-1)}else{c|=($WH.inArray(g_completion.ship[h.id],""+b.id+".1")!=-1);c|=($WH.inArray(g_completion.ship[h.id],""+b.id+".2")!=-1)}}var l=$WH.ce("a");l.href="/list="+h.id+"/"+h.url;l.className="progress-icon "+(c?"progress-8":"progress-0");$WH.Tooltip.simple(l,$WH.getCompletionTooltip(h,c),"",true);$WH.ae(f,l)}},sortFunc:function(j,h,k){var l=3;if(this.hiddenCols){for(var g=0;g<this.hiddenCols.length;g++){if(this.hiddenCols[g]=="namealliance"){l=2;break}if(this.hiddenCols[g]=="namehorde"){l=1;break}}}var f=l,m=l;if(j.npcalliance==j.npchorde){f=false}if(h.npcalliance==h.npchorde){m=false}var c=function(r,p){var b=0;if(!g_user.lists){return b}for(var o=g_user.lists.length-1;o>=0;o--){var q=g_user.lists[o];if(!g_completion.hasOwnProperty("ship")||(!(q.id in g_completion.ship))||!q.character){continue}var n=$WH.inArray(g_completion.ship[q.id],r)!=-1;if(p){if(p!=3){n|=($WH.inArray(g_completion.ship[q.id],""+r+"."+p)!=-1)}else{n|=($WH.inArray(g_completion.ship[q.id],""+r+".1")!=-1);n|=($WH.inArray(g_completion.ship[q.id],""+r+".2")!=-1)}}b=(b<<1)|(n?1:0)}return b};return $WH.stringCompare(c(j.id,f),c(h.id,m))}}],getItemLink:function(f,c){if(!c&&this.hiddenCols){for(var b=0;b<this.hiddenCols.length;b++){if(this.hiddenCols[b]=="namealliance"){c=2;break}if(this.hiddenCols[b]=="namehorde"){c=1;break}}}if(f.npcalliance==f.npchorde){c=false}return"/ship="+f.id+(c?("."+c):"")},onBeforeCreate:function(){for(var b in this.columns){if((this.columns[b].id=="completed")&&(this.columns[b].hidden)){if((!(this.hasOwnProperty("completionMode")&&this.completionMode))&&$WH.isSet("g_user")&&("lists" in g_user)&&("ship" in g_completion)&&($WH.inArray(this.hiddenCols,this.columns[b].id)==-1)){this.visibility.push(parseInt(b));break}}}}};Listview.templates.sound={searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",compute:function(c,f){var b=$WH.ce("a");b.className="listview-cleartext";b.href="/sound="+c.id;$WH.st(b,c.name);$WH.ae(f,b)}},{id:"type",name:LANG.type,type:"text",compute:function(f,h){var c="";if(!this.hasOwnProperty("soundtypecache")){var g={};for(var b in mn_sounds){if(mn_sounds[b][0]<1000){g[mn_sounds[b][0]]=mn_sounds[b][1]}}this.soundtypecache=g}if(this.soundtypecache.hasOwnProperty(f.type)){c=this.soundtypecache[f.type]}$WH.st(h,c)},sortFunc:function(f,c){if(!this.hasOwnProperty("soundtypecache")){var l={};for(var g in mn_sounds){if(mn_sounds[g][0]<1000){l[mn_sounds[g][0]]=mn_sounds[g][1]}}this.soundtypecache=l}var h=(this.soundtypecache.hasOwnProperty(f.type))?this.soundtypecache[f.type]:"";var j=(this.soundtypecache.hasOwnProperty(c.type))?this.soundtypecache[c.type]:"";return $WH.stringCompare(h,j)||$WH.stringCompare(f.name,c.name)}},{id:"activity",name:LANG.activity,hidden:true,type:"text",compute:function(b,c){if(!b.hasOwnProperty("activity")){return""}if(LANG.sound_activities.hasOwnProperty(b.activity)){return LANG.sound_activities[b.activity]}else{return b.activity}},sortFunc:function(f,c){return $WH.stringCompare(this.compute(f),this.compute(c))}},{id:"sound",name:LANG.types[19][2],span:2,compute:function(f,h,b){var c=$WH.ce("td");c.className="nowrap";$WH.ae(b,c);c.style.borderRight="none";h.className="nowrap";h.style.borderLeft="none";var g=$WH.ce("div");$WH.ae(c,g);(new AudioControls()).init(f.files,g,{listview:this,trackdisplay:h})}}],getItemLink:function(b){return"/sound="+b.id}};Listview.templates.threat={sort:[1,3],mode:0,nItemsPerPage:100,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",span:2,compute:function(c,k,h){var f=$WH.ce("td");f.style.width="1px";f.style.paddingRight="0";f.style.borderRight="none";var g=Icon.create(c.icon,(this.iconSize==null?0:this.iconSize),null,this.getItemLink(c));g.className+=" garrison-ability";$WH.ae(f,g);$WH.ae(h,f);k.style.borderLeft="none";var j=$WH.ce("div");$WH.ae(k,j);var b=$WH.ce("a");b.className="listview-cleartext";b.href=this.getItemLink(c);$WH.ae(b,$WH.ct(c.name));$WH.ae(j,b)},getVisibleText:function(b){return b.name}},{id:"description",name:LANG.description,type:"text",align:"left",compute:function(b,c){c.innerHTML=b.description}},{id:"category",name:LANG.category,type:"text",compute:function(c,f){var b=$WH.ce("a");b.href="/threats="+c.category;$WH.st(b,g_threat_categories[c.category]);$WH.ae(f,b)},getVisibleText:function(b){return g_threat_categories[b.category]},sortFunc:function(f,c){return $WH.stringCompare(g_threat_categories[f.category],g_threat_categories[c.category])}}],getItemLink:function(b){return"/threat="+b.id}};Listview.templates["order-advancement"]={sort:[3,4,1],mode:0,nItemsPerPage:100,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",span:2,compute:function(h,k,g){var c=$WH.ce("td");c.style.width="1px";c.style.paddingRight="0";c.style.borderRight="none";var f=Icon.create(h.icon,(this.iconSize==null?0:this.iconSize),null,this.getItemLink(h));$WH.ae(c,f);$WH.ae(g,c);k.style.borderLeft="none";var j=$WH.ce("div");$WH.ae(k,j);var b=$WH.ce("a");b.className="listview-cleartext";b.href=this.getItemLink(h);$WH.ae(b,$WH.ct(h.name));$WH.ae(j,b)},getVisibleText:function(b){return b.name}},{id:"description",name:LANG.description,type:"text",align:"left",compute:function(b,c){c.innerHTML=b.description},getVisibleText:function(b){return b.description},sortFunc:function(f,c){return $WH.stringCompare(f.description,c.description)}},{id:"class",name:LANG.classs,type:"text",compute:function(h,j){var g=$WH.ce("div");g.className="small2";var f=Listview.funcBox.assocBinFlags(h.classmask,g_chr_classes);for(var c=0,b=f.length;c<b;++c){if(c>0){$WH.ae(g,$WH.ct(", "))}a=$WH.ce("a");a.href="/order-advancements="+f[c];a.className="c"+f[c];$WH.st(a,g_chr_classes[f[c]]);$WH.ae(g,a)}$WH.ae(j,g)},getVisibleText:function(h){var g="";var f=Listview.funcBox.assocBinFlags(h.classmask,g_chr_classes);for(var c=0,b=f.length;c<b;++c){if(c>0){g+=", "}g+=g_chr_classes[f[c]]}return g},sortFunc:function(f,c){return $WH.stringCompare(Listview.templates["order-advancement"].columns[2].getVisibleText(f),Listview.templates["order-advancement"].columns[2].getVisibleText(c))}},{id:"tier",name:LANG.tier,type:"number",compute:function(b,c){return b.tier+1},getVisibleText:function(b){return b.tier+1},sortFunc:function(f,c){return $WH.stringCompare(f.tier,c.tier)}},{id:"researchcost",name:LANG.lv_orderadvancement_researchcost,type:"number",compute:function(b,c){if(b.researchcost){Listview.funcBox.appendMoney(c,null,null,null,[[b.researchcurrency,b.researchcost]])}},sortFunc:function(f,c,g){return $WH.stringCompare(f.researchcurrency,c.researchcurrency)||$WH.stringCompare(f.researchcost,c.researchcost)}},{id:"changecost",name:LANG.lv_orderadvancement_changecost,type:"number",compute:function(b,c){if(b.switchcost){Listview.funcBox.appendMoney(c,null,null,null,[[b.switchcurrency,b.switchcost]])}},sortFunc:function(f,c,g){return $WH.stringCompare(f.switchcurrency,c.switchcurrency)||$WH.stringCompare(f.switchcost,c.switchcost)}}],getItemLink:function(b){return"/order-advancement="+b.id}};Listview.templates.zone={sort:[2,4],nItemsPerPage:-1,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",compute:function(c,g){var b=$WH.ce("a");b.className="listview-cleartext";b.href=this.getItemLink(c);$WH.ae(b,$WH.ct(c.name));if(c.expansion){var f=$WH.ce("span");f.className=$WH.getExpansionClassName(c.expansion);$WH.ae(f,b);$WH.ae(g,f)}else{$WH.ae(g,b)}},getVisibleText:function(b){var c=b.name+Listview.funcBox.getExpansionText(b);if(b.instance==5||b.instance==8){c+=" heroic"}return c}},{id:"level",name:LANG.level,type:"range",width:"10%",getMinValue:function(b){return b.minlevel},getMaxValue:function(b){return b.maxlevel},compute:function(b,c){if(b.minlevel>0&&b.maxlevel>0){if(b.minlevel!=b.maxlevel){return b.minlevel+LANG.hyphen+b.maxlevel}else{return b.minlevel}}},sortFunc:function(f,c,g){if(g>0){return $WH.stringCompare(c.minlevel,f.minlevel)||$WH.stringCompare(c.maxlevel,f.maxlevel)}else{return $WH.stringCompare(c.maxlevel,f.maxlevel)||$WH.stringCompare(c.minlevel,f.minlevel)}}},{id:"players",name:LANG.players,type:"text",hidden:true,compute:function(b,g){if(b.instance>0){var c=$WH.ce("span");var f=Listview.templates.zone.getInstancePlayerText(b);if(f.indexOf("<br>")!=-1){c.className="small"}c.innerHTML=f;$WH.ae(g,c)}},getVisibleText:function(b){if(b.instance>0){return Listview.templates.zone.getInstancePlayerText(b)}},sortFunc:function(f,c,g){return $WH.stringCompare(Listview.templates.zone.getInstancePlayerText(f),Listview.templates.zone.getInstancePlayerText(c))}},{id:"territory",name:LANG.territory,type:"text",width:"13%",compute:function(b,f){var c=$WH.ce("span");switch(b.territory){case 0:c.className="icon-alliance";break;case 1:c.className="icon-horde";break;case 4:c.className="icon-ffa";break}$WH.ae(c,$WH.ct(g_zone_territories[b.territory]));$WH.ae(f,c)},getVisibleText:function(b){return g_zone_territories[b.territory]},sortFunc:function(f,c,g){return $WH.stringCompare(g_zone_territories[f.territory],g_zone_territories[c.territory])}},{id:"instancetype",name:LANG.instancetype,type:"text",compute:function(b,l){if(b.instance>0){var g=$WH.ce("span");if((b.instance>=1&&b.instance<=5)||b.instance==7||b.instance==8){g.className="icon-instance"+b.instance}var k=g_zone_instancetypes[b.instance];if($WH.isSet("g_difficulties")&&$WH.isSet("g_mapdifficulties")&&g_mapdifficulties[b.id]){for(var f in g_mapdifficulties[b.id]){if(f==8){var c=$WH.ce("span");c.className="icon-challenge";$WH.Tooltip.simple(c,LANG.tooltip_challengemodeavailable,"q");$WH.ae(l,c)}else{if(f==23){var j=$WH.ce("span");j.className="icon-mythic";$WH.Tooltip.simple(j,LANG.tooltip_mythicmodeavailable,"q");$WH.ae(l,j)}}}}if(b.heroicLevel){var h=$WH.ce("span");h.className="icon-heroic";$WH.Tooltip.simple(h,LANG.tooltip_heroicmodeavailable+LANG.qty.replace("$1",b.heroicLevel));$WH.ae(l,h)}$WH.ae(g,$WH.ct(k));$WH.ae(l,g)}},getVisibleText:function(b){if(b.instance>0){var f=g_zone_instancetypes[b.instance];if(b.nplayers&&((b.instance!=2&&b.instance!=5)||b.nplayers>5)){if(b.instance==4){f+=" "+$WH.sprintf(LANG.lvzone_xvx,b.nplayers,b.nplayers)}else{f+=" "+$WH.sprintf(LANG.lvzone_xman,b.nplayers)}}if($WH.isSet("g_difficulties")&&$WH.isSet("g_mapdifficulties")&&g_mapdifficulties[b.id]){for(var c in g_mapdifficulties[b.id]){if(c==8){f+=" challenge"}}}if(b.instance==5||b.instance==8){f+=" heroic"}return f}},sortFunc:function(f,c,g){return $WH.stringCompare(g_zone_instancetypes[f.instance],g_zone_instancetypes[c.instance])||$WH.stringCompare(f.instance,c.instance)||$WH.stringCompare(f.nplayers,c.nplayers)}},{id:"category",name:LANG.category,type:"text",width:"15%",hidden:true,compute:function(c,f){f.className="small q1";var b=$WH.ce("a");b.href="/zones="+c.category;$WH.ae(b,$WH.ct(g_zone_categories[c.category]));$WH.ae(f,b)},getVisibleText:function(b){return g_zone_categories[b.category]},sortFunc:function(f,c,g){return $WH.stringCompare(g_zone_categories[f.category],g_zone_categories[c.category])}}],getInstancePlayerText:function(l){if(l.nplayers==-2){l.nplayers="10/25"}var r="";if(l.instance==4){r+=$WH.sprintf(LANG.lvzone_xvx,l.nplayers,l.nplayers)}else{var c=true;if($WH.isSet("g_difficulties")&&$WH.isSet("g_mapdifficulties")&&g_mapdifficulties[l.id]){var n={};for(var p in g_mapdifficulties[l.id]){if(!parseInt(p)){continue}var b=g_difficulties[p];var q=b.minplayers;if(b.minplayers!=b.maxplayers){q=b.minplayers+"/"+b.maxplayers}if(p==17){q="25"}if(!n[q]){n[q]=[]}n[q].push(p)}var k=[];for(var o in n){k.push([o,n[o]])}k.sort(function(s,j){return j[1].length-s[1].length});if(k.length){c=false;var m=k.length>1;for(var h in k){var f="";for(var g in k[h][1]){f+=(!f?"":"/")+(g_difficulty_shortnames[k[h][1][g]]?g_difficulty_shortnames[k[h][1][g]]:"")}m=f&&m;r+=(r?"<br>":"")+(m?(f+": "):"")+$WH.sprintf(LANG.lvzone_xman,k[h]?k[h][0]:l.nplayers)}}}if(c){r+=$WH.sprintf(LANG.lvzone_xman,l.nplayers)}}return r},getItemLink:function(b){return"/zone="+b.id}};Listview.templates.holiday={sort:[2,1],nItemsPerPage:-1,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",span:2,compute:function(c,h,g){var f=$WH.ce("td");f.style.width="1px";f.style.paddingRight="0";f.style.borderRight="none";$WH.ae(f,g_holidays.createIcon(c.id,0));$WH.ae(g,f);h.style.borderLeft="none";var b=$WH.ce("a");b.className="listview-cleartext";b.href=this.getItemLink(c);$WH.ae(b,$WH.ct(c.name));$WH.ae(h,b)},getVisibleText:function(b){return b.name}},{id:"date",name:LANG.date,type:"text",width:"16%",allText:true,compute:function(c,l,h){var j=$WH.getEventNextDates(c);if(j[0]&&j[1]){var k=$WH.formatDateSimple(j[0]),b=$WH.formatDateSimple(j[1]),g=$WH.ce("span");if(k!=b){var f=$WH.ce("span",{className:"nowrap"});$WH.st(f,k+LANG.hyphen.replace(/\s*$/,""));$WH.st(g," "+b);$WH.aef(g,f)}else{g.className="nowrap";$WH.st(g,k)}$WH.ae(l,g);if(j[0]<=g_serverTime&&j[1]>=g_serverTime){h.className="checked";g.className="q2 tip";$WH.Tooltip.simple(g,LANG.tooltip_activeholiday,"q")}}},getVisibleText:function(c){var f=$WH.getEventNextDates(c);if(f[0]&&f[1]){var g=$WH.formatDateSimple(f[0]),b=$WH.formatDateSimple(f[1]);if(g!=b){return g+LANG.hyphen+b}else{return g}}return""},sortFunc:function(g,c,j){var f=$WH.getEventNextDates(g);var h=$WH.getEventNextDates(c);if(f[0]&&h[0]){return f[0]-h[0]}return 0}},{id:"category",name:LANG.category,type:"text",width:"16%",compute:function(f,g){g.className="small q1";var b=$WH.ce("a"),c="/events="+f.category;b.href=c;$WH.ae(b,$WH.ct(g_holiday_categories[f.category]));$WH.ae(g,b)},getVisibleText:function(b){return g_holiday_categories[b.category]},sortFunc:function(f,c,g){return $WH.stringCompare(g_holiday_categories[f.category],g_holiday_categories[c.category])}}],getItemLink:function(b){return"/event="+b.id}};Listview.templates.holidaycal={sort:[1],mode:4,startOnMonth:new Date(g_serverTime.getFullYear(),0,1),nMonthsToDisplay:12,rowOffset:g_serverTime.getMonth(),poundable:2,columns:[],compute:function(b,g,c){if(!b.events||!b.events.length){return}for(var c=0;c<b.events.length;++c){var f=g_holidays.createIcon(b.events[c].id,1);f.onmouseover=Listview.funcBox.dateEventOver.bind(f,b.date,b.events[c]);f.onmousemove=$WH.Tooltip.cursorUpdate;f.onmouseout=$WH.Tooltip.hide;f.style.cssFloat=f.style.styleFloat="left";$WH.ae(g,f)}},sortFunc:function(h,c){var g=$WH.getEventNextDates(h);var k=$WH.getEventNextDates(c);for(var l=0;l<2;++l){var j=g[l],f=k[l];if(j.getFullYear()==f.getFullYear()&&j.getMonth()==f.getMonth()&&j.getDate()==f.getDate()){return j-f}}return $WH.stringCompare(h.name,c.name)}};Listview.templates.currency={sort:[1],mode:1,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",span:2,value:"name",compute:function(c,j,g){var f=$WH.ce("td");f.style.width="1px";f.style.paddingRight="0";f.style.borderRight="none";$WH.ae(f,Icon.create(c.icon,0,null,this.getItemLink(c),c.stack?c.stack:null));$WH.ae(g,f);j.style.borderLeft="none";var h=$WH.ce("div");var b=$WH.ce("a");b.className="listview-cleartext";b.href=this.getItemLink(c);if(typeof c.name=="undefined"){c.name=(typeof g_currencies[c.id]!="undefined")?g_currencies[c.id][0]:""}$WH.ae(b,$WH.ct(c.name));$WH.ae(h,b);$WH.ae(j,h)}},{id:"category",name:LANG.category,type:"text",width:"15%",compute:function(c,f){f.className="small";var b=$WH.ce("a");b.className="q1";b.href="/currencies="+c.category;$WH.ae(b,$WH.ct(g_currency_categories[c.category]));$WH.ae(f,b)},getVisibleText:function(b){return g_currency_categories[b.category]},sortFunc:function(f,c,g){return $WH.stringCompare(g_currency_categories[f.category],g_currency_categories[c.category])}}],getItemLink:function(b){return"/currency="+b.id},createCbControls:function(f,c){if(!c){return}var b=$WH.ce("input");b.type="button";b.value=(!this.characterSettings||!this.characterSettings.editable?LANG.li_addtolist:LANG.li_addtoanotherlist);b.onclick=(function(g){Listview.cbAddToList.call(this,g,"currency")}).bind(this);$WH.ae(f,b)}};var LiveSearch=new function(){var currentTextbox,lastSearch={},lastDiv,timer,prepared,container,cancelNext,hasData,summary,selection,LIVESEARCH_DELAY=500;function setText(textbox,txt){textbox.value=txt;textbox.selectionStart=textbox.selectionEnd=txt.length}function colorDiv(div,fromOver){if(lastDiv){lastDiv.className=lastDiv.className.replace("live-search-selected","")}lastDiv=div;lastDiv.className+=" live-search-selected";selection=div.i;if(!fromOver){show();setTimeout(setText.bind(0,currentTextbox,$WH.getTextContent(div.firstChild.firstChild.childNodes[1])),1);cancelNext=1}}function aOver(){colorDiv(this.parentNode.parentNode,1)}function isVisible(){if(!container){return false}return container.style.display!="none"}function adjust(fromResize){if(fromResize==1&&!isVisible()){return}if(currentTextbox==null){return}var c=$WH.ac(currentTextbox);container.style.left=(c[0])+"px";container.style.top=(c[1]+currentTextbox.offsetHeight)+"px";container.style.width=(currentTextbox.offsetWidth-4)+"px"}function prepare(){if(prepared){if(Platform.isMobile()){container.className+=" live-search-mobile"}else{container.className=container.className.replace(/ *live-search-mobile\b/g,"")}return}prepared=1;container=$WH.ce("div");container.className="live-search"+(Platform.isMobile()?" live-search-mobile":"");container.style.display="none";$WH.ae(document.body,container);$WH.aE(window,"resize",adjust.bind(0,1));if(!Platform.isMobile()){$WH.aE(document,"click",hide)}}function show(){if(container&&!isVisible()){adjust();if(currentTextbox){currentTextbox.setAttribute("data-has-live-search","true")}$(container).css({opacity:"0"}).show().animate({opacity:"1"},"fast",null,doneShowing)}}function doneShowing(a){$(this).css("opacity","")}function hide(e){if(e&&!$WH.isLeftClick(e)){return}if(container){container.style.display="none"}if(currentTextbox){currentTextbox.setAttribute("data-has-live-search","false")}}function highlight(match,$1){return($1?match:"<b><u>"+match+"</u></b>")}function display(textbox,search,suggz,dataz){prepare();show();var isMobile=Platform.isMobile();hasData=1;selection=null;while(container.firstChild){$WH.de(container.firstChild)}search=search.replace(/[^a-z0-9\-]/gi," ");search=$WH.trim(search.replace(/\s+/g," "));var regex=$WH.createOrRegex(search,(search=="s"?"[%]":null));if(Platform.isMobile()){var firstDiv=$WH.ce("div");var firstDivDiv=$WH.ce("div");var firstA=$WH.ce("a");firstA.innerHTML='<i class="fa fa-times"></i><span class="q10">'+LANG.zul_closesearch+"</span>";firstA.onclick=hide;$WH.ae(firstDivDiv,firstA);$WH.ae(firstDiv,firstDivDiv);$WH.ae(container,firstDiv)}for(var i=0,len=suggz.length;i<len;++i){var pos=suggz[i].lastIndexOf("(");if(pos!=-1){suggz[i]=suggz[i].substr(0,pos-1)}var type=dataz[i][0],typeId=dataz[i][1],param1=dataz[i][2],param2=dataz[i][3],a=$WH.ce("a"),sp=$WH.ce("i"),sp2=$WH.ce("span"),div=$WH.ce("div"),div2=$WH.ce("div");div.i=i;a.onmouseover=aOver;a.href="/"+(type==10&&param2?"statistic":g_types[type])+"="+typeId;if(textbox._append){a.rel+=textbox._append}if(type==1&&param1!=null){div.className+=" live-search-icon-boss"}else{if(type==3&&param2!=null){a.className+=" q"+param2}else{if(type==4&&param1!=null){a.className+=" q"+param1}else{if(type==13){a.className+=" c"+typeId}}}}if((type==3||type==6||type==9||type==10||type==13||type==14||type==15||type==17)&&param1){div.className+=" live-search-icon";div.style.backgroundImage="url("+g_staticUrl+"/images/wow/icons/"+(isMobile?"medium":"small")+"/"+param1.toLowerCase()+".jpg)"}else{if((type==5||type==11)&&param1>=1&&param1<=2){div.className+=" live-search-icon-quest-"+(param1==1?"alliance":"horde")}}$WH.ae(sp,$WH.ct(LANG.types[type][0]));$WH.ae(a,sp);var buffer=suggz[i];buffer=buffer.replace(regex,highlight);if(type==11){buffer=buffer.replace("%s",'<span class="q0">&lt;'+LANG.name+"&gt;</span>")}sp2.innerHTML=buffer;$WH.ae(a,sp2);if(type==6&&param2){$WH.ae(a,$WH.ct(" ("+param2+")"))}$WH.ae(div2,a);$WH.ae(div,div2);$WH.ae(container,div)}}function receive(xhr,opt){var text=xhr.responseText;if(text.charAt(0)!="["||text.charAt(text.length-1)!="]"){return}var a=eval(text);var search=a[0];if(search==opt.search){if(a.length==8){display(opt.textbox,search,a[1],a[7])}else{hide()}}}function fetch(textbox,search){new Ajax("/search?q="+$WH.urlEncode(search)+"&opensearch",{onSuccess:receive,textbox:textbox,search:search})}function preFetch(textbox,search){if(cancelNext){cancelNext=0;return}hasData=0;if(timer>0){clearTimeout(timer);timer=0}timer=setTimeout(fetch.bind(0,textbox,search),LIVESEARCH_DELAY)}function cycle(dir){if(!isVisible()){if(hasData){show()}return}var firstNode=(container.childNodes[0].nodeName=="EM"?container.childNodes[3]:container.firstChild);var bakDiv=dir?firstNode:container.lastChild;if(lastDiv==null){colorDiv(bakDiv)}else{var div=dir?lastDiv.nextSibling:lastDiv.previousSibling;if(div){if(div.nodeName=="STRONG"){div=container.lastChild}colorDiv(div)}else{colorDiv(bakDiv)}}}function onKeyUp(e){e=$WH.normalizeEvent(e);var textbox=e._target;var search=$WH.trim(textbox.value.replace(/\s+/g," "));if(search==lastSearch[textbox.id]){return}lastSearch[textbox.id]=search;if(textbox!=document){currentTextbox=textbox}if(search.length){preFetch(textbox,search)}else{hide()}}function onKeyDown(e){e=$WH.normalizeEvent(e);switch(e.keyCode){case 27:hide();break;case 38:cycle(0);break;case 40:cycle(1);break}}function onFocus(e){e=$WH.normalizeEvent(e);var textbox=e._target;if(textbox!=document){currentTextbox=textbox}}this.attach=function(textbox){textbox=$(textbox);if(!textbox.length){return}textbox=textbox[0];if(textbox.getAttribute("autocomplete")=="off"){return}textbox.setAttribute("autocomplete","off");$WH.aE(textbox,"focus",onFocus);$WH.aE(textbox,"keyup",onKeyUp);$WH.aE(textbox,"keydown",onKeyDown)};this.reset=function(textbox){lastSearch[textbox.id]=null;textbox.value="";hasData=0;hide()};this.hide=function(){hide()}};var LOCALE_ENUS=0;var LOCALE_KOKR=1;var LOCALE_FRFR=2;var LOCALE_DEDE=3;var LOCALE_ZHCN=4;var LOCALE_ESES=6;var LOCALE_RURU=7;var LOCALE_PTBR=8;var LOCALE_ITIT=9;var Locale={current:{},locales:{0:{id:LOCALE_ENUS,name:"enus",domain:"www.wowhead.com",description:"English"},1:{id:LOCALE_KOKR,name:"kokr",domain:"ko.wowhead.com",description:"한국어"},2:{id:LOCALE_FRFR,name:"frfr",domain:"fr.wowhead.com",description:"Fran"+String.fromCharCode(231)+"ais"},3:{id:LOCALE_DEDE,name:"dede",domain:"de.wowhead.com",description:"Deutsch"},4:{id:LOCALE_ZHCN,name:"zhcn",domain:"cn.wowhead.com",description:"简体中文"},6:{id:LOCALE_ESES,name:"eses",domain:"es.wowhead.com",description:"Espa"+String.fromCharCode(241)+"ol"},7:{id:LOCALE_RURU,name:"ruru",domain:"ru.wowhead.com",description:String.fromCharCode(1056,1091,1089,1089,1082,1080,1081)},8:{id:LOCALE_PTBR,name:"ptbr",domain:"pt.wowhead.com",description:"Português Brasileiro"},9:{id:LOCALE_ITIT,name:"itit",domain:"it.wowhead.com",description:"Italiano"}},getAll:function(){var b=[];for(var c in Locale.locales){b.push(Locale.locales[c])}return b},getAllByName:function(){var b=Locale.getAll();b.sort(function(f,c){return $WH.stringCompare(f.description,c.description)});return b},getId:function(){return Locale.current.id},getName:function(){var b=Locale.getId();return Locale.locales[b].name},get:function(){var b=Locale.getId();return Locale.locales[b]},set:function(b){$.extend(Locale.current,Locale.locales[b])}};Locale.set(LOCALE_ENUS);var LoginDialog=new function(){var c;var b=null;this.onShow=function(){b=$WH.setHash("login")};this.onHide=function(){if(b&&b!="#login"&&(b.indexOf("screenshots:")==-1||b.indexOf("videos:")==-1)){$WH.setHash(b)}else{$WH.clearHash()}};this.onSubmit=function(k,g,j){if(k.submitting){return false}for(var h=0;h<j.elements.length;++h){j.elements[h].disabled=true}k.submitting=true;var f="/account=signin";if(location.pathname!="/"){f+="?next="+location.pathname}$WH.visitUrlWithPostData(f,{username:j.username.value,password:j.password.value,remember_me:j.remember_me.checked,masterpass:""});return false};this.show=function(){if(!c){this.init()}var f={mode:0};f.remember_me=1;f.focus="username";c.show("login",{data:f,onShow:this.onShow,onHide:this.onHide,onSubmit:this.onSubmit})};this.checkPound=function(){if(location.hash&&location.hash=="#login"){LoginDialog.show()}};this.init=function(){c=new Dialog();Dialog.templates.login={width:550,buttons:[["x",LANG.cancel]],fields:[{id:"iframe",type:"dynamic",compute:function(j,k,g,l,h){var f=$WH.ce("iframe");f.id=f.className="zul-bar-login-lightbox-iframe";f.src=($WH.isSet("g_dev")&&g_dev&&$WH.isSet("g_enablessl")&&!g_enablessl?"http":"https")+"://"+location.host+"/account=signin-form&next="+location.pathname;f.frameBorder="0";f.allowTransparency="true";$WH.ae(l,f)}},{id:"forgot",type:"caption",compute:function(k,m,f,h,j){h.className="login-dialog-cell";var l=$WH.ce("div");l.style.textAlign="right";l.style.position="relative";var g=$WH.ce("div",{className:"login-dialog-caption",innerHTML:LANG.zul_createone});$WH.ae(l,g);$WH.ae(h,l)}}],onInit:function(f){},onShow:function(f){setTimeout(function(){$WH.safeFocus($WH.ge("zul-bar-login-lightbox-iframe"))},100);setTimeout(Lightbox.reveal,250)}}};$(document).ready(this.checkPound)};function Mapper(c,f){$WH.cO(this,c);if(this.parent&&!this.parent.nodeName){this.parent=$WH.ge(this.parent)}else{if(!this.parent){return}}var b;this.mouseX=this.mouseY=0;this.editable=this.editable||false;this.overlay=this.overlay||false;if(this.editable){this.zoomable=this.toggle=false;this.show=this.mouse=true}else{this.zoomable=(this.zoomable==null?true:this.zoomable);this.toggle=(this.toggle==null?true:this.toggle);this.show=(this.show==null?true:this.show);this.mouse=(this.mouse==null?false:this.mouse)}this.buttons=(this.buttons==null?true:this.buttons);this.zoneLink=(this.zoneLink==null?true:this.zoneLink);if(location.href.indexOf("zone=")!=-1){this.zoneLink=false}this.zoom=(this.zoom==null?0:this.zoom);this.zone=(this.zone==null?0:this.zone);this.level=(this.level==null?(Mapper.zoneDefaultLevel[this.zone]?Mapper.zoneDefaultLevel[this.zone]:0):this.fixLevel(this.level,this.zone));this.pins=[];this.nCoords=0;this.tempWidth=null;this.tempHeight=null;this.parent.className="mapper";this.parent.appendChild(this.span=$WH.ce("span",{className:"mapper-map"}));$WH.disableOldIESelect(this.span);this.overlaySpan=b=$WH.ce("div",{className:"mapper-overlay"});this.overlaySpan.appendChild($WH.ce("div",{className:"mapper-overlay-expander"}));this.span.appendChild(b);this.buttonDiv=b=$WH.ce("div");b.style.position="absolute";b.style.top=b.style.right="3px";if(this.buttons){this.parent.appendChild(b)}if(this.editable){this.span.onmouseup=this.addPin.bind(this);b=$WH.createTextGlow(LANG.mapper_tippin);b.style.fontSize="13px";b.style.position="absolute";b.style.bottom=b.style.right="0";$WH.disableOldIESelect(b);this.parent.appendChild(b)}else{this.sToggle=b=$WH.createButton(LANG.mapper_hidepins,null,{click:this.toggleShow.bind(this)});b.style["float"]="right";b.style.display="none";$WH.disableOldIESelect(b);this.buttonDiv.appendChild(b)}if(this.zoomable&&!Platform.isMobile()){this.span.onclick=this.toggleZoom.bind(this);this.span.id="sjdhfkljawelis"+(this.unique!==undefined?this.unique:"");this.sZoom=b=$WH.createTextGlow(LANG.mapper_tipzoom,"mapper-zoomtip");b.style.fontSize="13px";b.style.position="absolute";b.style.bottom=b.style.right="0";$WH.disableOldIESelect(b);this.span.appendChild(b)}this.sZoneLink=b=$WH.createTextGlow("");b.style.display="none";b.style.position="absolute";b.style.top=b.style.left="0";this.parent.appendChild(b);if(this.mouse){this.parent.onmouseout=(function(){this.timeout=setTimeout((function(){this.sMouse.style.display="none"}).bind(this),1)}).bind(this);this.parent.onmouseover=(function(){clearTimeout(this.timeout);this.sMouse.style.display=""}).bind(this);this.span.onmousemove=this.span.onmousedown=this.getMousePos.bind(this);this.sMouse=b=$WH.createTextGlow("(0.0, 0.0)");b.style.display="none";b.style.position="absolute";b.style.bottom=b.style.left="0";b.onmouseup=$WH.sp;$WH.disableOldIESelect(b);this.span.appendChild(b)}this.floorPins={};if(c.coords!=null){this.setCoords(c.coords)}else{if(c.link!=null){this.setLink(c.link)}}if(c.objectives){this.setObjectives(c.objectives)}if(c.zoneparent&&c.zones){this.setZones(c.zoneparent,c.zones)}this.updateMap(f)}Mapper.sizes=[[488,325,"normal"],[772,515,"zoom"],[1002,668,"original"],[224,149,"small"]];Mapper.zoneLevelOffset={};Mapper.multiLevelZones={};Mapper.zonePhased={};Mapper.garrisonLevelsToMapTiers={};Mapper.zoneDefaultLevel={};Mapper.remappedLevels={};Mapper.prototype={getMap:function(){return this.parent},update:function(c,j){if(c.zoom!=null){this.zoom=c.zoom}if(c.zone!=null){this.zone=c.zone}if(c.show!=null){this.show=c.show}this.pins=[];this.nCoords=0;for(var h in this.floorPins){if(this.floorPins[h].parentNode){$WH.de(this.floorPins[h])}}this.floorPins={};if(this.floorButton){$WH.de(this.floorButton);this.floorButton=null}var b=(c.level===undefined?0:this.fixLevel(parseInt(c.level),this.zone));if(!c.preservelevel){this.level=b}else{b=this.level}var f=$WH.isSet("g_mapperData")?g_mapperData:false;if(f&&f[this.zone]&&!c.coords){var l=f[this.zone];var g=-1;for(var h in l){if(!l.hasOwnProperty(h)){continue}var m=this.fixLevel(parseInt(h),this.zone);if(c.level===undefined&&l[h].count>g){b=parseInt(m);g=l[h].count}if(l[h].coords){this.setCoords(l[h].coords,m)}}this.level=b;if(this.floorPins[this.level]){$WH.ae(this.span,this.floorPins[this.level])}}else{if(c.coords!=null){var k=999;for(var h in c.coords){if(!c.coords.hasOwnProperty(h)){continue}var m=this.fixLevel(parseInt(h),this.zone);this.setCoords(c.coords[h],m);if(m<k){k=m}}if(k!=999&&!c.preservelevel){this.level=k}if(this.floorPins[this.level]){$WH.ae(this.span,this.floorPins[this.level])}}else{if(c.link!=null){this.setLink(c.link)}}}this.updateMap(j)},fixLevel:function(h,c){if(Mapper.remappedLevels[c]&&Mapper.remappedLevels[c].hasOwnProperty(h)){return Mapper.remappedLevels[c][h]}if(Mapper.multiLevelZones.hasOwnProperty(c)){var g=parseInt(Mapper.multiLevelZones[c][0].substr((""+c).length+1));var f;for(var b=1;b<Mapper.multiLevelZones[c].length;b++){f=parseInt(Mapper.multiLevelZones[c][b].substr((""+c).length+1));if(Math.abs(h-f)<Math.abs(h-g)){g=f}}return g}return h},getZone:function(){return this.zone},setZone:function(b,f,c){this.pins=[];this.nCoords=0;if(this.floorPins[this.level]){$WH.de(this.floorPins[this.level])}this.floorPins={};if(this.floorButton){$WH.de(this.floorButton);this.floorButton=null}this.zone=b;this.level=f||0;this.updateMap(c);return true},getFloorsMenu:function(){if(!Mapper.multiLevelZones[this.zone]){return null}var k=[];var f=Mapper.multiLevelZones[this.zone];var j=(Mapper.zonePhased[this.zone]?g_zone_phases:g_zone_areas);var g=(function(m){return m[0]==this.level||(this.level===undefined&&m[0]==0)}).bind(this);var l,h,c;for(var b=0;h=f[b];b++){if(h.indexOf("-")<0){l=b}else{l=h.substr(h.indexOf("-")+1)}if(!j[this.zone]){c=[l,(Mapper.zonePhased[this.zone]?"[Phase ":"[Level ")+l+"]",this.setMap.bind(this,h,l,true)]}else{if(!j[this.zone].hasOwnProperty(l)){continue}c=[l,j[this.zone][l],this.setMap.bind(this,h,l,true)]}c[MENU_IDX_OPT]={checkedFunc:g};k.push(c)}return k},setMap:function(c,f,l){if(f!=this.level){if(this.floorPins[this.level]){$WH.de(this.floorPins[this.level])}if(this.floorPins[f]){$WH.ae(this.span,this.floorPins[f])}this.level=f}var k=Locale.getName();if($WH.isPtr()){k="ptr"}else{if($WH.isBeta()){k="beta"}}this.span.style.background="url("+g_staticUrl+"/images/wow/maps/"+k+"/"+Mapper.sizes[this.zoom][2]+"/"+c+".jpg?"+g_wow_build+")";if(this.overlay){this.overlaySpan.style.background="url("+g_staticUrl+"/images/wow/maps/overlay/"+Mapper.sizes[this.zoom][2]+"/"+c+".png?"+g_wow_build+")"}if(this.sZoneLink&&!this.noZoneName){var j="";var h=parseInt(this.zone);var m=g_zones[h]!=null;var b=(Mapper.zonePhased[this.zone]?g_zone_phases:g_zone_areas);if(m){if(this.zoneLink){j+='<a href="/zone='+h+'">'+g_zones[h]+"</a>"}if(Mapper.multiLevelZones[h]){if(this.zoneLink){j+=": "}j+=(b[h]&&b[h][f])?b[h][f]:((Mapper.zonePhased[h]?"Phase ":"Level ")+f)}$WH.setInnerHtml(this.sZoneLink,j,"div");if(this.zoneLink){for(var g=0;g<9;++g){if(g==4){continue}this.sZoneLink.childNodes[g].firstChild.style.color="black"}}}this.sZoneLink.style.display=m?"":"none"}if(l){this.onMapUpdate&&this.onMapUpdate(this)}},setObjectives:function(k){var c={start:1,end:1,startend:1,sourcestart:1,sourceend:1};for(var n in k){var m=k[n];if(g_mapperData[n]===undefined){g_mapperData[n]={}}for(var f in m.levels){var b=m.levels[f];var j=ShowOnMap.combinePins(b);var g=j[0];g_mapperData[n][f]={count:g.length,coords:[]};for(var h=0;h<g.length;++h){var o=ShowOnMap.buildTooltip(g[h].list);g_mapperData[n][f].coords.push([g[h].coord[0],g[h].coord[1],{type:o[1],url:o[2],menu:o[3],label:o[0]}])}}}},setZones:function(p,q){p=$("#"+p);if(!p||!q||q.length==0||!this.objectives){return}var u=function(D,I,C,J){var H=[false,-1];for(var F=0;F<C.length;++F){if(F>0){w.append((F==C.length-1?LANG.and:LANG.comma))}var G=null;if(D.objectives[C[F][0]].mappable>0){G=$("<a/>",{href:"javascript:;",text:D.objectives[C[F][0]].zone});G.click(function(L,K){D.update({zone:K});$WH.setSelectedLink(L,"mapper")}.bind(D,G[0],C[F][0]));G.isLink=true}else{G=$("<a/>",{href:"/zone="+C[F][0],text:D.objectives[C[F][0]].zone});$WH.Tooltip.simple(G[0],LANG.tooltip_zonelink,"q")}if(q.length>1){var E=J[C[F][0]];if(E.start&&E.end){G.addClass("icontiny");G.css("background-image","url("+g_staticUrl+"/images/wow/icons/tiny/quest_startend.gif)");G.css("padding-left","20px")}else{if(E.start){G.addClass("icontiny");G.css("background-image","url("+g_staticUrl+"/images/wow/icons/tiny/quest_start.gif)");G.css("padding-left","14px")}else{if(E.end){G.addClass("icontiny");G.css("background-image","url("+g_staticUrl+"/images/wow/icons/tiny/quest_end.gif)");G.css("padding-left","16px")}}}}I.append(G);if(C[F][1]>H[1]){H=[G,C[F][1]]}}return H[0]};var m=function(C,G,F){var D=[];for(var E=0;E<C.length;++E){if(G[C[E][0]][F]){D.push(C[E])}}return D};var h={};var n={start:[],end:[],objective:[]};for(var f in this.objectives){if(h[f]===undefined){h[f]={}}var y=this.objectives[f];for(var r in y.levels){var c=y.levels[r];for(var v=0;v<c.length;++v){if(c[v].point=="start"||c[v].point=="sourcestart"){n.start.push(f);h[f].start=true}else{if(c[v].point=="end"||c[v].point=="sourceend"){n.end.push(f);h[f].end=true}else{if(c[v].point=="requirement"||c[v].point=="sourcerequirement"){n.objective.push(f);h[f].objective=true}}}}}}p.append($WH.getMajorHeading(LANG.mapper_relevantlocs,2,3));if(q.length==1&&this.missing==0){var w=$("<span/>",{html:LANG.mapper_entiretyinzone.replace("$$","<b>"+this.objectives[q[0][0]].zone+"</b>.")});p.append(w);this.update({zone:q[0][0]})}else{if(this.missing>0){var j=function(D,C){if(D.length!=C.length){return false}var G={};for(var F=D.length;F>=0;--F){G[D[F]]=true}for(var E=C.length;E>=0;--E){if(G[C[E]]===undefined){return false}}return true};var w=$("<span/>");var o=false,l=false,z=false;n.objective=$WH.arrayUnique(n.objective);n.start=$WH.arrayUnique(n.start);n.end=$WH.arrayUnique(n.end);var A=n.start.length>0&&j(n.start,n.end);var g=n.start.length>0&&j(n.start,n.objective);var s=n.end.length>0&&j(n.end,n.objective);var B=m(q,h,"objective");var b=m(q,h,"start");var k=m(q,h,"end");switch(true){case !!(A&&g):var t=LANG.mapper_happensin.split("$$");w.text(t[0]);o=u(this,w,q,h);w.append(t[1]);break;case !!(A&&n.objective.length==0):var t=LANG.mapper_objectives.sex.split("$$");w.text(t[0]);o=u(this,w,q,h);w.append(t[1]);break;case !!(A):var t=LANG.mapper_objectives.ox_sey.split("$$");w.text(t[0]);o=u(this,w,b,h);w.append(t[1]);l=u(this,w,B,h);w.append(t[2]);break;case !!(g&&n.end.length==0):var t=LANG.mapper_objectives.osx.split("$$");w.text(t[0]);o=u(this,w,q,h);w.append(t[1]);break;case !!(g):var t=LANG.mapper_objectives.osx_ey.split("$$");w.text(t[0]);o=u(this,w,B,h);w.append(t[1]);l=u(this,w,k,h);w.append(t[2]);break;case !!(s&&n.start.length==0):var t=LANG.mapper_objectives.oex.split("$$");w.text(t[0]);o=u(this,w,q,h);w.append(t[1]);break;case !!(s):var t=LANG.mapper_objectives.oex_sy.split("$$");w.text(t[0]);o=u(this,w,b,h);w.append(t[1]);l=u(this,w,B,h);w.append(t[2]);break;case !!(n.start.length>0&&n.end.length>0&&n.objective.length>0):var t=LANG.mapper_objectives.ox_sy_ez.split("$$");w.text(t[0]);o=u(this,w,b,h);w.append(t[1]);l=u(this,w,B,h);w.append(t[2]);z=u(this,w,k,h);w.append(t[3]);break;case !!(n.start.length>0&&n.end.length>0):var t=LANG.mapper_objectives.sx_ey.split("$$");w.text(t[0]);o=u(this,w,b,h);w.append(t[1]);l=u(this,w,k,h);w.append(t[2]);break;case !!(n.start.length>0&&n.objective.length>0):var t=LANG.mapper_objectives.ox_sy.split("$$");w.text(t[0]);o=u(this,w,b,h);w.append(t[1]);l=u(this,w,B,h);w.append(t[2]);break;case !!(n.end.length>0&&n.objective.length>0):var t=LANG.mapper_objectives.ox_ey.split("$$");w.text(t[0]);o=u(this,w,B,h);w.append(t[1]);l=u(this,w,k,h);w.append(t[2]);break;case (n.start.length>0):var t=LANG.mapper_objectives.sx.split("$$");w.text(t[0]);o=u(this,w,q,h);w.append(t[1]);break;case (n.end.length>0):var t=LANG.mapper_objectives.ex.split("$$");w.text(t[0]);o=u(this,w,q,h);w.append(t[1]);break;case (n.objective.length>0):var t=LANG.mapper_objectives.ox.split("$$");w.text(t[0]);o=u(this,w,q,h);w.append(t[1]);break;default:var t=LANG.mapper_happensin.split("$$");w.text(t[0]);o=u(this,w,q,h);w.append(t[1]);break}p.append(w);if(o&&o.isLink){o.click()}else{if(l&&l.isLink){l.click()}else{if(z&&z.isLink){z.click()}}}}else{var t=LANG.mapper_happensin.split("$$");var w=$("<span/>",{text:t[0]});var o=u(this,w,q,h);w.append(t[1]);p.append(w);if(o&&o.isLink){o.click()}}}},setSize:function(b,c){this.tempWidth=b;this.tempHeight=c;this.updateMap(true)},getZoom:function(){return this.zoom},setZoom:function(b,c){this.zoom=b;this.tempWidth=this.tempHeight=null;this.updateMap(c)},toggleZoom:function(b){this.zoom=1-this.zoom;this.zoom++;this.updateMap(true);if(b){this.getMousePos(b)}if(this.sZoom){if(this.sZoom.style.display=="none"){this.sZoom.style.display=""}else{this.sZoom.style.display="none"}}if(this.zoom){MapViewer.show({mapper:this,zoom:this.zoom})}},getShow:function(){return this.show},setShow:function(b){this.show=b;var f=this.show?"":"none";for(var c in this.floorPins){this.floorPins[c].style.display=f}this.sToggle.innerHTML=this.show?LANG.mapper_hidepins:LANG.mapper_showpins},toggleShow:function(){this.setShow(!this.show)},getCoords:function(){var b=[];for(var c in this.pins){if(!this.pins[c].free){b.push([this.pins[c].x,this.pins[c].y])}}return b},clearPins:function(){for(var b in this.pins){this.pins[b].style.display="none";this.pins[b].free=true}},setCoords:function(r,o){var b;var f,m;if(o===undefined){this.clearPins();if(r.length){m=true;f=0}else{for(var l in r){f=l;break}if(f==null){return}r=r[f]}f=parseInt(f);if(!m){f=this.fixLevel(f,this.zone);this.level=f}}else{f=o}this.nCoords=r.length;for(var l in r){var q=r[l],h=q[2];if(q[0]===undefined||q[1]===undefined){continue}b=this.getPin(f);b.x=q[0];b.y=q[1];b.style.left=b.x+"%";b.style.top=b.y+"%";if(this.editable){b.a.onmouseup=this.delPin.bind(this,b)}else{if(h&&h.url){b.a.href=Markup._fixUrl(h.url);b.a.rel="np"+(h.rel?"&"+h.rel:"");b.a.style.cursor="pointer"}}if(h&&h.tooltip){b.a.tt="";var n=false;for(var c in h.tooltip){if(b.a.tt!=""){b.a.tt+="<br />"}b.a.tt+='<b class="q">'+c+"</b> ($)<br />";for(var v in h.tooltip[c].info){b.a.tt+="<div>"+h.tooltip[c].info[v]+"</div>"}if(!n&&h.tooltip[c].footer){b.a.tt+=h.tooltip[c].footer+"<br />";n=true}}}else{if(h&&h.label){b.a.tt=h.label}else{if(h&&h.fixTooltip){b.a.rel=b.a.rel.replace(/^np&?/,"");$WH.dE(b.a,"mouseover",this.pinOver);$WH.dE(b.a,"mouseout",$WH.Tooltip.hide);b.a.tt="";if(typeof h.fixTooltip=="function"){b.a._fixTooltip=h.fixTooltip}}else{b.a.tt="$"}}}if(h&&h.menu){b.a.menu=h.menu;Menu.add(b.a,b.a.menu,{showAtCursor:true})}if(h&&h.type){b.className+=" pin-"+h.type}if(h&&h.mapicon){b.className+=" pin-object";b.a.style.backgroundPosition=(((h.mapicon+2)%8)*-16)+"px "+(Math.floor((h.mapicon+2)/8)*-16)+"px"}b.a.tt=$WH.stringReplace(b.a.tt,"$",b.x.toFixed(1)+", "+b.y.toFixed(1));if(h&&h.lines){for(var g=0,k=h.lines.length;g<k;++g){if(q[0]==h.lines[g][0]&&q[1]==h.lines[g][1]){continue}for(var u=0,j=Mapper.sizes.length;u<j;++u){var t=Mapper.sizes[u];b=Line(q[0]*t[0]/100,q[1]*t[1]/100,h.lines[g][0]*t[0]/100,h.lines[g][1]*t[1]/100,h.type);b.className+=" "+t[2];$WH.ae(this.floorPins[f],b)}}}}this.onPinUpdate&&this.onPinUpdate(this)},getLink:function(){var c="";for(var b in this.pins){if(!this.pins[b].free&&this.pins[b].floor==this.level){c+=(this.pins[b].x<10?"0":"")+(this.pins[b].x<1?"0":"")+(this.pins[b].x*10).toFixed(0)+(this.pins[b].y<10?"0":"")+(this.pins[b].y<1?"0":"")+(this.pins[b].y*10).toFixed(0)}}return(this.zone?this.zone:"")+(Mapper.multiLevelZones[this.zone]&&this.level!=0?"."+this.level:"")+(c?":"+c:"")},setLink:function(k,g,n){var m=[];k=k.split(":");var h=k[0];var b=0;if(h.indexOf(".")!=-1){var f=h.split(".");h=f[0];b=parseInt(f[1])}b=(n&&n!=-1&&!b)?n:b;if(!this.setZone(h,b,g)){return false}if(k.length==2){for(var c=0;c<k[1].length;c+=6){var l=k[1].substr(c,3)/10;var j=k[1].substr(c+3,3)/10;if(isNaN(l)||isNaN(j)){break}m.push([l,j])}}this.setCoords(m,b);return true},updateMap:function(c){this.parent.style.width=this.span.style.maxWidth=(this.tempWidth?this.tempWidth:Mapper.sizes[this.zoom][0])+"px";this.span.style.maxHeight=(this.tempHeight?this.tempHeight:Mapper.sizes[this.zoom][1])+"px";this.parent.setAttribute("data-mapsize",Mapper.sizes[this.zoom][2]);if(!this.editable){this.parent.style.cssFloat=this.parent.style.styleFloat="left"}if(this.zone=="0"){this.span.style.background="black"}else{var g=this.level;var f=this.zone+(g?"-"+g:"");if(Mapper.garrisonLevelsToMapTiers[this.zone]&&Mapper.garrisonLevelsToMapTiers[this.zone][g]){f=this.zone+"__"+Mapper.garrisonLevelsToMapTiers[this.zone][g]}this.setMap(f,g);if(!this.floorButton&&Mapper.multiLevelZones[this.zone]){var b;this.floorButton=b=$WH.createButton((Mapper.zonePhased[this.zone]?LANG.mapper_phase:LANG.mapper_floor));b.menu=this.getFloorsMenu();if(b.menu&&b.menu.length){Menu.add(b,b.menu,{showAtElement:true})}b.style["float"]="right";$WH.disableOldIESelect(b);this.buttonDiv.appendChild(b)}else{if(this.floorButton){this.floorButton.style.display=Mapper.multiLevelZones[this.zone]?"":"none"}}}if(this.sToggle){this.sToggle.style.display=(this.toggle&&this.nCoords?"":"none")}$(".line",this.floorPins[g]).hide();$(".line."+Mapper.sizes[this.zoom][2],this.floorPins[g]).show();this.onMapUpdate&&this.onMapUpdate(this)},cleanPin:function(c,f){var b=this.pins[c];b.style.display="";b.free=false;b.className="pin";b.a.onmousedown=$WH.rf;b.a.onmouseup=$WH.rf;b.a.href="javascript:;";b.a.style.cursor="default";b.floor=f;return b},getPin:function(g){for(var f=0;f<this.pins.length;++f){if(this.pins[f].free){return this.cleanPin(f,g)}}var c=$WH.ce("div"),b=$WH.ce("a");c.className="pin";c.appendChild(b);c.a=b;c.floor=g;$WH.aE(b,"mouseover",this.pinOver);$WH.aE(b,"mouseout",$WH.Tooltip.hide);b.onclick=$WH.sp;this.pins.push(c);this.cleanPin(this.pins.length-1,g);if(!this.floorPins[g]){this.floorPins[g]=$WH.ce("div");this.floorPins[g].style.display=this.show?"":"none";if(g==this.level){$WH.ae(this.span,this.floorPins[g])}}$WH.ae(this.floorPins[g],c);return c},addPin:function(c){c=$WH.normalizeEvent(c);if(c._button>=2){return}this.getMousePos(c);var b=this.getPin(this.level);b.x=this.mouseX;b.y=this.mouseY;b.style.left=b.x.toFixed(1)+"%";b.style.top=b.y.toFixed(1)+"%";b.a.onmouseup=this.delPin.bind(this,b);b.a.tt=b.x.toFixed(1)+", "+b.y.toFixed(1);this.onPinUpdate&&this.onPinUpdate(this);return false},delPin:function(b,c){c=$WH.normalizeEvent(c);b.style.display="none";b.free=true;$WH.sp(c);this.onPinUpdate&&this.onPinUpdate(this)},pinOver:function(){$WH.Tooltip.show(this,this.tt,4,0)},getMousePos:function(f){f=$WH.normalizeEvent(f);var g=$WH.ac(this.parent);var b=$WH.getScroll();this.mouseX=Math.floor((f.clientX+b.x-g[0]-3)/Mapper.sizes[this.zoom][0]*1000)/10;this.mouseY=Math.floor((f.clientY+b.y-g[1]-3)/Mapper.sizes[this.zoom][1]*1000)/10;if(this.mouseX<0){this.mouseX=0}else{if(this.mouseX>100){this.mouseX=100}}if(this.mouseY<0){this.mouseY=0}else{if(this.mouseY>100){this.mouseY=100}}if(this.mouse){$WH.setTextNodes(this.sMouse,"("+this.mouseX.toFixed(1)+", "+this.mouseY.toFixed(1)+")")}}};var g_zone_areas={};var MapViewer=new function(){var j,v,B,c,w,g,o,m,z,f,p,b,r,y,t;function l(){var C=Math.max(50,Math.min(618,$WH.getWindowSize().h-72));c=1;B=1;if(c>1){c=1}if(B>1){B=1}j=Math.round(B*Mapper.sizes[MapViewer.getZoom()][0]);v=Math.round(B*Mapper.sizes[MapViewer.getZoom()][1]);var D=Math.max(480,j);Lightbox.setSize(D+20,v+52)}function h(C){var D=function(G,F){F+=":"+G.zone;if(G.level){F+="."+G.level}return F};var E="#map";if(f){E+="="+w.getLink()}else{if(Mapper.zoneDefaultLevel[w.zone]){if(Mapper.zoneDefaultLevel[w.zone]!=w.level){E=D(w,E)}}else{if(w.level!=0){E=D(w,E)}else{if((!$WH.isSet("g_mapperData")||!g_mapperData[w.zone])&&(!$WH.isSet("g_mapper_data")||!g_mapper_data[w.zone])){E=D(w,E)}}}}return E}function u(){if(o){o(w)}location.replace(h(true))}function s(C){if(C&&(B==c)&&$WH.getWindowSize().h>b.offsetHeight){return}b.style.visibility="hidden";l(0);if(!C){if(!p){p=$WH.ce("div");p.style.height="325px";p.style.padding="3px";p.style.marginTop="10px"}w.parent.style.borderWidth="0px";w.parent.style.marginTop="0px";w.span.style.cursor="pointer";if(w.span.onclick){g=w.span.onclick}w.span.onclick=Lightbox.hide;w.span.onmouseover=function(){t.style.display="block"};w.span.onmouseout=function(){setTimeout(function(){if(!t.hasMouse){t.style.display="none"}},10)};if(w.onMapUpdate){o=w.onMapUpdate}w.onMapUpdate=u;if(!f){m=w.parent.parentNode;z=w.parent.nextSibling;m.insertBefore(p,w.parent);$WH.de(w.parent);$WH.ae(y,w.parent)}else{$WH.de(f);$WH.ae(y,f)}if(location.hash.indexOf("#show")==-1){location.replace(h(false))}else{if($WH.isSet("mapShower")){mapShower.onExpand()}}}Lightbox.reveal();b.style.visibility="visible"}function k(){s(1)}function q(){if(g){w.span.onclick=g}else{w.span.onclick=null}g=null;if(o){w.onMapUpdate=o}else{w.onMapUpdate=null}o=null;w.span.style.cursor="";w.span.onmouseover=null;w.span.onmouseout=null;if(!f){$WH.de(p);$WH.de(w.parent);w.parent.style.borderWidth="";w.parent.style.marginTop="";if(z){m.insertBefore(w.parent,z)}else{$WH.ae(m,w.parent)}m=z=null}else{$WH.de(f);f=null}w.toggleZoom();if(location.hash.indexOf("#show")==-1){$WH.clearHash()}else{if($WH.isSet("mapShower")){mapShower.onCollapse()}}}function A(D,F,E){w=E.mapper;b=D;if(F){D.className+=" mapviewer";r=$WH.ce("div");r.style.width=Mapper.sizes[MapViewer.getZoom()][0]+"px";r.style.height=Mapper.sizes[MapViewer.getZoom()][1]+"px";r.className="lightbox-content mapviewer-screen";t=$WH.ce("a");t.className="mapviewer-cover";t.href="javascript:;";t.onclick=Lightbox.hide;t.onmouseover=function(){t.hasMouse=true};t.onmouseout=function(){t.hasMouse=false};var H=$WH.ce("span");var C=$WH.ce("b");$WH.ae(C,$WH.ct(LANG.close));$WH.ae(H,C);$WH.ae(t,H);$WH.ae(r,t);y=$WH.ce("div");$WH.ae(r,y);$WH.ae(D,r);var G=$WH.ce("a");G.className="dialog-x fa fa-times";G.href="javascript:;";G.onclick=Lightbox.hide;$WH.ae(G,$WH.ct(LANG.close));$WH.ae(D,G)}n()}function n(){s()}this.checkPound=function(){if(location.hash&&location.hash.indexOf("#map")==0){var G=location.hash.split("=");if(G.length==2){var E=G[1];if(E){MapViewer.show({link:E})}}else{G=location.hash.split(":");var F=$WH.ge("sjdhfkljawelis");if(F){F.onclick()}if(G.length==2){if(!F){MapViewer.show({link:G[1]})}var C=G[1].split(".");var D={zone:C[0]};if(C.length==2){D.level=parseInt(C[1])+1}w.update(D)}}}};this.getZoom=function(){if(typeof this.zoom=="number"){return this.zoom}return 1};this.show=function(C){this.zoom=C.zoom;$WH.track.event("Zone Maps","Show",(C.link?C.link:"General"));if(C.link){f=$WH.ce("div");f.id="fewuiojfdksl";$WH.ae(document.body,f);var D=new Mapper({parent:f.id});D.setLink(C.link,true);D.toggleZoom()}else{Lightbox.show("mapviewer",{onShow:A,onHide:q,onResize:k},C)}};$(document).ready(this.checkPound)};var MARKUP_MODE_COMMENT=1,MARKUP_MODE_ARTICLE=2,MARKUP_MODE_QUICKFACTS=3,MARKUP_MODE_SIGNATURE=4,MARKUP_MODE_REPLY=5,MARKUP_CLASS_ADMIN=40,MARKUP_CLASS_STAFF=30,MARKUP_CLASS_PREMIUM=20,MARKUP_CLASS_USER=10,MARKUP_CLASS_PENDING=1;var MARKUP_SOURCE_LIVE=1,MARKUP_SOURCE_PTR=2,MARKUP_SOURCE_BETA=3;var MarkupModeMap={};MarkupModeMap[MARKUP_MODE_COMMENT]="comment";MarkupModeMap[MARKUP_MODE_REPLY]="reply";MarkupModeMap[MARKUP_MODE_ARTICLE]="article";MarkupModeMap[MARKUP_MODE_QUICKFACTS]="quickfacts";MarkupModeMap[MARKUP_MODE_SIGNATURE]="signature";var MarkupSourceMap={};MarkupSourceMap[MARKUP_SOURCE_LIVE]="live";MarkupSourceMap[MARKUP_SOURCE_PTR]="ptr";MarkupSourceMap[MARKUP_SOURCE_BETA]="beta";var MarkupIconPath="";var MarkupDomainRegexMap={betaPtrLang:/^(beta|legion|wod|mop|ptr|www|ko|fr|de|cn|es|ru|pt|it)$/,lang:/^(www|ko|fr|de|cn|es|ru|pt|it)$/};var Markup={MODE_COMMENT:MARKUP_MODE_COMMENT,MODE_REPLY:MARKUP_MODE_REPLY,MODE_ARTICLE:MARKUP_MODE_ARTICLE,MODE_QUICKFACTS:MARKUP_MODE_QUICKFACTS,MODE_SIGNATURE:MARKUP_MODE_SIGNATURE,SOURCE_LIVE:MARKUP_SOURCE_LIVE,SOURCE_PTR:MARKUP_SOURCE_PTR,SOURCE_BETA:MARKUP_SOURCE_BETA,CLASS_ADMIN:MARKUP_CLASS_ADMIN,CLASS_STAFF:MARKUP_CLASS_STAFF,CLASS_PREMIUM:MARKUP_CLASS_PREMIUM,CLASS_USER:MARKUP_CLASS_USER,CLASS_PENDING:MARKUP_CLASS_PENDING,whitelistedWebsites:[/(.*\.)?wowhead.com/i,/(.*\.)?thottbot.com/i,/(.*\.)?torhead.com/i,/(.*\.)?mmoui.com/i,/(.*\.)?tankspot.com/i,/(.*\.)?guildfans.com/i,/(.*\.)?allakhazam.com/i,/(.*\.)?zam.com/i,/(.*\.)?blizzard.com/i,/(.*\.)?worldofwarcraft.com/i,/(.*\.)?wow-europe.com/i,/(.*\.)?battle.net/i,/(.*\.)?sc2ranks.com/i,/(.*\.)?torchlightarmory.com/i,/(.*\.)?vindictusdb.com/i,/(.*\.)?wowinterface.com/i,/(.*\.)?vginterface.com/i,/(.*\.)?lotrointerface.com/i,/(.*\.)?eq2interface.com/i,/(.*\.)?eqinterface.com/i,/(.*\.)?mmo-champion.com/i,/(.*\.)?joystiq.com/i,/(.*\.)?wow-heroes.com/i,/(.*\.)?be-imba.hu/i,/(.*\.)?wowpedia.org/i,/(.*\.)?curse.com/i,/(.*\.)?elitistjerks.com/i,/(.*\.)?wowwiki.com/i,/(.*\.)?worldoflogs.com/i,/(.*\.)?wowinsider.com/i,/(.*\.)?guildwork.com/i,/(.*\.)?hearthhead\.com/i],rolesToClass:function(b){if(b&(U_GROUP_ADMIN|U_GROUP_VIP|U_GROUP_DEV)){return Markup.CLASS_ADMIN}else{if(b&U_GROUP_STAFF){return Markup.CLASS_STAFF}else{if(b&U_GROUP_PREMIUM){return Markup.CLASS_PREMIUM}else{if(b&U_GROUP_PENDING){return Markup.CLASS_PENDING}else{return Markup.CLASS_USER}}}}},defaultSource:false,nameCol:"name_enus",domainToLocale:{www:"enus",live:"enus",ptr:"ptr",beta:"beta",legion:"beta",wod:"enus",mop:"enus",fr:"frfr",de:"dede",es:"eses",ru:"ruru",pt:"ptbr",it:"itit",cn:"zhcn",ko:"kokr"},maps:[],firstTags:{},postTags:[],collectTags:{},excludeTags:{},tooltipTags:{},tooltipBare:{},attributes:{id:{req:false,valid:/^[a-z0-9_-]+$/i},title:{req:false,valid:/[\S ]+/},"class":{req:false,valid:/\S+/}},counts:{},timers:{spoilers:null},youTube:{players:[],apiReady:false,onClick:function(c){if(!Markup.youTube.players[c]){if(typeof console!="undefined"&&console&&typeof console.error=="function"){console.error("YouTube embed options not found!")}return}if(Markup.youTube.players[c].loaded){return}if(!Markup.youTube.apiReady){setTimeout(Markup.youTube.onClick.bind(this),50);return}var b=$WH.ge(Markup.youTube.players[c].containerId);if(!b){if(typeof console!="undefined"&&console&&typeof console.error=="function"){console.error("YouTube embed container vanished!")}return}this.className+=" wh-youtube-loaded";Markup.youTube.players[c].loaded=true;Markup.youTube.players[c].player=new YT.Player(this.firstChild,Markup.youTube.players[c].yt)}},callbacks:{idSequence:0,getCallbackElementId:function(){return"markup-callback-"+(++Markup.callbacks.idSequence)}},IsLinkAllowed:function(g){var h=g.match("[a-z]+://([a-z0-9.-]+)");if(!h){return true}var b=h[1];var j=false;for(var c in Markup.whitelistedWebsites){var f=Markup.whitelistedWebsites[c];if(b.search(f)==0){j=true}}return j},getAutoIncrementCount:function(b){if(!Markup.counts[b]){Markup.counts[b]=0}Markup.counts[b]++;return Markup.counts[b]},tags:{"<text>":{empty:true,noHelp:true,allowInReplies:true,toHtml:function(c,b){b=b||$.noop;if(c._text==" "&&!b.noNbsp){c._text="&nbsp;"}c._text=c._text.replace(/\\\[/g,"[");if(b&&b.noLink){return c._text}else{if(b&&b.needsRaw){return c._rawText}else{var g=[];var h=Markup._preText(c._rawText.replace(/(https?:\/\/|www\.)([\/_a-z0-9\%\?#@\-\+~&=;:'|]|\.[a-z0-9\-])+/gi,function(j){matchUrl=Markup._preText(j.replace(/^www/,"http://www"));j=Markup._preText(j);var k=g.length;g.push([matchUrl,j]);return"$L"+k}));h=h.replace(/\$L([\d+]) /gi,"$L$1&nbsp;");for(var f in g){h=h.replace("$L"+f,function(k){if(Markup.allow<Markup.CLASS_USER&&!Markup.IsLinkAllowed(g[f][0])){return $WH.sprintf('<span class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, LANG.linkremoved_tip, 0, 0, \'q\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">[$1]</span>',LANG.linkremoved)}var j='<a href="'+g[f][0]+'"';if(Markup._isUrlExternal(g[f][0])){j+=' target="_blank"'}j+=">"+g[f][1]+"</a>";return j})}return h}}},toText:function(b){return b._text}},achievement:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},diff:{req:false,valid:/^[0-9]+$/},diffnew:{req:false,valid:/^[12]$/},icon:{req:false,valid:/^false$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},tempname:{req:false}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(c){var l=c.unnamed;var k=Markup._getDatabaseDomainInfo(c);var h=k[0];var j=k[1];var b=[];var g=null;if(c.diff){b.push("diff="+c.diff)}if(c.diffnew){b.push("diffnew="+c.diffnew)}if(c.tempname){g=c.tempname}if(g_achievements[l]&&g_achievements[l][j]){var f=g_achievements[l];return'<a href="'+h+"/achievement="+l+'"'+(b.length?' rel="'+b.join("&")+'"':"")+(!c.icon?' class="icontiny"><img src="'+g_staticUrl+"/images/wow/icons/tiny/"+f.icon.toLowerCase()+'.gif"':"")+Markup._addGlobalAttributes(c)+' align="absmiddle" /> <span class="tinyicontxt">'+Markup._safeHtml(f[j])+"</span></a>"}return'<a href="'+h+"/achievement="+l+'"'+(b.length?' rel="'+b.join("&")+'"':"")+Markup._addGlobalAttributes(c)+">"+(g?g:("("+LANG.types[10][0]+" #"+l+")"))+"</a>"},toText:function(b){var h=b.unnamed;var g=Markup._getDatabaseDomainInfo(b);var c=g[0];var f=g[1];if(g_achievements[h]&&g_achievements[h][f]){return Markup._safeHtml(g_achievements[h][f])}return LANG.types[10][0]+" #"+h}},achievementpoints:{empty:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){var c='<span class="moneyachievement tip" onmouseover="Listview.funcBox.moneyAchievementOver(event)" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"'+Markup._addGlobalAttributes(b)+">"+b.unnamed+"</span>";return c}},affix:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},diff:{req:false,valid:/^[0-9]+$/},diffnew:{req:false,valid:/^[12]$/},tempname:{req:false}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(c){var l=c.unnamed;var k=Markup._getDatabaseDomainInfo(c);var g=k[0];var h=k[1];var b=[];var f=null;if(c.diff){b.push("diff="+c.diff)}if(c.diffnew){b.push("diffnew="+c.diffnew)}if(c.tempname){f=c.tempname}if(g_affixes[l]&&g_affixes[l][h]){var j=g_affixes[l];return'<a href="'+g+"/affix="+l+'"'+(b.length?' rel="'+b.join("&")+'"':"")+(!c.icon?' class="icontiny"><img src="'+g_staticUrl+"/images/wow/icons/tiny/"+j.icon.toLowerCase()+'.gif" align="absmiddle"':"")+Markup._addGlobalAttributes(c)+"> "+Markup._safeHtml(j[h])+"</a>"}return'<a href="'+g+"/affix="+l+'"'+(b.length?' rel="'+b.join("&")+'"':"")+Markup._addGlobalAttributes(c)+">"+(f?f:("("+LANG.types[40][0]+" #"+l+")"))+"</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_affixes[g]&&g_affixes[g][c]){return Markup._safeHtml(g_affixes[g][c])}return LANG.types[40][0]+" #"+g}},anchor:{empty:true,ltrim:true,rtrim:true,attr:{unnamed:{req:false,valid:/\S+/}},validate:function(b){if(!b.unnamed&&!b.id){return false}return true},toHtml:function(b){if(!b.unnamed&&b.id){b.unnamed=b.id;b.id=null}return'<a name="'+b.unnamed+'"'+Markup._addGlobalAttributes(b)+"></a>"}},artifactcalc:{empty:true,attr:{unnamed:{req:true,valid:/^#?[\/a-zA-Z0-9_-]+$/},editable:{req:false,valid:/^true$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},artifactcalcDivsOnPage:0,artifactcalcObjects:{},toHtml:function(b){var l=Markup._getDatabaseDomainInfo(b);this.artifactcalcDivsOnPage++;var c="markup-artifactcalc-"+this.artifactcalcDivsOnPage;var h=this;var k={id:c,embedded:true,markup:true,hash:b.unnamed.replace(/^#+/,""),editable:b.editable=="true",dataDomain:l[0]};var j=(function(f){var m=function(){if((!$WH.ge("markup-artifactcalc-"+f))||(!$WH.isSet("ArtifactCalc"))){window.setTimeout(m,250);return}h.artifactcalcObjects[f]=new ArtifactCalc(k)};return m})(this.artifactcalcDivsOnPage);if(this.artifactcalcDivsOnPage==1&&!$WH.isSet("ArtifactCalc")){$WH.loadAssets("artifact-weapon-calc",j)}else{j()}var g="artifactcalc-markup-parent";return'<div id="'+c+'" class="'+g+'"></div>'}},acronym:{empty:false,attr:{unnamed:{req:true}},toHtml:function(b){return['<span class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, \''+Markup._safeHtml(b.unnamed)+'\', 0, 0, \'q1\');" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()" '+Markup._addGlobalAttributes(b)+">","</span>"]}},b:{empty:false,allowInReplies:true,toHtml:function(b){return["<b"+Markup._addGlobalAttributes(b)+">","</b>"]},fromHtml:function(b){return b.replace(/<(b|big|strong)\b[\s\S]*?>([\s\S]*?)<\/\1>/gi,"[b]$2[/b]")}},blip:{empty:true,attr:{unnamed:{req:true,valid:/\S+/}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){var c="http://blip.tv/play/"+b.unnamed;var g=600;var h=368;var f="";f+='<embed width="'+g+'" height="'+h+'" src="'+c+'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="opaque"></embed>';return f}},bluetweet:{empty:true,ltrim:true,attr:{id:{req:true,valid:/^[0-9]+$/}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){if(g_bluetweets[b.id]&&g_bluetweets[b.id].id){return Markup.CreateTweet(g_bluetweets[b.id]).outerHTML}return'<a href="https://twitter.com/wowheadtweets/status/'+b.id+'" class="full-tweet">Tweet #'+b.id+"</a>"}},br:{empty:true,toHtml:function(b){return"<br />"},fromHtml:function(b){return b.replace(/<br\b[\s\S]*?>/gi,"\n")}},building:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},nolvl:{req:false,valid:/^true$/},"short":{req:false,valid:/^true$/},side:{req:false,valid:/^1|2$/}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(k){var f=k.unnamed;var h=Markup._getDatabaseDomainInfo(k);var c=h[0];var m=h[1];if(g_buildings[f]&&g_buildings[f][m]){var n=g_buildings[f];var b=n[m];var j=k["short"]?LANG.traits["level"][2]:LANG.level;if(k.side){var l=new RegExp(k.side==1?" \\/ .+$":"[^\\/]+ \\/ ");b=b.replace(l,"")}else{if(k["short"]){if(g_garrison_building_short_names.hasOwnProperty(f)){b=g_garrison_building_short_names[f]}}}var g=(!k.nolvl&&n.hasOwnProperty("level"))?j+" "+n.level+" ":"";return'<a href="'+c+"/building="+f+'"'+Markup._addGlobalAttributes(k)+">"+g+Markup._safeHtml(b)+"</a>"}return'<a href="'+c+"/building="+f+'"'+Markup._addGlobalAttributes(k)+">("+LANG.types[20][0]+" #"+f+")</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_buildings[g]&&g_buildings[g][c]){return Markup._safeHtml(g_buildings[g][c])}return LANG.types[20][0]+" #"+g}},"class":{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},icon:{req:false,valid:/^false$/i},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}if(b.unnamed>=1&&b.unnamed<=12){return true}return false},toHtml:function(b){var j=b.unnamed;var h=Markup._getDatabaseDomainInfo(b);var f=h[0];var g=h[1];if(g_classes[j]&&g_classes[j][g]){var c=g_classes[j];return'<a href="'+f+"/class="+j+'"'+(!b.icon?' class="icontiny c'+j+'"><img src="'+g_staticUrl+"/images/wow/icons/tiny/"+g_classes.getIcon(j)+'.gif"':"")+Markup._addGlobalAttributes(b)+' align="absmiddle" /> <span class="tinyicontxt">'+Markup._safeHtml(c[g])+"</span></a>"}return'<a href="'+f+"/class="+j+'" class="c'+j+'"'+Markup._addGlobalAttributes(b)+">("+LANG.types[13][0]+" #"+j+")</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_classes[g]&&g_classes[g][c]){return Markup._safeHtml(g_classes[g][c])}return LANG.types[13][0]+" #"+g}},chart:{empty:true,allowedClass:MARKUP_CLASS_STAFF,attr:{id:{req:true,valid:/^\d+$/},type:{req:true,valid:/^barpercent|pie|rank|rankpercent$/},width:{req:false,valid:/^\d+$/},height:{req:false,valid:/^\d+$/},credits:{req:false,valid:/^profiler|none$/},sort:{req:false,valid:/^asc|desc$/}},toHtml:function(C){var u;if(!g_charts.hasOwnProperty(C.id)){u='<div class="highchart '+C.type+'" style="border: 1px solid #CCC;';if(C.width){u+="width: "+C.width+"px;"}if(C.height){u+="height: "+C.height+"px"}u+='">(Chart '+C.id+" not found)</div>";return u}var b=Locale.getName();var y={};if(!C.credits||C.credits=="profiler"){y.href="/list";y.text=LANG.message_poweredbyprofiler}if(C.credits=="none"){y.enabled=false}switch(C.type){case"rank":case"rankpercent":var f=g_charts[C.id];var l,j=f[0].keyType;if(j&&j in g_types){l="/"+g_types[j]+"="}var m,w,g,h,F=(f[0].keyType&&g_gathered_types.hasOwnProperty(f[0].keyType))?g_gathered_types[f[0].keyType]:{};var n=[];for(var E in f[0].data){n.push(E)}n.sort(function(o,k){return $WH.stringCompare(f[0].data[o],f[0].data[k])});if(C.sort=="desc"){n.reverse()}else{if(!C.sort){if(f[1].data){if(f[0].data[n[0]]/f[1].data>0.5){n.reverse()}}}}u='<div style="display: inline-block;';if(C.width){u+=" width: "+C.width+"px;"}u+='"><ol>';for(var s=0;s<n.length;s++){E=n[s];h=false;m=E;w="";g="";if(F.hasOwnProperty(parseInt(E,10))){h=F[parseInt(E,10)];m=h.hasOwnProperty("name_"+b)?h["name_"+b]:E;w=h.hasOwnProperty("quality")?h.quality:"";g=h.hasOwnProperty("icon")?h.icon:""}u+="<li>";if(g){g='<img align="absmiddle" src="'+g_staticUrl+"/images/wow/icons/tiny/"+g+'.gif">&nbsp;'}if(l){u+='<a href="'+l+E+'" class="q'+w+(g?" icontiny":"")+'">'+g+m+"</a>"}else{u+='<span class="q'+w+'">'+g+m+"</span>"}if(C.type=="rankpercent"&&f[1].data){u+=' <small class="q0">'+$WH.sprintf(LANG.qty,(f[0].data[E]/f[1].data*100).toFixed(4)+"%")+"</small>"}u+="</li>"}u+="</ol>";if(y.text){u+='<div style="position: relative; top: -12px; text-align: right; font-size: 10px">';if(y.href){u+='<a href="'+y.href+'" class="q0">'+y.text+"</a>"}else{u+='<span class="q0">'+y.text+"</span>"}u+="</div>"}u+="</div>";return u;break}if(!$WH.isSet("g_highcharts")){g_highcharts={charts:[],divIndex:0,pending:undefined};$WH.ajaxIshRequest(g_staticUrl+"/js/highcharts.js",true);g_highcharts.ShowCharts=function(o){if(o){g_highcharts.pending=undefined}else{if(typeof g_highcharts.pending!="undefined"){return}}var I=false;if($WH.isSet("Highcharts")){for(var k=0;k<g_highcharts.charts.length;k++){if(g_highcharts.charts[k].rendered){continue}if($(g_highcharts.charts[k].container).length==0){I=true;continue}$(g_highcharts.charts[k].container).highcharts(g_highcharts.charts[k].chart);g_highcharts.charts[k].rendered=true}}else{I=true}if(I){g_highcharts.pending=window.setTimeout(g_highcharts.ShowCharts,250,true);return}}}var t="highchart-markup-"+(g_highcharts.divIndex++);u='<div class="highchart '+C.type+'" id="'+t+'" style="';if(C.width){u+="width: "+C.width+"px;"}if(C.height){u+="height: "+C.height+"px"}u+='"></div>';switch(C.type){case"barpercent":var f=g_charts[C.id];var c=(f[0].keyType&&g_types.hasOwnProperty(f[0].keyType))?g_types[f[0].keyType]:false;var z={container:"#"+t,chart:{}};z.chart={credits:y,chart:{type:"bar",backgroundColor:"#242424",plotBorderWidth:0,style:{fontFamily:"Open Sans"}},plotOptions:{bar:{borderWidth:0,dataLabels:{color:"#ddd",style:{textShadow:"none"}}}},xAxis:{categories:[],labels:{style:{color:"#CCC"}},gridLineColor:"#404040",lineColor:"#404040",tickColor:"#404040"},yAxis:{min:0,max:100,title:{enabled:false},gridLineColor:"#404040",lineColor:"#404040",tickColor:"#404040"},legend:{enabled:false},title:{text:""},tooltip:{formatter:function(){var I=this.x+": "+this.y+"%";if(c){var J=(c in g_completion)?g_completion[c]:false;for(var K in g_user.lists){var k=g_user.lists[K];if(!(k.id in J)){continue}var o=($WH.inArray(J[k.id],this.point.id)!=-1);I+='<br><span class="progress-icon '+(o?"progress-8":"progress-0")+'"></span> ';I+=k.character+" - "+k.realm+" "+k.region}}return I},useHTML:true,backgroundColor:"rgba(36, 36, 36, 0.85)",style:{color:"#ccc"}},series:[{data:[],events:{click:function(k){if(g_charts[C.id][0].keyType){location.href="/"+g_types[g_charts[C.id][0].keyType]+"="+k.point.series.data[k.point.x].id}}}}]};var F=(f[0].keyType&&g_gathered_types.hasOwnProperty(f[0].keyType))?g_gathered_types[f[0].keyType]:{};var v,H=[];if(c&&$WH.isSet("g_completion")&&g_completion.hasOwnProperty(c)&&g_user.hasOwnProperty("lists")&&g_user.lists&&g_user.lists.length){for(var s=0;s<g_user.lists.length;s++){v=""+g_user.lists[s].id;if((g_user.lists[s].pinned>0)&&g_completion[c].hasOwnProperty(v)){H=g_completion[c][v];if(g_user.lists[s].pinned>1){break}}}}var G=[];for(var E in f[0].data){if(!f[0].data.hasOwnProperty(E)){continue}G.push({k:E,v:f[0].data[E]})}G.sort(function(o,k){return $WH.stringCompare(k.v,o.v)});if(C.sort=="asc"){G.reverse()}for(var s=0;s<G.length;s++){var D=G[s];var h=F.hasOwnProperty(D.k)?F[D.k]["name_"+b]:D.k;var A={id:D.k,y:Math.round(D.v/f[1].data*100)};if(H.indexOf(parseInt(A.id,10))!=-1){A.color="#7CECB5"}z.chart.xAxis.categories.push(h);z.chart.series[0].data.push(A)}g_highcharts.charts.push(z);break;case"pie":var z={container:"#"+t,chart:{}};z.chart={credits:y,chart:{type:"pie",backgroundColor:"#242424",plotBorderWidth:0,style:{fontFamily:"Open Sans"}},plotOptions:{pie:{borderColor:"#242424",dataLabels:{color:"#ddd",style:{textShadow:"none"}}}},legend:{enabled:false},title:{text:""},tooltip:{formatter:function(){return this.point.name+": "+Math.round(this.y)+"%"},backgroundColor:"rgba(36, 36, 36, 0.85)",style:{color:"#ccc"}},series:[{data:[]}]};var f=g_charts[C.id];var G=[];var p=0,B=true;var h,F=(f[0].keyType&&g_gathered_types.hasOwnProperty(f[0].keyType))?g_gathered_types[f[0].keyType]:{};if(f[0].keyType==14){$WH.cO(F,F);var r={24:LANG.som_legend_neutral,25:LANG.som_legend_alliance,26:LANG.som_legend_horde};for(var q in r){if(!r.hasOwnProperty(q)){continue}if(F.hasOwnProperty(q)&&F[q].hasOwnProperty("name_"+b)){F[q]["name_"+b]+=LANG.wordspace+LANG.parens_open+r[q]+LANG.parens_close}}}for(var E in f[0].data){if(!f[0].data.hasOwnProperty(E)){continue}p+=f[0].data[E];B&=!isNaN(E)&&(E!="0");h=F.hasOwnProperty(E)?F[E]["name_"+b]:E;G.push({k:E,keyName:h,v:f[0].data[E]})}if(!isNaN(f[1].data)&&(p/f[1].data<0.98)){G.push({k:B?0:"Other",v:f[1].data-p})}if(F){G.sort(function(o,k){return $WH.stringCompare(k.v,o.v)||$WH.stringCompare(o.keyName,k.keyName)})}else{G.sort(function(o,k){return $WH.stringCompare(o.keyName,k.keyName)||$WH.stringCompare(k.v,o.v)})}for(var s=0;s<G.length;s++){var D=G[s];z.chart.series[0].data.push({id:D.k,name:D.keyName,y:(D.v/f[1].data*100)})}g_highcharts.charts.push(z);break;default:u="<div>(Chart type "+C.type+" unknown)</div>";break}g_highcharts.ShowCharts();return u}},champion:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9\.]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},level:{req:false,valid:/^[0-9:]+$/},quality:{req:false,valid:/^[2345]$/},abilities:{req:false,valid:/^[0-9:]+$/},diff:{req:false,valid:/^[0-9]+$/},diffnew:{req:false,valid:/^[12]$/},tempname:{req:false}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(j){var g=j.unnamed;var h=Markup._getDatabaseDomainInfo(j);var f=h[0];var l=h[1];var p=[];var k=null;if(j.diff){p.push("diff="+j.diff)}if(j.diffnew){p.push("diffnew="+j.diffnew)}if(j.quality){p.push("q="+j.quality)}if(j.level){p.push("level="+j.level)}if(j.abilities){p.push("abil="+j.abilities)}if(j.tempname){k=j.tempname}var o=parseInt(g);if(g_champions[o]&&g_champions[o][l]){var c=g_champions[o];var n=c.quality;if(j.quality){n=j.quality}if(!j.hasOwnProperty("class")){j["class"]="q"+n}else{if(!/\bq\d\b/.test(j["class"])){j["class"]+=" q"+n}}var b=c[l];var m;if((m=b.indexOf(" / "))!=-1){if(/\.1$/.test(g)){b=b.substr(0,m)}else{if(/\.2$/.test(g)){b=b.substr(m+3)}}}return'<a href="'+f+"/champion="+g+'"'+(p.length?' rel="'+p.join("&")+'"':"")+Markup._addGlobalAttributes(j)+">"+Markup._safeHtml(b)+"</a>"}return'<a href="'+f+"/champion="+g+'"'+(p.length?' rel="'+p.join("&")+'"':"")+Markup._addGlobalAttributes(j)+">"+(k?k:("("+LANG.types[28][0]+" #"+g+")"))+"</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_champions[g]&&g_champions[g][c]){return Markup._safeHtml(g_champions[g][c])}return LANG.types[28][0]+" #"+g}},changelog:{empty:false,allowedClass:MARKUP_CLASS_STAFF,attr:{open:{req:false,valid:/^true$/}},toHtml:function(b){var f='<a id="revealtoggle-changelog" class="revealtoggle changelog" href="javascript:;" onclick="Markup.toggleReveal(\'changelog\');">Show Changelog</a>';var c="display: none";if(b.open=="true"){f=c=""}return['<div style="margin: 1em 0" id="guide-changelog"><div id="reveal-changelog" style="'+c+'"><h3 class="heading-size-3">Changelog</h3>',"</div>"+f+"</div>"]}},code:{block:true,empty:false,rtrim:true,itrim:true,helpText:true,allowedChildren:{"<text>":1},toHtml:function(b){var c='<pre class="code';if(b.first){c+=" first"}if(b.last){c+=" last"}c+='"'+Markup._addGlobalAttributes(b)+">";return[c,"</pre>"]}},color:{empty:false,attr:{unnamed:{req:true,valid:/^.*/i}},allowedClass:MARKUP_CLASS_STAFF,extraColors:{deathknight:"c6",dk:"c6",druid:"c11",hunter:"c3",mage:"c8",monk:"c10",paladin:"c2",priest:"c5",rogue:"c4",shaman:"c7",warlock:"c9",warrior:"c1",poor:"q0",common:"q1",uncommon:"q2",rare:"q3",epic:"q4",legendary:"q5",artifact:"q6",heirloom:"q7",wowtoken:"q8"},toHtml:function(b){var f=/^(aqua|black|blue|fuchsia|gray|green|lightblue|lime|maroon|navy|olive|purple|red|silver|teal|white|yellow|c\d+|r\d+|q\d*?|#[a-f0-9]{6})$/i;var g="<span ";if(b.unnamed.match(f)){if(b.unnamed=="#00C0FF"){g+='class="blizzard-blue"'+Markup._addGlobalAttributes(b)}else{var c=b.unnamed.charAt(0);g+=((c=="q"||c=="c"||(c=="r"&&b.unnamed!="red"))?'class="':'style="color: ')+b.unnamed+'"'+Markup._addGlobalAttributes(b)}}else{if(Markup.tags.color.extraColors[b.unnamed]){g+='class = "'+Markup.tags.color.extraColors[b.unnamed]+'"'}}g+=">";return[g,"</span>"]}},currency:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},amount:{req:false,valid:/^[0-9\:]+$/},icon:{req:false,valid:/^false$/i},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(b){var j=b.unnamed;var h=Markup._getDatabaseDomainInfo(b);var c=h[0];var f=h[1];if(g_gatheredcurrencies[j]&&g_gatheredcurrencies[j][f]){var g=g_gatheredcurrencies[j];if(b.amount){return'<a href="'+c+"/currency="+j+'"'+(!b.icon?' class="icontinyr tip q1" onmouseover="$WH.Tooltip.showAtCursor(event, \''+Markup._safeHtml(g[f])+'\', 0, 0, \'q1\');" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()" style="background-image:url('+g_staticUrl+"/images/wow/icons/tiny/"+g.icon[0].toLowerCase()+".gif)":"")+Markup._addGlobalAttributes(b)+'"> <span class="tinyicontxt">'+b.amount.split(":").join(" - ")+"</span></a>"}else{return'<a href="'+c+"/currency="+j+'"'+(!b.icon?' class="icontiny q1"><span><img src="'+g_staticUrl+"/images/wow/icons/tiny/"+g.icon[0].toLowerCase()+'.gif"':"")+Markup._addGlobalAttributes(b)+' align="absmiddle" /> <span class="tinyicontxt">'+Markup._safeHtml(g[f])+"</a>"}}return'<a href="'+c+"/currency="+j+'"'+Markup._addGlobalAttributes(b)+">("+LANG.types[17][0]+" #"+j+")</a>"+(b.amount>0?" x"+b.amount:"")},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_gatheredcurrencies[g]&&g_gatheredcurrencies[g][c]){return Markup._safeHtml(g_gatheredcurrencies[g][c])}return LANG.types[17][0]+" #"+g}},db:{empty:true,attr:{unnamed:{req:true,valid:/^(live|ptr|beta|legion|wod|mop)$/}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){if(b.unnamed=="live"||b.unnamed=="mop"||b.unnamed=="wod"){Markup.defaultSource=Markup.SOURCE_LIVE}else{if(b.unnamed=="ptr"&&$WH.ptrIsActive()){Markup.defaultSource=Markup.SOURCE_PTR}else{if((b.unnamed=="beta"||b.unnamed=="legion")&&$WH.betaIsActive()){Markup.defaultSource=Markup.SOURCE_BETA}}}return""},toText:function(b){if(b.unnamed=="live"||b.unnamed=="mop"||b.unnamed=="wod"){Markup.defaultSource=Markup.SOURCE_LIVE}else{if(b.unnamed=="ptr"&&$WH.ptrIsActive()){Markup.defaultSource=Markup.SOURCE_PTR}else{if((b.unnamed=="beta"||b.unnamed=="legion")&&$WH.betaIsActive()){Markup.defaultSource=Markup.SOURCE_BETA}}}return""}},del:{empty:false,attr:{copy:{req:false,valid:/^true$/}},toHtml:function(b){var c='<del class="diffmod"'+Markup._addGlobalAttributes(b);if(!b.copy){c+=' unselectable="on"'}c+=">";return[c,"</del>"]}},div:{empty:false,block:true,ltrim:true,rtrim:true,itrim:true,attr:{clear:{req:false,valid:/^(left|right|both)$/i},unnamed:{req:false,valid:/^hidden$/i},"float":{req:false,valid:/^(left|right)$/i},align:{req:false,valid:/^(left|right|center)$/i},margin:{req:false,valid:/^\d+$/},style:{req:false,valid:/^[^"<>]+$/},width:{req:false,valid:/^[0-9]+(px|em|\%)$/}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){var g="<div"+Markup._addGlobalAttributes(b);var c=[];var f=[];if(b.clear){c.push("clear: "+b.clear)}if(b.unnamed){c.push("display: none")}if(b.width){c.push("width: "+b.width)}if(b["float"]){f.push("markup-float-"+b["float"])}if(b.align){c.push("text-align: "+b.align)}if(b.margin){c.push("margin: "+b.margin)}if(b.style&&Markup.allow>=Markup.CLASS_STAFF){c.push(b.style)}if(b.first){f.push("first")}if(b.last){f.push("last")}if(c.length>0){g+=' style="'+c.join(";")+'"'}if(f.length>0){g+=' class="'+f.join(" ")+'"'}g+=">";return[g,"</div>"]},fromHtml:function(h,g){g=g||0;var b;if(b=Markup.matchOuterTags(h,"<div\\b[\\s\\S]*?>","</div>","g")){for(var c=0;c<b.length;++c){var j=b[c][1].match(/float:\s*(left|right)"/i),f=b[c][1].match(/width[:="]+\s*([0-9]+)/i);h=h.replace(b[c][1]+b[c][0]+b[c][2],"\n"+Array(g+1).join("\t")+"[div"+(j?" float="+j[1]:"")+(f?" width="+f[1]:"")+"]"+Markup.tags.div.fromHtml(b[c][0],g+1)+"[/div]")}}return h}},event:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},allowedClass:MARKUP_CLASS_STAFF,validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(b){var j=b.unnamed;var h=Markup._getDatabaseDomainInfo(b);var f=h[0];var g=h[1];if(g_holidays[j]&&g_holidays[j][g]){var c=g_holidays[j];return'<a href="'+f+"/event="+j+'"'+Markup._addGlobalAttributes(b)+">"+Markup._safeHtml(c[g])+"</a>"}return'<a href="'+f+"/event="+j+'"'+Markup._addGlobalAttributes(b)+">("+LANG.types[12][0]+" #"+j+")</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_holidays[g]&&g_holidays[g][c]){return Markup._safeHtml(g_holidays[g][c])}return LANG.types[12][0]+" #"+g}},faction:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(b){var j=b.unnamed;var h=Markup._getDatabaseDomainInfo(b);var c=h[0];var f=h[1];if(g_factions[j]&&g_factions[j][f]){var g=g_factions[j];return'<a href="'+c+"/faction="+j+'"'+Markup._addGlobalAttributes(b)+">"+Markup._safeHtml(g[f])+"</a>"}return'<a href="'+c+"/faction="+j+'"'+Markup._addGlobalAttributes(b)+">("+LANG.types[8][0]+" #"+j+")</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_factions[g]&&g_factions[g][c]){return Markup._safeHtml(g_factions[g][c])}return LANG.types[8][0]+" #"+g}},feedback:{empty:true,allowedClass:MARKUP_CLASS_STAFF,attr:{mailto:{req:false,valid:/^true$/i}},toHtml:function(b){return'<b><span class="icontiny" style="background-image: url('+g_staticUrl+"/images/icons"+MarkupIconPath+'/email.gif)"><a href="'+(b.mailto?"mailto:feedback@wowhead.com":'javascript:;" onclick="ContactTool.show();')+'">feedback@wowhead.com</a></span></b>'}},follower:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9\.]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},level:{req:false,valid:/^[0-9:]+$/},quality:{req:false,valid:/^[2345]$/},abilities:{req:false,valid:/^[0-9:]+$/},diff:{req:false,valid:/^[0-9]+$/},diffnew:{req:false,valid:/^[12]$/},tempname:{req:false}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(j){var f=j.unnamed;var g=Markup._getDatabaseDomainInfo(j);var c=g[0];var l=g[1];var p=[];var k=null;if(j.diff){p.push("diff="+j.diff)}if(j.diffnew){p.push("diffnew="+j.diffnew)}if(j.quality){p.push("q="+j.quality)}if(j.level){p.push("level="+j.level)}if(j.abilities){p.push("abil="+j.abilities)}if(j.tempname){k=j.tempname}var o=parseInt(f);if(g_followers[o]&&g_followers[o][l]){var h=g_followers[o];var n=h.quality;if(j.quality){n=j.quality}if(!j.hasOwnProperty("class")){j["class"]="q"+n}else{if(!/\bq\d\b/.test(j["class"])){j["class"]+=" q"+n}}var b=h[l];var m;if((m=b.indexOf(" / "))!=-1){if(/\.1$/.test(f)){b=b.substr(0,m)}else{if(/\.2$/.test(f)){b=b.substr(m+3)}}}return'<a href="'+c+"/follower="+f+'"'+(p.length?' rel="'+p.join("&")+'"':"")+Markup._addGlobalAttributes(j)+">"+Markup._safeHtml(b)+"</a>"}return'<a href="'+c+"/follower="+f+'"'+(p.length?' rel="'+p.join("&")+'"':"")+Markup._addGlobalAttributes(j)+">"+(k?k:("("+LANG.types[21][0]+" #"+f+")"))+"</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_followers[g]&&g_followers[g][c]){return Markup._safeHtml(g_followers[g][c])}return LANG.types[21][0]+" #"+g}},forumrules:{empty:true,allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){return'<b><span class="icontiny" style="background-image: url('+g_staticUrl+"/images/icons"+MarkupIconPath+'/favicon.gif)"><a href="//www.wowhead.com/forums&topic=2">forum rules</a></span></b>'}},galleryupload:{empty:false,allowedClass:MARKUP_CLASS_ADMIN,attr:{unnamed:{req:true,valid:/^[0-9]+$/},submittext:{req:false,valid:/.+/}},toHtml:function(b){var c="";c='<form method="POST" action="/gallery-upload" enctype="multipart/form-data" onsubmit="return Markup.tags.galleryupload._validateForm(this);">';c+='<input type="hidden" name="gallery" value="'+b.unnamed+'">';c+='<input type="hidden" name="message" value="">';c+='<input type="hidden" name="from" value="'+encodeURIComponent(location.pathname+location.search)+'">';c+='<input type="file" name="incoming" accept=".jpg,.jpeg,.png,image/jpeg,image/png" required>';c+=' <button type="submit" class="btn btn-primary">'+(b.submittext||LANG.submit)+"</button>";c+='</form><div style="display: none">';return[c,"</div>"]},_validateForm:function(c){var b=3;var g=c.incoming;if(!g||g.value==""){return false}if(g.files&&g.files.length){if(g.files.length>1){alert("Too many files");return false}if(g.files[0].size>b*1048576){alert(LANG.message_sizelimit.replace("%d",b).replace("&gt;",">"));return false}}c.message.value=c.nextSibling.textContent;return true}},"mission-ability":{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},diff:{req:false,valid:/^[0-9]+$/},diffnew:{req:false,valid:/^[12]$/},tempname:{req:false}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(c){var l=c.unnamed;var k=Markup._getDatabaseDomainInfo(c);var g=k[0];var h=k[1];var b=[];var f=null;if(c.diff){b.push("diff="+c.diff)}if(c.diffnew){b.push("diffnew="+c.diffnew)}if(c.tempname){f=c.tempname}if(g_missionabilities[l]&&g_missionabilities[l][h]){var j=g_missionabilities[l];return'<a href="'+g+"/mission-ability="+l+'"'+(b.length?' rel="'+b.join("&")+'"':"")+(!c.icon?' class="icontiny"><img src="'+g_staticUrl+"/images/wow/icons/tiny/"+j.icon.toLowerCase()+'.gif" align="absmiddle"':"")+Markup._addGlobalAttributes(c)+"> "+Markup._safeHtml(j[h])+"</a>"}return'<a href="'+g+"/mission-ability="+l+'"'+(b.length?' rel="'+b.join("&")+'"':"")+Markup._addGlobalAttributes(c)+">"+(f?f:("("+LANG.types[22][0]+" #"+l+")"))+"</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_missionabilities[g]&&g_missionabilities[g][c]){return Markup._safeHtml(g_missionabilities[g][c])}return LANG.types[22][0]+" #"+g}},guide:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(c){var j=c.unnamed;var h=Markup._getDatabaseDomainInfo(c);var f=h[0];var g="name";if(g_guides[j]&&g_guides[j][g]){var b=g_guides[j];return'<a href="'+f+"/guide="+j+'"'+Markup._addGlobalAttributes(c)+"> "+Markup._safeHtml(b[g])+"</a>"}return'<a href="'+f+"/guide="+j+'"'+Markup._addGlobalAttributes(c)+">("+LANG.types[100][0]+" #"+j+")</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c="name";if(g_guides[g]&&g_guides[g][c]){return Markup._safeHtml(g_guides[g][c])}return LANG.types[100][0]+" #"+g}},hr:{empty:true,trim:true,allowedModes:{article:1,quickfacts:1,comment:1},toHtml:function(b){return"<hr />"},fromHtml:function(b){return b.replace(/<hr\b[\s\S]*?>/gi,"[hr]")}},h2:{block:true,empty:false,ltrim:true,rtrim:true,itrim:true,allowedClass:MARKUP_CLASS_STAFF,attr:{unnamed:{req:false,valid:/^first$/i},clear:{req:false,valid:/^(true|both|left|right)$/i},style:{req:false,valid:/^[^"<>]+$/},toc:{req:false,valid:/^false$/i}},toHtml:function(b){if(!b.id){b.id=$WH.urlize(b._textContents)}var g="<h2"+Markup._addGlobalAttributes(b);var f=["heading-size-2"];if(b.first||b.unnamed){f.push("first")}if(b.last){f.push("last")}if(f.length>0){g+=' class="'+f.join(" ")+'"'}var c=[];if(b.clear){if(b.clear=="true"||b.clear=="both"){c.push("clear:both")}else{c.push("clear:"+b.clear)}}if(b.style&&Markup.allow>=Markup.CLASS_STAFF){c.push(b.style)}if(c.length){g+=' style="'+c.join(";")+'"'}return[g+">","</h2>"]},fromHtml:function(b){return b.replace(/<h2\b[\s\S]*?>([\s\S]*?)<\/h2>/gi,"\n[major-heading]$1[/major-heading]")}},h3:{block:true,empty:false,ltrim:true,rtrim:true,itrim:true,attr:{unnamed:{req:false,valid:/^first$/i},style:{req:false,valid:/^[^"<>]+$/},toc:{req:false,valid:/^false$/i}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){if(!b.id){b.id=$WH.urlize(b._textContents)}var g="<h3"+Markup._addGlobalAttributes(b);var f=["heading-size-3"];if(b.first||b.unnamed){f.push("first")}if(b.last){f.push("last")}if(f.length>0){g+=' class="'+f.join(" ")+'"'}var c=[];if(b.style&&Markup.allow>=Markup.CLASS_STAFF){c.push(b.style)}if(c.length){g+=' style="'+c.join(";")+'"'}return[g+">","</h3>"]},fromHtml:function(b){return b.replace(/<h3\b[\s\S]*?>([\s\S]*?)<\/h3>/gi,"\n[minor-heading]$1[/minor-heading]")}},h4:{block:true,empty:false,ltrim:true,rtrim:true,itrim:true,attr:{unnamed:{req:false,valid:/^first$/i},toc:{req:false,valid:/^false$/i}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){if(!b.id){b.id=$WH.urlize(b._textContents)}var f="<h4"+Markup._addGlobalAttributes(b);var c=["heading-size-4"];if(b.first||b.unnamed){c.push("first")}if(b.last){c.push("last")}if(c.length>0){f+=' class="'+c.join(" ")+'"'}return[f+">","</h4>"]},fromHtml:function(b){return b.replace(/<h4\b[\s\S]*?>([\s\S]*?)<\/h4>/gi,"\n[h4]$1[/h4]")}},h5:{block:true,empty:false,ltrim:true,rtrim:true,itrim:true,attr:{unnamed:{req:false,valid:/^first$/i},toc:{req:false,valid:/^false$/i}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){if(!b.id){b.id=$WH.urlize(b._textContents)}var f="<h5"+Markup._addGlobalAttributes(b);var c=["heading-size-5"];if(b.first||b.unnamed){c.push("first")}if(b.last){c.push("last")}if(c.length>0){f+=' class="'+c.join(" ")+'"'}return[f+">","</h5>"]},fromHtml:function(b){return b.replace(/<h5\b[\s\S]*?>([\s\S]*?)<\/h5>/gi,"\n[h5]$1[/h5]")}},h6:{block:true,empty:false,ltrim:true,rtrim:true,itrim:true,attr:{unnamed:{req:false,valid:/^first$/i},toc:{req:false,valid:/^false$/i}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){if(!b.id){b.id=$WH.urlize(b._textContents)}var f="<h6"+Markup._addGlobalAttributes(b);var c=["heading-size-6"];if(b.first||b.unnamed){c.push("first")}if(b.last){c.push("last")}if(c.length>0){f+=' class="'+c.join(" ")+'"'}return[f+">","</h6>"]},fromHtml:function(b){return b.replace(/<h6\b[\s\S]*?>([\s\S]*?)<\/h6>/gi,"\n[h6]$1[/h6]")}},html:{empty:false,allowedClass:MARKUP_CLASS_ADMIN,allowedChildren:{"<text>":1},rawText:true,taglessSkip:true,toHtml:function(b){return[b._contents]}},i:{empty:false,allowInReplies:true,toHtml:function(b){return["<i"+Markup._addGlobalAttributes(b)+">","</i>"]},fromHtml:function(b){return b.replace(/<(i|em)\b[\s\S]*?>([\s\S]*?)<\/\1>/gi,"[i]$2[/i]")}},icon:{empty:false,itrim:true,attr:{align:{req:false,valid:/^right$/i},"float":{req:false,valid:/^(left|right)$/i},name:{req:false,valid:/\S+/},size:{req:false,valid:/^(tiny|small|medium|large)$/},unnamed:{req:false,valid:/^class$/i},url:{req:false,valid:/\S+/},preset:{req:false,valid:/\S+/}},allowedClass:MARKUP_CLASS_STAFF,presets:{boss:g_staticUrl+"/images/icons"+MarkupIconPath+"/boss.gif",heroic:g_staticUrl+"/images/icons"+MarkupIconPath+"/heroic.gif"},validate:function(b){if(!b.name&&!b.url&&!b.preset){return false}if(b.preset&&!Markup.tags.icon.presets[b.preset]){return false}return true},toHtml:function(b){var f=(b.size?b.size:"tiny");if(!b.name){b.name=""}if(f=="tiny"){var k="<span"+Markup._addGlobalAttributes(b)+' class="';if(b.unnamed==undefined){k+="icontiny";if(b.align){k+="r"}var j="";if(b.name){j=g_staticUrl+"/images/wow/icons/tiny/"+b.name.toLowerCase()+".gif"}else{if(b.preset){j=Markup.tags.icon.presets[b.preset]}else{if(b.url&&Markup._isUrlSafe(b.url)){j=b.url}else{return""}}}k+='" style="background-image: url('+j+')">'}else{k+=b.name+'">'}return[k,"</span>"]}else{var k="<div"+Markup._addGlobalAttributes(b)+' onclick="Icon.showIconName(this)" class="icon'+f+(b["float"]?'" style="float: '+b["float"]+';">':'">');var h={small:0,medium:1,large:2};var c=null;if(b.url&&Markup._isUrlSafe(b.url)){c=b.url}else{if(b._textContents&&Markup._isUrlSafe(b._textContents)){c=b._textContents}}var g=Icon.create(b.name.toLowerCase(),h[f],null,c);k+=g.innerHTML+"</div>";return[k]}}},icondb:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},block:{req:false,valid:/^(true|false)$/},size:{req:false,valid:/^(tiny|small|medium|large)$/},name:{req:false,valid:/^true$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},diff:{req:false,valid:/^[0-9]+$/},diffnew:{req:false,valid:/^[12]$/},tempname:{req:false}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(j){var o=j.size?j.size:"small";var m=j.name=="true";var f=j.unnamed;var g=Markup._getDatabaseDomainInfo(j);var c=g[0];var p=c+"/icon="+f;var n=[];var h=null;if(j.diff){n.push("diff="+j.diff)}if(j.diffnew){n.push("diffnew="+j.diffnew)}if(j.tempname){h=j.tempname}if(g_icons[f]&&g_icons[f].name){p+="/"+$WH.urlize(g_icons[f].name);var k=g_icons[f];if(m){if(o=="tiny"){return'<a href="'+p+'"'+(n.length?' rel="'+n.join("&")+'"':"")+(!j.icon?' class="icontiny"><img src="'+g_staticUrl+"/images/wow/icons/tiny/"+k.icon.toLowerCase()+'.gif" align="absmiddle"':"")+Markup._addGlobalAttributes(j)+"> "+Markup._safeHtml(k.name)+"</a>"}else{var l=$WH.ce("a",{href:p});var b=$WH.ce("div",null,l);$WH.ae(l,Icon.create(k.name,Icon.sizeIds[o],null,false,null,null,null,null,true));l.innerHTML+=Markup._safeHtml(k.name);return b.innerHTML}}else{var b=$WH.ce("div");$WH.ae(b,Icon.create(k.name,Icon.sizeIds[o],null,p,null,null,null,null,j.block!="true"));return b.innerHTML}}return'<a href="'+p+'"'+(n.length?' rel="'+n.join("&")+'"':"")+Markup._addGlobalAttributes(j)+">"+(h?h:("("+LANG.types[29][0]+" #"+f+")"))+"</a>"},toText:function(b){var c=b.unnamed;if(g_icons[c]&&g_icons[c].name){return Markup._safeHtml(g_icons[c].name)}return LANG.types[29][0]+" #"+c}},iconlist:{empty:false,block:true,ltrim:true,rtrim:true,attr:{domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},taglessSkip:true,allowedClass:MARKUP_CLASS_STAFF,allowedChildren:{b:1,achievement:1,currency:1,faction:1,holiday:1,item:1,itemset:1,npc:1,object:1,pet:1,quest:1,spell:1,title:1,zone:1},toHtml:function(k){var g=Markup._getDatabaseDomainInfo(k)[2];var n="",c;for(var h=0;h<k._nodes.length;++h){var f=$WH.dO(k._nodes[h]);f.attr.domain=g;var j=Markup.tags[f.name].toHtml(f.attr),l=f.name,b="",o="";if(typeof j!="string"){j=j[0]+f.attr._contents+j[1]}else{if(typeof j=="string"&&(c=j.match(/href="(.+?)".+?url\(\/images\/wow\/icons\/tiny\/(.+?)\.gif\)/))){f.attr.icon="false";j=Markup.tags[f.name].toHtml(f.attr);b=c[1];o=c[2]}}if(j){n+="<tr><th>"+(o?Markup.toHtml("[icon name="+o+" size=small url="+b+"]",{skipReset:true}):"<ul><li>&nbsp;</li></ul>")+"</th><td>"+j+"</td></tr>"}}if(n){n='<div class="iconlist-col"><table class="iconlist">'+n+"</table></div>"}return[n]}},img:{empty:true,attr:{src:{req:false,valid:/\S+/},icon:{req:false,valid:/\S+/},id:{req:false,valid:/^[0-9]+$/},blog:{req:false,valid:/^[0-9]+$/},news:{req:false,valid:/^[0-9]+$/},size:{req:false,valid:/^(thumb|resized|normal|large|medium|small|tiny)$/i},width:{req:false,valid:/^[0-9]+$/},height:{req:false,valid:/^[0-9]+$/},"float":{req:false,valid:/^(left|right|center)$/i},border:{req:false,valid:/^[0-9]+$/},shadow:{req:false,valid:/^(true|false)$/},margin:{req:false,valid:/^[0-9]+$/}},blogSize:/^(thumb|normal)$/i,idSize:/^(thumb|resized|normal)$/i,iconSize:/^(large|medium|small|tiny)$/i,allowedClass:MARKUP_CLASS_STAFF,validate:function(b){if(b.src){return true}else{if(b.id){return(b.size?Markup.tags.img.idSize.test(b.size):true)}else{if(b.icon){return(b.size?Markup.tags.img.iconSize.test(b.size):true)}else{if(b.blog||b.news){return(b.size?Markup.tags.img.blogSize.test(b.size):true)}}}}return false},toHtml:function(b){var k="<img"+Markup._addGlobalAttributes(b);var j=[];var c=[];var h="";if(b.src){k+=' src="'+b.src+'"'}else{if(b.id){k+=' src="'+$WH.getScreenshotUrl(b.id,b.size||"normal",b.title)+'"'}else{if(b.icon){k+=' src="'+g_staticUrl+"/images/wow/icons/"+(b.size?b.size:"large")+"/"+b.icon+'.jpg"'}else{if(b.blog||b.news){if(g_blogimages[b.blog||b.news]){var f=g_blogimages[b.blog||b.news];if(b.size&&b.size=="thumb"){var g=g_staticUrl+"/uploads/blog/images/"+(b.blog||b.news)+(f.type==3?".png":".jpg");k+=' src="'+g_staticUrl+"/uploads/blog/thumbs/"+(b.blog||b.news)+(f.type==3?".png":".jpg")+'" alt="'+Markup._safeHtml(f.alt)+'" width="'+f.thumbwidth+'" height="'+f.thumbheight+'"';if(!g_screenshots[Markup.uid]){g_screenshots[Markup.uid]=[]}k='<a href="'+g+'" onclick="if(!$WH.isLeftClick(event)) return; ScreenshotViewer.show({screenshots: \''+Markup.uid+"', pos: "+g_screenshots[Markup.uid].length+'}); return false;">'+k;h="</a>";var l={url:g,caption:f.alt,width:f.width,height:f.height,noMarkup:true};g_screenshots[Markup.uid].push(l)}else{k+=' src="'+g_staticUrl+"/uploads/blog/images/"+(b.blog||b.news)+(f.type==3?".png":".jpg")+'" alt="'+Markup._safeHtml(f.alt)+'"';if(!b.width&&!b.height){b.width=f.width;b.height=f.height}else{if(!b.height){b.height=Math.round(f.height*b.width/f.width)}else{if(!b.width){b.width=Math.round(f.width*b.height/f.height)}}}}}else{return("Image #"+(b.blog||b.news))}}}}}if(b.width){k+=' width="'+b.width+'"'}if(b.height){k+=' height="'+b.height+'"'}if(b["float"]){if(b["float"]=="center"){k='<div style="text-align: center">'+k+' style="margin: 10px auto"';h="</div>"}else{j.push("markup-float-"+b["float"]);if(b.margin){k+=' style="';if(b["float"]=="left"){k+=" margin: 0 "+b.margin+"px "+b.margin+'px 0"'}else{k+=" margin: 0 0 "+b.margin+"px "+b.margin+'px"'}}}}if(b.border){if(b.border==0){j.push("no-border")}else{j.push("border");c.push("border-width:"+b.border+"px")}}else{j.push("content-image");if(b.shadow=="true"){j.push("content-image-shadowed")}}if(b.title){k+=' alt="'+b.title+'"'}else{k+=' alt=""'}if(j.length){k+=' class="'+j.join(" ")+'"'}if(c.length){k+=' style="'+c.join(";")+'"'}k+=" />"+h;return k},fromHtml:function(k){var c;if(c=k.match(/<img\b[\s\S]*?src="[\s\S]+?"[\s\S]*?>/gi)){for(var g=0;g<c.length;++g){var b=c[g].match(/src="([\s\S]+?)"/i),h=c[g].match(/width[:="]+\s*([0-9]+)/i),j=c[g].match(/height[:="]+\s*([0-9]+)/i),f=c[g].match(/border[:="]+\s*([0-9]+)/i);k=k.replace(c[g],"[img src="+b[1]+(h?" width="+h[1]:"")+(j?" height="+j[1]:"")+" border="+(f?f[1]:0)+"]")}}return k}},ins:{empty:false,toHtml:function(b){return['<ins class="diffmod"'+Markup._addGlobalAttributes(b)+">","</ins>"]}},item:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},icon:{req:false,valid:/^false$/i},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},bonus:{req:false,valid:/^[0-9:]+$/},spec:{req:false,valid:/^[0-9]+$/},tooltip:{req:false,valid:/^true$/i},tempname:{req:false}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(j){var c=j.unnamed;var g=Markup._getDatabaseDomainInfo(j);var b=g[0];var m=g[1];var o=[];var k=null;var h="";if(j.tempname){k=j.tempname}if(j.bonus){o.push("bonus="+j.bonus)}if(j.spec){o.push("spec="+j.spec)}if(g_items[c]&&g_items[c][m]){var n=g_items[c];var p=n.icon||"inv_misc_questionmark";var l="<a"+Markup._addGlobalAttributes(j)+' href="'+b+"/item="+c+(o.length?"?"+o.join("&"):"")+'" class="q'+n.quality+(!j.icon?' icontiny" data-entity="item" data-entity-has-icon="true"><img src="'+g_staticUrl+"/images/wow/icons/tiny/"+p.toLowerCase()+'.gif"':"")+' align="absmiddle" />&nbsp;<span class="tinyicontxt">';l+=Markup._safeHtml(n[m])+"</span></a>";h=l}else{h='<a href="'+b+"/item="+c+(o.length?"?"+o.join("&"):"")+'"'+Markup._addGlobalAttributes(j)+' data-entity="item" data-entity-has-icon="true">'+(k?k:("("+LANG.types[3][0]+" #"+c+")"))+"</a>"}if(j.tooltip){var f=Markup.callbacks.getCallbackElementId();window.setTimeout($WowheadPower.replaceWithTooltip.bind($WowheadPower,f,3,c),5);h='<span id="'+f+'">'+h+"</span>"}return h},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_items[g]&&g_items[g][c]){return Markup._safeHtml(g_items[g][c])}return LANG.types[3][0]+" #"+g}},"item-set":{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^-?[0-9]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(b){var j=b.unnamed;var g=Markup._getDatabaseDomainInfo(b);var c=g[0];var f=g[1];if(g_itemsets[j]&&g_itemsets[j][f]){var h=g_itemsets[j];return'<a href="'+c+"/item-set="+j+'"'+Markup._addGlobalAttributes(b)+">"+Markup._safeHtml(h[f])+"</a>"}return'<a href="'+c+"/item-set="+j+'"'+Markup._addGlobalAttributes(b)+">("+LANG.types[4][0]+" #"+j+")</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_itemsets[g]&&g_itemsets[g][c]){return Markup._safeHtml(g_itemsets[g][c])}return LANG.types[4][0]+" #"+g}},li:{empty:false,itrim:true,allowedParents:{ul:1,ol:1},attr:{"class":{req:false,valid:/^[a-z0-9 _-]+$/i},style:{req:false,valid:/^[^<>]+$/}},helpText:function(){var c="";c+="[ul]";for(var b=0;b<3;++b){c+="\n[li]"+LANG.markup_li+"[/li]"}c+="\n[/ul]\n\n";c+="[ol]";for(var b=0;b<3;++b){c+="\n[li]"+LANG.markup_li+"[/li]"}c+="\n[/ol]\n";return c.toLowerCase()},toHtml:function(b){return["<li"+Markup._addGlobalAttributes(b)+"><div>","</div></li>"]},fromHtml:function(g,f){f=f||0;var b;if(b=Markup.matchOuterTags(g,"<li\\b[\\s\\S]*?>","</li>","g")){for(var c=0;c<b.length;++c){g=g.replace(b[c][1]+b[c][0]+b[c][2],"\n\t"+Array(f+1).join("\t")+"[li]"+Markup.tags.li.fromHtml(b[c][0],f+1)+"[/li]")}}return g}},lightbox:{empty:false,allowedClass:MARKUP_CLASS_STAFF,attr:{unnamed:{req:true,valid:/^(map|model|screenshot)$/},zone:{req:false,valid:/^-?[0-9]+[a-z]?$/i},floor:{req:false,valid:/^[0-9]+$/},pins:{req:false,valid:/^[0-9]+$/}},validate:function(b){switch(b.unnamed){case"map":if(b.zone){return true}break;case"model":break;case"screenshot":break}return false},toHtml:function(b){var c="";var f="";switch(b.unnamed){case"map":c="/maps="+b.zone;if(b.floor){c+="."+b.floor}if(b.pins){c+=":"+b.pins}var g=c.substr(6);f="if(!$WH.isLeftClick(event)) return; MapViewer.show({ link: '"+g+"' }); return false;";break}if(c&&f){return['<a href="'+c+'" onclick="'+f+'"'+Markup._addGlobalAttributes(b)+">","</a>"]}return""}},"major-heading":{block:true,empty:false,ltrim:true,rtrim:true,itrim:true,allowedClass:MARKUP_CLASS_STAFF,attr:{unnamed:{req:false,valid:/^first$/i},clear:{req:false,valid:/^(true|both|left|right)$/i},style:{req:false,valid:/^[^"<>]+$/},toc:{req:false,valid:/^false$/i}},toHtml:function(b){if(!b.id){b.id=$WH.urlize(b._textContents)}var g="<h2"+Markup._addGlobalAttributes(b);var f=["heading-size-2"];if(b.first||b.unnamed){f.push("first")}if(b.last){f.push("last")}if(f.length>0){g+=' class="'+f.join(" ")+'"'}var c=[];if(b.clear){if(b.clear=="true"||b.clear=="both"){c.push("clear:both")}else{c.push("clear:"+b.clear)}}if(b.style&&Markup.allow>=Markup.CLASS_STAFF){c.push(b.style)}if(c.length){g+=' style="'+c.join(";")+'"'}return[g+">","</h2>"]},fromHtml:function(b){return b.replace(/<h2\b[\s\S]*?>([\s\S]*?)<\/h2>/gi,"\n[major-heading]$1[/major-heading]")}},"minor-heading":{block:true,empty:false,ltrim:true,rtrim:true,itrim:true,attr:{unnamed:{req:false,valid:/^first$/i},style:{req:false,valid:/^[^"<>]+$/},toc:{req:false,valid:/^false$/i}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){if(!b.id){b.id=$WH.urlize(b._textContents)}var g="<h3"+Markup._addGlobalAttributes(b);var f=["heading-size-3"];if(b.first||b.unnamed){f.push("first")}if(b.last){f.push("last")}if(f.length>0){g+=' class="'+f.join(" ")+'"'}var c=[];if(b.style&&Markup.allow>=Markup.CLASS_STAFF){c.push(b.style)}if(c.length){g+=' style="'+c.join(";")+'"'}return[g+">","</h3>"]},fromHtml:function(b){return b.replace(/<h3\b[\s\S]*?>([\s\S]*?)<\/h3>/gi,"\n[minor-heading]$1[/minor-heading]")}},map:{empty:false,attr:{zone:{req:true,valid:/^-?[0-9a-z\-_]+$/i},source:{req:false,valid:/\S+/}},allowedClass:MARKUP_CLASS_STAFF,allowedChildren:{pin:1},toHtml:function(c){var b=c._contents;c.id="dsgdfngjkfdg"+(Markup.maps.length);var f="<div"+Markup._addGlobalAttributes(c)+'></div><div style="clear: left"></div>';Markup.maps.push([c.id,c.zone,b?b:null]);return[f]}},nav:{block:true,empty:false,ltrim:true,rtrim:true,itrim:true,allowedClass:MARKUP_CLASS_STAFF,allowedChildren:{"nav-item":1},toHtml:function(b){var j="nav-markup-"+Markup.getAutoIncrementCount("nav");var h='<div class="clear"></div><div class="dynamic-nav-wrapper" id="'+j+'"><div class="dynamic-nav-outer"><div class="dynamic-nav-inner">';var f=b._contents;for(var g=0,c;c=f[g];++g){h+='<a id="'+j+"-"+g+'"'+(c.url?' href="'+c.url+'"':"")+' rel="np">';h+=c.content;h+="</a>";if(c.tooltip){setTimeout((function(m,l){var k=$WH.ge(m);if(k){$WH.Tooltip.simple(k,l.replace(/&lt;br&gt;/g,"<br>"),"q")}}).bind(null,j+"-"+g,c.tooltip),0)}}h+="</div></div></div>";setTimeout($WH.setupDynamicNav.bind(null,"#"+j),0);return[h]}},"nav-item":{block:true,empty:false,ltrim:true,rtrim:true,itrim:true,allowedClass:MARKUP_CLASS_STAFF,allowedParents:{nav:1},attr:{unnamed:{req:false,valid:/\S+/},tooltip:{req:false,valid:/^.*$/}},toHtml:function(b){return[{content:b._contents,tooltip:b.tooltip,url:b.unnamed}]}},n5:{empty:true,attr:{unnamed:{req:true,valid:/^[0-9\.]+$/}},toHtml:function(b){return $WH.getN5(b.unnamed)}},pin:{empty:false,attr:{url:{req:false,valid:/\S+/},type:{req:false,valid:/^[0-9]+$/},x:{req:true,valid:/^[0-9]{1,2}(\.[0-9])?$/},y:{req:true,valid:/^[0-9]{1,2}(\.[0-9])?$/},path:{req:false,valid:/^([0-9]{1,2}(\.[0-9])?[,:]?)+$/}},taglessSkip:true,allowedClass:MARKUP_CLASS_STAFF,allowedParents:{map:1},toHtml:function(f){if(f.url&&!Markup._isUrlSafe(f.url)){f.url=""}var h=f._contents;if(f.url&&f.url.indexOf("npc=")!=-1){h='<b class="q">'+h+'</b><br /><span class="q2">Click to view this NPC</span>'}if(f.url&&(f.url.indexOf("/")<0)&&(f.url.indexOf("=")>=0)){f.url="/"+f.url}var g=null;if(f.path){var c=f.path.split(":"),g=[];for(var j=0,b=c.length;j<b;++j){var k=c[j].split(",");if(k.length==2){g.push([parseFloat(k[0]||0),parseFloat(k[1]||0)])}}}return[[parseFloat(f.x||0),parseFloat(f.y||0),{label:h,url:f.url,type:f.type,lines:g}]]}},markupdoc:{empty:true,attr:{tag:{req:false,valid:/[a-z0-9]+/i},help:{req:false,valid:/^(admin|staff|premium|user|pending)$/}},allowedClass:MARKUP_CLASS_STAFF,validate:function(b){if(b.tag&&!Markup.tags[b.tag]){return false}return true},toHtml:function(f){var g="",c=(f.help?Markup["CLASS_"+f.help.toUpperCase()]:false);if(c){g+=LANG.markup_helpdoc+'<div class="pad3"></div><table class="comment comment-markupdoc"><tr><th>'+LANG.markup_help1+"</th><th>"+LANG.markup_help2+"</th></tr>"}if(f.tag){g=Markup._generateTagDocs(f.tag,c)}else{for(var b in Markup.tags){if(!c&&g!=""){g+='<div class="pad3"></div>'}g+=Markup._generateTagDocs(b,c)}}return g+(c?"</table>":"")}},menu:{empty:true,trim:true,ltrim:true,rtrim:true,attr:{tab:{req:true,valid:/^[0-9]+$/},path:{req:true,valid:/\S+/}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){var c=b.path.split(",");PageTemplate.set({activeTab:b.tab,breadcrumb:c})}},mission:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},diff:{req:false,valid:/^[0-9]+$/},diffnew:{req:false,valid:/^[12]$/},tempname:{req:false}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(c){var l=c.unnamed;var k=Markup._getDatabaseDomainInfo(c);var g=k[0];var h=k[1];var b=[];var f=null;if(c.diff){b.push("diff="+c.diff)}if(c.diffnew){b.push("diffnew="+c.diffnew)}if(c.tempname){f=c.tempname}if(g_missions[l]&&g_missions[l][h]){var j=g_missions[l];return'<a href="'+g+"/mission="+l+'"'+(b.length?' rel="'+b.join("&")+'"':"")+Markup._addGlobalAttributes(c)+"> "+Markup._safeHtml(j[h])+"</a>"}return'<a href="'+g+"/mission="+l+'"'+(b.length?' rel="'+b.join("&")+'"':"")+Markup._addGlobalAttributes(c)+">"+(f?f:("("+LANG.types[23][0]+" #"+l+")"))+"</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_missions[g]&&g_missions[g][c]){return Markup._safeHtml(g_missions[g][c])}return LANG.types[23][0]+" #"+g}},minibox:{empty:false,rtrim:true,itrim:true,attr:{"float":{req:false,valid:/^(left|right)$/i}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){var c="<div"+Markup._addGlobalAttributes(b)+' class="minibox';if(b["float"]=="left"){c+=" minibox-left"}c+='">';return[c,"</div>"]}},model:{empty:false,attr:{item:{req:false,valid:/^[0-9]+$/},object:{req:false,valid:/^[0-9]+$/},npc:{req:false,valid:/^[0-9]+$/},itemset:{req:false,valid:/^[0-9,]+$/},slot:{req:false,valid:/^[0-9]+$/},humanoid:{req:false,valid:/^1$/},"float":{req:false,valid:/^(left|right)$/i},border:{req:false,valid:/^[0-9]+$/},shadow:{req:false,valid:/^(true|false)$/},img:{req:false,valid:/\S+/},link:{req:false,valid:/\S+/},label:{req:false,valid:/[\S ]+/}},allowedClass:MARKUP_CLASS_STAFF,skipSlots:{4:1,5:1,6:1,7:1,8:1,9:1,10:1,16:1,19:1,20:1},toHtml:function(b){var g="";var f=[];var c=[];if(b["float"]){f.push("markup-float-"+b["float"])}if(b.border){if(b.border==0){f.push("no-border")}else{f.push("border");c.push("border-width:"+b.border+"px")}}else{f.push("content-image");if(b.shadow=="true"){f.push("content-image-shadowed")}}if(b.npc){g="<a"+Markup._addGlobalAttributes(b)+' href="#modelviewer:1:'+b.npc+":"+(b.humanoid?"1":"0")+'" onclick="ModelViewer.show({ type: 1, displayId: '+b.npc+", slot: "+b.slot+", "+(b.humanoid?"humanoid: 1, ":"")+"displayAd: 1, fromTag: 1"+(b.link?", link: '"+Markup._safeJsString(b.link)+"'":"")+(b.label?", label: '"+Markup._safeJsString(b.label)+"'":"")+' });"><img alt="'+Markup._safeHtml(b._contents)+'" title="'+Markup._safeHtml(b._contents)+'" src="'+(b.img?b.img:g_staticUrl+ModelViewer.getStaticBase()+"/thumbs/npc/"+b.npc+'.png" width="150" height="150')+'" ';if(f.length){g+='class="'+f.join(" ")+'"'}if(c.length){g+=' style="'+c.join(";")+'"'}g+="/></a>";return[g]}else{if(b.object){g="<a"+Markup._addGlobalAttributes(b)+' href="#modelviewer:2:'+b.object+'" onclick="ModelViewer.show({ type: 2, displayId: '+b.object+", displayAd: 1, fromTag: 1"+(b.link?", link: '"+Markup._safeJsString(b.link)+"'":"")+(b.label?", label: '"+Markup._safeJsString(b.label)+"'":"")+' });"><img alt="'+Markup._safeHtml(b._contents)+'" title="'+Markup._safeHtml(b._contents)+'" src="'+(b.img?b.img:g_staticUrl+ModelViewer.getStaticBase()+"/thumbs/obj/"+b.object+'.png" width="150" height="150')+'" ';if(f.length){g+='class="'+f.join(" ")+'"'}if(c.length){g+=' style="'+c.join(";")+'"'}g+="/></a>";return[g]}else{if(b.item&&b.slot){g="<a"+Markup._addGlobalAttributes(b)+' href="#modelviewer:3:'+b.item+":"+b.slot+'" onclick="ModelViewer.show({ type: 3, displayId: '+b.item+", slot: "+b.slot+", displayAd: 1, fromTag: 1"+(b.link?", link: '"+Markup._safeJsString(b.link)+"'":"")+(b.label?", label: '"+Markup._safeJsString(b.label)+"'":"")+' });"><img alt="'+Markup._safeHtml(b._contents)+'" title="'+Markup._safeHtml(b._contents)+'" src="'+(b.img?b.img:g_staticUrl+ModelViewer.getStaticBase()+"/thumbs/item/"+b.item+'.png" width="150" height="150')+'" ';if(f.length){g+='class="'+f.join(" ")+'"'}if(c.length){g+=' style="'+c.join(";")+'"'}g+="/></a>";return[g]}else{if(b.itemset){g="<a"+Markup._addGlobalAttributes(b)+' href="javascript:;" onclick="ModelViewer.show({ type: 4, equipList: ['+b.itemset+"], displayAd: 1, fromTag: 1"+(b.link?", link: '"+Markup._safeJsString(b.link)+"'":"")+(b.label?", label: '"+Markup._safeJsString(b.label)+"'":"")+' });">'}else{return["[model]","[/model]"]}}}}return[g,"</a>"]}},money:{empty:true,attr:{unnamed:{req:false,valid:/^[0-9]+$/},side:{req:false,valid:/^(alliance|horde|both)$/i},items:{req:false,valid:/^[0-9,]+$/},currency:{req:false,valid:/^[0-9,]+$/},achievement:{req:false,valid:/\S+/},arena:{req:false,valid:/^[0-9]+$/},honor:{req:false,valid:/^[0-9]+$/},conquest:{req:false,valid:/^[0-9]+$/},justice:{req:false,valid:/^[0-9]+$/},valor:{req:false,valid:/^[0-9]+$/}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){var f=[],c=[];if(b.items){var h=b.items.split(",");if(h.length>=2){for(var g=0;g<h.length-1;g+=2){f.push([h[g],h[g+1]])}}}if(b.currency){var h=b.currency.split(",");if(h.length>=2){for(var g=0;g<h.length-1;g+=2){c.push([h[g],h[g+1]])}}}if(b.arena&&!b.conquest){b.conquest=b.arena}if(b.honor){c.push([392,b.honor])}if(b.conquest){c.push([390,b.conquest])}if(b.justice){c.push([395,b.justice])}if(b.valor){c.push([396,b.valor])}return $WH.getMoneyHtml(b.unnamed,b.side,f,c,b.achievement)}},npc:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(b){var j=b.unnamed;var h=Markup._getDatabaseDomainInfo(b);var f=h[0];var g=h[1];if(g_npcs[j]&&g_npcs[j][g]){var c=g_npcs[j];return'<a href="'+f+"/npc="+j+'"'+Markup._addGlobalAttributes(b)+">"+Markup._safeHtml(c[g])+"</a>"}return'<a href="'+f+"/npc="+j+'"'+Markup._addGlobalAttributes(b)+">("+LANG.types[1][0]+" #"+j+")</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_npcs[g]&&g_npcs[g][c]){return Markup._safeHtml(g_npcs[g][c])}return LANG.types[1][0]+" #"+g}},"order-advancement":{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},diff:{req:false,valid:/^[0-9]+$/},diffnew:{req:false,valid:/^[12]$/},tempname:{req:false}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(c){var l=c.unnamed;var k=Markup._getDatabaseDomainInfo(c);var g=k[0];var h=k[1];var b=[];var f=null;if(c.diff){b.push("diff="+c.diff)}if(c.diffnew){b.push("diffnew="+c.diffnew)}if(c.tempname){f=c.tempname}if(g_orderadvancements[l]&&g_orderadvancements[l][h]){var j=g_orderadvancements[l];return'<a href="'+g+"/order-advancement="+l+'"'+(b.length?' rel="'+b.join("&")+'"':"")+(!c.icon?' class="icontiny"><img src="'+g_staticUrl+"/images/wow/icons/tiny/"+j.icon.toLowerCase()+'.gif" align="absmiddle"':"")+Markup._addGlobalAttributes(c)+"> "+Markup._safeHtml(j[h])+"</a>"}return'<a href="'+g+"/order-advancement="+l+'"'+(b.length?' rel="'+b.join("&")+'"':"")+Markup._addGlobalAttributes(c)+">"+(f?f:("("+LANG.types[30][0]+" #"+l+")"))+"</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_orderadvancements[g]&&g_orderadvancements[g][c]){return Markup._safeHtml(g_orderadvancements[g][c])}return LANG.types[30][0]+" #"+g}},outfit:{empty:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/}},toHtml:function(c){var h=c.unnamed;var b=g_outfits[h];var f="/outfit="+h+(b&&b.hasOwnProperty("name")?"/"+$WH.urlize(b.name):"");var g;if(b){if(b.classs){g='<a href="'+f+'" class="icontiny c'+b.classs+'" target="_blank" whattach="true"><img src="'+g_staticUrl+"/images/wow/icons/tiny/"+g_classes.getIcon(b.classs)+'.gif" align="absmiddle" /> '}else{g='<a href="'+f+'" target="_blank" whattach="true">'}g+=$WH.htmlEntities(b.name)+"</a>"}else{g='<a href="'+f+'" target="_blank" whattach="true">Outfit #'+h+"</a>"}return g}},"pet-ability":{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},diff:{req:false,valid:/^[0-9]+$/},diffnew:{req:false,valid:/^[12]$/},tempname:{req:false}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(c){var l=c.unnamed;var k=Markup._getDatabaseDomainInfo(c);var g=k[0];var h=k[1];var b=[];var f=null;if(c.diff){b.push("diff="+c.diff)}if(c.diffnew){b.push("diffnew="+c.diffnew)}if(c.tempname){f=c.tempname}if(g_petabilities[l]&&g_petabilities[l][h]){var j=g_petabilities[l];return'<a href="'+g+"/pet-ability="+l+'"'+(b.length?' rel="'+b.join("&")+'"':"")+Markup._addGlobalAttributes(c)+(j.icon?(' class="icontiny"><img src="'+g_staticUrl+"/images/wow/icons/tiny/"+j.icon.toLowerCase()+'.gif" align="absmiddle" /'):"")+'> <span class="tinyicontxt">'+Markup._safeHtml(j[h])+"</span></a>"}return'<a href="'+g+"/pet-ability="+l+'"'+(b.length?' rel="'+b.join("&")+'"':"")+Markup._addGlobalAttributes(c)+">"+(f?f:("("+LANG.types[200][0]+" #"+l+")"))+"</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_petabilities[g]&&g_petabilities[g][c]){return Markup._safeHtml(g_petabilities[g][c])}return LANG.types[200][0]+" #"+g}},"pet-team":{empty:true,attr:{unnamed:{req:true,valid:/^#?[\/a-zA-Z0-9_-]+$/},editable:{req:false,valid:/^true$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},calcDivsOnPage:0,calcObjects:{},toHtml:function(b){var l=Markup._getDatabaseDomainInfo(b);this.calcDivsOnPage++;var c="markup-pet-team-"+this.calcDivsOnPage;var h=this;var k={id:"markup-pet-team-"+this.calcDivsOnPage,embedded:true,markup:true,hash:b.unnamed.replace(/^#+/,""),editable:b.editable=="true",dataDomain:l[0]};var j=(function(f){var m=function(){if((!$WH.ge("markup-pet-team-"+f))||(!$WH.isSet("BattlePetTeamCalc"))){window.setTimeout(m,250);return}h.calcObjects[f]=new BattlePetTeamCalc(k)};return m})(this.calcDivsOnPage);if(this.calcDivsOnPage==1&&!$WH.isSet("BattlePetTeamCalc")){$WH.loadAssets("battle-pet-team-calc",j)}else{j()}var g="bpetteamcalc-markup-parent";return'<div id="'+c+'" class="'+g+'"></div>'}},object:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(b){var j=b.unnamed;var h=Markup._getDatabaseDomainInfo(b);var c=h[0];var f=h[1];if(g_objects[j]&&g_objects[j][f]){var g=g_objects[j];return'<a href="'+c+"/object="+j+'"'+Markup._addGlobalAttributes(b)+">"+Markup._safeHtml(g[f])+"</a>"}return'<a href="'+c+"/object="+j+'"'+Markup._addGlobalAttributes(b)+">("+LANG.types[2][0]+" #"+j+")</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_objects[g]&&g_objects[g][c]){return Markup._safeHtml(g_objects[g][c])}return LANG.types[2][0]+" #"+g}},ol:{block:true,empty:false,ltrim:true,rtrim:true,itrim:true,allowedChildren:{li:1},toHtml:function(b){var c="<ol";var f=[];if(b.first){f.push("first")}if(b.last){f.push("last")}if(f.length>0){c+=' class="'+f.join(" ")+'"'}c+=Markup._addGlobalAttributes(b)+">";return[c,"</ol>"]},fromHtml:function(g,f){f=f||0;var b;if(b=Markup.matchOuterTags(g,"<ol\\b[\\s\\S]*?>","</ol>","g")){for(var c=0;c<b.length;++c){g=g.replace(b[c][1]+b[c][0]+b[c][2],"\n"+Array(f+1).join("\t")+"[ol]"+Markup.tags.ol.fromHtml(b[c][0],f+1)+"\n"+Array(f+1).join("\t")+"[/ol]")}}return g}},p:{empty:false,ltrim:true,rtrim:true,itrim:true,allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){return['<p style="line-height: 1.4em; margin: 1em 0px 0px 0px;"'+Markup._addGlobalAttributes(b)+">","</p>"]},fromHtml:function(g){var b;if(b=g.match(/<p\b[\s\S]*?>[\s\S]*?<\/p>/gi)){for(var c=0;c<b.length;++c){var h=b[c].match(/^<p\b[\s\S]*?text-align:\s*(center|left|right)/i);var f=b[c].match(/<p\b[\s\S]*?>([\s\S]*?)<\/p>/i);g=g.replace(b[c],"[pad][div"+(h?" align="+h[1]:"")+"]"+(f?f[1]:"")+"[/div][pad]")}}return g}},pad:{empty:true,block:true,trim:true,allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){var c='<div class="pad';if(b.first){c+=" first"}if(b.last){c+=" last"}c+='"'+Markup._addGlobalAttributes(b)+"></div>";return c}},pet:{empty:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},icon:{req:false,valid:/^false$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(b){var j=b.unnamed;var h=Markup._getDatabaseDomainInfo(b);var c=h[0];var f=h[1];if(g_pet_families&&g_pet_families[j]&&g_pets&&g_pets[j]){var g="<span"+(!b.icon?' class="icontiny" style="background-image: url('+g_staticUrl+"/images/wow/icons/tiny/"+g_pets[j]["icon"].toLowerCase()+".gif)":"")+'">';g+='<a href="'+c+"/pet="+j+'"'+Markup._addGlobalAttributes(b)+">"+Markup._safeHtml(g_pet_families[j])+"</a></span>";return g}return'<a href="'+c+"/pet="+j+'"'+Markup._addGlobalAttributes(b)+">("+LANG.types[9][0]+" #"+j+")</a>"},toText:function(b){var c=b.unnamed;if(g_pet_families&&g_pet_families[c]){return Markup._safeHtml(g_pet_families[c])}return LANG.types[9][0]+" #"+c}},pre:{empty:false,block:true,rtrim:true,toHtml:function(b){var c='<pre class="code';if(b.first){c+=" first"}if(b.last){c+=" last"}c+='"'+Markup._addGlobalAttributes(b)+">";return[c,"</pre>"]},fromHtml:function(b){return b.replace(/<pre\b[\s\S]*?>([\s\S]*?)<\/pre>/gi,"[pre]$1[/pre]")}},quest:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},icon:{req:false,valid:/^false$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(b){var k=b.unnamed;var j=Markup._getDatabaseDomainInfo(b);var f=j[0];var g=j[1];if(g_quests[k]&&g_quests[k][g]){var c=g_quests[k];var h="";if(c.hasOwnProperty("_side")){switch(c._side){case 1:h=" icon-alliance";break;case 2:h=" icon-horde";break}}return'<a href="'+f+"/quest="+k+'"'+(!b.icon?' class="icontiny"><img src="'+g_staticUrl+"/images/wow/icons/tiny/"+(c.daily?"quest_start_daily":"quest_start")+'.gif"':"")+Markup._addGlobalAttributes(b)+' align="absmiddle" /> <span class="tinyicontxt'+h+'">'+Markup._safeHtml(c[g])+"</span></a>"}return'<a href="'+f+"/quest="+k+'"'+Markup._addGlobalAttributes(b)+">("+LANG.types[5][0]+" #"+k+")</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_quests[g]&&g_quests[g][c]){return Markup._safeHtml(g_quests[g][c])}return LANG.types[5][0]+" #"+g}},quote:{block:true,empty:false,rtrim:true,ltrim:true,itrim:true,attr:{unnamed:{req:false,valid:/[\S ]+/},url:{req:false,valid:/\S+/},blizzard:{req:false,valid:/^true$/},pname:{req:false},wowhead:{req:false,valid:/^true$/},display:{req:false,valid:/^block$/},align:{req:false,valid:/^(left|right|center)$/i},"float":{req:false,valid:/^(left|right|none)$/i},clear:{req:false,valid:/^(left|right|both)$/i},collapse:{req:false,valid:/^true$/}},allowedModes:{article:1,quickfacts:1,comment:1},validate:function(b){if(b.blizzard||b.wowhead||b.collapse||b.url){if(Markup.allow<Markup.CLASS_STAFF){return false}}return true},toHtml:function(k){var l="<div"+Markup._addGlobalAttributes(k);var m=[];var f=["quote"];if(k.display){m.push("display: "+k.display)}if(k.align){m.push("text-align: "+k.align)}if(k.clear){m.push("clear:"+k.clear)}if(m.length){l+=' style="'+m.join("; ")+'" '}if(k.first){f.push("first")}if(k.last){f.push("last")}if(k["float"]){f.push("markup-float-"+k["float"])}l+=' class="'+f.join(" ");if(k.blizzard){if(k.unnamed&&k.blizzard){var c=Markup._fixUrl(k.url);var h="View Original";if(c.indexOf("bluetracker")>=0){h="Blue Tracker"}if(typeof(k.pname)!="undefined"){h=k.pname}var g=k.unnamed.trim();if(g.length<=0){return["",""]}l=l.replace('class="quote','class="quote-blizz');l+=(k.collapse?" collapse":"")+'"><div class="quote-header">';var j=c.match(/https?:\/\/(us|eu)\.battle\.net\/wow\/en\/blog\/([0-9]+)/i)||c.match(/https?:\/\/(us|eu)\.battle\.net\/wow\/en\/forum\/topic\/([0-9]+)/i);if(j){l+='Originally posted by <strong>Blizzard</strong> (<a href="'+c+'" target="_blank">Official Post</a>';var b=j[2];l+=' | <a href="//www.wowhead.com/bluetracker?topic='+b+'">Blue Tracker</a>)</div><div class="quote-body"><hr /><h2 class="heading-size-2">'+g+"</h2>"}else{l+=(k.url&&Markup._isUrlSafe(k.url)?'Originally posted by <strong>Blizzard</strong> (<a href="'+Markup._fixUrl(k.url)+'" target="_blank">'+h+'</a>)</div><div class="quote-body"><hr />':'<h2 class="heading-size-2">'+g+"</h2>")}return[l,"</div></div>"]}return["",""]}else{if(k.wowhead){l=l.replace('class="quote','class="quote-wh');l+=(k.collapse?" collapse":"")+'">';l+='<div class="quote-body">';return[l,"</div></div>"]}else{l+='">';if(k.unnamed){var g=k.unnamed.trim();if(g.length>0){l+="<small><b>";if(k.url&&Markup._isUrlSafe(k.url)){l+='<a href="'+Markup._fixUrl(k.url)+'"'+(Markup._isUrlExternal(k.url)?' target="_blank"':"")+">"+g+"</a>"}else{if($WH.isUsernameValid(g)){l+='<a href="/user='+g+'">'+g+"</a>"}else{l+=g}}l+="</b> "+LANG.markup_said+'</small><div class="pad"></div>'}}return[l,"</div>"]}}}},race:{empty:true,allowInReplies:true,valid:{1:true,2:true,3:true,4:true,5:true,6:true,7:true,8:true,9:true,10:true,11:true,22:true,24:true,25:true,26:true},attr:{unnamed:{req:true,valid:/^[0-9]+$/},gender:{req:false,valid:/^(0|1)$/},icon:{req:false,valid:/^false$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}if(Markup.tags.race.valid[b.unnamed]){return true}return false},toHtml:function(b){var k=b.unnamed;var c=b.gender|0;var j=Markup._getDatabaseDomainInfo(b);var f=j[0];var h=j[1];if(g_races[k]&&g_races[k][h]){var g=g_races[k];return'<a href="'+f+"/race="+k+'"'+(!b.icon?' class="icontiny"><img src="'+g_staticUrl+"/images/wow/icons/tiny/"+g_races.getIcon(k,c)+'.gif"':"")+Markup._addGlobalAttributes(b)+' align="absmiddle" /> <span class="tinyicontxt">'+Markup._safeHtml(g[h])+"</span></a>"}return'<a href="'+f+"/race="+k+'"'+Markup._addGlobalAttributes(b)+">("+LANG.types[14][0]+" #"+k+")</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_races[g]&&g_races[g][c]){return Markup._safeHtml(g_races[g][c])}return LANG.types[14][0]+" #"+g}},random:{empty:false,itrim:true,allowedClass:MARKUP_CLASS_STAFF,toHtml:function(c){var f=[];for(var b=0;b<c._nodes.length;b++){if(c._nodes[b].name=="randomoption"){f.push(c._nodes[b].attr._contents)}}if(f.length==0){return[c._contents]}return[f[Math.floor(Math.random()*f.length)]]}},randomoption:{empty:false,rtrim:true,ltrim:true,itrim:true,allowedClass:MARKUP_CLASS_STAFF,allowedParents:{random:1},toHtml:function(b){return["",""]}},resource:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},diff:{req:false,valid:/^[0-9]+$/},diffnew:{req:false,valid:/^[12]$/},tempname:{req:false}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(f){var l=f.unnamed;var k=Markup._getDatabaseDomainInfo(f);var h=k[0];var j=k[1];var c=[];var g=null;if(f.diff){c.push("diff="+f.diff)}if(f.diffnew){c.push("diffnew="+f.diffnew)}if(f.tempname){g=f.tempname}if(g_resources[l]&&g_resources[l][j]){var b=g_resources[l];return'<a href="'+h+"/resource="+l+'"'+(c.length?' rel="'+c.join("&")+'"':"")+(!f.icon?' class="icontiny"><img src="'+g_staticUrl+"/images/wow/icons/tiny/"+b.icon.toLowerCase()+'.gif" align="absmiddle"':"")+Markup._addGlobalAttributes(f)+"> "+Markup._safeHtml(b[j])+"</a>"}return'<a href="'+h+"/resource="+l+'"'+(c.length?' rel="'+c.join("&")+'"':"")+Markup._addGlobalAttributes(f)+">"+(g?g:("("+LANG.types[27][0]+" #"+l+")"))+"</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_resources[g]&&g_resources[g][c]){return Markup._safeHtml(g_resources[g][c])}return LANG.types[27][0]+" #"+g}},reveal:{empty:false,allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){if(!Markup.inBlog||Markup.inBlog>1){return["",""]}return['<span id="reveal-'+Markup.reveals+'" style="display: none">','</span> <a id="revealtoggle-'+Markup.reveals+'" class="revealtoggle" href="javascript:;" onclick="Markup.toggleReveal('+Markup.reveals+');">(read more)</a>'];Markup.reveals++}},s:{empty:false,allowInReplies:true,toHtml:function(b){return["<del"+Markup._addGlobalAttributes(b)+">","</del>"]},fromHtml:function(b){b=b.replace(/<del\b[\s\S]*?>([\s\S]*?)<\/del>/gi,"[s]$1[/s]");return b.replace(/<s\b[\s\S]*?>([\s\S]*?)<\/s>/gi,"[s]$1[/s]")}},screenshot:{empty:false,attr:{id:{req:false,valid:/^[0-9]+$/},url:{req:false,valid:/\S+/},thumb:{req:false,valid:/\S+/},size:{req:false,valid:/^(thumb|small|resized|normal)$/i},width:{req:false,valid:/^[0-9]+$/},height:{req:false,valid:/^[0-9]+$/},"float":{req:false,valid:/^(left|right)$/i},border:{req:false,valid:/^[0-9]+$/},shadow:{req:false,valid:/^(true|false)$/}},taglessSkip:true,allowedClass:MARKUP_CLASS_STAFF,validate:function(b){if(b.url&&!b.thumb){return false}else{if(!b.id&&!b.url){return false}}return true},toHtml:function(b){var h=[];var c=[];var g="javascript:;";var f="";if(b.id){g=$WH.getScreenshotUrl(b.id,"normal",b.title);var j=b.id;if(b.thumb&&b.thumb.match(/^[0-9]+$/)){j=b.thumb;b.thumb=null}f=$WH.getScreenshotUrl(j,b.size||"thumb",b.title)}else{if(b.url){g=b.url}}if(b.thumb){f=b.thumb}if(!g_screenshots[Markup.uid]){g_screenshots[Markup.uid]=[]}var k='<a href="'+g+'" onclick="if(!$WH.isLeftClick(event)) return; ScreenshotViewer.show({screenshots: \''+Markup.uid+"', pos: "+g_screenshots[Markup.uid].length+'}); return false;"'+Markup._addGlobalAttributes(b)+">";k+='<img src="'+f+'" ';if(b.size&&b.width){k+=' width="'+b.width+'"'}if(b.size&&b.height){k+=' height="'+b.height+'"'}if(b.border){if(b.border==0){h.push("no-border")}else{h.push("border");c.push("border-width:"+b.border+"px")}}else{h.push("content-image");if(b.shadow=="true"){h.push("content-image-shadowed")}}if(b["float"]){h.push("markup-float-"+b["float"])}if(h.length){k+=' class="'+h.join(" ")+'"'}if(c.length){k+=' style="'+c.join(";")+'"'}k+='alt="'+(b.title||"")+'" ';var l={caption:b.title,width:(b.size?null:b.width),height:(b.size?null:b.height),noMarkup:true};if(b.id){l.id=b.id}else{l.url=b.url}g_screenshots[Markup.uid].push(l);return[k+"/></a>"]}},script:{ltrim:true,rtrim:true,empty:false,attr:{src:{req:false,valid:/^\S+$/}},allowedClass:MARKUP_CLASS_ADMIN,allowedChildren:{"<text>":1},rawText:true,taglessSkip:true,toHtml:function(b){if(b.src){$.getScript(b.src,function(){$.globalEval(b._contents)})}else{$.globalEval(b._contents)}return[""]}},section:{empty:false,ltrim:true,rtrim:true,trim:true,allowedClass:MARKUP_CLASS_STAFF,attr:{},toHtml:function(b){return['<div class="secheader"><var></var>',"</div>"]}},ship:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9\.]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},quality:{req:false,valid:/^[2345]$/},abilities:{req:false,valid:/^[0-9:]+$/},diff:{req:false,valid:/^[0-9]+$/},diffnew:{req:false,valid:/^[12]$/},tempname:{req:false}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(j){var f=j.unnamed;var h=Markup._getDatabaseDomainInfo(j);var c=h[0];var l=h[1];var p=[];var k=null;if(j.diff){p.push("diff="+j.diff)}if(j.diffnew){p.push("diffnew="+j.diffnew)}if(j.quality){p.push("q="+j.quality)}if(j.abilities){p.push("abil="+j.abilities)}if(j.tempname){k=j.tempname}var o=parseInt(f);if(g_ships[o]&&g_ships[o][l]){var g=g_ships[o];var n=g.quality;if(j.quality){n=j.quality}if(!j.hasOwnProperty("class")){j["class"]="q"+n}else{if(!/\bq\d\b/.test(j["class"])){j["class"]+=" q"+n}}var b=g[l];var m;if((m=b.indexOf(" / "))!=-1){if(/\.1$/.test(f)){b=b.substr(0,m)}else{if(/\.2$/.test(f)){b=b.substr(m+3)}}}return'<a href="'+c+"/ship="+f+'"'+(p.length?' rel="'+p.join("&")+'"':"")+Markup._addGlobalAttributes(j)+">"+Markup._safeHtml(b)+"</a>"}return'<a href="'+c+"/ship="+f+'"'+(p.length?' rel="'+p.join("&")+'"':"")+Markup._addGlobalAttributes(j)+">"+(k?k:("("+LANG.types[25][0]+" #"+f+")"))+"</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_ships[g]&&g_ships[g][c]){return Markup._safeHtml(g_ships[g][c])}return LANG.types[25][0]+" #"+g}},skill:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},icon:{req:false,valid:/^false$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(b){var j=b.unnamed;var h=Markup._getDatabaseDomainInfo(b);var f=h[0];var g=h[1];if(g_skills[j]&&g_skills[j][g]){var c=g_skills[j];return'<a href="'+f+"/skill="+j+'"'+(!b.icon?' class="icontiny"><img src="'+g_staticUrl+"/images/wow/icons/tiny/"+g_skills.getIcon(j)+'.gif"':"")+Markup._addGlobalAttributes(b)+' align="absmiddle" /> <span class="tinyicontxt">'+Markup._safeHtml(c[g])+"</span></a>"}return'<a href="'+f+"/skill="+j+'"'+Markup._addGlobalAttributes(b)+">("+LANG.types[15][0]+" #"+j+")</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_skills[g]&&g_skills[g][c]){return Markup._safeHtml(g_skills[g][c])}return LANG.types[15][0]+" #"+g}},small:{empty:false,toHtml:function(b){return["<small"+Markup._addGlobalAttributes(b)+">","</small>"]},fromHtml:function(b){return b.replace(/<small\b[\s\S]*?>([\s\S]*?)<\/small>/gi,"[small]$1[/small]")}},sound:{empty:true,attr:{unnamed:{req:false,valid:/^[0-9]+$/},src:{req:false,valid:/\S+/},title:{req:false,valid:/\S+/},type:{req:false,valid:/\S+/},src2:{req:false,valid:/\S+/},type2:{req:false,valid:/\S+/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if(b.unnamed){return true}if(!b.src){return false}return true},toHtml:function(j){var l,b,m,c,f,h;var g=Markup._getDatabaseDomainInfo(j);var n=g[0];if(j.unnamed){if(!(j.unnamed in g_sounds)){return""}if(!g_sounds[j.unnamed].hasOwnProperty("files")){return""}if(g_sounds[j.unnamed].files.length==0){return""}if(!g_sounds[j.unnamed].files[0].hasOwnProperty("type")){return""}l=g_sounds[j.unnamed].files[0].type;b=g_sounds[j.unnamed].files[0].url;m=g_sounds[j.unnamed].name?g_sounds[j.unnamed].name:g_sounds[j.unnamed].files[0].title;c=n+"/sound="+j.unnamed+"/"+$WH.urlize(m)}else{if(Markup.allow<MARKUP_CLASS_STAFF){return""}b=j.src;m=j.title?j.title:"(Unknown)";if(j.hasOwnProperty("type")){l=j.type}else{switch(j.src.toLowerCase().substr(-4)){case".mp3":l="audio/mpeg";break;case".ogg":l='audio/ogg; codecs="vorbis"';break}}if(j.src2){f=j.src2;if(j.hasOwnProperty("type2")){h=j.type2}else{switch(j.src2.toLowerCase().substr(-4)){case".mp3":h="audio/mpeg";break;case".ogg":h='audio/ogg; codecs="vorbis"';break}}}}var k='<audio preload="none" controls="true"'+Markup._addGlobalAttributes(j);if(j.unnamed){k+=' rel="sound='+j.unnamed+'"'}k+=">";if(!(/^(https?:)?\/\//).test(b)){b=g_staticUrl+"/wowsounds"+b}k+='<source src="'+b+'"';if(l){k+=' type="'+l.replace(/"/g,"&quot;")+'"'}k+=">";if(f){k+='<source src="'+f+'"';if(h){k+=' type="'+h.replace(/"/g,"&quot;")+'"'}k+=">"}k+="</audio>";if(c){k='<div class="audiomarkup">'+k+'<br><a href="'+c+'">'+m+"</a></div>"}return k},fromHtml:function(c){var b=c.match(/<audio [^>]*\brel="sound=(\d+)/);if(b){return"[sound="+b[1]+"]"}return c.replace(/<audio\b[\s\S]*?><source\b[\s\S]*\bsrc="([^"]*?)"[\s\S]*?<\/audio>/gi,'[sound src="$1"]')}},span:{empty:false,attr:{"class":{req:false,valid:/^[a-z0-9 _-]+$/i},style:{req:false,valid:/^[^<>]+$/},unnamed:{req:false,valid:/^(hidden|invisible)$/},tooltip:{req:false,valid:/\S+/},tooltip2:{req:false,valid:/\S+/}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){var f="<span"+Markup._addGlobalAttributes(b);var c=[];if(b.unnamed=="hidden"){c.push("display: none")}else{if(b.unnamed=="invisible"){c.push("visibility: hidden")}}if(c.length>0){f+=' style="'+c.join(";")+'"'}if(b.tooltip&&Markup.tooltipTags[b.tooltip]){f+=" onmouseover=\"$WH.Tooltip.showAtCursor(event, Markup.tooltipTags['"+b.tooltip+"'], 0, 0, "+(Markup.tooltipBare[b.tooltip]?"null":"'q'")+", "+(b.tooltip2&&Markup.tooltipTags[b.tooltip2]?"Markup.tooltipTags['"+b.tooltip2+"']":"null")+')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"'}f+=">";return[f,"</span>"]},fromHtml:function(b){return b.replace(/<span\b([\s\S]*?)>([\s\S]*?)<\/span>/gi,function(h,l,k){var g=/style="[\s\S]*?color:\s?#(\w{6});?/i;var j=l.match(g);if(j){var c={ffd100:"q","9d9d9d":"q0",ffffff:"q1","1eff00":"q2","0070dd":"q3",a335ee:"q4",ff8000:"q5",e5cc80:"q6","00ccff":"q8","71d5ff":"q9",ff4040:"q10",ffff98:"q13",ff8040:"r1",ffff00:"r2","40bf40":"r3","808080":"r4",c69b6d:"c1",f48cba:"c2",aad372:"c3",fff468:"c4",c41e3b:"c6","2359ff":"c7","68ccef":"c8","9382c9":"c9","008467":"c10",ff7c0a:"c11"};var f=c[j[1]];if(f){return"[color="+f+"]"+k+"[/color]"}}return h})}},spell:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},diff:{req:false,valid:/^[0-9]+$/},diffnew:{req:false,valid:/^[12]$/},icon:{req:false,valid:/^(false|tiny|small|medium|large)$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},buff:{req:false,valid:/^true$/},mop:{req:false,valid:/^[0-9]+$/},mopname:{req:false,valid:/\S+/},mopicon:{req:false,valid:/\S+/},tooltip:{req:false,valid:/^true$/},tempname:{req:false}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(p){var f=p.unnamed;var m=Markup._getDatabaseDomainInfo(p);var c=m[0];var r=m[1];var s=[];var q=null;var o="";if(p.buff){s.push("buff")}if(p.diff){s.push("diff="+p.diff)}if(p.diffnew){s.push("diffnew="+p.diffnew)}if(p.mop){s.push("mop="+p.mop)}if(p.tempname){q=p.tempname}if(g_spells[f]&&g_spells[f][r]){var n=g_spells[f];var l=[];var k=false;var g="";var j="";o="";switch(p.icon){case"false":break;case"large":case"medium":case"small":var b=$WH.ce("div");$WH.ae(b,Icon.create(n.icon.toLowerCase(),Icon.sizeIds[p.icon],null,c+"/spell="+f,null,null,null,null,true));o=b.innerHTML.replace(/^(<span[^>]+)>/,'$1 data-entity-icon="spell">');k=true;break;case"tiny":default:if(p["class"]){p["class"]+=" icontiny"}else{p["class"]="icontiny"}g='<img src="'+g_staticUrl+"/images/wow/icons/tiny/"+n.icon.toLowerCase()+'.gif" align="absmiddle" /> <span class="tinyicontxt">';j="</span>";k=true}o+='<a href="'+c+"/spell="+f+'"'+(s.length?' rel="'+s.join("&")+'"':"")+(l.length?' class="'+l.join(" ")+'"':"")+Markup._addGlobalAttributes(p)+' data-entity="spell" data-entity-has-icon="'+JSON.stringify(k)+'">'+g+Markup._safeHtml(n[r])+j+"</a>"}else{if(p.mop&&p.mopname&&p.mopicon&&p.mopicon.indexOf(".jpg",p.mopicon.length-4)!==-1){o='<span class="tooltip-inside-icon" style="background:url('+g_staticUrl+"images/wow/icons/mop-talents/18/"+Markup._safeHtml(p.mopicon)+')"></span> <a href="'+c+"/spell="+f+'"'+(s.length?' rel="'+s.join("&")+'"':"")+' data-entity="spell"><span class="tinyicontxt">'+Markup._safeHtml(p.mopname)+"</span></a>"}else{o='<a href="'+c+"/spell="+f+'"'+(s.length?' rel="'+s.join("&")+'"':"")+' data-entity="spell">'+(q?q:("("+LANG.types[6][0]+" #"+f+")"))+"</a>"}}if(p.tooltip){var h=Markup.callbacks.getCallbackElementId();window.setTimeout($WowheadPower.replaceWithTooltip.bind($WowheadPower,h,6,f),5);o='<span id="'+h+'">'+o+"</span>"}return o},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_spells[g]&&g_spells[g][c]){return Markup._safeHtml(g_spells[g][c])}return LANG.types[6][0]+" #"+g}},spoiler:{block:true,empty:false,attr:{unnamed:{req:false,valid:/^.*$/}},rtrim:true,ltrim:true,itrim:true,toHtml:function(b){clearTimeout(Markup.timers.spoilers);Markup.timers.spoilers=setTimeout(function(){$('button[data-spoiler-revealer="needs-handler"].spoiler-revealer').each(function(){this.onclick=function(){this.parentNode.parentNode.className+=" spoiler-reveal"};this.removeAttribute("data-spoiler-revealer")});$('button[data-spoiler-hider="needs-handler"].spoiler-hider').each(function(){this.onclick=function(){this.parentNode.parentNode.className=this.parentNode.parentNode.className.replace(/ *spoiler-reveal/g,"")};this.removeAttribute("data-spoiler-hider")})},1);return['<div class="pad"></div><div class="spoiler-wrapper"><div class="spoiler-desc"><b>'+LANG.markup_spoil+"</b> "+(b.unnamed?b.unnamed:"")+' <button type="button" class="spoiler-revealer btn btn-small btn-site" data-spoiler-revealer="needs-handler">'+LANG.markup_spoiler_reveal+'</button><button type="button" class="spoiler-hider btn btn-small btn-site" data-spoiler-hider="needs-handler">'+LANG.markup_spoiler_hide+"</button></div><div"+Markup._addGlobalAttributes(b)+' class="spoiler">',"</div></div>"]}},statistic:{empty:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},icon:{req:false,valid:/^false$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(b){var j=b.unnamed;var h=Markup._getDatabaseDomainInfo(b);var f=h[0];var g=h[1];if(g_achievements[j]&&g_achievements[j][g]){var c=g_achievements[j];return'<a href="'+f+"/achievement="+j+'"'+(!b.icon?' class="icontiny"><img src="'+g_staticUrl+"/images/wow/icons/tiny/"+c.icon.toLowerCase()+'.gif"':"")+Markup._addGlobalAttributes(b)+' align="absmiddle" /> <span class="tinyicontxt">'+Markup._safeHtml(c[g])+"</span></a>"}return'<a href="'+f+"/achievement="+j+'"'+Markup._addGlobalAttributes(b)+">("+LANG.types[10][0]+" #"+j+")</a>"},toText:function(b){var h=b.unnamed;var g=Markup._getDatabaseDomainInfo(b);var c=g[0];var f=g[1];if(g_achievements[h]&&g_achievements[h][f]){return Markup._safeHtml(g_achievements[h][f])}return LANG.types[10][0]+" #"+h}},style:{ltrim:true,rtrim:true,empty:false,allowedClass:MARKUP_CLASS_ADMIN,allowedChildren:{"<text>":1},rawText:true,taglessSkip:true,toHtml:function(b){$WH.addCss(b._contents);return[""]}},sub:{empty:false,toHtml:function(b){return["<sub"+Markup._addGlobalAttributes(b)+">","</sub>"]},fromHtml:function(b){return b.replace(/<sub\b[\s\S]*?>([\s\S]*?)<\/sub>/gi,"[sub]$1[/sub]")}},sup:{empty:false,toHtml:function(b){return["<sup"+Markup._addGlobalAttributes(b)+">","</sup>"]},fromHtml:function(b){return b.replace(/<sup\b[\s\S]*?>([\s\S]*?)<\/sup>/gi,"[sup]$1[/sup]")}},tabs:{block:true,empty:false,ltrim:true,rtrim:true,itrim:true,allowedClass:MARKUP_CLASS_STAFF,allowedChildren:{tab:1},attr:{name:{req:true,valid:/\S+/},width:{req:false,valid:/^[0-9]+(px|em|\%)$/}},toHtml:function(c){c.id=$WH.urlize(c.name);var b=Markup.preview;var j='<div class="clear"></div><div id="dsf67g4d-'+c.id+(b?"-preview":"")+'"></div>';j+="<div";if(c.width){j+=' style="width: '+c.width+'"'}j+=">";j+='<div class="tabbed-contents">';var g=c._contents;for(var f=0;f<g.length;++f){var h=g[f];j+='<div id="tab-'+c.id+"-"+h.id+'" style="display: none">';j+=h.content;j+='<div class="clear"></div>';j+="</div>"}j+="</div>";j+="</div>";setTimeout(Markup.createTabs.bind(null,c,g,(b?"preview":"")),100);return[j]}},tab:{block:true,empty:false,ltrim:true,rtrim:true,itrim:true,allowedClass:MARKUP_CLASS_STAFF,allowedParents:{tabs:1},attr:{name:{req:true,valid:/[\S ]+/},icon:{req:false,valid:/\S+/}},toHtml:function(b){b.id=$WH.urlize(b.name);b.name=$WH.stringReplace(b.name,"_"," ");if(typeof(b["class"])!="undefined"){b["class"]=$WH.stringReplace(b["class"],"_"," ")}return[{content:b._contents,id:b.id,name:b.name,icon:b.icon,"class":b["class"]}]}},table:{empty:false,ltrim:true,rtrim:true,itrim:true,allowedChildren:{tr:1},attr:{border:{req:false,valid:/^[0-9]+$/},cellspacing:{req:false,valid:/^[0-9]+$/},cellpadding:{req:false,valid:/^[0-9]+$/},width:{req:false,valid:/^[0-9]+(px|em|\%)$/}},toHtml:function(b){var c="<table"+Markup._addGlobalAttributes(b);if(b.border!=undefined){c+=' border="'+b.border+'"'}if(b.cellspacing!=undefined){c+=' cellspacing="'+b.cellspacing+'"'}if(b.cellpadding!=undefined){c+=' cellpadding="'+b.cellpadding+'"'}if(b.width!=undefined){c+=' style="width: '+b.width+'"'}c+="><tbody>";return[c,"</tbody></table>"]},fromHtml:function(k,j){j=j||0;var b;if(b=Markup.matchOuterTags(k,"<table\\b[\\s\\S]*?>","</table>","g")){for(var f=0;f<b.length;++f){var c=b[f][1].match(/border[:="]+\s*([0-9]+)/i),g=b[f][1].match(/width[:="]+\s*([0-9]+)/i),h=b[f][1].match(/cellspacing="([\s\S]+?)"/i),l=b[f][1].match(/cellpadding="([\s\S]+?)"/i);k=k.replace(b[f][1]+b[f][0]+b[f][2],"\n"+Array(j+1).join("\t")+"[table"+(c?" border="+c[1]:"")+(g?" width="+g[1]:"")+(h?" cellspacing="+h[1]:"")+(l?" cellpadding="+l[1]:"")+"]"+Markup.tags.table.fromHtml(b[f][0],j+1)+"\n"+Array(j+1).join("\t")+"[/table]")}}return k}},talent:{empty:true,attr:{unnamed:{req:true,valid:/^#?[\/a-zA-Z0-9_-]+$/},editable:{req:false,valid:/^true$/},glyphs:{req:false,valid:/^false$/},specs:{req:false,valid:/^true$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},icons:{req:false}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},talentDivsOnPage:0,talentObjects:{},toHtml:function(b){var l=Markup._getDatabaseDomainInfo(b);this.talentDivsOnPage++;var c="markup-talent-"+this.talentDivsOnPage;if(b.unnamed.indexOf("-")<0){b.glyphs="false"}var h=this;var k={parent:c,embedded:true,markup:true,hash:b.unnamed.replace(/^#+/,""),editable:b.editable=="true",dataDomain:l[0]};var j=(function(f){var m=function(){if((!$WH.ge("markup-talent-"+f))||(!$WH.isSet("TalentCalc"))){window.setTimeout(m,250);return}h.talentObjects[f]=new TalentCalc(k)};return m})(this.talentDivsOnPage);if(this.talentDivsOnPage==1&&!$WH.isSet("TalentCalc")){$WH.loadAssets("talent-calc",j)}else{j()}var g="talentcalc-markup-parent";if(b.glyphs=="false"){g+=" talentcalc-markup-no-glyphs"}if(b.specs!="true"){g+=" talentcalc-markup-no-specs"}return'<div id="'+c+'" class="'+g+'"></div>'}},"talent-pvp":{empty:true,attr:{unnamed:{req:true,valid:/^#?[\/a-zA-Z0-9_-]+$/},editable:{req:false,valid:/^true$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},icons:{req:false}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},talentDivsOnPage:0,talentObjects:{},toHtml:function(b){var l=Markup._getDatabaseDomainInfo(b);this.talentDivsOnPage++;var c="markup-talent-pvp-"+this.talentDivsOnPage;var h=this;var k={id:"talent-pvp-"+this.talentDivsOnPage,parent:c,embedded:true,markup:true,hash:b.unnamed.replace(/^#+/,""),editable:b.editable=="true",dataDomain:l[0]};var j=(function(f){var m=function(){if((!$WH.ge("markup-talent-pvp-"+f))||(!$WH.isSet("HonorTalentCalc"))){window.setTimeout(m,250);return}h.talentObjects[f]=new HonorTalentCalc(k)};return m})(this.talentDivsOnPage);if(this.talentDivsOnPage==1&&!$WH.isSet("HonorTalentCalc")){$WH.loadAssets("honor-talent-calc",j)}else{j()}var g="honortalentcalc-markup-parent";return'<div id="'+c+'" class="'+g+'"></div>'}},tr:{empty:false,itrim:true,allowedChildren:{td:1},allowedParents:{table:1},toHtml:function(b){return["<tr"+Markup._addGlobalAttributes(b)+">","</tr>"]},fromHtml:function(g,f){f=f||0;var b;if(b=Markup.matchOuterTags(g,"<tr\\b[\\s\\S]*?>","</tr>","g")){for(var c=0;c<b.length;++c){g=g.replace(b[c][1]+b[c][0]+b[c][2],"\n\t"+Array(f+1).join("\t")+"[tr]"+Markup.tags.tr.fromHtml(b[c][0],f+1)+"\n"+Array(f+1).join("\t")+"[/tr]")}}return g}},td:{empty:false,itrim:true,allowedParents:{tr:1},attr:{unnamed:{req:false,valid:/^header$/},align:{req:false,valid:/^(right|left|center|justify)$/i},valign:{req:false,valid:/^(top|middle|bottom|baseline)$/i},colspan:{req:false,valid:/^[0-9]+$/},rowspan:{req:false,valid:/^[0-9]+$/},width:{req:false,valid:/^[0-9]+(px|em|\%)$/}},toHtml:function(b){var c="<"+(b.unnamed?"th":"td")+Markup._addGlobalAttributes(b);if(b.align!=undefined){c+=' align="'+b.align+'"'}if(b.valign!=undefined){c+=' valign="'+b.valign+'"'}if(b.colspan!=undefined){c+=' colspan="'+b.colspan+'"'}if(b.rowspan!=undefined){c+=' rowspan="'+b.rowspan+'"'}if(b.width!=undefined){c+=' style="width: '+b.width+'"'}c+=">";return[c,"</"+(b.unnamed?"th":"td")+">"]},fromHtml:function(o,l){l=l||0;var q=["td","th"],f;for(var h=0;h<q.length;++h){if(f=Markup.matchOuterTags(o,"<"+q[h]+"\\b[\\s\\S]*?>","</"+q[h]+">","g")){for(var k=0;k<f.length;++k){var b=f[k][1].match(/width[:="]+\s*([0-9]+)/i),n=f[k][1].match(/align="([\s\S]+?)"/i),p=f[k][1].match(/valign="([\s\S]+?)"/i),c=f[k][1].match(/colspan="([\s\S]+?)"/i),g=f[k][1].match(/rowspan="([\s\S]+?)"/i);o=o.replace(f[k][1]+f[k][0]+f[k][2],"\n\t\t"+Array(l+1).join("\t")+"[td"+(q[h]=="th"?"=header":"")+(b?" width="+b[1]:"")+(n?" align="+n[1]:"")+(p?" valign="+p[1]:"")+(c?" colspan="+c[1]:"")+(g?" rowspan="+g[1]:"")+"]"+Markup.tags.td.fromHtml(f[k][0],l+1)+"[/td]")}}}return o}},threat:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},diff:{req:false,valid:/^[0-9]+$/},diffnew:{req:false,valid:/^[12]$/},tempname:{req:false}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(c){var l=c.unnamed;var k=Markup._getDatabaseDomainInfo(c);var h=k[0];var j=k[1];var b=[];var g=null;if(c.diff){b.push("diff="+c.diff)}if(c.diffnew){b.push("diffnew="+c.diffnew)}if(c.tempname){g=c.tempname}if(g_threats[l]&&g_threats[l][j]){var f=g_threats[l];return'<a href="'+h+"/threat="+l+'"'+(b.length?' rel="'+b.join("&")+'"':"")+(!c.icon?' class="icontiny"><img src="'+g_staticUrl+"/images/wow/icons/tiny/"+f.icon.toLowerCase()+'.gif" align="absmiddle"':"")+Markup._addGlobalAttributes(c)+"> "+Markup._safeHtml(f[j])+"</a>"}return'<a href="'+h+"/threat="+l+'"'+(b.length?' rel="'+b.join("&")+'"':"")+Markup._addGlobalAttributes(c)+">"+(g?g:("("+LANG.types[26][0]+" #"+l+")"))+"</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_threats[g]&&g_threats[g][c]){return Markup._safeHtml(g_threats[g][c])}return LANG.types[26][0]+" #"+g}},time:{empty:true,count:0,attr:{until:{req:false,valid:/^\d+$/},since:{req:false,valid:/^\d+$/},server:{req:false,valid:/^true$/}},validate:function(b){if(!b.until&&!b.since){return false}return true},toHtml:function(b){var f=Markup.tags.time.count++;var c='<span title="'+(new Date((b.until?b.until:b.since)*1000)).toLocaleString()+'" id="markupTime'+f+'">'+Markup.tags.time.getTime(b)+"</span>";setInterval(Markup.tags.time.updateTime.bind(null,f,b),5000);return c},getTime:function(b){var f;if(b.server){f=g_serverTime.getTime()/1000}else{f=(new Date()).getTime()/1000}var c=0;if(b.until){c=b.until-f}else{c=f-b.since}if(c>0){return $WH.formatTimeElapsed(c)}else{return"0 "+LANG.timeunitspl[6]}},updateTime:function(f,b){var c=$WH.ge("markupTime"+f);if(!c){return}c.firstChild.nodeValue=Markup.tags.time.getTime(b)}},toc:{block:true,post:true,trim:true,ltrim:true,rtrim:true,collect:{h2:1,h3:1,"major-heading":1,"minor-heading":1,toggler:1,changelog:1},exclude:{tabs:{h2:1,h3:1,"major-heading":1,"minor-heading":1},minibox:{h2:1,h3:1,"major-heading":1,"minor-heading":1}},allowedClass:MARKUP_CLASS_STAFF,attr:{h3:{req:false,valid:/^false$/},"minor-heading":{req:false,valid:/^false$/}},postHtml:function(r,c){var t="<h3";var h=["heading-size-3"];if(r.first){h.push("first")}if(r.last){h.push("last")}if(h.length>0){t+=' class="'+h.join(" ")+'"'}t+=Markup._addGlobalAttributes(r)+">"+LANG.markup_toc+"</h3><ul>";var l="<b>";var v="</b>";var q=$WH.ge("guide-view-toc");if(q){t="<ul>";l=v=""}var s="";var p=1;var u=(r.h3!="false"&&r["minor-heading"]!="false");var b=[];for(var g in c.h2){b.push(c.h2[g])}for(var g in c["major-heading"]){b.push(c["major-heading"][g])}for(var g in c.h3){b.push(c.h3[g])}for(var g in c["minor-heading"]){b.push(c["minor-heading"][g])}for(var g in c.toggler){b.push(c.toggler[g])}for(var g in c.changelog){b.push(c.changelog[g])}b.sort(function(k,j){return k.offset-j.offset});var w=false;for(var o in b){if(b[o].name=="h2"||b[o].name=="major-heading"){w=true;break}}for(var n in b){g=b[n];switch(g.name){case"changelog":if(s=="h3"){t+="</ul>";p--}t+="<li>"+l+"<a href='#guide-changelog' onclick=\"Markup.toggleReveal('changelog');\">Changelog</a>"+v+"</li>";s="h2";break;case"toggler":if((g.attr.toc!="false")&&g.attr.name){var f=g.attr.size||3;if(f==3&&s=="h2"){t+="<ul>";p++}else{if(f==2&&s=="h3"){t+="</ul>";p--}}t+="<li>"+l+"<a href='#"+(g.attr.id?$WH.urlize(g.attr.id):$WH.urlize(g.attr.name))+"'>"+g.attr.name+"</a>"+v+"</li>";s="h"+f}break;case"h2":case"major-heading":if(g.attr.toc!="false"){if(s=="h3"){t+="</ul>";p--}t+="<li>"+l+"<a href='#"+(g.attr.id?$WH.urlize(g.attr.id):$WH.urlize(g.attr._textContents))+"'>"+g.attr._textContents+"</a>"+v+"</li>";s="h2"}break;case"h3":case"minor-heading":if(u&&g.attr.toc!="false"&&(s!=""||c.h2.length==0||c["major-heading"].length==0)){if(s=="h2"){t+="<ul>";p++}else{if(!s&&w){t+="<li>"+LANG.overview+"</li><ul>";p++}}t+="<li>"+l+"<a href='#"+(g.attr.id?$WH.urlize(g.attr.id):$WH.urlize(g.attr._textContents))+"'>"+g.attr._textContents+"</a>"+v+"</li>";s="h3"}break}}for(var m=0;m<p;m++){t+="</ul>"}if(q){q.innerHTML=t;return""}return t}},toggler:{empty:false,attr:{id:{req:false,valid:/^[a-z0-9_-]+$/i},closed:{req:false,valid:/^(true|false)$/i},"class":{req:false,valid:/^[a-z0-9 _-]+$/i},icon:{req:false,valid:/^[a-z0-9 _-]+$/i},name:{req:false,valid:/^.+$/i},size:{req:false,valid:/^[2-6]$/i},toc:{req:false,valid:/^false$/i},unnamed:{req:false,valid:/^hidden$/i}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){if(b.id){var f='<a href="javascript:;" class="disclosure-'+(b.unnamed?"off":"on")+'" onclick="return $WH.disclose($WH.ge(\''+b.id+"'), this)\">";return[f,"</a>"]}var k="toggler-set-"+Markup.getAutoIncrementCount("toggler");var c="";if(b.icon){var j=$WH.ce("div",{},Icon.create(b.icon,0,null,false,null,null,null,null,true));c=j.innerHTML}var g=$WH.getMajorHeading('<a href="javascript:;" class="toggler-'+(b.closed=="true"?"off":"on")+'" onclick="return $WH.toggle.call(this, $WH.ge(\''+k+'\'))"><span class="fa fa-chevron-right fa-fw"></span> <span class="toggler-title'+(c?" toggler-title-with-icon":"")+(b["class"]?" "+b["class"]:"")+'">'+c+(b.name||LANG.su_toggle)+"</span></a>",b.size||3,null,{asString:true,id:b.id||$WH.urlize(b.name)});var h=g+'<div id="'+k+'"'+(b.closed=="true"?' style="display:none"':"")+">";return[h,"</div>"]}},tooltip:{empty:false,attr:{unnamed:{req:false,valid:/\S+/},name:{req:false,valid:/\S+/},bare:{req:false,valid:/^true$/i},label:{req:false,valid:/[\S ]+/}},taglessSkip:true,allowedClass:MARKUP_CLASS_STAFF,validate:function(b){if(!b.unnamed&&!b.name){return false}return true},toHtml:function(b){if(b.unnamed){return['<span class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, LANG[\''+b.unnamed+'\'], 0, 0, \'q\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">',"</span>"]}else{Markup.tooltipTags[b.name]=(b.label?'<table><tr><td class="q0" style="width: 300px"><small>'+b.label+"</small></td></tr></table>":"")+b._contents;if(b.bare){Markup.tooltipBare[b.name]=true}return[""]}}},twitch:{empty:true,attr:{unnamed:{req:true,valid:/^\w+$/}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){var c=location.protocol=="https:"?"https://www-cdn.jtvnw.net/swflibs/TwitchPlayer.swf?channel="+b.unnamed:"http://player.twitch.tv/?channel="+b.unnamed;return'<iframe src="'+c+'" frameborder="0" scrolling="no" height="378" width="620"></iframe>'}},u:{empty:false,allowInReplies:true,toHtml:function(b){return["<ins"+Markup._addGlobalAttributes(b)+">","</ins>"]},fromHtml:function(b){return b.replace(/<(ins|u)\b[\s\S]*?>([\s\S]*?)<\/\1>/gi,"[u]$2[/u]")}},ul:{block:true,empty:false,ltrim:true,rtrim:true,itrim:true,allowedChildren:{li:1},toHtml:function(b){var c="<ul";var f=[];if(b.first){f.push("first")}if(b.last){f.push("last")}if(f.length>0){c+=' class="'+f.join(" ")+'"'}c+=Markup._addGlobalAttributes(b)+">";return[c,"</ul>"]},fromHtml:function(g,f){f=f||0;var b;if(b=Markup.matchOuterTags(g,"<ul\\b[\\s\\S]*?>","</ul>","g")){for(var c=0;c<b.length;++c){g=g.replace(b[c][1]+b[c][0]+b[c][2],"\n"+Array(f+1).join("\t")+"[ul]"+Markup.tags.ul.fromHtml(b[c][0],f+1)+"\n"+Array(f+1).join("\t")+"[/ul]")}}return g}},url:{allowedClass:MARKUP_CLASS_USER,allowInReplies:true,empty:false,helpText:"[url=http://www.google.com]"+LANG.markup_url+"[/url]",attr:{unnamed:{req:false,valid:/\S+/},rel:{req:false,valid:/((item|quest|spell|achievement|npc|object|petability|pet-ability)=([0-9]+)|np)/},onclick:{req:false,valid:/[\S ]+/},style:{req:false,valid:/^[^"<>]+$/},tooltip:{req:false,valid:/\S+/},tooltip2:{req:false,valid:/\S+/},newwindow:{req:false,valid:/^true$/}},validate:function(b){if(b.onclick&&Markup.allow<Markup.CLASS_ADMIN){return false}if(b.tooltip&&Markup.allow<Markup.CLASS_STAFF){return false}var c="";if(b.unnamed&&/^(mailto:|irc:)/i.test(b.unnamed.trim())&&Markup.allow<Markup.CLASS_STAFF){return false}if(b.unnamed&&/^(javascript:)/i.test(b.unnamed.trim())){return false}return true},toHtml:function(b){var f;if(b.unnamed){f=b.unnamed;f=f.replace(/&amp;/,"&");if(!f.match(/^([^:\\.\/]+):/i)&&f.charAt(0)!="/"&&f.charAt(0)!="#"){f="/"+f}if(Markup._isUrlSafe(f,true)){var c="<a"+Markup._addGlobalAttributes(b)+' href="'+Markup._fixUrl(f)+'"';if(Markup._isUrlExternal(f)||b.newwindow){c+=' target="_blank"'}if(b.rel){c+=' rel="'+b.rel+'"'}if(b.onclick){c+=' onclick="'+b.onclick+'"'}if(b.tooltip&&Markup.tooltipTags[b.tooltip]){c+=" onmouseover=\"$WH.Tooltip.showAtCursor(event, Markup.tooltipTags['"+b.tooltip+"'], 0, 0, "+(Markup.tooltipBare[b.tooltip]?"null":"'q'")+", "+(b.tooltip2&&Markup.tooltipTags[b.tooltip2]?"Markup.tooltipTags['"+b.tooltip2+"']":"null")+')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"'}if(b.style&&Markup.allow>=Markup.CLASS_STAFF){c+=' style="'+b.style+'"'}c+=">";return[c,"</a>"]}else{return["",""]}}else{f=b._textContents;f=f.replace(/&amp;/,"&");if(Markup._isUrlSafe(f)){var c="<a"+Markup._addGlobalAttributes(b)+' href="'+Markup._fixUrl(f)+'"';if(Markup._isUrlExternal(f)){c+=' target="_blank"'}if(b.rel){c+=' rel="'+b.rel+'"'}if(b.onclick){c+=' onclick="'+b.onclick+'"'}if(b.style&&Markup.allow>=Markup.CLASS_STAFF){c+=' style="'+b.style+'"'}c+=">";return[c+f+"</a>"]}else{return["",""]}}},fromHtml:function(b){return b.replace(/<a\b[^>]*?href=\"(.+?)\"[\s\S]*?>([\s\S]*?)<\/a>/gi,"[url=$1]$2[/url]")}},video:{empty:true,attr:{id:{req:true,valid:/^[0-9]+$/},unnamed:{req:false,valid:/^embed$/i},"float":{req:false,valid:/^(left|right)$/i},shadow:{req:false,valid:/^(true|false)$/},border:{req:false,valid:/^[0-9]+$/}},ltrim:true,rtrim:true,allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){if(g_videos[b.id]){var g="",h=g_videos[b.id];var f=[];var c=[];if(b.unnamed){if(h.videoType==1){g+=Markup.toHtml("[youtube="+h.videoId+"]",{skipReset:true})}}else{if(!g_videos[Markup.uid]){g_videos[Markup.uid]=[]}g+='<div style="position: relative; display: -moz-inline-stack; display: inline-block; zoom: 1; *display: inline"><a href="'+$WH.sprintf(vi_siteurls[h.videoType],h.videoId)+'" onclick="if(!$WH.isLeftClick(event)) return; VideoViewer.show({videos: \''+Markup.uid+"', pos: "+g_videos[Markup.uid].length+'}); return false;"'+Markup._addGlobalAttributes(b)+">";g+='<img src="'+$WH.sprintf(vi_thumbnails[h.videoType],h.videoId)+'" ';if(b.border){if(b.border==0){f.push("no-border")}else{f.push("border");c.push("border-width:"+b.border+"px")}}else{f.push("content-image");if(b.shadow!="false"){f.push("content-image-shadowed")}}if(b["float"]){f.push("markup-float-"+b["float"])}if(f.length){g+='class="'+f.join(" ")+'" '}if(c.length){str+=' style="'+c.join(";")+'"'}if(h.hasCaption){g+='alt="'+Markup.removeTags(h.caption,{mode:Markup.MODE_SIGNATURE,skipReset:true})+'" '}g+='/><img src="'+g_staticUrl+"/images/icons"+MarkupIconPath+'/play-sm.png" style="opacity: 0.6; filter:alpha(opacity=60); position: absolute; width: 48px; height: 48px; top: 23px; left: 38px" />';g+="</a></div>";g_videos[Markup.uid].push($WH.dO(h))}return g}return"<b>Video #"+b.id+"</b>"}},visitedpage:{empty:false,attr:{unnamed:{req:true,valid:/^[0-9]+$/}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){$.post("/visited-page",{id:b.unnamed},function(){AchievementCheck()});return""}},wowheadresponse:{block:true,empty:false,rtrim:true,ltrim:true,itrim:true,attr:{unnamed:{req:true,valid:/[\S ]+/},roles:{req:true,valid:/[0-9]+/}},allowedModes:{article:1,quickfacts:1,comment:1},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){var h="<div"+Markup._addGlobalAttributes(b);var f=[];h+=' class="quote ';if(b.first){h+="firstmargin "}if(b.last){h=="last "}var g=b.unnamed.trim();if(g.length<=0){return["",""]}var c="";if(b.roles&U_GROUP_ADMIN){c="comment-blue"}else{c="comment-green"}if(g_customColors[g]){c="comment-"+g_customColors[g]}h+=c+'"><small class="icon-wowhead"><b class="'+c+'"><a href="/user='+g+'">'+g+"</a></b> "+LANG.markup_said+'</small><div class="pad"></div>';return[h,"</div>"]}},youtube:{empty:true,attr:{unnamed:{req:true,valid:/\S+/},title:{req:false,valid:/[\S ]+/},thumb:{req:false,valid:/\S+/},width:{req:false,valid:/^[0-9]+$/},height:{req:false,valid:/^[0-9]+$/}},allowedClass:MARKUP_CLASS_STAFF,toHtml:function(m){var b=m.width?m.width:640;var n=m.height?m.height:390;if(window.outerWidth&&window.outerWidth-20<b){b=window.outerWidth-20;n=Math.floor(b*0.6015625)}var p={height:n,width:b,videoId:m.unnamed,playerVars:{autoplay:1}};if(Markup.youTube.players.length==0){var g;if($WH.isSet("onYouTubeIframeAPIReady")&&(typeof window.onYouTubeIframeAPIReady=="function")){g=window.onYouTubeIframeAPIReady}else{g=function(){}}window.onYouTubeIframeAPIReady=function(){Markup.youTube.apiReady=true;g()};if(!$WH.isSet("YT")){window.YT={};$WH.ajaxIshRequest("https://www.youtube.com/iframe_api",true)}}var l=Markup.youTube.players.length;var f={id:l,containerId:"wh-youtube-"+l,yt:p,loaded:false};Markup.youTube.players.push(f);var h="";var q=(n/b)*100;var k="//i.ytimg.com/vi/"+p.videoId+"/sddefault.jpg";if(b<=480||$(document).width()<=500){k="//i.ytimg.com/vi/"+p.videoId+"/hqdefault.jpg"}if(m.thumb){k=m.thumb;h+=" wh-youtube-custom-thumb"}if(q<=35){h+=" wh-youtube-short"}var c="";if(m.title){c='<div class="wh-youtube-title">'+m.title+"</div>"}var j='<div class="wh-youtube'+h+'" id="wh-youtube-'+l+'" style="background:url('+k+");max-width:"+b+'px"><div class="wh-youtube-inner" style="padding-top:'+q+'%">'+c+'<i class="fa fa-circle"></i><i class="fa fa-play-circle"></i></div></div>';setTimeout((function(o){var r=$WH.ge("wh-youtube-"+o);if(r){r.onclick=Markup.youTube.onClick.bind(r,o)}}).bind(null,l),0);return j},fromHtml:function(k){var c;if(c=k.match(/<iframe\b[\s\S]*?src="[\s\S]*?youtube\.com\/embed\/[\s\S]*?"[\s\S]*?><\/iframe>/gi)){for(var g=0;g<c.length;++g){var b=c[g].match(/src="[\s\S]*?youtube\.com\/embed\/([\s\S]*?)"/i),h=c[g].match(/width[:="]+\s*([0-9]+)/i),j=c[g].match(/height[:="]+\s*([0-9]+)/i),f=c[g].match(/border[:="]+\s*([0-9]+)/i);k=k.replace(c[g],"[youtube="+b[1]+(h?" width="+h[1]:"")+(j?" height="+j[1]:"")+"]")}}return k}},center:{empty:false,allowInReplies:false,allowedClass:MARKUP_CLASS_STAFF,toHtml:function(b){return["<center>","</center>"]},fromHtml:function(b){return b.replace(/<center>([\s\S]+?)<\/center>/gi,"[pad][div align=center]$1[/div][pad]")}},title:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(b){var h=b.unnamed;var g=Markup._getDatabaseDomainInfo(b);var c=g[0];var f=g[1];if(g_titles[h]&&g_titles[h][f]){return'<a href="'+c+"/title="+h+'"'+Markup._addGlobalAttributes(b)+">"+Markup._safeHtml(g_titles[h][f])+"</a>"}return'<a href="'+c+"/title="+h+'"'+Markup._addGlobalAttributes(b)+">("+LANG.types[11][0]+" #"+h+")</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_titles[g]&&g_titles[g][c]){return Markup._safeHtml(g_titles[g][c])}return LANG.types[11][0]+" #"+g}},"transmog-set":{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(b){var h=b.unnamed;var g=Markup._getDatabaseDomainInfo(b);var c=g[0];var f=g[1];if(g_transmogsets[h]&&g_transmogsets[h][f]){return'<a href="'+c+"/transmog-set="+h+'"'+Markup._addGlobalAttributes(b)+' class="q'+g_transmogsets[h]["quality"]+'">'+Markup._safeHtml(g_transmogsets[h][f])+"</a>"}return'<a href="'+c+"/transmog-set="+h+'"'+Markup._addGlobalAttributes(b)+">("+LANG.types[101][0]+" #"+h+")</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_transmogsets[g]&&g_transmogsets[g][c]){return Markup._safeHtml(g_transmogsets[g][c])}return LANG.types[101][0]+" #"+g}},zone:{empty:true,allowInReplies:true,attr:{unnamed:{req:true,valid:/^[0-9]+$/},domain:{req:false,valid:MarkupDomainRegexMap.betaPtrLang},site:{req:false,valid:MarkupDomainRegexMap.betaPtrLang}},validate:function(b){if((b.domain||b.site)&&Markup.dbpage){return false}return true},toHtml:function(b){var h=b.unnamed;var g=Markup._getDatabaseDomainInfo(b);var c=g[0];var f=g[1];if(g_gatheredzones[h]&&g_gatheredzones[h][f]){return'<a href="'+c+"/zone="+h+'"'+Markup._addGlobalAttributes(b)+">"+Markup._safeHtml(g_gatheredzones[h][f])+"</a>"}return'<a href="'+c+"/zone="+h+'"'+Markup._addGlobalAttributes(b)+">("+LANG.types[7][0]+" #"+h+")</a>"},toText:function(b){var g=b.unnamed;var f=Markup._getDatabaseDomainInfo(b);var c=f[1];if(g_gatheredzones[g]&&g_gatheredzones[g][c]){return Markup._safeHtml(g_gatheredzones[g][c])}return LANG.types[7][0]+" #"+g}},"--":{empty:true,allowedClass:MARKUP_CLASS_STAFF,trim:true,ltrim:true,rtrim:true,attr:{unnamed:{req:false}},toHtml:function(b){return""},toText:function(b){return""}}},_addGlobalAttributes:function(b){var c="";if(Markup.allow<Markup.CLASS_STAFF){return c}if(b.id){c+=' id="'+b.id+'"'}if(b.title){c+=' title="'+Markup._safeQuotes(b.title)+'"'}if(b["class"]){c+=' class="'+b["class"]+'"'}if(b.style){c+=' style="'+b.style+'"'}if(b["data-highlight"]){c+=' data-highlight="'+b["data-highlight"]+'"'}return c},_generateTagDocs:function(g,c){var b=Markup.tags[g];if(!b){return""}if(c){if((b.allowedClass&&b.allowedClass>c)||(!b.helpText&&(b.empty||b.allowedParents||b.allowedChildren||!LANG["markup_"+g]))){return""}if(b.helpText&&typeof b.helpText=="function"){var k=b.helpText()}else{if(b.helpText&&typeof b.helpText=="string"){var k=b.helpText}else{var k="["+g+"]"+LANG["markup_"+g].toLowerCase()+"[/"+g+"]"}}return"<tr><td><pre>"+k+"</pre></td><td>"+Markup.toHtml(k,{skipReset:true})+"</td></tr>"}var k='<div><h3 class="heading-size-3 first">Tag: ['+Markup._safeHtml(g)+"]</h3>";k+='<table class="grid">';if(b.attr){k+='<tr><td align="right" width="200">Attributes:</td><td>';for(var f in b.attr){k+='<div style="margin: 5px; display: inline-block"><table><tr><th style="background-color: #242424; font-weight: bolder" colspan="2">';if(f=="unnamed"){k+="Self (["+g+"=???])"}else{k+=f}k+="</th></tr>";k+='<tr><td align="right">Required:</td><td>'+(b.attr[f].req?"Yes":"No")+"</td></tr>";k+='<tr><td align="right">Valid:</td><td>'+(b.attr[f].valid?Markup._safeHtml(b.attr[f].valid.toString()):"--")+"</td></tr></table></div>"}k+="</td></tr>"}k+='<tr><td align="right" width="200">Has closing tag:</td><td>'+(b.empty?"No":"Yes")+"</td></tr>";k+='<tr><td align="right">Required group:</td><td>';if(b.allowedClass==MARKUP_CLASS_ADMIN){k+="Administrator"}else{if(b.allowedClass==MARKUP_CLASS_STAFF){k+="Staff"}else{if(b.allowedClass==MARKUP_CLASS_PREMIUM){k+="Premium"}else{if(b.allowedClass&&b.allowedClass!=MARKUP_CLASS_PENDING){k+="Not pending"}else{k+="None"}}}}k+="</td></tr>";if(b.allowedChildren){k+='<tr><td align="right">Allowed children:</td><td>';for(var h in b.allowedChildren){k+=Markup._safeHtml(h)+"<br />"}k+="</td></tr>"}if(b.allowedParents){k+='<tr><td align="right">Allowed parents:</td><td>';for(var h in b.allowedParents){k+=Markup._safeHtml(h)+"<br />"}k+="</td></tr>"}if(b.presets){k+='<tr><td align="right">Preset values:</td><td><table>';for(var j in b.presets){k+='<tr><td align="right">'+j+"</td><td>"+Markup._safeHtml(b.presets[j])+"</td></tr>"}k+="</table></td></tr>"}if(b.trim){k+='<tr><td colspan="2">Trim whitespace</td></tr>'}if(b.ltrim){k+='<tr><td colspan="2">Trim preceding whitespace</td></tr>'}if(b.rtrim){k+='<tr><td colspan="2">Trim following whitespace</td></tr>'}if(b.itrim){k+='<tr><td colspan="2">Trim whitespace around interior content</td></tr>'}if(b.block){k+='<tr><td colspan="2">Automatically remove top padding if not the first item</td></tr>'}k+="</table></div>";return k},_init:function(){if(!this.inited){var c=[],f=[],h=[];for(var b in Markup.tags){if(Markup.tags[b].block){this.firstTags[b]=true}if(Markup.tags[b].exclude){for(var g in Markup.tags[b].exclude){if(!this.excludeTags[g]){this.excludeTags[g]={}}this.excludeTags[g][b]=Markup.tags[b].exclude[g]}}if(Markup.tags[b].post){this.postTags.push(b)}if(Markup.tags[b].trim){h.push(b)}if(Markup.tags[b].ltrim){c.push(b)}if(Markup.tags[b].rtrim){f.push(b)}}if(c.length>0){this.ltrimRegex=new RegExp("\\s*\\[("+c.join("|")+")([^a-z0-9]+.*)?]","ig")}if(f.length>0){this.rtrimRegex=new RegExp("\\[/("+f.join("|")+")\\]\\s*","ig")}if(h.length>0){this.trimRegex=new RegExp("\\s*\\[("+h.join("|")+")([^\\[]*)?\\]\\s*","ig")}this.inited=true;$(function(){$("body").delegate("[data-highlight]","mouseenter",function(){var j=$(this).attr("data-highlight").split(":");if(j.length!=2){return}var k=$("#"+j[0]).get(0),n=parseInt(j[1]),m=$(k).val();if(!k||!n||!m){return}var l=$(k).val(m.substr(0,n))[0].scrollHeight;$(k).val(m).animate({scrollTop:l},250);k.selectionStart=n;k.selectionEnd=n})})}},_safeJsString:function(b){return b.replace(/'/g,"'")},_safeQuotes:function(b){return b.replace('"','"').replace("'","'")},_safeHtml:function(b){var c=["nbsp","ndash"];if(typeof b=="undefined"){return""}b=b.replace(/&/g,"&amp;");if(c.length>0){b=b.replace(new RegExp("&amp;("+c.join("|")+");","g"),"&$1;")}return b.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},_preText:function(b){b=Markup._safeHtml(b);b=b.replace(/\n/g,"<br />");return b},_getDatabaseDomainInfo:function(c){var h="";var k=Markup.nameCol;var l=location.hostname.split(".");var j="",g="";if(l.length>=4||l[0]=="local"||l[0]=="vagrant"){if(/^staging\d+$/.test(l[l.length-3])){g="."+l[l.length-3]}j=l[0]+"."}var b=false;if(c.domain){b=c.domain}else{if(c.site){b=c.site}else{if(Markup.defaultSource){b=MarkupSourceMap[Markup.defaultSource]}}}if(b){switch(b){case"beta":b="legion";break;case"live":case"wod":case"mop":case"www":b="www";if(j!=""){j=j.replace(/\.$/,"")}break}h="//"+j+(b=="www"&&j!=""?"":b)+g+".wowhead.com";var f=b=="live"?"www":b;k="name_"+Markup.domainToLocale[f]}else{h=$WH.getRelativeHostPrefix()}return[h,k,b]},_isUrlSafe:function(g,b){if(!g){return true}if(g=="javascript:;"){return true}var c=g.match(/^([^:\\./]+):/i);if(c&&c[1]){var f=c[1];if(f=="http"||f=="https"){return true}if(b&&(f=="mailto"||f=="irc")){return true}if(f!="mailto"&&g.indexOf("://")==-1){return true}return false}return true},_fixUrl:function(b){if(!b){return""}var c=b.charAt(0);if(c=="/"||c=="?"){b=b.replace(/^[\/\?]+/,"");b="/"+b}return b},_isUrlExternal:function(c){if(!c){return false}var b=$WH.ce("a");b.href=c;return !(!b.hostname||/(^|\.)wowhead\.com$/.test(b.hostname))},_nodeSearch:function(c,b,f){if(!f){f=0}if(f>=3){return}if(c.name==b){return true}else{if(c.parent){return Markup._nodeSearch(c.parent,b,f+1)}}},_parse:function(r,h){Markup.nameCol="name_"+Locale.getName();if(h&&h.locale){Markup.nameCol="name_"+Markup.domainToLocale[h.locale]}else{if($WH.isBeta()){Markup.nameCol="name_beta"}else{if($WH.isPtr()){Markup.nameCol="name_ptr"}}}if(!r){r=""}r=r.replace(/\r/g,"");if(!h){h={}}if(!h.skipReset){Markup.uid=h.uid||"abc";Markup.root=h.root;Markup.preview=h.preview||false;Markup.dbpage=h.dbpage||false;Markup.defaultSource=false;if(Markup.uid!="abc"){g_screenshots[Markup.uid]=[]}}if(h.roles&&(h.roles&(U_GROUP_ADMIN|U_GROUP_EDITOR|U_GROUP_MOD|U_GROUP_BUREAU|U_GROUP_DEV|U_GROUP_BLOGGER))&&h.mode!=Markup.MODE_SIGNATURE){h.mode=Markup.MODE_ARTICLE}Markup.mode=h.mode||Markup.MODE_ARTICLE;Markup.allow=h.allow||Markup.CLASS_STAFF;Markup.inBlog=h.inBlog?h.inBlog:0;if(h.stopAtBreak){var y=r.indexOf("[break]");if(y!=-1){r=r.substring(0,y)}}else{r=r.replace("[break]","")}var o=new MarkupTree();r=r.trim();if(this.postTags.length){for(var v in this.postTags){var G=this.postTags[v];if(r.indexOf("["+G)!=-1){if(!(Markup.tags[G].allowedModes&&Markup.tags[G].allowedModes[MarkupModeMap[h.mode]]==undefined)){for(var l in Markup.tags[G].collect){this.collectTags[l]=true}}}}}r=r.replace(/\n(\s*)\n/g,"\n\n");var w=r.length;var A=0,m=0,j=-1,n=-1,b=true,t=false;var c=function(K){var H,J,I;if(K.charAt(0)=='"'||K.charAt(0)=="'"){H=K.charAt(0);var s=K.indexOf(H,1);if(s>-1){I=K.substring(1,s);K=K.substring(s+1).trim();return{value:Markup._safeHtml(I),str:K}}}J=K.indexOf(" ");if(J>-1){I=K.substring(0,J);K=K.substring(J+1).trim()}else{I=K;K=""}return{value:I,str:K}};var u=/^\s*[a-z0-9]+\s*=/;while(m<w){j=r.indexOf("[",m);if(j>-1){m=j+1;if(j>0&&r.charAt(j-1)=="\\"){b=false;j=-1}else{n=r.indexOf("]",m)}}else{m=w}var f,p={};if(h.highlight&&$(h.highlight)){p["data-highlight"]=h.highlight+":"+j}if(n>-1){var C=r.substring(j+1,n);if(C.charAt(0)=="/"){t=true;f=C.substr(1).trim().toLowerCase()}if(!t){var B=C.indexOf(" "),z=C.indexOf("=");var D;if((z<B||B==-1)&&z>-1){f=C.substring(0,z).toLowerCase();C=C.substring(z+1).trim();var F=c(C);C=F.str;if(Markup.tags[f]==undefined||Markup.tags[f].attr==undefined||Markup.tags[f].attr.unnamed==undefined){b=false}else{p.unnamed=F.value}}else{if(B>-1){f=C.substring(0,B).toLowerCase();C=C.substring(B+1).trim();if(C.indexOf("=")==-1){if(Markup.tags[f]==undefined||Markup.tags[f].attr==undefined||Markup.tags[f].attr.unnamed==undefined){b=false}else{p.unnamed=C}C=""}}else{f=C.toLowerCase();C=""}}if(Markup.tags[f]==undefined){b=false}else{if(b){var G=Markup.tags[f];while(C!=""){var q="";if(!u.test(C)){q="unnamed"}else{z=C.indexOf("=");if(z==-1){b=false;break}q=C.substring(0,z).trim().toLowerCase();C=C.substring(z+1).trim()}var F=c(C);C=F.str;if(G.attr==undefined||G.attr[q]==undefined){if(Markup.attributes[q]==undefined||(Markup.attributes[q].valid!=undefined&&!Markup.attributes[q].valid.test(F.value))){b=false;break}}p[q]=F.value}if(b&&G.attr){for(var E in G.attr){if(G.attr[E].req&&p[E]==undefined){b=false;break}else{if(p[E]==undefined){continue}}if(G.attr[E].valid!=undefined&&!G.attr[E].valid.test(p[E])){b=false;break}}if(b&&G.validate!=undefined){b=G.validate(p)}}}}}else{if(Markup.tags[f]==undefined){b=false}}}else{b=false}if(b){if(A!=j){var k=r.substring(A,j).replace(/\\\[/g,"[");var g={_rawText:k};o.openTag("<text>",g)}if(t){b=o.closeTag(f)}else{b=o.openTag(f,p)}if(b){A=m=n+1}else{A=j}}b=true;t=false;j=n=-1}if(A<w){var k=r.substr(A).replace(/\\\[/g,"[");var g={_rawText:k};o.openTag("<text>",g)}return o},createMaps:function(){for(var c=0;c<Markup.maps.length;++c){var b=Markup.maps[c];new Mapper({parent:b[0],zone:b[1],coords:b[2],unique:c})}Markup.maps=[]},toHtml:function(g,f){if(!f){f={}}if(!f.allow){if(f.roles){f.allow=Markup.rolesToClass(f.roles)}else{f.allow=Markup.CLASS_STAFF}}var b=Markup._parse(g,f);var c=b.toHtml();if(f.prepend){c=f.prepend+c}if(f.append){c+=f.append}c=$WH.fixWowheadHTTPS(c);setTimeout(Markup.createMaps,250);return c},fromHtml:function(f,c){f=f.replace(/\n+/g,"");f=f.replace(/\s+/g," ");f=f.replace(/> </g,"><");f=f.replace(/&amp;/gi,"&");f=f.replace(/(&#160;|$nbsp;)/gi," ");for(var b in Markup.tags){if(Markup.tags[b].fromHtml){f=Markup.tags[b].fromHtml(f,c)}}f=f.replace(/<style\b[\s\S]*?>[\s\S]*?<\/style>/g,"");f=f.replace(/<\/?[a-z][a-z0-9]*\b[\s\S]*?>/g," ");f=f.replace(/<!--(.*?)-->/g,"");f=f.replace(/\n[\n]+/g,"\n\n");f=f.replace(/[ ]+/g," ");f=f.replace(/\t/g,"  ");return $WH.trim(f)},removeTags:function(f,c){var b=Markup._parse(f,c);return b.tagless()},matchOuterTags:function(q,j,v,c){var o=c.indexOf("g")>-1,p=c.replace(/g/g,""),u=new RegExp(j+"|"+v,"g"+p),k=new RegExp(j,p),r=[],w,y,h,b;do{w=0;while(h=u.exec(q)){if(k.test(h[0])){if(!w++){y=u.lastIndex;b=h}}else{if(w){if(!--w){r.push([q.slice(y,h.index),b[0],h[0]]);if(!o){return r}}}}}}while(w&&(u.lastIndex=y));return(r.length?r:false)},getImageUploadIds:function(f,c){var b=Markup._parse(f,c);return b.imageUploadIds()},printHtml:function(c,f,b){f=$WH.ge(f);if(b&&b.removeTableTags){c=c.replace(/\[\/?(td|tr|table)[^\]]*]/g,"")}f.innerHTML=Markup.toHtml(c,b);Markup.createMaps();if($(f).find("div.full-tweet").length&&(typeof twttr=="object")&&twttr.hasOwnProperty("widgets")){twttr.widgets.load(f)}},toggleReveal:function(f){var b=$("#reveal-"+f);if(b.length==0){return}var c=$("#revealtoggle-"+f);if(b.is(":visible")&&c.is(":visible")){b.hide();c.text("(read more)")}else{b.show();if(c.hasClass("changelog")){c.hide()}else{c.text("(hide)")}}},mapperPreview:function(f){try{window.mapper=Markup.maps[f];var c=window.open("/edit=mapper-preview","mapperpreview","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=800,height=540");c.focus()}catch(b){}},createTabs:function(b,g,j){var c=new Tabs({parent:$WH.ge("dsf67g4d-"+b.id+(j?"-preview":"")),forum:1,noScroll:(j?true:false)});for(var f=0;f<g.length;++f){var h=g[f];c.add(h.name,{id:b.id+"-"+h.id,icon:h.icon,"class":h["class"]})}c.flush()},CreateTweet:function(o){var y=$WH.isSet("BlueTweets");var b=y?BlueTweets.now:new Date();if(!o.id){return document.createTextNode("")}var K=$WH.ce("div");K.className="full-tweet";if(o.wh_significant=="1"){K.className+=" significant"}if(o.repliedTo){var B=this.CreateTweet(o.repliedTo);B.className+=" replied";$WH.ae(K,B)}if(o.quoted){var B=this.CreateTweet(o.quoted);B.className+=" replied quoted";$WH.ae(K,B)}var v=$WH.ce("div");$WH.ae(K,v);v.className="tweet";var J=$WH.ce("a");$WH.ae(v,J);J.className="avatar";J.style.backgroundImage="url("+o.author.avatar.replace(/^http:/,"")+")";J.href="https://twitter.com/"+o.author.username;var g=$WH.ce("div");$WH.ae(v,g);g.className="main";var F=$WH.ce("div");$WH.ae(g,F);F.className="top";var J=$WH.ce("a");$WH.ae(F,J);J.href="https://twitter.com/"+o.author.username;if(y){BlueTweets.AuthorTooltip(J,o.author.id)}var w=$WH.ce("span");$WH.ae(J,w);w.className="author-name";$WH.st(w,o.author.name);var w=$WH.ce("span");$WH.ae(J,w);w.className="author-username";$WH.st(w,"@"+o.author.username);var J=$WH.ce("a");$WH.ae(F,J);J.className="timestamp";J.href="https://twitter.com/"+o.author.username+"/status/"+o.id;if(isNaN(Date.parse(o.timestamp))){o.timestamp=o.timestamp.replace(/^([A-Za-z]+ [A-Za-z]+ \d\d)( \d\d:\d\d:\d\d [-+]\d{4})( (?:19|20)\d\d)$/,"$1$3$2")}var H=(b.getTime()-Date.parse(o.timestamp))/1000;if(H<60){$WH.st(J,""+H+"s")}else{if(H<60*60){$WH.st(J,""+Math.floor(H/60)+"m")}else{if(H<60*60*24){$WH.st(J,""+Math.floor(H/60/60)+"h")}else{if(H<60*60*24*3){$WH.st(J,""+Math.floor(H/60/60/24)+"d")}else{H=(new Date(o.timestamp)).toString().split(" ");$WH.st(J,""+H[1]+" "+H[2])}}}}var F=$WH.ce("div");$WH.ae(g,F);F.className="status";var r=o.text;var D,h,n,j,z;if(o.hasOwnProperty("entities")&&(o.entities!==null)){if(o.entities.hasOwnProperty("media")&&$WH.isArray(o.entities.media)){for(j in o.entities.media){n=o.entities.media[j];r=r.replace(o.text.substr(n.indices[0],n.indices[1]-n.indices[0]),'<a href="'+n.url+'" class="entity-media">'+n.display_url+"</a>");if(n.type=="photo"){var f="",A=0;for(var p in n.sizes){if((n.sizes[p].w>=250)&&(A==0||n.sizes[p].w<A)){f=p;A=n.sizes[p].w}}if(f!=""){if(A>375){A=375}var L=$WH.ce("img");$WH.ae(g,L);L.className="photo";L.width=A;L.height=Math.floor(n.sizes[f].h*(A/n.sizes[f].w));L.src=n.media_url.replace(/^http:/,"")+":"+f}}}}if(o.entities.hasOwnProperty("urls")&&$WH.isArray(o.entities.urls)){D=[];z=o.quoted?$WH.sprintf("https://twitter.com/$1/status/$2",o.quoted.author.username,o.quoted.id):false;for(j in o.entities.urls){n=o.entities.urls[j];h=o.text.substr(n.indices[0],n.indices[1]-n.indices[0]);if($WH.inArray(D,h)>=0){continue}D.push(h);if(z&&n.expanded_url.indexOf(z)==0){r=r.replace(h,"")}else{r=r.replace(h,'<a href="'+n.url+'" class="entity-url">'+n.display_url+"</a>","g")}}}if(o.entities.hasOwnProperty("user_mentions")&&$WH.isArray(o.entities.user_mentions)){D=[];for(j in o.entities.user_mentions){n=o.entities.user_mentions[j];h=o.text.substr(n.indices[0],n.indices[1]-n.indices[0]).toLowerCase();if($WH.inArray(D,h)>=0){continue}D.push(h);r=r.replace(h,'<a href="https://twitter.com/'+n.screen_name+'" class="entity-mention">@'+n.screen_name+"</a>","gi")}}if(o.entities.hasOwnProperty("hashtags")&&$WH.isArray(o.entities.hashtags)){D=[];for(j in o.entities.hashtags){n=o.entities.hashtags[j];h=o.text.substr(n.indices[0],n.indices[1]-n.indices[0]).toLowerCase();if($WH.inArray(D,h)>=0){continue}D.push(h);r=r.replace(h,'<a href="https://twitter.com/search?q=#'+n.text+'" class="entity-hashtag">#'+n.text+"</a>","gi")}}}F.innerHTML=r;var I=$WH.ce("div");$WH.ae(g,I);I.className="bottom";if(y&&g_user&&(g_user.roles&U_GROUP_MODERATOR)){var J=$WH.ce("a");$WH.ae(I,J);J.href="javascript:;";J.className="markup-link";J.setAttribute("data-tweet",o.id);$WH.aE(J,"click",BlueTweets.ShowLinks);$WH.st(J,"Links");var C=$WH.ce("label");C.className="significance";$WH.ae(I,C);var E=$WH.ce("input");$WH.ae(C,E);E.type="checkbox";E.setAttribute("data-tweet",o.id);E.checked=(o.wh_significant=="1");$WH.aE(E,"click",BlueTweets.SetSignificant);var w=$WH.ce("span");$WH.ae(C,w);$WH.st(w,"Significant");var m=$WH.ce("div",{className:"mod-footer"});$WH.ae(g,m);var G=BlueTweets.wowClasses;if(!o.hasOwnProperty("wh_classFlags")){o.wh_classFlags=0}for(j=0;j<G.length;j++){E=$WH.ce("img",{className:"sig-role"});if(o.wh_classFlags&Math.pow(2,G[j].id)){E.className+=" selected"}E.setAttribute("data-tweet",o.id);E.setAttribute("data-wowclass",G[j].id);$WH.aE(E,"click",BlueTweets.ToggleClassRoleFlag);E.src=g_staticUrl+"/images/wow/icons/tiny/"+G[j].icon+".gif";$WH.ae(m,E);$WH.Tooltip.simple(E,G[j].name)}$WH.ae(m,$WH.ce("span",{style:"display: inline-block; width: 15px; height: 15px"}));if(!o.hasOwnProperty("wh_roleFlags")){o.wh_roleFlags=0}var k=["tank","healer","dps"];for(j in g_roles){if(!g_roles.hasOwnProperty(j)){continue}E=$WH.ce("img",{className:"sig-role"});if(o.wh_roleFlags&Math.pow(2,j)){E.className+=" selected"}E.setAttribute("data-tweet",o.id);E.setAttribute("data-role",j);$WH.aE(E,"click",BlueTweets.ToggleClassRoleFlag);E.src=g_staticUrl+"/images/wow/icons/tiny/role_"+k[j]+".gif";$WH.ae(m,E);$WH.Tooltip.simple(E,g_roles[j])}}var J=$WH.ce("a");$WH.ae(I,J);J.className="widget reply";J.href="https://twitter.com/intent/tweet?in_reply_to="+o.id;J.target="whtwitter";$WH.st(J,"Reply");J.insertBefore($WH.ce("span"),J.firstChild);var J=$WH.ce("a");$WH.ae(I,J);J.className="widget retweet";J.href="https://twitter.com/intent/retweet?tweet_id="+o.id;J.target="whtwitter";$WH.st(J,"Retweet");J.insertBefore($WH.ce("span"),J.firstChild);var J=$WH.ce("a");$WH.ae(I,J);J.className="widget favorite";J.href="https://twitter.com/intent/favorite?tweet_id="+o.id;J.target="whtwitter";$WH.st(J,"Favorite");J.insertBefore($WH.ce("span"),J.firstChild);return K}};Markup.tags.garrisonability=Markup.tags["mission-ability"];Markup.tags.petability=Markup.tags["pet-ability"];Markup.tags.itemset=Markup.tags["item-set"];var MarkupUtil={ltrimText:function(b){b._rawText=b._rawText.ltrim();return b},rtrimText:function(b){b._rawText=b._rawText.rtrim();return b},checkSiblingTrim:function(b,c){if(c.name=="<text>"&&(Markup.tags[b.name].rtrim||Markup.tags[b.name].trim)){c.attr=MarkupUtil.ltrimText(c.attr)}else{if(b.name=="<text>"&&(Markup.tags[c.name].ltrim||Markup.tags[c.name].trim)){b.attr=MarkupUtil.rtrimText(b.attr)}}return[b,c]}};var MarkupTree=function(){this.nodes=[];this.currentNode=null};MarkupTree.prototype={openTag:function(c,f){if(c!="<text>"&&Markup.tags[c]&&!Markup.tags[c].allowedClass){Markup.tags[c].allowedClass=MARKUP_CLASS_PENDING}if(!Markup.tags[c]){return false}else{if(Markup.tags[c].allowedModes&&Markup.tags[c].allowedModes[MarkupModeMap[Markup.mode]]==undefined){return false}else{if(Markup.tags[c].allowedClass&&Markup.tags[c].allowedClass>Markup.allow){return false}}}if(Markup.mode==MARKUP_MODE_REPLY&&!Markup.tags[c].allowInReplies){return false}var g={name:c,attr:f,parent:null,nodes:[]};if(this.currentNode){g.parent=this.currentNode}if(Markup.tags[c].allowedParents){if(g.parent!=null){if(Markup.tags[c].allowedParents[g.parent.name]===undefined){return false}}else{if(Markup.root==undefined||Markup.tags[c].allowedParents[Markup.root]==undefined){return false}}}if(g.parent&&Markup.tags[g.parent.name].allowedChildren&&Markup.tags[g.parent.name].allowedChildren[c]==undefined){return false}if(this.currentNode){if(this.currentNode.nodes.length==0&&g.name=="<text>"&&Markup.tags[this.currentNode.name].itrim){g.attr=MarkupUtil.ltrimText(g.attr)}else{if(this.currentNode.nodes.length>0){var b=this.currentNode.nodes.length-1;var h=MarkupUtil.checkSiblingTrim(this.currentNode.nodes[b],g);this.currentNode.nodes[b]=h[0];g=h[1]}}if(g.name=="<text>"){g.attr._text=Markup._preText(g.attr._rawText);if(g.attr._text.length>0){this.currentNode.nodes.push(g)}}else{this.currentNode.nodes.push(g)}}else{if(this.nodes.length>0){var b=this.nodes.length-1;var h=MarkupUtil.checkSiblingTrim(this.nodes[b],g);this.nodes[b]=h[0];g=h[1]}if(g.name=="<text>"){g.attr._text=Markup._preText(g.attr._rawText);if(g.attr._text.length>0){this.nodes.push(g)}}else{this.nodes.push(g)}}if(!Markup.tags[c].empty&&!Markup.tags[c].post){this.currentNode=g}return true},closeTag:function(f){if(Markup.tags[f].empty||Markup.tags[f].post){return false}if(!this.currentNode){return false}else{if(this.currentNode.name==f){if(this.currentNode.nodes.length>0){var c=this.currentNode.nodes.length-1;if(Markup.tags[this.currentNode.name].itrim&&this.currentNode.nodes[c].name=="<text>"){var h=this.currentNode.nodes[c];h.attr=MarkupUtil.rtrimText(h.attr);h.attr._text=Markup._preText(h.attr._rawText);this.currentNode.nodes[c]=h}}this.currentNode=this.currentNode.parent}else{var g=function(k,j){for(var l=j.length-1;l>=0;--l){if(j[l].name==k){return l}}return -1};var b;if(this.currentNode.parent){b=g(f,this.currentNode.parent.nodes)}else{b=g(f,this.nodes)}if(b==-1){return false}}}return true},toHtml:function(){var g=[];var f={};for(var n in Markup.collectTags){f[n]=[]}this.tagless(true);var l=0;var b=function(o,r,w){var z="";for(var q=0;q<o.length;++q){var p=o[q];if(r==0&&q==0&&Markup.firstTags[p.name]){p.attr.first=true}else{if(r>0&&q==0&&Markup.firstTags[p.parent.name]){p.attr.first=true}}if(q==o.length-1&&Markup.firstTags[p.name]){p.attr.last=true}if(Markup.excludeTags[p.name]){w[p.name]=(w[p.name]?w[p.name]+1:1)}for(var y in w){for(var A in Markup.excludeTags[y]){if(Markup.excludeTags[y][A][p.name]){p.attr[A]=false}}}if(Markup.collectTags[p.name]){p.offset=l++;f[p.name].push(p)}if(Markup.tags[p.name].post){var v="<!--"+Math.random()+"-->";z+=v;g.push([p,v])}else{if(Markup.tags[p.name].empty){var u;if(p.parent&&Markup.tags[p.parent.name].rawText){u=Markup.tags[p.name].toHtml(p.attr,{needsRaw:true})}else{u=Markup.tags[p.name].toHtml(p.attr)}if(typeof u=="string"){z+=u}else{if(u!==undefined){if(z==""){z=[]}z.push(u)}}}else{var s=arguments.callee(p.nodes,r+1,w);p.attr._contents=s;p.attr._nodes=p.nodes;var B=Markup.tags[p.name].toHtml(p.attr);if(B.length==2){z+=B[0]+s+B[1]}else{if(B.length==1){if(typeof B[0]=="string"){z+=B[0]}else{if(z==""){z=[]}z.push(B[0])}}}}}if(w[p.name]){w[p.name]--;if(w[p.name]==0){delete w[p.name]}}}return z};var m=b(this.nodes,0,[]);for(var j=0;j<g.length;++j){var h=g[j][0];var c=g[j][1];var k=Markup.tags[h.name].postHtml(h.attr,f);if(typeof k=="string"){m=m.replace(c,k)}}return m},tagless:function(f){var b=function(h){var l="";for(var j=0;j<h.length;++j){var k=h[j];var g=arguments.callee(k.nodes);if(f){k.attr._textContents=g}else{k.attr._contents=g}if(k.name=="<text>"){l+=Markup.tags[k.name].toHtml(k.attr,{noLink:true,noNbsp:true})}else{if(Markup.tags[k.name].toText){l+=Markup.tags[k.name].toText(k.attr)}}if(!Markup.tags[k.name].taglessSkip){l+=g}}return l};if(f){b(this.nodes)}else{var c=b(this.nodes);c=c.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"');return c}},imageUploadIds:function(){var c=[];var b=function(f){for(var g=0;g<f.length;++g){var h=f[g];if(h.name=="img"&&h.attr.upload){c.push(h.attr.upload)}arguments.callee(h.nodes)}};b(this.nodes);return c}};Markup.tags.modelviewer=Markup.tags.model;Markup.reveals=0;Markup._init();$(document).ready(function(){$(".quote-header").each(function(c){var g=$(this);var f=g.siblings();if(f.hasClass("quote-body")){var b=$("<a/>",{href:"javascript:;","class":"toggle"});b.click(function(k){var h=$(k);var j=h.parent();j.toggleClass("collapse");if(j.hasClass("collapse")){$(this).html("Expand")}else{$(this).html("Collapse")}}.bind(b,this));if($(this).parent().hasClass("collapse")){b.html("Expand")}else{b.html("Collapse")}g.append(b)}});$(".quote-wh").each(function(c){var f=$(this);var b=$("<a/>",{href:"javascript:;","class":"toggle"});b.click(function(h){var g=$(h);g.toggleClass("collapse");if(g.hasClass("collapse")){$(this).html("Expand")}else{$(this).html("Collapse")}}.bind(b,this));if($(this).hasClass("collapse")){b.html("Expand")}else{b.html("Collapse")}f.append(b)})});var MENU_IDX_ID=0;var MENU_IDX_NAME=1;var MENU_IDX_URL=2;var MENU_IDX_SUB=3;var MENU_IDX_OPT=4;var Menu=new function(){var ax=this;var X=null;var U=[];var Z=null;var aJ=null;var au=null;var C=null;var D=null;ax.getMenu=function(){return mn_path};ax.addTouch=function(aT,aU,aS){if(!aS){aS=$.noop}var aR=$(aT);aR.data("menu",aU);aR.click(am)};function am(aR,aT){var aS=$(this);if(aS.hasClass("active")||aS.hasClass("touch-menu-active")){aG.call(this)}else{ac.call(this,aR,aT)}if(aR){aR.preventDefault();aR.stopPropagation()}}function w(aT,aS,aR,aU){E(aT,aS,aR,aU);if(aS){aS.preventDefault();aS.stopPropagation()}}ax.add=function(aT,aU,aS){if(!aS){aS=$.noop}var aR=$(aT);if(aS.onShow){aU.onShow=aS.onShow}if(aS.onHide){aU.onHide=aS.onHide}aR.data("menu",aU);if(Platform.isTouch()){aR.click(am);return}if(aS.showAtCursor){if(aS.leftAndRightClick){aT.oncontextmenu=$WH.rf;aR.click(function(aV){if(aV.which!=2){Q.call(this,aV);return false}}).mouseup(function(aV){S.call(this,Q,aV)})}else{if(aS.rightClick){aT.oncontextmenu=$WH.rf;aR.mouseup(function(aV){S.call(this,Q,aV)})}else{aR.click(Q)}}}else{if(aS.showAtElement){if(aS.leftAndRightClick){aT.oncontextmenu=$WH.rf;aR.click(function(aV){if(aV.which!=2){aq.call(this,aV);return false}}).mouseup(function(aV){S.call(this,aq,aV)}).mouseleave(f)}else{if(aS.rightClick){aT.oncontextmenu=$WH.rf;aR.mouseup(function(aV){S.call(this,aq,aV)}).mouseleave(f)}else{aR.click(function(aV){if(aV.which!=2){if($(this).hasClass("open")){return}else{aq.call(this,aV);return false}}}).mouseleave(f)}}}else{aR.mouseover(aq).mouseout(f)}}};ax.remove=function(aR){$(aR).data("menu",null).unbind("click",Q).unbind("mouseover",aq).unbind("mouseout",f)};ax.show=function(aT,aS){if(Platform.isTouch()){am.call(aS,null,aT);return}var aR=$(aS);D=aR.get(0);C=aT;n(aT,aR)};ax.showAtCursor=function(aS,aR){if(Platform.isTouch()){w(aS,aR);return}C=aS;aw(aS,aR.pageX,aR.pageY)};ax.showAtXY=function(aS,aR,aT){if(Platform.isTouch()){w(aS,null,aR,aT);return}C=aS;aw(aS,aR,aT)};ax.hide=function(aR){if(Platform.isTouch()){ag();return}f(null,aR);ap()};ax.addButtons=function(aR,aU,aT){var aV=$(aR);if(!aV.length){return}var aS=$('<span class="menu-buttons"></span>');$.each(aU,function(aW,aY){if(aH(aY)){return}var aZ=$("<a></a>");var aX=$("<span></span>",{text:aY[MENU_IDX_NAME]}).appendTo(aZ);ax.linkifyItem(aY,aZ);aZ.data("parentMenu",aU).data("menuItem",aY);if(aY[MENU_IDX_OPT]&&aY[MENU_IDX_OPT].rel){aZ.attr("rel",aY[MENU_IDX_OPT].rel)}if(I(aY)){aX.addClass("hassubmenu");if(Platform.isTouch()){ax.addTouch(aZ.get(0),aY[MENU_IDX_SUB])}else{if(aT&&aT.menusOnClick){ax.add(aZ,aY[MENU_IDX_SUB],{showAtElement:true})}else{ax.add(aZ,aY[MENU_IDX_SUB])}}}aS.append(aZ)});aV.append(aS)};ax.linkifyItem=function(aR,aU){var aT=ax.getItemOpt(aR);if(typeof aR[MENU_IDX_OPT]=="object"&&aR[MENU_IDX_OPT].className){aU.addClass(aR[MENU_IDX_OPT].className)}if(typeof aR[MENU_IDX_OPT]=="object"&&aR[MENU_IDX_OPT].onMouseOver){aU.mouseover(aR[MENU_IDX_OPT].onMouseOver)}if(typeof aR[MENU_IDX_OPT]=="object"&&aR[MENU_IDX_OPT].onMouseOut){aU.mouseout(aR[MENU_IDX_OPT].onMouseOut)}if(!aR[MENU_IDX_URL]){aU.attr("href","javascript:;");aU.addClass("unlinked");return false}if(typeof aR[MENU_IDX_URL]=="function"){aU.attr("href","javascript:;");aU.click(ai);aU.click(aR[MENU_IDX_URL]);if(aT.rel){aU.attr("rel",aT.rel)}}else{var aS=ax.getItemUrl(aR);aU.attr("href",aS);if(aT.newWindow||$WH.isExternalUrl(aS)){aU.attr("target","_blank")}if(aT.rel){aU.attr("rel",aT.rel)}}return true};ax.updateItem=function(aZ){var aV=aZ.$a;if(!aV){return}var aS=ax.getItemOpt(aZ);aV.removeClass("checked tinyicon icon");aV.css("background-image","");if(aZ.checked){aV.addClass("checked fonticon");aV.prepend('<i class="fa fa-check fa-size-s fa-color-white fonticon-icon"/>')}else{var aW=false;var aX=function(a3){switch(typeof a3){case"string":return a3;break;case"function":var a4=a3(aZ);if(typeof a4=="string"){return a4}break}return false};if(!aW&&aS.armory){var aU=aX(aS.armory);if(aU){aW=true;aV.addClass("armoryicon");aV.css("background-image","url("+aU+")")}}if(!aW&&aS.fontIcon){var a1=aX(aS.fontIcon);if(a1){aW=true;aV.addClass("fonticon");aV.prepend('<i class="fa fa-'+a1+' fonticon-icon"/>')}}if(!aW&&aS.tinyIcon){var aT=aX(aS.tinyIcon);if(aT){aW=true;aV.addClass("tinyicon");aV.css("background-image","url("+$WH.getTinyIconUrl(aT)+")")}}if(!aW&&aS.icon){var a0=aX(aS.icon);if(a0){aW=true;aV.addClass("icon");aV.css("background-image","url("+a0+")")}}if(!aW&&aS.socketColor){var a2=aX(aS.socketColor);if(a2&&g_file_gems[a2]){aW=true;aV.addClass("socket-"+g_file_gems[a2])}}}if(aS.np){aV.attr("rel","np")}var aR=(aS["class"]||aS.className);if(aR){aV.addClass(aR)}if(aS.attributes){for(var aY in aS.attributes){if(aS.attributes.hasOwnProperty(aY)){aV.attr(aY,aS.attributes[aY])}}}};ax.prepareForZul=function(aS,aR){return av(aS,aR)};ax.hasMenu=function(aS){var aR=$(aS);return aR.data("menu")!=null};ax.modifyUrl=function(aR,aU,aT){var aS={params:aU,opt:aT};B(aR,function(aV){aV.modifyUrl=aS});PageTemplate.updateBreadcrumb()};ax.fixUrls=function(aT,aR,aS){aS=aS||{};aS.hash=(aS.hash?"#"+aS.hash:"");c(aT,aR,aS,0)};ax.customizeUrl=function(aV,aU){for(var aT=0,aS;aS=aV[aT];aT++){if(typeof aS[MENU_IDX_URL]!="string"){continue}var aR=aS[MENU_IDX_URL].replace(/^\//,"");if(aU[aR]){aS[MENU_IDX_URL]="/"+aU[aR]}}};ax.sort=function(aR){if(N(aR)){ae(aR)}else{A(aR)}};ax.sortSubmenus=function(aS,aR){$.each(aR,function(aT,aV){var aU=ax.findItem(aS,aV);if(aU&&aU[MENU_IDX_SUB]){ax.sort(aU[MENU_IDX_SUB])}})};ax.implode=function(aU,aR){if(!aR){aR=$.noop}var aT=[];var aS;if(aR.createHeadinglessGroup){aS=[];aT.push([0,"",null,aS])}$.each(aU,function(aV,aW){if(aH(aW)){aS=[];aT.push([aW[MENU_IDX_ID],aW[MENU_IDX_NAME],aW[MENU_IDX_URL],aS,aW[MENU_IDX_OPT]])}else{if(aS){aS.push(aW)}else{aT.push(aW)}}});return aT};ax.findItem=function(aS,aR){return ax.getFullPath(aS,aR).pop()};ax.getFullPath=function(aV,aU){var aT=[];for(var aS=0;aS<aU.length;++aS){var aW=z(aV,aU[aS]);if(aW!=-1){var aR=aV[aW];aR.parentMenu=aV;aV=aR[MENU_IDX_SUB];aT.push(aR)}}return aT};ax.getItemUrl=function(aR){var aS=aR[MENU_IDX_URL];if(!aS){return null}if(aR.modifyUrl){aS=$WH.modifyUrl(aS,aR.modifyUrl.params,aR.modifyUrl.opt,aR)}return aS};ax.getItemOpt=function(aR){if(!aR[MENU_IDX_OPT]){aR[MENU_IDX_OPT]={}}return aR[MENU_IDX_OPT]};ax.removeItemById=function(aR,aT){var aS=z(aR,aT);if(aS!=-1){aR.splice(aS,1)}};ax.map=function(aT,aS,aZ){aS.className+=" menu-map";for(var aW=0,a0;a0=aT[aW];aW++){if(a0[MENU_IDX_OPT]&&a0[MENU_IDX_OPT].menuMapHide){continue}$WH.ae(aS,$WH.getMajorHeading(typeof a0[MENU_IDX_URL]=="string"?'<a href="'+ax.getItemUrl(a0)+'">'+a0[MENU_IDX_NAME]+"</a>":a0[MENU_IDX_NAME],2));if(typeof a0[MENU_IDX_SUB]=="object"){var a1=$WH.ce("div",{className:"menu-map-section"});var aR=null;var a2=$WH.ce("div",{className:"menu-map-submenu-group"});for(var aV=0,aX;aX=a0[MENU_IDX_SUB][aV];aV++){if(aX[MENU_IDX_OPT]&&aX[MENU_IDX_OPT].menuMapHide){continue}if(aX[MENU_IDX_ID]==null){$WH.ae(a1,a2);a2=$WH.ce("div",{className:"menu-map-submenu-group"});aR=aX[MENU_IDX_NAME];$WH.ae(a1,$WH.getMajorHeading(typeof aX[MENU_IDX_URL]=="string"?'<a href="'+ax.getItemUrl(aX)+'">'+aX[MENU_IDX_NAME]+"</a>":aX[MENU_IDX_NAME],3));continue}if(aZ&&aZ.noEmptySubmenus&&!aX[MENU_IDX_SUB]){continue}var aU=$WH.getMajorHeading(typeof aX[MENU_IDX_URL]=="string"?'<a href="'+ax.getItemUrl(aX)+'">'+aX[MENU_IDX_NAME]+"</a>":aX[MENU_IDX_NAME],4);var aY=$WH.ce("div",{className:"menu-map-submenu"},aU);if(aX[MENU_IDX_NAME]==aR){aY.setAttribute("data-duplicate-heading","true")}if(typeof aX[MENU_IDX_SUB]=="object"){ax.addButtons(aY,aX[MENU_IDX_SUB],{menusOnClick:true})}$WH.ae(a2,aY)}$WH.ae(a1,a2);$WH.ae(aS,a1)}}};var ak=25;var p=333;var aN=520;var aQ=4;var m=6;var P=6;var L=2;var ad=26;var q=false;var V;var aa;var h={};var R={};var ao={};var v={};var W=0;function af(){if(q){return}q=true;var aR=$('<div class="menu"><a href="#"><span>ohai</span></a></div>').css({left:"-1000px",top:"-1000px"}).appendTo(document.body);var aS=aR.children("a").outerHeight();aR.remove();if(aS&&!isNaN(aS)&&aS!=ad){ad=aS}}function n(aS,aR){if(aa){aa.removeClass("open")}aa=aR;aa.addClass("open");b(aS)}function ai(){if(Platform.isTouch()){ag();return}if(aa){aa.removeClass("open");aa=null}ar(0)}function aw(aS,aR,aT){clearTimeout(V);b(aS,aR,aT)}function b(aS,aR,aT){y(0);ah(aS,0,aR,aT);ar(1)}function ah(aT,aX,a1,a0){af();if(typeof aT=="function"){aT=aT()}at(aT);var aR=F(aT);var aW=j(aR,aX);var aY=al(aX,aW);aY.append(aW.menu);var aU=!aE(aX);h[aX]=aY;for(var aV=0,aS;aS=h[aV];aV++){aS.attr("data-reverse-tier",aX-aV+1)}var aZ=aC(aY,aX,a1,a0);aY.css({left:aZ.x+"px",top:aZ.y+"px"});var a2=$WH.createRect(aZ.x,aZ.y,aY.width(),aY.height());WAS.intersect(a2,true);aP(aY,aU)}function al(aT,aS){var aR;if(ao[aT]){aR=ao[aT];aR.children().detach();aR.css({left:0,top:0});aR.attr("class","menu");if(aS.menuType){aR.addClass("menu-type-"+aS.menuType)}return aR}aR=$('<div class="menu"></div>').data("depth",aT).mouseover(s.bind(null,aT)).mouseleave(az).delegate("a","mouseenter",{depth:aT},aF).delegate("a","click",u);if(aS.menuType){aR.addClass("menu-type-"+aS.menuType)}aR.appendTo(document.body);ao[aT]=aR;return aR}function F(aU){var aS=r(aU);if(v[aS]){return v[aS]}var aV;var aR=[];$.each(aU,function(aW,aX){if(!aD(aX)){return}var aY=g(aX);if(aH(aX)){aV=aY;return}if(aV){aR.push(aV);aV=null}aR.push(aY)});var aT=$(aR);v[aU]=aT;return aT}function g(aS){Y(aS);var aW=$("<a></a>");aS.$a=aW;aW.data("menuItem",aS);var aT=aS[MENU_IDX_NAME];if(aS[MENU_IDX_OPT]&&aS[MENU_IDX_OPT].generateText){aT=aS[MENU_IDX_OPT].generateText(aS)}if(aH(aS)){aW.addClass("separator");aW.text(aT)}ax.linkifyItem(aS,aW);ax.updateItem(aS);if(aS[MENU_IDX_OPT]){if(aS[MENU_IDX_OPT].column){aW.data("column",aS[MENU_IDX_OPT].column)}if(aS[MENU_IDX_OPT].noSoftColumns){aW.data("noSoftColumns",aS[MENU_IDX_OPT].noSoftColumns)}if(aS[MENU_IDX_OPT].menuType){aW.data("menuType",aS[MENU_IDX_OPT].menuType)}}if(aH(aS)){return aW}var aR;var aV=aT,aU,aX,aY;if((typeof aV=="object"&&aV!=null)&&("tagName" in aV)&&(aV.tagName.toLowerCase()=="span")){while(aU=aV.getElementsByTagName("span")[0]){aX=document.createElement("div");aX.className=aU.className;$.extend(aX.style,aU.style);aX.style.display="inline";while(aY=aU.firstChild){aY.parentNode.removeChild(aY);aX.appendChild(aY)}aU.parentNode.insertBefore(aX,aU);aU.parentNode.removeChild(aU)}aR=$(aV).clone()}else{aR=$("<span></span>");aR.text(aT)}aR.appendTo(aW);if(I(aS)){aR.addClass("hassubmenu")}return aW}function j(ba,bh){var aX=ba.length;var aV=$(window).height()-(L*2)-P;var a1=Math.floor(Math.max(0,aV)/ad);var a5=Math.floor(aN/ad);var a6=aX>0&&!ba[0].data("noSoftColumns");var bi=false;if(a5<a1&&a6){a1=a5;bi=true}var aU=[];var aR=null;var a7=-1;if(aX>0){aR=ba[0].data("menuType");if(ba[0].data("column")){ba.each(function(){var bj=$(this).data("column");if(bj){a7=bj-1}if(!aU[a7]){aU[a7]=$("<td/>")}aU[a7].append(this)})}else{if(a1<aX){var aT=Math.min(aQ,Math.ceil(aX/a1));var a2=Math.ceil(aX/aT);var bd=0;var be=aX;var bb=0;while(be>0){a7++;var a4=Math.min(be,a2);var aY=bd;var aW=aY+a4;if(bi){if(bb!=0){aW+=bb;a4+=bb;bb=0}if(ba[aW-1]&&ba[aW-1].hasClass("separator")){aW--;a4--;bb=1}if(ba[aW]&&!ba[aW].hasClass("separator")){if(ba[aW-2]&&ba[aW-1]&&ba[aW]&&ba[aW-2].hasClass("separator")&&!ba[aW-1].hasClass("separator")){if(ba[aW+1]&&ba[aW+2]&&!ba[aW+1].hasClass("separator")&&ba[aW+2].hasClass("separator")){aW+=2;a4+=2}else{aW-=2;a4-=2;bb=2}}if(ba[aW]&&ba[aW+1].hasClass("separator")){aW+=1;a4+=1}if(ba[aW+1]&&ba[aW+2]&&!ba[aW+1].hasClass("separator")&&ba[aW+2].hasClass("separator")){aW+=2;a4+=2}}}ba.slice(aY,aW).each(function(){if(!aU[a7]){aU[a7]=$("<td/>")}aU[a7].append(this)});bd+=a4;be-=a4}}}}if(aU.length){var aZ=$WH.ce("div",{className:"menu-outer"});var bf=$WH.ce("div",{className:"menu-inner"});var bc=$WH.ce("table",{className:"menu-columns"});var aS=$WH.ce("tbody");var bg=$("<tr/>");$WH.ae(aZ,bf);$WH.ae(bf,bc);$WH.ae(bc,aS);for(var a9=0,a0;a0=aU[a9];a9++){bg.append(a0)}bg.appendTo(aS);return{columns:aU.length,menuType:aR,menu:aZ}}var a3=$('<div class="menu-outer"></div>');var a8=$('<div class="menu-inner"></div>');ba.each(function(){a8.append(this)});a3.append(a8);return{menuType:aR,menu:a3}}function aC(aS,aT,aR,aU){if(aT==0){return aO(aS,aT,aR,aU)}return T(aS,aT)}function aO(a0,aW,a2,a1){var aZ=$WH.getViewport();var aS=a0.width();var aX=a0.height();var aU=aS+m;var aR=aX+P;var aY=(a2!=null&&a1!=null);if(aY){if(a1+aR>aZ.b){a1=Math.max(aZ.t,aZ.b-aR)}}else{var aT=aa;var aV=aT.offset();a2=aV.left;a1=aV.top+aT.outerHeight();if(a1+aR>aZ.b&&aV.top>=aR){a1=aV.top-aR}}if(a2+aU>aZ.r){a2=Math.max(aZ.l,aZ.r-aU)}return{x:a2,y:a1}}function T(aZ,aW){var aY=$WH.getViewport();var aS=aZ.width();var aX=aZ.height();var aU=aS+m;var aR=aX+P;var aT=R[aW-1];var aV=aT.offset();var a1=false;var a2=aV.left+aT.outerWidth()-5;var a0=aV.top-2;if(a2+aU>aY.r){a1=true}if(a1){a2=Math.max(aY.l,aV.left-aS)}if(a0+aR>aY.b){a0=Math.max(aY.t,aY.b-aR)}return{x:a2,y:a0}}function aP(aS,aR){if(aR){aS.css({opacity:"0"}).show().animate({opacity:"1"},"fast",null,aK)}else{aS.show()}}function aK(aR){$(this).css("opacity","")}function ar(aR){while(h[aR]){h[aR].stop().hide();h[aR]=null;++aR}if(!h[0]){WAS.restoreHidden();ap()}}function y(aR){while(R[aR]){R[aR].removeClass("open");R[aR]=null;++aR}}function aE(aR){return h[aR||0]!=null}function k(aR){return aR[MENU_IDX_ID]}function aH(aR){return aR[MENU_IDX_ID]==null||(aR[MENU_IDX_OPT]&&aR[MENU_IDX_OPT].heading)}function N(aR){return $WH.inArray(aR,true,aH)!=-1}function I(aR){return aR[MENU_IDX_SUB]!=null}function z(aR,aS){return $WH.inArray(aR,aS,k)}function aB(aR){var aS=ax.getItemOpt(aR);if(aS&&aS.requiredAccess&&!User.hasPermissions(aS.requiredAccess)){return false}return true}function aD(aR){if(!(aR instanceof Array)){return false}if(!aB(aR)){return false}if(aR[MENU_IDX_OPT]&&aR[MENU_IDX_OPT].hide){return false}if(I(aR)){if(!ab(aR[MENU_IDX_SUB])){return false}}return true}function ab(aR){return $WH.inArray(aR,true,J)!=-1}function J(aR){return !aH(aR)&&aB(aR)}function r(aR){if(aR.uniqueId==null){aR.uniqueId=W++}return aR.uniqueId}function M(aS,aR){$.each(aS,function(aT,aU){B(aU,aR)})}function B(aR,aS){aS(aR);if(I(aR)){M(aR[MENU_IDX_SUB],aS)}}function c(aU,aR,aS,aT){$.each(aU,function(aW,aX){if(aX===undefined){return}if(aH(aX)){return}if(aS.uniqueUrls&&aS.uniqueUrls[aX[MENU_IDX_ID]]){aX[MENU_IDX_URL]=aS.uniqueUrls[aX[MENU_IDX_ID]]}else{if(aX[MENU_IDX_URL]==null){if(aS.idReplacements&&aS.idReplacements[aX[MENU_IDX_ID]]){aX[MENU_IDX_URL]=aR+aS.idReplacements[aX[MENU_IDX_ID]]+aS.hash}else{aX[MENU_IDX_URL]=aR+aX[MENU_IDX_ID]+aS.hash}}}if(I(aX)){var aV=true;var aY=aR;if(aS.useSimpleIds){aV=false}else{if(aS.useSimpleIdsAfter!=null&&aT>=aS.useSimpleIdsAfter){aV=false}else{if(aS.useLastUrl){aV=false;aY=aX[MENU_IDX_URL]+((aX[MENU_IDX_URL].indexOf("=")>=0)?".":"=")}}}if(aV){aY+=aX[MENU_IDX_ID]+"."}c(aX[MENU_IDX_SUB],aY,aS,aT+1)}})}function A(aR){aR.sort(function(aT,aS){return $WH.stringCompare(aT[MENU_IDX_NAME],aS[MENU_IDX_NAME])})}function ae(aS){var aR=ax.implode(aS,{createHeadinglessGroup:true});$.each(aR,function(aT,aU){A(aU[MENU_IDX_SUB])});o(aS,aR)}function o(aS,aR){aS.splice(0,aS.length);$.each(aR,function(aT,aU){if(aU[MENU_IDX_NAME]){aS.push([aU[MENU_IDX_ID],aU[MENU_IDX_NAME],aU[MENU_IDX_URL],undefined,aU[MENU_IDX_OPT]])}$.each(aU[MENU_IDX_SUB],function(aV,aW){aS.push(aW)})})}function Y(aR){var aS=ax.getItemOpt(aR);if(aS.checkedUrl&&location.href.match(aS.checkedUrl)){aR.checked=true}if(typeof aS.checkedFunc=="function"){aR.checked=aS.checkedFunc(aR)}}function at(aR){if(aR.onBeforeShow){aR.onBeforeShow(aR)}$.each(aR,function(aS,aT){var aU=ax.getItemOpt(aT);if(aU.onBeforeShow){aU.onBeforeShow(aT)}})}function aq(aS){clearTimeout(V);var aR=$(this);var aT=aR.data("menu");D=this;C=aT;if(!aE()){V=setTimeout((function(aV,aU){n.call(null,aV,aU);H(this,aV,aS)}).bind(this,aT,aR),ak);return}n(aT,aR);H(this,aT,aS)}function f(aS,aR){clearTimeout(V);if(aE()){if(aR){ai()}else{V=setTimeout(ai,p)}}}function Q(aS){clearTimeout(V);var aR=$(this);var aT=aR.data("menu");D=this;C=aT;ax.showAtCursor(aR.data("menu"),aS);H(this,aT,aS)}function S(aR,aS){aS=$WH.normalizeEvent(aS);if(aS._button==3||aS.shiftKey||aS.ctrlKey){aR.call(this,aS)}}function ac(aT,aV){var aS=$(this),aU=aS.parent(),aR=aS.data("menuItem");if(!aV){aV=aS.data("menu")}C=aV;D=this;if(au){au.removeClass("touch-menu-active");au=null}if(aU[0].tagName=="DT"){ag();aS.addClass("active");X=null;U=[aR[MENU_IDX_ID]];K(aV)}else{au=aS;au.addClass("touch-menu-active");X=aV;U=aR?[aR[MENU_IDX_ID]]:[null];K(aV,{atElement:aS})}H(this,aV,aT)}function E(aT,aS,aR,aU){C=aT;D=null;if(au){au.removeClass("touch-menu-active");au=null}X=aT;K(aT,{atPosition:aS?[aS.pageX,aS.pageY+5]:[aR,aU]});H(null,aT,aS,aR,aU)}function K(aV,a2){if(!a2){a2={}}var aU;if(a2.atElement||a2.atPosition){var aT=false;if(!Z){Z=$("<div/>",{"class":"floating-touch-menu-container",css:{display:"none"}});Z.appendTo("body")}else{var a4=Z.offset();aT=a4.top}Z.empty();aU=$("<div/>",{"class":"floating-touch-menu"});aJ=$("<div/>",{"class":"floating-touch-menu-arrow"});aU.append(aJ).appendTo(Z);var a5=$("<a/>",{"class":"floating-touch-menu-closer"});a5.click(ag);Z.append(a5);var aS=a2.atElement?a2.atElement.offset():{left:a2.atPosition[0],top:a2.atPosition[1]};var a3=aS.top;if(a2.atElement){a3+=a2.atElement.outerHeight()}var aR=parseInt(a3+7);var aZ=aR!=aT;Z.css({display:"block",top:(aZ?aR-10:aR)+"px"});var aX=aS.left;if(a2.atElement){aX+=(a2.atElement.outerWidth()/2)}aJ.css({display:"block",left:parseInt(aX-10)+"px"});if(aZ){Z.css({opacity:"0"});setTimeout(function(){Z.animate({opacity:"1",top:"+=10px"})},0)}}else{Z=null;aJ=null;aU=$("#header-nav-subnav");if(!aU.length){aU=$("<div/>",{"class":"header-nav-subnav",id:"header-nav-subnav"});aU.insertAfter("#header-nav")}aU.empty()}var aW=false;if((!a2.atElement&&!a2.atPosition)||(a2.atElement&&a2.atElement.data("menuItem"))){aW=true}if(aW){if(Z){Z.addClass("has-breadcrumb")}var aY=$WH.ce("ul");aY.className="touch-menu-breadcrumb";aY.menu=a2.atElement&&$(a2.atElement).data("parentMenu")?$(a2.atElement).data("parentMenu"):[[0,a2.atElement?$(a2.atElement).html():LANG.menu,null,aV]];an(aY,U)}else{if(Z){Z.removeClass("has-breadcrumb")}}if(Z){if(a2.atElement&&a2.atElement.parents("div.breadcrumb")){Z.addClass("from-breadcrumb")}else{Z.removeClass("from-breadcrumb")}}var a0=$WH.ce("div");a0.className="touch-menu-items";a0.style.left="0%";ay(aV,{target:a0});var a1=$WH.ce("div");a1.className="touch-menu-items-wrapper";$WH.ae(a1,a0);if(aW){aU.append(aY)}aU.append(a1).attr("class","touch-menu")}function ay(aX,aU){if(aU.animate){var aW=$(".touch-menu-items");$(aU.animate).parent().addClass("chosen");aW.addClass("chosen");setTimeout(function(){var aY=$WH.ce("div");aY.className="touch-menu-items";var a0=(U.length-2)*-10+2;aY.style.left=a0+"%";l(aY,aX);var a2=$(aY);var aZ=aW.last();aZ.after(a2);var a3=aZ.height();aW.each(function(){var a4=$(this);if(a4.data("height")){a4.css({height:"1px"}).animate({left:"-=12%"})}else{a4.data("height",a4.height()).css("height",a4.height()+"px").animate({left:"-=12%",height:"1px"})}});var a1=a2.height();a2.css("height",a3+"px").animate({left:"-=12%",height:a1+"px"})},100)}else{if(aU.reverse){var aV=$(".touch-menu-items");var aR=$(aV.get(aU.targetPathIndex));var aT=aU.reverse*12;var aS=aV.last();aR.css({height:aS.height()+"px"}).animate({left:"+="+aT+"%",height:aR.data("height")+"px"},{complete:function(){$(this).css("height","")}});aS.css({height:"1px"});aV.not(aR).animate({left:"+="+aT+"%"},{complete:function(){aR.removeClass("chosen");$(".chosen",aR).removeClass("chosen");aR.nextAll().stop().remove()}})}else{if(aU.target){$(aU.target).empty();l(aU.target,aX)}}}}function an(aS,a2,a0,aX){var aT=aS.menu||Menu.getMenu();var aR,aV,aW,aU;if(a0){for(aW in U){aR=U[aW];for(aU in aT){aV=aT[aU];if(aV[MENU_IDX_ID]==aR){aT=aV[MENU_IDX_SUB];break}}}U=U.concat(a2)}var aZ,a1,aY;for(aW in a2){aR=a2[aW];aZ=null;for(aU in aT){aV=aT[aU];if(aV[MENU_IDX_ID]==aR){aZ=aV;break}}if(!aZ){break}a1=$WH.ce("li");aY=$WH.ce("a");aY.href="javascript:;";ax.linkifyItem(aZ,$(aY));aY.innerHTML=aZ[MENU_IDX_NAME];aY.onclick=aj;$WH.ae(a1,aY);$WH.ae(aS,a1)}}function aj(){var aV=$(this).parent();if(aV.is(":last-child")){return true}var aT=aV.index();var aU=Menu.getMenu();for(var aS=0;aS<=aT;aS++){for(var aR in aU){if(aU[aR][MENU_IDX_ID]==U[aS]){aU=aU[aR][MENU_IDX_SUB];break}}}aV.nextAll().remove();ay(aU,{reverse:U.length-aT-1,targetPathIndex:aT});U=U.slice(0,aT+1);return false}function l(aV,aU){var aT=null,aR;for(var aS in aU){aR=aU[aS];if(!aD(aR)){continue}if(aH(aR)){aI(aV,aR);aT=O(aV);continue}if(!aT){aT=O(aV)}$WH.ae(aT,G(aR))}}function O(aS){var aR=$WH.ce("ul");$WH.ae(aS,aR);return aR}function aI(aV,aS){var aT=$WH.ce("a");var aR=$(aT);aS.$a=aR;aR.data("menuItem",aS);ax.linkifyItem(aS,aR);ax.updateItem(aS);aR.text(aS[MENU_IDX_NAME]);var aU=$WH.getMajorHeading(aR.get(0),2);$WH.ae(aV,aU)}function G(aW){g(aW);Y(aW);var aS=$("<a></a>");aW.$a=aS;aS.data("menuItem",aW);var aT=ax.linkifyItem(aW,aS);ax.updateItem(aW);var aV;var a0=aM(aW),aZ,aU,aR;if((typeof a0=="object")&&("tagName" in a0)&&(a0.tagName.toLowerCase()=="span")){while(aZ=a0.getElementsByTagName("span")[0]){aU=document.createElement("div");aU.className=aZ.className;$.extend(aU.style,aZ.style);aU.style.display="inline";while(aR=aZ.firstChild){aR.parentNode.removeChild(aR);aU.appendChild(aR)}aZ.parentNode.insertBefore(aU,aZ);aZ.parentNode.removeChild(aZ)}aV=$(a0)}else{aV=$("<span></span>");aV.text(aM(aW))}aV.appendTo(aS);var aY=$WH.ce("li");aS.appendTo(aY);if(I(aW)){if(aT){aS.addClass("has-sub");aV.addClass("has-sub");var aX=$WH.ce("a");aX.className="view-sub";aX.href="javascript:;";aX.onclick=t;$(aX).data("menuItem",aW);$WH.ae(aY,aX)}else{aS.addClass("only-sub").data("menuItem",aW).click(t);aV.addClass("only-sub")}}return aY}function aM(aR){return aR[MENU_IDX_OPT].shortname||aR[MENU_IDX_NAME]}function t(){var aR=$(this).data("menuItem");var aS=$(".touch-menu-breadcrumb");if(aS.length){an(aS.get(0),[aR[MENU_IDX_ID]],true)}else{U.push(null)}ay(aR[MENU_IDX_SUB],{animate:this})}function aG(){ag()}function ag(){$("#header-nav dt > a.active").removeClass("active");$("#header-nav-subnav").removeClass("touch-menu").empty();if(Z){Z.empty().css({display:"none"})}X=null;U=[];aJ=null;if(au){au.removeClass("touch-menu-active")}au=null;ap()}function s(aU,aT){clearTimeout(V);var aS=!aT.target.className;if(!aS){var aR=aT.target.className.split(" ");aS=aR.indexOf("open")==-1&&aR.indexOf("hassubmenu")==-1&&aR.indexOf("fonticon-icon")==-1}if(aS){aA(aU)}}function az(aR){clearTimeout(V);V=setTimeout(ai,p)}function aF(aS){clearTimeout(V);var aT=$(this);var aU=aS.data.depth;y(aU);var aR=aT.data("menuItem");var aV=aU;if(aR&&I(aR)){aT.addClass("open");R[aU]=aT;ah(aR[MENU_IDX_SUB],aU+1);++aV}ar(aV+1)}function aA(aR){clearTimeout(V);y(aR);ar(aR+1)}function u(aT){var aU=$(this);var aR=aU.data("menuItem");if(!aR){return}var aS=ax.getItemOpt(aR);if(aS.onClick){aS.onClick()}}function ap(){if(C&&C.onHide){C.onHide.call(D,C)}C=null;D=null}function H(aR,aT,aS){if(aT.onShow){aT.onShow.call(aR,aT,aS)}}function av(aW,aV){if(!(aW instanceof Array)){return null}var aT=[];var aX;for(var aS=0,aR;aR=aW[aS];aS++){var aU=aL(aR,aV);if(!aU){continue}if(aR[MENU_IDX_ID]==null){aX=aU;continue}if(aX){aT.push(aX);aX=null}aT.push(aU)}return aT}function aL(aR,aV){var aT=aR[MENU_IDX_OPT]||{};if(aT.zulHide){return null}if(aR[MENU_IDX_OPT]&&aR[MENU_IDX_OPT].requiredAccess&&!User.hasPermissions(aR[MENU_IDX_OPT].requiredAccess)){return null}var aU={type:"link"};var aS="";if(aR[MENU_IDX_ID]==null){aU.heading=true}aU.text=aR[MENU_IDX_NAME];if(typeof aU.text!="string"){aU.text=""}aU.name="null";if(aR[MENU_IDX_OPT]&&aR[MENU_IDX_OPT].hasOwnProperty("zulName")){aU.name=aR[MENU_IDX_OPT].zulName}if(aT.zulNoHref){}else{if(typeof aT.zulHref=="function"){aU.href=aT.zulHref}else{switch(typeof aR[MENU_IDX_URL]){case"string":aU.href=Menu.getItemUrl(aR);break;case"function":aU.click=aR[MENU_IDX_URL];break}}}if(aR[MENU_IDX_OPT]){if(aT.zulGetMobileMenu){if(!aU.menu){aU.menu={}}aU.menu.mobile=aT.zulGetMobileMenu}if(aT.fontIcon){aU.fontIcon=aT.fontIcon}if(aT.icon){aU.imageIcon={universal:aT.icon,enlargeForMobile:true}}if(aT.tinyIcon){aU.imageIcon={universal:$WH.getTinyIconUrl(aT.tinyIcon),enlargeForMobile:true}}if(aT.armory){aU.imageIcon={universal:aT.armory,enlargeForMobile:true};aS=(aS?" ":"")+"zul-bar-icon-armory"}if(typeof aU.imageIcon=="object"&&typeof aU.fontIcon!="undefined"){delete aU.fontIcon}if(aR.checked){aU.checked=true}else{if(aT.checkedUrl&&location.href.match(aT.checkedUrl)){aU.checked=true}else{if(typeof aT.checkedFunc=="function"){aU.checked=aT.checkedFunc(aR)}else{if(aT.checked){aU.checked=true}}}}}if(aR[MENU_IDX_SUB]){if(!aU.menu){aU.menu={}}aU.menu.mobile=av(aR[MENU_IDX_SUB])}if(aS){aU.className=aS}if(aV){aU.condition=aV}else{if(aT.zulCondition){aU.condition=aT.zulCondition}}return aU}$(window).keyup((function(aR,aS){if(aS.keyCode==27){aR()}}).bind(null,ai))};Menu.customizeUrl(mn_events_holidays,mn_events_urls);Menu.customizeUrl(mn_events_recurring,mn_events_urls);Menu.customizeUrl(mn_events_pvp,mn_events_urls);Menu.fixUrls(mn_bluetracker,"/bluetracker=");Menu.fixUrls(mn_forums,"/forums?board=",{useSimpleIds:true});if($WH.isSet("mn_garrisons")){Menu.fixUrls(mn_garrisons,null,{useLastUrl:true})}Menu.findItem(mn_lists,[101])[2]=li_createList.bind(null,1,null,null,null,null);Menu.findItem(mn_lists,[102])[2]=li_createList.bind(null,2);$(document).ready(function(){if(Locale.getId()==LOCALE_ENUS){return}Menu.sort(mn_classes);Menu.sort(mn_database);Menu.sortSubmenus(mn_forums,[[-2]]);Menu.sortSubmenus(mn_items,[[4,1],[4,2],[4,3],[4,4],[1],[0],[16],[7],[6],[9]]);Menu.sort(mn_itemSets);Menu.sort(mn_npcs);Menu.sort(mn_objects);Menu.sort(mn_talentCalc);Menu.sort(mn_pets);Menu.sort(mn_races);Menu.sort(mn_skills);Menu.sortSubmenus(mn_spells,[[7],[-2],[-3],[11],[9]])});function MessageBox(b,f){b.find(".message-box").remove();var c=$("<div></div>");c.hide();c.addClass("message-box");c.html('<div class="message">'+f+'</div><div class="close" title="Click on this box to close it"></div>');c.click(function(){$(this).fadeOut()});b.append(c[0]);c.fadeIn()}var ModelViewer=new function(){this.validSlots=[1,3,4,5,6,7,8,9,10,13,14,15,16,17,19,20,21,22,23,25,26];this.slotMap={1:1,3:3,4:4,5:5,6:6,7:7,8:8,9:9,10:10,13:21,14:14,15:22,16:16,17:21,19:19,20:20,21:21,22:22,23:22,25:21,26:21};var k,J,M=[],F,b,n,u,m,K,v,z,A,l,c,w,D,C,t,h=false,y=[{id:10,name:g_chr_races[10],model:"bloodelf"},{id:11,name:g_chr_races[11],model:"draenei"},{id:3,name:g_chr_races[3],model:"dwarf"},{id:7,name:g_chr_races[7],model:"gnome"},{id:9,name:g_chr_races[9],model:"goblin"},{id:1,name:g_chr_races[1],model:"human"},{id:4,name:g_chr_races[4],model:"nightelf"},{id:24,name:g_chr_races[24],model:"pandaren"},{id:2,name:g_chr_races[2],model:"orc"},{id:6,name:g_chr_races[6],model:"tauren"},{id:8,name:g_chr_races[8],model:"troll"},{id:5,name:g_chr_races[5],model:"scourge"},{id:22,name:g_chr_races[22],model:"worgen"}],o=[{id:0,name:LANG.male,model:"male"},{id:1,name:LANG.female,model:"female"}];var r=[{name:LANG.pd_hd,val:"true"},{name:LANG.pd_sd,val:"false"}];function G(){}function f(){var N,O;if(z.is(":visible")){N=(z[0].selectedIndex>=0?z.val():"")}else{N=(A[0].selectedIndex>=0?A.val():"")}O=(l[0].selectedIndex>=0?l.val():0);return{r:N,s:O}}function j(N,O){return(!isNaN(N)&&N>0&&$WH.inArray(y,N,function(P){return P.id})!=-1&&!isNaN(O)&&O>=0&&O<=1)}function E(){var O=600;if(C.displayAd&&g_user.ads){O=725}if(window.innerWidth&&window.innerWidth-20<O){O=window.innerWidth-20}K.css("width",O+"px");if(u){u.destroy()}var W={type:ZamModelViewer.WOW,contentPath:ModelViewer.getContentPath(),container:K,aspect:O/K.height(),background:"background.png",models:{type:J,id:k}};if(C.hasOwnProperty("characterData")){var P=f();if(C.characterData.race==P.r&&C.characterData.gender==P.s){W.sk=C.characterData.skincolor;W.ha=C.characterData.hairstyle;W.hc=C.characterData.haircolor;W.fa=C.characterData.facetype;W.fh=C.characterData.features;W.fc=C.characterData.haircolor;W.ep=C.characterData.blindfolds;W.ho=C.characterData.hornstyle;W.ta=C.characterData.tattoos;W.cls=C.characterData.charClass}}var Q=ZamModelViewer.Wow.Types;if((J==Q.NPC||J==Q.HUMANOIDNPC||J==Q.CHARACTER)&&M.length){var T=[];M=[].concat.apply([],M);for(var R=0;R<M.length;R+=2){T.push([M[R],M[R+1]])}W.items=T}if(F){W.link=F}if(b){W.label=b}if(c){W.hd=(c.val()=="true")}var V=f(),S=V.r,U=V.s;if(S==10||(S==1&&U==0)){W.hd=true}this.viewer=u=new ZamModelViewer(W);if(!n.noPound){var N="#modelviewer";var V=$("#dsgndslgn464d");if(V.length==0){switch(n.type){case 1:N+=":1:"+n.displayId+":"+(n.humanoid|0);break;case 2:N+=":2:"+n.displayId;break;case 3:N+=":3:"+n.displayId+":"+(n.slot|0);break;case 4:N+=":4:"+M.join(";");break;case 101:case 110:N+=":101:"+M.join(";");break}}if(S&&U){N+=":"+S+"+"+U}else{N+=":"}if(n.extraPound!=null){N+=":"+n.extraPound}h=false;location.replace($WH.rtrim(N,":"))}}function g(){var R=f(),O=R.r,P=R.s;if(!O){if(!l.is(":visible")){return}l.hide();k=M[1];switch(n.slot){case 1:J=2;break;case 3:J=4;break;default:J=1}}else{if(!l.is(":visible")){l.show()}var R=function(S){return S.id};var Q=$WH.inArray(y,O,R);var N=$WH.inArray(o,P,R);if(Q!=-1&&N!=-1){k=y[Q].model+o[N].model;J=16}$WH.setWowheadCookie("temp_default_3dmodel",O+","+P)}H();G();E()}function s(){var N=$("select",v);if(N.val()&&u&&u.method("isLoaded")){u.method("setAnimation",N.val())}}function q(){if(h){return}var P=$("select",v);P.empty();if(!u||!u.method("isLoaded")){P.append($("<option/>",{text:LANG.tooltip_loading,val:0}));return}var N={};var R=u.method("getNumAnimations");for(var Q=0;Q<R;++Q){var O=u.method("getAnimation",Q);if(O&&O!="EmoteUseStanding"){N[O]=1}}var S=[];for(var O in N){S.push(O)}S.sort();for(var Q=0;Q<S.length;++Q){P.append($("<option/>",{text:S[Q],val:S[Q]}))}h=true}function I(N,R,P,Q){$WH.arrayWalk(N,function(S){S.checked=false;if(S&&S[MENU_IDX_SUB]){$WH.arrayWalk(S[MENU_IDX_SUB],function(T){T.checked=false})}});R.checked=true;P.checked=true;M[1]=Q;k=Q;var O=f();if(O.r){g()}else{G();E()}}function H(){var O=[];switch(C.type){case 4:case 101:case 110:if(C.itemData){for(var N in C.itemData){O.push({itemId:C.itemData[N][0],itemBonus:C.itemData[N][1],slot:C.itemData[N][2]})}}break}if(O.length>0){if(C.characterData){O.push(C.characterData)}else{var P=f();O.push(P)}$WH.localStorage.set("lastViewedModel",JSON.stringify(O))}}function B(T,O){var V=-1,X=-1,P,S;if(O.race!=null&&O.sex!=null){V=O.race;X=O.sex;m.hide();T=0}else{m.show()}if(O.hasOwnProperty("characterData")&&O.characterData.hasOwnProperty("race")){V=O.characterData.race}if(O.hasOwnProperty("characterData")&&O.characterData.hasOwnProperty("gender")){X=O.characterData.gender}if(V==-1&&X==-1){if(location.hash){var U=location.hash.match(/modelviewer:.*?([0-9]+)\+([0-9]+)/);if(U!=null){if(j(U[1],U[2])){V=U[1];X=U[2];l.show()}}}}if(T){P=z;S=1;z.show();z[0].selectedIndex=-1;A.hide();if(X==-1){l.hide()}}else{if(V==-1&&X==-1){var aa=1,R=0;if(g_user&&g_user.cookies.default_3dmodel){var N=g_user.cookies.default_3dmodel.split(",");if(N.length==2){aa=N[0];R=N[1]-1}}else{var W=$WH.getWowheadCookie("temp_default_3dmodel");if(W){var N=W.split(",");if(N.length==2){aa=N[0];R=N[1]}}}if(j(aa,R)){V=aa;X=R}else{V=1;X=0}}P=A;S=0;z.hide();A.show();l.show()}if(X!=-1){l[0].selectedIndex=X}if(V!=-1&&X!=-1){var Z=function(ab){return ab.id};var Y=$WH.inArray(y,V,Z);var Q=$WH.inArray(o,X,Z);if(Y!=-1&&Q!=-1){k=y[Y].model+o[Q].model;J=16;Y+=S;P[0].selectedIndex=Y;l[0].selectedIndex=Q}}}function p(){if(!n.noPound){if(!n.fromTag&&w&&w.indexOf("modelviewer")==-1){$WH.setHash(w)}else{$WH.clearHash()}}if(u){u.destroy()}if(n.onHide){n.onHide()}}function L(ai,Q,ac){var av,ar;C=ac;if(!ac.displayAd||!g_user.ads){Lightbox.setSize(620,452)}else{Lightbox.setSize(749,546)}if(Q){ai=$(ai);ai.addClass("has-lightbox-caption modelviewer");var al=$("<div/>",{"class":"modelviewer-screen"});var aw=$("<div/>",{"class":"lightbox-content modelviewer-modelbg"});aw.append(al);ai.append(aw);K=al;v=$("<div/>",{"class":"modelviewer-animation"});var am=$("<var/>",{text:LANG.animation});v.append(am);var O=$("<select/>",{change:s,mouseenter:q});O.append($("<option/>",{text:Platform.isTouch()?LANG.dialog_taptoload:LANG.dialog_mouseovertoload}));v.append(O);ai.append(v);var av=$("<a/>",{"class":"dialog-question fa fa-question",href:"/help=modelviewer",target:"_blank",text:LANG.help}),ar=$("<a/>",{"class":"dialog-x fa fa-times",href:"javascript:;",click:Lightbox.hide,text:LANG.close});ai.append(ar);ai.append(av);if(ac.itemData){var af=$("<div/>",{"class":"modelviewer-slots"}).appendTo(al);var X=$("<div/>",{"class":"modelviewer-slots-left"}).appendTo(af);var ab=$("<div/>",{"class":"modelviewer-slots-right"}).appendTo(af);var P=$("<div/>",{"class":"modelviewer-slots-bottom"}).appendTo(af);var ak=$("<a/>",{"class":"btn btn-site btn-small modelviewer-slots-link fa fa-male",href:"/dressing-room",html:" "+LANG.mv_dressingroom}).appendTo(af);var W={};for(var ay=0,S;S=g_character_slots_data[ay];++ay){W[S.id]=Icon.create("inventoryslot_"+S.name,1,null,"javascript:;");W[S.id].className+=" modelviewer-slots-noicon";if(S.noModel){W[S.id].style.visibility="hidden"}$(W[S.id]).appendTo(ay<8?X:(ay<16?ab:P))}for(var ax=0,aj;aj=ac.itemData[ax];ax++){if(W[aj[2]]){Icon.setTexture(W[aj[2]],1,g_items.getIcon(aj[0],aj[1]).toLowerCase());Icon.getLink(W[aj[2]]).href="/item="+aj[0]+(aj[1]&&aj[1]!=-1?"&bonus="+aj[1]:"");W[aj[2]].className=W[aj[2]].className.replace(/ *modelviewer-slots-noicon/,"")}}}m=$("<div/>",{"class":"modelviewer-model"});var ap=function(aC,aB){return $WH.stringCompare(aC.name,aB.name)};y.sort(ap);z=$("<select/>",{change:g});A=$("<select/>",{change:g});l=$("<select/>",{change:g});c=$("<select/>",{change:g});z.append($("<option/>"));for(var az=0,ad=y.length;az<ad;++az){var au=$("<option/>",{val:y[az].id,text:y[az].name});z.append(au)}for(var az=0,ad=y.length;az<ad;++az){var au=$("<option/>",{val:y[az].id,text:y[az].name});A.append(au)}for(var az=0,ad=o.length;az<ad;++az){var au=$("<option/>",{val:o[az].id,text:o[az].name});l.append(au)}l.css("display","inline");l.hide();for(var az=0,ad=r.length;az<ad;++az){var au=$("<option/>",{val:r[az].val,text:r[az].name});c.append(au)}var ag=C.artifact&&!$.isEmptyObject(C.artifact);var aq=$("<a>"+LANG.artifactappearances+"</a>");aq.get(0).style.marginLeft="5px";if(ag){var ah=g_items[C.typeId];var T=[];for(var az in C.artifact){var aa=C.artifact[az];if(!$.isEmptyObject(aa)){var R=[az,aa["1"]?aa["1"].setname:""];var Y=[];var aA=false;for(var ay in aa){var N=aa[ay].mod;if(ah.appearances&&ah.appearances[N]&&ah.appearances[N][0]){var ao=aa[ay].swatchrgb;var V=$WH.ce("span");V.className="artifact-appearance";V.style.backgroundColor="rgba("+$WH.sprintf("$1,$2,$3,1",(ao>>16)&255,(ao>>8)&255,ao&255)+")";var ae=[ay,V];ae[MENU_IDX_URL]=I.bind(this,T,R,ae,ah.appearances[N][0]);Y.push(ae);if(ah.appearances[N][0]==ac.displayId){Y[Y.length-1].checked=true;aA=true}}}R[MENU_IDX_SUB]=Y;R.checked=aA;T.push(R)}}Menu.add(aq,T)}m.append(z);m.append(A);m.append(l);m.append(c);if(ag){m.append("<br>");m.append(aq)}ai.append(m);var V=$("<div/>",{"class":"modelviewer-instructions"});V.append(LANG.mv_controls);ai.append(V);d=$("<div/>",{id:"modelviewer-msg","class":"sub",css:{display:"none","margin-top":"-6px",color:"#ccc","font-size":"13px"}});ai.append(d);if(ac.displayAd&&false){d.css("padding-bottom","4px");d=$("<div/>",{id:"modelviewer-ad",css:{"padding-bottom":"10px"}});ai.append(d)}if($WH.isSet("g_user")&&g_user.id){$.ajax({url:"/website-achievement-explored",data:{trigger:"modelviewer"},success:function(){AchievementCheck()},type:"POST"})}}switch(ac.type){case 1:m.hide();if(ac.humanoid){J=32}else{J=8}if(ac.equipList){M=ac.equipList}k=ac.displayId;break;case 2:m.hide();J=64;k=ac.displayId;break;case 3:case 4:case 101:case 110:if(ac.type==3){M=[ac.slot,ac.displayId]}else{M=ac.equipList}if(M.length>2||$WH.inArray([4,5,6,7,8,9,10,16,19,20],M[0])!=-1||((ac.type==101||ac.type==110)&&M.length>1)){B(0,ac)}else{switch(M[0]){case 1:J=2;break;case 3:J=4;break;default:J=1}k=M[1];B(1,ac)}break}var U=$("#modelviewer-ad");U.empty();G();setTimeout(E,1);if(ac.displayAd&&U.length>0){var at=$WH.ce("div");$WH.ae(U[0],at);WAS.create("leaderboard",at)}var an=$("#modelviewer-msg");if(ac.message&&an.length>0){an.html(ac.message);an.show()}else{an.hide()}if(ac.link){F=ac.link}if(ac.label){b=ac.label}var Z="";if(ac.fromTag){Z+="Custom ";switch(ac.type){case 1:Z+="NPC "+ac.displayId+(ac.humanoid?" humanoid":"");break;case 2:Z+="Object "+ac.displayId;break;case 3:Z+="Item "+ac.displayId+" Slot "+(ac.slot|0);break;case 4:Z+="Item set "+M.join(".");break;case 101:Z+="Transmog set "+M.join(".");break;case 110:Z+="Outfit "+M.join(".");break}}else{switch(ac.type){case 1:Z+="NPC "+(ac.typeId?ac.typeId:" DisplayID "+ac.displayId);break;case 2:Z+="Object "+ac.typeId;break;case 3:Z+="Item "+ac.typeId;break;case 4:Z+="Item set "+M.join(".");break;case 101:Z+="Transmog set "+M.join(".");break;case 110:Z+="Outfit "+M.join(".");break}}$WH.track.event("Model Viewer","Show",$WH.urlize(Z));w=location.hash;H()}this.checkPound=function(){if(location.hash&&location.hash.indexOf("#modelviewer")==0){var R=location.hash.split(":");if(R.length>=3){R.shift();var P=parseInt(R.shift());var O={type:P,displayAd:1};switch(P){case 1:O.displayId=parseInt(R.shift());var N=parseInt(R.shift());if(N==1){O.humanoid=1}break;case 2:O.displayId=parseInt(R.shift());break;case 3:O.displayId=parseInt(R.shift());O.slot=parseInt(R.shift());break;case 4:var Q=R.shift();O.equipList=Q.split(";");break}if(O.displayId||O.equipList){ModelViewer.show(O)}if(t!=null){if(R.length>0&&R[R.length-1]){t(R[R.length-1])}}}else{if(t!=null&&R.length==2&&R[1]){t(R[1])}else{var S=$("#dsgndslgn464d");if(S.length>0){S.click()}}}}};this.addExtraPound=function(N){t=N};this.show=function(N){n=N;Lightbox.show("modelviewer",{onShow:L,onHide:p},N)};this.getContentPath=function(){return g_staticUrl+this.getStaticBase()+"/"};this.getStaticBase=function(){return"/modelviewer"};$(document).ready(this.checkPound)};var PageTemplate=new function(){var l=this;var R={};var M=null;l.init=function(){n();s();z();o();v();m=true};l.initUserMenus=function(){N();H();t();K();$("#zul-bar-user .hassubmenu").append('<span class="fa fa-chevron-down"></span>')};l.initSidebar=function(){$WH.setupDynamicFixedElement("sidebar","#sidebar")};l.get=function(S){return q[S]};l.set=function(T){if(!T){return}var S={};$.extend(S,q);$.extend(q,T);q.activeTab=parseInt(q.activeTab);if(m){if(q.activeTab!=S.activeTab){O()}if(q.breadcrumb!=S.breadcrumb){P()}}};l.getBreadcrumb=function(){return j};l.updateBreadcrumb=function(){P()};l.expandBreadcrumb=function(){return C()};l.locateBreadcrumb=function(){var V=Menu.getFullPath(Menu.getMenu(),q.breadcrumb);if(!V.length){return}if((!g_pageInfo)||(!g_pageInfo.hasOwnProperty("typeId"))){return}var W=new RegExp("\\b"+g_types[g_pageInfo.type]+"="+g_pageInfo.typeId+"\\b");var U=$WH.cO(q.breadcrumb);U.pop();var T=false;var S=function(Y){U.push(Y[0]);if(Y[3]&&Y[3].length){for(var X=0;X<Y[3].length&&!T;X++){S(Y[3][X])}}else{T|=(Y.length>2)&&W.test(Y[2])}if(!T){U.pop()}};S(V.pop());if(T){q.breadcrumb=U;P()}};l.getUserMenu=function(){return b()};l.getListsSubmenu=function(){return I()};l.applyUrl=function(T){if(!("replaceState" in window.history)){return}if(typeof T!="string"||!T){var S=document.getElementsByTagName("head")[0].getElementsByTagName("link");for(var U=0,V;V=S[U];U++){if(V.rel=="canonical"){T=V.href}}}if(!T){return}T=T.replace(/https?:\/\/[^\/]+/,"");if(location.href.indexOf(T)==0){return}var W="";if(T.indexOf("#")<0){W=window.location.hash;if(W=="#"){W=""}if(W!=""&&(W.substr(0,1)!="#")){W="#"+W}}window.history.replaceState({},"",T+W)};l.setMinimumPageWidth=function(S){if(!document.body){setTimeout(l.setMinimumPageWidth.bind(this,S),5);return}switch(typeof S){case"number":S+="px";break;case"string":if(S.match(/^[0-9]+$/)){S+="px"}break;default:return}document.body.style.minWidth=S};l.collapseInteriorSidebar=function(){$(".interior-sidebar-wrapper").addClass("collapsed");$WH.checkDynamicNavWidth()};l.expandInteriorSidebar=function(){$(".interior-sidebar-wrapper").removeClass("collapsed");$WH.checkDynamicNavWidth()};var m=false;var q={};var j;var p;var g=[];function w(){D();y()}function D(){j=$('<div class="breadcrumb"></div>')}function y(){if($WH.Browser.ie6){$(document.documentElement).addClass("ie6 ie67 ie678")}if($WH.Browser.ie7){$(document.documentElement).addClass("ie7 ie67 ie678")}if($WH.Browser.ie8){$(document.documentElement).addClass("ie8 ie678")}}function H(){Favorites.refreshMenu()}function t(){var S=$(".zul-bar-user-item-user");if(!S.length){return}S.attr("href","/user="+g_user.name);Menu.add(S,b());S.addClass("hassubmenu")}function b(){if(M){return M}var W=$WH.isSet("g_dev")&&g_dev&&$WH.isSet("g_enablessl")&&!g_enablessl?"http://":"https://";var X=[];var V=["user-page",LANG.userpage,"/user="+g_user.name,null,{checkedUrl:new RegExp("user="+g_user.name+"$","i"),fontIcon:"user"}];X.push(V);var U=["settings",LANG.settings,W+window.location.hostname+"/account",null,{fontIcon:"cog",checkedUrl:/account(?!=premium)/i}];X.push(U);if(g_user.premium){X.push(["premium",LANG.premiumsettings,W+window.location.hostname+"/account=premium",null,{checkedUrl:/account=premium/i,fontIcon:"star"}])}else{X.push(["premium-upgrade",LANG.premiumsettings,"/premium",null,{className:"premium-upgrade",checkedUrl:/premium/i,fontIcon:"star"}])}var T=["reputation",LANG.reputation,"/reputation",null,{fontIcon:"trophy"}];X.push(T);if(!Locale.getId()){var S=["guides","My Guides","/my-guides",null,{fontIcon:"book"}];X.push(S)}k(X);h(X);X.push(["sign-out",LANG.signout,"/account=signout"]);M=X;return X}function N(){if(!g_user.lists||!g_user.lists.length){return}var T=[];E(T);T=T[MENU_IDX_SUB];if(!T.length){return}var S=$WH.ge("zul-bar-user-item-avatar");if(!S){return}Menu.add(S,T)}function k(T){if(!g_user.lists||!g_user.lists.length){return}var S=Q();T.push(S)}function Q(){var T={onBeforeShow:E,zulGetMobileMenu:f,zulHref:function(X,V,W,U){return W?false:"/user="+g_user.name},fontIcon:"users"};for(var S=0;S<g_user.lists.length;S++){if(g_user.lists[S].thumbnail){delete T.icon;T.armory="//render-"+g_user.lists[S].region.toLowerCase()+".worldofwarcraft.com/character/"+g_user.lists[S].thumbnail}}return["lists",LANG.li_myprofiles,"/user="+g_user.name+"#lists",null,T]}function f(){return Menu.prepareForZul(I())}function E(S){S[MENU_IDX_SUB]=I()}function I(){if(!g_user.lists){return null}var ac=[];var ag=[["refresh",LANG.refreshcharacterlist,"/account=battlenet",null,{icon:g_staticUrl+"/images/icons/battlenet.png"}]];var V=[],S=[],W=[],Z=[];g_user.lists.sort(function(ai,ah){return $WH.stringCompare(ai.realm,ah.realm)||$WH.stringCompare(ai.name,ah.name)});var X=false;$.each(g_user.lists,function(ah,ai){if(ai.mode==1){if(ai.pinned>0){V.push(li_generateListMenuItem(ai,true))}if(X&&(X!=ai.realm)){if(S.length){S.unshift([undefined,X])}S.push([undefined,ai.realm])}X=ai.realm;S.push(li_generateListMenuItem(ai))}else{Z.push(li_generateListMenuItem(ai))}});var Y=0,T,ab,ae;var U=function(ai,aj){var ah=0+aj;return function(al){if(al){return}for(var ak=0;ak<ai.length;ak++){if(ai[ak][0]==ah){ai.splice(ak--,1)}}}};if(g_user.battlenetChars&&g_user.battlenetChars.length){g_user.battlenetChars.sort(function(ai,ah){return $WH.stringCompare(ai.region,ah.region)||$WH.stringCompare(ai.realm,ah.realm)||$WH.stringCompare(ai.name,ah.name)});X=false;for(var af=0;af<g_user.battlenetChars.length;af++){ab=g_user.battlenetChars[af];if(ab.level<10){continue}T=$WH.urlize(ab.region+" "+ab.realm+" "+ab.name,true);ae=false;for(var ad=0;ad<g_user.lists.length;ad++){if(g_user.lists[ad].url==T){ae=true;break}}if(ae){continue}if(X&&(X!=ab.realm)){if(W.length){W.unshift([undefined,X])}W.push([undefined,ab.realm])}X=ab.realm;Y--;W.push([Y,ab.name,"/list/"+T+"?private",null,{className:"listmanager-mode1"}]);$WH.BattleNet.CharacterExists(ab.region,ab.realm,ab.name,U(W,Y))}}var aa=0;if(S.length){aa++}if(W.length){aa++}if(Z.length){aa++}if((S.length+W.length+Z.length<=12)||(aa<=1)){if(S.length){ac.push([undefined,LANG.tab_profiles]);ac.push.apply(ac,S)}if(W.length){ac.push([undefined,LANG.tc_import]);ac.push.apply(ac,ag.concat(W))}if(Z.length){ac.push([undefined,LANG.li_customlists]);ac.push.apply(ac,Z)}}else{if(V.length){ac.push([undefined,LANG.zul_pinnedprofiles]);ac.push.apply(ac,V);ac.push([undefined,LANG.other])}if(S.length){ac.push([1,LANG.tab_profiles,null,S])}if(W.length){ac.push([1,LANG.tc_import,null,ag.concat(W)])}if(Z.length){ac.push([1,LANG.li_customlists,null,Z])}}return ac}function h(T){if(!g_user.bagscans||!g_user.bagscans.length){return}var S=["bagscans",LANG.mybagscans,"/bagscanner",null,{onBeforeShow:r,zulGetMobileMenu:J,zulHref:function(X,V,W,U){return W?false:"/bagscanner"},tinyIcon:"inv_misc_bag_08"}];T.push(S)}function J(){return Menu.prepareForZul(L())}function r(S){S[MENU_IDX_SUB]=L()}function L(){var U=[[0,LANG.mybagscans,"/bagscanner",null,{hide:true,zulCondition:function(Y,W,X){return X}}]];var T=15;var V=[];if(g_user.bagscans.length>T){g_user.bagscans.sort(function(X,W){return $WH.stringCompare(W.when,X.when)})}for(var S=0;S<T&&S<g_user.bagscans.length;S++){V.push(g_user.bagscans[S])}V.sort(function(X,W){return $WH.stringCompare(X.name,W.name)});$.each(V,function(W,X){U.push([X.id,X.name,"/bagscanner="+X.id])});return U}function K(){var T="//";var W=location.pathname+location.search+location.hash;var S=Locale.getId();var V=[];var U;$.each(Locale.getAllByName(),function(X,Z){var Y=[Z.id,Z.description,T+Z.domain+W];if(Z.id==S){Y.checked=true;U=Z}V.push(Y)});c($(".zul-bar-user-item-locale"),V,U);$(document).ready(function(){c($("#footer-links-language"),V,U)})}function c(S,U,T){S.attr("href","javascript:;");S.text(T.description);S.addClass("hassubmenu");Menu.add(S,U)}function n(){$("#header-expandsite").attr("href","javascript:;").click(G);$(".beta-ptr-links a[title]").each(function(){$WH.Tooltip.simple(this,this.title,"q2");this.title=""})}function F(){if(j.is(":empty")){return}var S=location.href.split("/");if(S.length){S=S[3].replace(/^\?(.*)/,"$1").split(/[\?&#=]/);if(S.length&&S[0]=="news"){return}}PageTemplate.addShareButtons($("#main-precontents"));F=function(){}}l.addShareButtons=function(T,Z){if(!(T instanceof jQuery)){T=$(T)}if(typeof Z!="object"){Z={}}if(!(Z.types instanceof Array)){Z.types=["twitter","facebook","google","reddit"]}if(!Z.mode){Z.mode="links"}var W=$("<div/>",{"class":"share-buttons"}).prependTo(T);var ab=(""+(Z.title||document.title)).split(LANG.hyphen).shift();var S=(""+(Z.url||location.href)).replace(/^https:/,"http:");for(var U=0,X;X=Z.types[U];U++){if(["buttons","links","icons"].indexOf(Z.mode)>-1){var aa="";var Y=X;var ac=LANG.share;switch(X){case"twitter":aa="https://twitter.com/intent/tweet?text=%20"+S+"%20via%20@Wowhead";ac=LANG.tweet;break;case"facebook":aa="https://www.facebook.com/sharer/sharer.php?u="+S;Y="facebook-official";break;case"reddit":aa="//www.reddit.com/submit?url="+S+"&r=wow";Y="reddit-alien";ac=LANG.reddit;break;case"google":aa="https://plus.google.com/share?url="+S;Y="google-plus";break}if(Z.mode=="icons"){Y+=" fa-fw";ac=null}var V=$("<a/>",{"class":(Z.mode=="buttons"?"btn btn-primary btn-small ":"")+"fa fa-"+Y,href:aa,rel:"np",text:ac,target:"_blank"});W.append(V);if(Z.mode=="icons"){$WH.Tooltip.simple(V.get(0),$WH.sprintf(LANG.shareon,X=="google"?LANG.googleplus:LANG[X]),"q",true)}}else{if(Z.mode=="native-buttons"){switch(X){case"twitter":W.append($('<a href="https://twitter.com/share" class="twitter-share-button btn btn-primary btn-small fa fa-twitter" data-url="'+S+'" data-text="'+ab+'" data-via="Wowhead" data-lang="'+Locale.getName().replace(/(..)(..)/,"$1-$2")+'" target="_blank">'+LANG.tweet+"</a>"));break;case"facebook":W.append($('<div class="fb-share-button" data-href="'+S+'" data-layout="'+(Z.showCounts?"button_count":"button")+'"></div>'));break;case"reddit":W.append($('<a href="//www.reddit.com/submit?url='+encodeURIComponent(S)+'&r=wow" onclick="window.location = \'//www.reddit.com/submit?url='+encodeURIComponent(S)+'\'; return false" class="btn btn-primary btn-small fa fa-reddit-alien" target="_blank" rel="np">'+LANG.reddit+"</a>"));break;case"google":W.append($('<div class="g-plus" data-action="share" data-annotations="bubble"></div>'));break}B(X)}}}};function B(V){if(R[V]){return}R[V]=true;var U=null;switch(V){case"facebook":$('<div id="fb-root"></div>').prependTo(document.body);U=$WH.ce("script",{id:"facebook-jssdk",src:"//connect.facebook.net/"+Locale.getName().replace(/(..)(..)/,"$1_$2").replace(/(..)$/,function(W){return W.toUpperCase()})+"/sdk.js#xfbml=1&version=v2.5"});break;case"twitter":var S=/^http:/.test(document.location)?"http":"https";U=$WH.ce("script",{id:"twitter-wjs",src:S+"://platform.twitter.com/widgets.js"});break;case"google":U=$WH.ce("script",{id:"google-platform-api",src:"https://apis.google.com/js/platform.js"});break}if(U){var T=document.getElementsByTagName("script")[0];T.parentNode.insertBefore(U,T)}}function s(){var S=$("#header-nav");if(!S.length){return}p=$("<dl/>");var T='<span class="fa fa-chevron-down"></span>';$.each(Menu.getMenu(),function(U,V){if(V[MENU_IDX_OPT]&&(V[MENU_IDX_OPT].breadcrumbOnly||V[MENU_IDX_OPT].hide)){return}var W=$('<dt><a data-id="'+V[MENU_IDX_ID]+'">'+V[MENU_IDX_NAME]+T+"</a></dt>");var X=W.children("a");if(V[MENU_IDX_OPT]&&V[MENU_IDX_OPT].rel){X.attr("rel",V[MENU_IDX_OPT].rel)}Menu.linkifyItem(V,X);X.data("menuItem",V);W.appendTo(p)});O();p.prependTo(S)}function u(T){var S=$WH.ce("a",{className:T[MENU_IDX_OPT]&&T[MENU_IDX_OPT].headerNavIcon?"header-nav-icon":"header-nav-text",href:T[MENU_IDX_URL],rel:"np"});if(!T[MENU_IDX_URL]){S.href="javascript:;";S.className+=" unlinked"}if(T[MENU_IDX_OPT]&&T[MENU_IDX_OPT].className){S.className+=" "+T[MENU_IDX_OPT].className}if(T[MENU_IDX_OPT]&&T[MENU_IDX_OPT].title){S.title=T[MENU_IDX_OPT].title}var U=$WH.ce("span");$WH.ae(S,U);if(T[MENU_IDX_OPT]&&T[MENU_IDX_OPT].headerNavIcon){U.style.background="url("+g_staticUrl+"/images/wow/icons/medium/"+T[MENU_IDX_OPT].headerNavIcon+".jpg)"}else{$WH.st(U,T[MENU_IDX_NAME]);if(T[MENU_IDX_SUB]&&T[MENU_IDX_SUB].length){$WH.ae(S,$WH.ce("span",{className:"fa fa-chevron-down"}))}}if(T[MENU_IDX_SUB]&&T[MENU_IDX_SUB].length){Menu.add(S,T[MENU_IDX_SUB])}return S}function z(){var S=$(".header-nav-features").empty();for(var W=0,T;T=mn_featuredContent[W];W++){if(T[MENU_IDX_OPT]&&T[MENU_IDX_OPT].expandInHeaderNav){if(T[MENU_IDX_SUB]){for(var U=0,V;V=T[MENU_IDX_SUB][U];U++){S.append(u(V))}}}else{S.append(u(T))}}S.append($("<a/>",{"class":"header-nav-wowhead-premium",href:"/premium"}).append($("<span/>",{html:LANG.premiumupgrade})).append($("<span/>",{html:LANG.premium})))}function o(){var W=$("div.header-search");if(W.length){var S=$('input[type="text"]',W);var V=$("body");if(V.hasClass("home")){$WH.safeFocus(S)}if($WH.localStorage.get("showRandomWidget")=="true"){$WH.localStorage.remove("showRandomWidget");var U=$WH.ce("a");U.className="header-random fa fa-random";U.href="/random";$WH.Tooltip.simple(U,LANG.anotherrandompage_tip,"q2");W.append(U)}var T;T=$("<a/>",{"class":"header-search-button fa fa-search",href:"javascript:;"});T.click(A).appendTo(W);$("form",W).submit($WH.preventEmptyFormSubmission);LiveSearch.attach(S);if(Array.prototype.indexOf&&!q.noSearchBoxGrab){V.keydown((function(X,Y){if(!Y.ctrlKey&&!Y.metaKey&&!Y.altKey&&$WH.keyPressIsAlphaNumeric(Y)&&["INPUT","SELECT","TEXTAREA"].indexOf(document.activeElement.tagName)==-1){if(X.offset().top>=(window.scrollY||window.pageYOffset)){X.focus()}}}).bind(null,S))}}}function v(){P();j.appendTo($("#main-precontents"))}function O(){if(!p){return}$.each(Menu.getMenu(),function(S,U){var V=$('a[data-id="'+U[MENU_IDX_ID]+'"]',p);var T=(U[MENU_IDX_ID]==q.activeTab);if(T){if(Platform.isTouch()){V.addClass("active-touch");if(U[MENU_IDX_SUB]){Menu.addTouch(V,U[MENU_IDX_SUB])}}else{V.addClass("active");Menu.add(V,U[MENU_IDX_SUB])}}else{V.removeClass("active-touch").removeClass("active");if(U[MENU_IDX_SUB]){if(Platform.isTouch()){Menu.addTouch(V,U[MENU_IDX_SUB])}else{Menu.add(V,U[MENU_IDX_SUB])}}}})}function P(){if(!q.breadcrumb||!q.breadcrumb.length){j.detach();setTimeout(function(){if(j.is(":empty")){j.detach()}},0);return}j.empty();j.appendTo("#main-precontents");if(g.length){$.each(g,function(){this.checked=false;Menu.updateItem(this)});g=[]}var T=Menu.getFullPath(Menu.getMenu(),q.breadcrumb);if(!T.length){return}var V=(T.length-1);var U={"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:[]};$.each(T,function(ad,ab){var Y=Menu.getItemOpt(ab);var ac={"@type":"ListItem",position:ad+1,item:{}};if(Y.tinyIcon){ac.item.image=$WH.ensureUrlProtocol($WH.getTinyIconUrl(Y.tinyIcon))}ab.checked=true;g.push(ab);Menu.updateItem(ab);var aa=C();var X=aa;if(ab[MENU_IDX_URL]){var W=Menu.getItemUrl(ab);ac.item["@id"]=$WH.ensureUrlProtocol(W);X=$("<a/>",{href:W,rel:"np"}).appendTo(aa)}var ae=Y.breadcrumb?Y.breadcrumb.trim():ab[MENU_IDX_NAME].trim();ac.item.name=ae;X.text(ae);Menu.add(X,ab.parentMenu);U.itemListElement.push(ac);aa.appendTo(j);if(ad==V&&ab[MENU_IDX_SUB]){aa.addClass("breadcrumb-arrow");var Z=$('<span class="breadcrumb-ellipsis">...</span>');Menu.add(Z,ab[MENU_IDX_SUB]);Z.appendTo(j)}});$("#json-ld-breadcrumbs").remove();if(U.itemListElement.length){var S=document.createElement("script");S.id="json-ld-breadcrumbs";S.type="application/ld+json";S.text=JSON.stringify(U);document.head.appendChild(S)}j.trigger("update");j.show();ZUL.regenerateMenu(false,true);F()}function C(){j.children("span:last").addClass("breadcrumb-arrow");return $("<span/>").appendTo(j)}function G(){WAS.removeAll();$("#header-expandsite").remove();var S=333;var U=$("#sidebar");var T=$(".top-sidebar-infobox");T.detach();if(U.is(":empty")){U.remove();$("#sidebar-wrapper").remove();var V=$("#layout");if(V.hasClass("no-sidebar")){return}V.removeClass("has-sidebar").addClass("no-sidebar");setTimeout(function(){if(typeof SearchSupport!="undefined"){if($(".graphical-guide-links").length){SearchSupport.updateTopResultsWidth();SearchSupport.checkGuidesSize()}else{SearchSupport.updateTopResultsWidth(true)}}},S+1)}else{U.prepend(T)}setTimeout(function(){$(document.body).removeClass("has-ads").addClass("no-ads")},S+1)}function A(){var S=$(this).siblings("form").submit().children("input");$WH.safeFocus(S)}w()};$WH.convertRawItemDataForPaperdoll=function(c){var f={};f.slotId=c[0];f.itemId=c[1];f.transmogId=c[9];f.hidden=c[10];f.rawBonuses=c.slice(11,17);f.bonuses=[];for(var b in f.rawBonuses){if(f.rawBonuses.hasOwnProperty(b)&&f.rawBonuses[b]){f.bonuses.push(f.rawBonuses[b])}}return f};$WH.convertPaperdollItemDataToRaw=function(f){var b=[];for(var c=0;c<17;c++){b[c]=0}b[0]=f.slotId;b[1]=f.itemId;b[9]=f.transmogId?f.transmogId:0;b[10]=f.hidden?f.hidden:0;b[11]=f.itemBonus?f.itemBonus:0;return b};var Platform=new function(){this.known=false;this.initialized=false;this.initSteps={};var l="user-specified-platform";var b=false;var g=false;var c=false;var j=navigator.userAgent||navigator.vendor||window.opera;if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(j)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(j.substr(0,4))){b=true}if(!b){if(/(android|ipad|playbook|silk)/i.test(j)){g=true}}var m=$WH.localStorage.get(l);if(m){switch(m){case"mobile":if(!b){c=true;b=true;g=false}break;case"tablet":if(!g){c=true;b=false;g=true}break;default:if(b||g){c=true;b=false;g=false}}}var q=$WH.getGets();if(typeof q.testmobile!="undefined"&&!b){c=true;b=true}if(typeof q.testtablet!="undefined"&&!g){c=true;g=true}this.known=true;this.preInit1=function(){if(Platform.initSteps["1"]){return}$("html").addClass(Platform.get()+"-device"+(c?" forced-device":""));if(Platform.isTouch()){p()}r();Platform.initSteps["1"]=true};this.preInit2=function(){if(Platform.initSteps["2"]){return}if(Platform.isTouch()){n()}Platform.initSteps["2"]=true};this.init=function(){if(Platform.initSteps["3"]||Platform.initialized){return}if(Platform.isTouch()){k();t()}else{$WH.prepInfobox();t()}Platform.initSteps["3"]=true;Platform.initialized=true};function t(){setTimeout(function(){$WH.updateContentHeight();setInterval($WH.updateContentHeight,200)},9)}this.isMobile=function(){return b};this.isTablet=function(){return g};this.isTouch=function(){return this.isMobile()||this.isTablet()};this.get=function(){if(this.isMobile()){return"mobile"}if(this.isTablet()){return"tablet"}return"pointer"};this.set=function(u){if(!$WH.localStorage.isSupported()){alert(LANG.platform_layoutchoicelserror);return}switch(u){case"mobile":case"tablet":case"pointer":f(u);break;case"auto":s();break;default:if(typeof console!="undefined"&&console.error){console.error("Attempted to set platform to invalid value:",u)}}};this.getViewportSize=function(){var v=window;var u="inner";if(!("innerWidth" in window)){u="client";v=document.documentElement||document.body}return{width:v[u+"Width"],height:v[u+"Height"]}};function f(u){$WH.localStorage.set(l,u);h()}function s(){$WH.localStorage.remove(l);h()}function h(){location.reload()}function r(){$("head meta[name=viewport]").remove();var w=Platform.get();var v=$("head");var u="initial-scale=1";if(c){switch(w){case"mobile":u="width="+414;break;case"tablet":u="width="+768;break;case"pointer":u="width="+996}}if(w=="mobile"){u+=", user-scalable=no"}if(!(w=="pointer"&&!c)){v.append('<meta name="viewport" content="'+u+'">')}}function p(){$("html").addClass("touch-device")}function n(){Platform.preInit1();$("#layout").removeClass("has-sidebar").addClass("no-sidebar");$("#sidebar .vertical-bg, #sidebar .sidebar-bg, #sidebar .block-bg").remove();$("#header-expandsite").remove()}function k(){Platform.preInit1();Platform.preInit2();var u=$WH.ge("infobox-alternate");if(u){var w=$(".infobox");var v=w.closest(".interior-sidebar");if(v.length){if((Platform.getViewportSize()).width>767){return}v.appendTo(u)}else{w.appendTo(u)}if(Platform.isTablet()){o(w,{rows:2})}}}function o(w,A){if(!A){A={}}if(!A.rows){A.rows=1}w=w.first();$("tr.hide-from-mobile",w).remove();var B=[];$("table",w).each(function(){var C=this.parentNode;var D=$(this);D.detach();B.push([C,D])});var v=$("tr",w);var z;while(v.length>A.rows){for(y=0;y<A.rows;y++){z=A.rows;$(v[y]).append($("th, td",v[z]));$(v[z]).remove();v.splice(z,1)}}for(var y in B){if(B.hasOwnProperty(y)){B[y][1].appendTo(B[y][0])}}var u=$WH.getPage();if(u[0]=="guide"){$("th:last-child, td:last-child",w).remove()}}};$(document).ready(Platform.init);var PoundChecker=new function(){var c=null;var g=null;var f=1000;var b=function(){if(!g){PoundChecker.stop();return}if(location.hash){g()}};this.start=function(h,j){if(g){if($WH.isSet("g_dev")){alert("Multiple pound checkers are bad, mmkay?")}return}g=h;if(j){f=j}c=setInterval(b,f)};this.stop=function(){clearInterval(c);c=g=null;f=1000};this.pause=function(){clearInterval(c)};this.resume=function(){if(g){c=setInterval(g,f)}}};var ProgressBar=function(b){this.opts={text:"",hoverText:"",color:"rep6",width:0,progress:0};this.elements={text:null,hoverText:null,textContainer:null,progress:null,container:null};$WH.cO(this.opts,b);this.build()};ProgressBar.prototype.build=function(){var c=$("<a/>",{"class":"progressbar",href:"javascript:;"});if(this.opts.width>0){c.css("width",this.opts.width+"px")}else{c.css("width","auto")}var b=$("<div/>",{"class":"progressbar-text"});if(this.opts.text){this.elements.text=$("<del/>",{text:this.opts.text});b.append(this.elements.text)}if(this.opts.hoverText){this.elements.hoverText=$("<ins/>",{text:this.opts.hoverText});b.append(this.elements.hoverText)}c.append(b);var f=$("<div/>",{"class":"progressbar-"+this.opts.color,css:{width:this.opts.progress+"%"},text:String.fromCharCode(160)});c.append(f);if(this.opts.text){b.append($("<div/>",{"class":"progressbar-text progressbar-hidden",text:this.opts.text}))}this.elements.container=c;this.elements.progress=f;this.elements.textContainer=b;return c};ProgressBar.prototype.setText=function(b){this.opts.text=b;if(this.elements.text){this.elements.text.text(this.opts.text)}else{this.elements.text=$("<del/>",{text:this.opts.text});if(this.opts.hoverText){this.opts.hoverText.before(this.elements.text)}else{this.elements.textContainer.append(this.elements.text)}}};ProgressBar.prototype.setHoverText=function(b){this.opts.hoverText=b;if(this.elements.hoverText){this.elements.hoverText.text(this.opts.hoverText)}else{this.elements.hoverText=$("<ins/>",{text:this.opts.hoverText});this.elements.textContainer.append(this.elements.hoverText)}};ProgressBar.prototype.setProgress=function(b){this.opts.progress=b;this.elements.progress.css("width",this.opts.progress+"%")};ProgressBar.prototype.setWidth=function(b){this.opts.width=b;if(this.opts.width>0){this.elements.container.css("width",this.opts.width+"px")}else{this.elements.container.css("width","auto")}};ProgressBar.prototype.getText=function(){return this.opts.text};ProgressBar.prototype.getHoverText=function(){return this.opts.hoverText};ProgressBar.prototype.getWidth=function(){return this.opts.width};ProgressBar.prototype.getContainer=function(){return this.elements.container};function Rectangle(g,f,b,c){this.l=g;this.t=f;this.r=g+b;this.b=f+c}Rectangle.prototype={intersectWith:function(b){return !(this.l>=b.r||b.l>=this.r||this.t>=b.b||b.t>=this.b)},contains:function(b){return(this.l<=b.l&&this.t<=b.t&&this.r>=b.r&&this.b>=b.b)},containedIn:function(b){return b.contains(this)}};function ss_submitAScreenshot(){tabsContribute.focus(1)}function ss_validateForm(b){if(!b.elements.screenshotfile.value.length){alert(LANG.message_noscreenshot);return false}return true}function ss_appendSticky(){var m=$WH.ge("infobox-sticky-ss");if(!m){return}var j=g_pageInfo.type;var h=g_pageInfo.typeId;var k=$WH.inArray(lv_screenshots,1,function(o){return o.sticky});if(k!=-1){m.className="has-thumb";var b=lv_screenshots[k];var l=$WH.ce("a");l.href="#screenshots:id="+b.id;l.onclick=function(o){ScreenshotViewer.show({screenshots:lv_screenshots,pos:k});return $WH.rfWithoutControlKey(o)};var n=[300,300];var g=$WH.ce("img"),f=Math.min(n[0]/b.width,n[1]/b.height);g.src=$WH.getScreenshotUrl(b.id,"small");g.width=Math.round(f*b.width);g.height=Math.round(f*b.height);g.className="border";$WH.ae(l,g);$WH.ae(m,l);var c=$("#infobox-screenshots");if(!c){c=$("th",$(m).parents().prev("tr"))}c.append(" ("+lv_screenshots.length+")").wrapInner($('<a href="#screenshots"></a>').click(function(){tabsRelated.focus(tabsRelated.getTabById("screenshots"));return false}))}else{var l;if(g_user.id>0){l='<a href="javascript:;" onclick="ss_submitAScreenshot(); return false">'}else{l='<a href="/account=signin">'}m.innerHTML=$WH.sprintf(LANG.infobox_noneyet,l+LANG.infobox_submitone+"</a>")}ss_appendSticky=function(){}}var g_screenshots={};var ScreenshotViewer=new function(){var r,C,f,v,P,A=150,I=150,G,D,j=0,t,m,K,H,F,M,q,y,n,w,O,b,s,z="screenshots";function k(){var W=r[C];if(!W){W={height:270,width:300}}v=W.width;P=W.height;var U=v;var S=$WH.getWindowSize();var T=S.w-A;var R=Math.min(v,T);var V=R*(P/v);if(V+I>S.h){U=(S.h-I)*(v/P);G=true}else{G=false}Lightbox.setSize(U+20,P+52);$(".screenshotviewer-image-inner",H).css({"padding-top":(P/v)*100+"%"})}function o(T){var S=r[T],R="#"+z;if(j==0){R+=(S?":id="+S.id:"")}else{R+=":"+t+":"+(S?T+1:T+0.5)}return R}function J(S){var R="";if(typeof g_gathered_types=="object"&&g_gathered_types[S.type]&&g_gathered_types[S.type][S.typeId]&&g_gathered_types[S.type][S.typeId]["name_"+Locale.getName()]){R=g_gathered_types[S.type][S.typeId]["name_"+Locale.getName()]}else{if(typeof g_pageInfo=="object"&&g_pageInfo.type&&g_pageInfo.typeId&&g_pageInfo.name){R=g_pageInfo.name}}if(S.caption){if(R){R+=LANG.hyphen+S.caption}else{R=S.caption}}return R}function p(U){clearTimeout(s);if(U&&!G&&$WH.getWindowSize().h>m.offsetHeight+I){return}m.style.visibility="hidden";var R=r[C];if(!R){R={ad:true,height:270,width:300}}k();var ab=J(R);var T=R.url||$WH.getScreenshotUrl(R.id,"normal",ab);var X="";if(R.ad){X='<div class="screenshot-block"><div id="screenshot-block-target"></div><div class="screenshot-block-caption">'+LANG.advertisement+"</div></div>";setTimeout(function(){WAS.create("medrec","screenshot-block-target")},0)}else{X='<img src="'+T+'" width="'+v+'" height="'+P+'">'}H.innerHTML=X+'<div class="screenshotviewer-image-inner" style="padding-top:'+(P/v)*100+'%"></div>';if(!U){$WH.track.event("Screenshots","Show",R.id+((R.caption&&R.caption.length)?" ("+R.caption+")":""));if(R.ad){y.href="javascript:;";y.style.display="none"}else{if(R.url){y.href=T;y.style.display="block"}else{y.href=$WH.getScreenshotUrl(R.id,"normal",ab);y.style.display="block"}}if(!R.user&&typeof g_pageInfo=="object"){R.user=g_pageInfo.username}var Z=(R.date&&R.user),Y=(r.length>1);if(Z){var W=new Date(R.date),ac=(g_serverTime-W)/1000;var aa=n.firstChild.childNodes[1];aa.href="/user="+R.user;aa.innerHTML=R.user;var ae=n.firstChild.childNodes[3];$WH.ee(ae);ae.removeAttribute("class");ae.removeAttribute("title");$WH.formatDate(ae,ac,W);n.firstChild.title=LANG.lvscreenshot_from+R.user+" "+$WH.formatDate(null,ac,W);n.firstChild.style.display=""}else{n.firstChild.style.display="none"}var ae=n.childNodes[1];$WH.ee(ae);if(R.user){if(Z){$WH.ae(ae,$WH.ct(" "+LANG.dash+" "))}var aa=$WH.ce("a");aa.href="javascript:;";aa.onclick=ContactTool.show.bind(ContactTool,{mode:3,screenshot:R});aa.className="icon-report";$WH.Tooltip.simple(aa,LANG.report_tooltip,"q2");$WH.ae(aa,$WH.ct(LANG.report));$WH.ae(ae,aa)}ae=n.childNodes[2];if(Y){var ad="";if(R.user){ad=LANG.dash}if(C%1!=0){ad+=$WH.sprintf(LANG.dialog_adbetweenimages,C+0.5,C+1.5,r.length)}else{ad+=(C+1)+LANG.lvpage_of+r.length}ae.innerHTML=ad;ae.style.display=""}else{ae.style.display="none"}n.style.display=(Z||Y?"":"none");if(Locale.getId()!=LOCALE_ENUS&&R.caption){R.caption=""}var S=(R.caption!=null&&R.caption.length);var V=(R.subject!=null&&R.subject.length&&R.type&&R.typeId);if(S||V){X="";if(V){X+=LANG.types[R.type][0]+LANG.colon;X+='<a href="/'+g_types[R.type]+"="+R.typeId+'">';X+=R.subject;X+="</a>"}if(S){if(V){X+=LANG.dash}X+=(R.noMarkup?R.caption:Markup.toHtml(R.caption,{mode:Markup.MODE_SIGNATURE}))}w.innerHTML=X;w.style.display=""}else{w.style.display="none"}if(r.length>1){M.href=o(Q(-1));q.href=o(Q(1));M.style.display=q.style.display=""}else{M.style.display=q.style.display="none"}if(C!=f||Platform.isTouch()){F.style.display="none"}location.replace(o(C))}Lightbox.reveal();m.style.visibility="visible"}function Q(R){var S=C;S+=R;if(S<0){S=r.length-1}else{if(S>=r.length){S=0}}return S}function u(S){console.log("logging",S);if(typeof OX=="undefined"){return}if(!window.ox_instances){window.ox_instances={}}var R=window.ox_instances;R[S]=OX({auid:S});R[S].load()}function E(S){var R=C+S;if(typeof WAS!="undefined"&&WAS.showAds()&&false){if(C%1!=0){S=S/2}else{if(R!=f&&R+1!=f&&((S>0&&(100+R-f)%5==0)||(S<0&&(100+R-f+1)%5==0))){S=S/2}}if(C%1==0&&R!=f&&R+1!=f&&((S>0&&(100+R-f)%4==0)||(S<0&&(100+R-f+1)%4==0))){u("537180962")}}C=Q(S);c();return false}function N(R){R=$WH.normalizeEvent(R);switch(R.keyCode){case 37:E(-1);break;case 39:E(1);break}}function L(){p(1)}function g(){h();if(r.length>1){$WH.dE(document,"keyup",N)}if(D&&j==0){if(D.indexOf(":id=")!=-1){D="#"+z}$WH.setHash(D)}else{$WH.clearHash()}}function l(X,W,T){if(typeof T.screenshots=="string"){r=g_screenshots[T.screenshots];j=1;t=T.screenshots}else{r=T.screenshots;j=0;t=null}m=X;C=0;if(T.pos&&T.pos>=0&&T.pos<r.length){C=T.pos}f=C;if(W){X.className+=" has-lightbox-caption screenshotviewer";K=$WH.ce("div");K.className="lightbox-content screenshotviewer-screen";F=$WH.ce("div");F.className="screenshotviewer-keystip";F.innerHTML=LANG.dialog_ssviewerkeys;$WH.ae(X,F);var Z=$WH.ce("div");var R=$WH.ce("div");Z.className="screenshotviewer-page-wrapper screenshotviewer-prev-wrapper";R.className="screenshotviewer-page-wrapper screenshotviewer-next-wrapper";M=$WH.ce("a");q=$WH.ce("a");M.className="screenshotviewer-prev";q.className="screenshotviewer-next";M.href="javascript:;";q.href="javascript:;";var V=$WH.ce("span");V.className="fa fa-chevron-left";$WH.ae(M,V);V=$WH.ce("span");V.className="fa fa-chevron-right";$WH.ae(q,V);$WH.aE(M,"click",E.bind(M,-1));$WH.aE(M,"tap",E.bind(M,-1));$WH.aE(q,"click",E.bind(q,1));$WH.aE(q,"tap",E.bind(q,1));$WH.ae(Z,M);$WH.ae(R,q);$WH.ae(K,Z);$WH.ae(K,R);H=$WH.ce("div",{className:"screenshotviewer-image",innerHTML:'<div class="screenshotviewer-image-inner"></div>'});$WH.ae(K,H);$WH.ae(X,K);var U=$WH.ce("a");U.className="dialog-x fa fa-times";U.href="javascript:;";U.onclick=Lightbox.hide;$WH.ae(U,$WH.ct(LANG.close));$WH.ae(X,U);y=$WH.ce("a");y.className="dialog-arrow fa fa-external-link";y.href="javascript:;";y.target="_blank";$WH.ae(y,$WH.ct(LANG.original));$WH.ae(X,y);var Y=$WH.ce("div",{className:"lightbox-caption"});n=$WH.ce("div");n.className="screenshotviewer-from";var S=$WH.ce("span");$WH.ae(S,$WH.ct(LANG.lvscreenshot_from));$WH.ae(S,$WH.ce("a"));$WH.ae(S,$WH.ct(" "));$WH.ae(S,$WH.ce("span"));$WH.ae(n,S);$WH.ae(n,$WH.ce("span"));$WH.ae(n,$WH.ce("span"));$WH.ae(Y,n);w=$WH.ce("div");w.className="screenshotviewer-caption";$WH.ae(Y,w);$WH.ae(X,Y)}D=location.hash;if(r.length>1){$WH.aE(document,"keyup",N)}c()}function c(){var R=r[C];if(R&&(!R.width||!R.height)){if(O){O.onload=null;O.onerror=null}else{m.className="";b=[];while(m.firstChild){b.push(m.firstChild);$WH.de(m.firstChild)}}clearTimeout(s);s=setTimeout(function(){R.width=126;R.height=22;k();R.width=null;R.height=null;var T=$WH.ce("div");T.className="screenshotviewer-loading";var S=$WH.ce("img");S.src=g_staticUrl+"/images/ui/misc/progress-anim.gif";S.width=126;S.height=22;$WH.ae(T,S);$WH.ae(m,T);Lightbox.reveal();m.style.visiblity="visible"},150);O=new Image();O.onload=(function(S,T){clearTimeout(T);S.width=this.width;S.height=this.height;O=null;B();p()}).bind(O,R,s);O.onerror=(function(S){clearTimeout(S);O=null;Lightbox.hide();B()}).bind(O,s);O.src=R.url||$WH.getScreenshotUrl(R.id,"normal",J(R))}else{p()}}function h(){if(!O){return}O.onload=null;O.onerror=null;O=null;B()}function B(){if(!b){return}$WH.ee(m);m.className="lightbox-frame has-lightbox-caption screenshotviewer";for(var R=0;R<b.length;++R){$WH.ae(m,b[R])}b=null}this.getScreenshotDescription=function(R){return J(R)};this.checkPound=function(){if(location.hash&&location.hash.indexOf("#"+z)==0){if(!g_listviews[z]){var S=location.hash.split(":");if(S.length==3){var T=g_screenshots[S[1]],R=parseInt(S[2]);if(T&&R>=1&&R<=T.length){ScreenshotViewer.show({screenshots:S[1],pos:R-1,hashname:z})}}}}};this.show=function(R){if("hashname" in R){z=R.hashname;delete R.hashname}Lightbox.show("screenshotviewer",{onShow:l,onHide:g,onResize:L},R)};$(document).ready(this.checkPound)};$WH.aE(window,"load",function(){if(!(window.JSON&&$WH.localStorage.isSupported())){return}var l=$WH.localStorage.get("lvBrowse");if(!l){return}l=window.JSON.parse(l);if(!l){return}var r=/^\/[-a-z]+=\d+/i;var o=r.exec(location.pathname);if(!o){return}o=o[0];var f=function(s,b){if(!b){return $WH.ce("i",{className:"fa fa-"+s})}return $WH.ce("a",{className:"fa fa-"+s,href:b})};for(var n=0;n<l.length;n++){var q=l[n].urls;for(var m=0;m<q.length;m++){if(q[m]==o){var g=m>0?q[m-1]:false;var j=(m+1)<q.length?q[m+1]:false;var p=l[n].path+l[n].hash;var c=$(".header-browse");if(!c.length){return}var k=c[0];var h=f("arrow-circle-up",p);$WH.Tooltip.simple(h,LANG.backtolist,"q2");$WH.ae(k,f("arrow-circle-left",g));$WH.ae(k,h);$WH.ae(k,f("arrow-circle-right",j));k.style.display="block";return}}}});var ShowOnMap=function(f,g,c){var b=this;b.data=f;b.currentPath=[];if(g==null){g=myMapper}b.mapper=g;b._legend=null;b._legendLabel=null;b._legendContents=null;b._legendHorde=null;b._legendAlliance=null;b._menu=[];b._trackingIcons=[];b._controlsdiv=c?$(typeof c=="string"?("#"+c):c):$("#lenrlkn4");b.construct()};ShowOnMap.prototype.onExpand=function(){this.expanded=true;location.replace(this.pound+".map")};ShowOnMap.prototype.onCollapse=function(){this.expanded=false;var b=$WH.getHash();if(b.indexOf("#show")==0&&b.indexOf(".map")>0){this.pound=b.substr(0,b.indexOf(".map"));location.replace(this.pound)}};ShowOnMap.prototype.construct=function(){if(!this.data){return}var ae=this._controlsdiv;var c=function(m,l){return $WH.stringCompare(m[1],l[1])};var J=[];var aa=[];for(var Z in this.data){if(this.data[Z].length===undefined){var j=[];var k=[];var L={};var C=this.data[Z];for(var S in C){var b=false;for(var W=0,A=C[S].length;W<A;++W){if(C[S][W].paths){b=true;break}}var o=$WH.urlize(S);if(C[S][0].name_enus!==undefined){o=$WH.urlize(C[S][0].name_enus)}var O={};var r={};var H=[o];var h=ShowOnMap.combinePins(C[S],false,b);var N=h[0];var F=h[1];var ag=0;for(var W=0;W<N.length;++W){var I=N[W];var t=ShowOnMap.buildTooltip(I.list);var f=t[2];var X=null;if(f=="javascript:;"){X=t[3]}if(I.list.length==1){f=(g_types[I.list[0].type]&&I.list[0].id?"/"+g_types[I.list[0].type]+"="+I.list[0].id:"")}if(Z=="rare"||Z=="herb"||Z=="vein"){t[1]=j.length+1}if(O[I.level]==undefined){O[I.level]=[]}O[I.level].push([I.coord[0],I.coord[1],{url:f,label:t[0],menu:X,type:t[1],lines:I.list[0].paths}]);ag++}if(ag>0){var f=(g_types[C[S][0].type]&&C[S][0].id?"/"+g_types[C[S][0].type]+"="+C[S][0].id:"");r[j.length+1]=[S,f];H.push(S+$WH.sprintf(LANG.qty,F));H.push(this.showStuff.bind(this,O,[Z,o],r));j.push(H);for(var Y in O){if(k[Y]){k[Y]=k[Y].concat(O[Y])}else{k[Y]=O[Y]}}L[j.length]=[S,f]}}if(j.length>0){j.sort(c);var H=[Z,LANG.som[Z],this.showStuff.bind(this,k,[Z],L),j];this._menu.push(H);var y=[[null,LANG.som[Z]],["all",LANG.som.all,H[2]]];for(x=0;x<j.length;x++){y.push(j[x])}this._trackingIcons.push([Z,undefined,L,y])}}else{if(this.data[Z].length==0){continue}var b=false;for(var W=0,A=this.data[Z].length;W<A;++W){if(this.data[Z][W].paths){b=true;break}}var H=[Z];var O={};var T={},D={};var q={},s={};var r={};var u={};var M={};var h=ShowOnMap.combinePins(this.data[Z],false,b);var F=h[1];var ag=0,g=0,G=0,R=0,ad=0;var w=function(ah,ak){for(var ai=0;ai<ak.length;++ai){var l=ak[ai];var an=ah;l.list.key=Z;var am=ShowOnMap.buildTooltip(l.list,(ah=="hordedailyquests"||ah=="alliancedailyquests")?true:false);var p=am[2];var aj=null;if(p=="javascript:;"){aj=am[3]}if(l.list.length==1){p=(g_types[l.list[0].type]&&l.list[0].id?"/"+g_types[l.list[0].type]+"="+l.list[0].id:"")}var al=[l.coord[0],l.coord[1],{url:p,label:am[0],menu:aj,type:am[1],lines:l.list[0].paths}];if(O[l.level]==undefined){O[l.level]=[];T[l.level]=[];D[l.level]=[];q[l.level]=[];s[l.level]=[]}if(l.list[0].mapicon){al[2].mapicon=l.list[0].mapicon}if(an!="mailbox"&&an!="vignettes"&&an!="rare"&&an!="spirithealer"&&an!="book"&&an!="forge"&&an!="treasure"&&an!="anvil"&&an!="hordequests"&&an!="alliancequests"&&an!="hordedailyquests"&&an!="alliancedailyquests"&&an!="boss"){if(am[1]==2||am[1]==0){if(am[1]==2){u[2]=[LANG.som_legend_horde,null]}else{u[0]=[LANG.som_legend_neutral,null]}T[l.level].push(al);g++}if(am[1]==3||am[1]==0){if(am[1]==3){M[3]=[LANG.som_legend_alliance,null]}else{M[0]=[LANG.som_legend_neutral,null]}q[l.level].push(al);R++}}else{if(an=="hordequests"){an="quest";if(am[1]==2){u[2]=[LANG.som_legend_horde,null]}else{u[0]=[LANG.som_legend_neutral,null]}T[l.level].push(al);g++}else{if(an=="hordedailyquests"){an="daily";if(am[1]==2){u[2]=[LANG.som_legend_horde,null]}else{u[0]=[LANG.som_legend_neutral,null]}D[l.level].push(al);G++}else{if(an=="alliancequests"){an="quest";if(am[1]==3){M[3]=[LANG.som_legend_alliance,null]}else{M[0]=[LANG.som_legend_neutral,null]}q[l.level].push(al);R++}else{if(an=="alliancedailyquests"){an="daily";if(am[1]==3){M[3]=[LANG.som_legend_alliance,null]}else{M[0]=[LANG.som_legend_neutral,null]}s[l.level].push(al);ad++}else{O[l.level].push(al);ag++}}}}}}return an};var ac=w(Z,h[0]);if(Z=="alliancequests"){var B=ShowOnMap.combinePins(this.data[Z],true);if(B[1]>0){w("alliancedailyquests",B[0])}}else{if(Z=="hordequests"){var P=ShowOnMap.combinePins(this.data[Z],true);if(P[1]>0){w("hordedailyquests",P[0])}}}if(ac=="rare"){F=this.data[ac].length}else{if(ac=="forge"||ac=="anvil"||ac=="treasure"||ac=="mailbox"){F=h[0].length}}if(ag>0){var H=[ac,LANG.som[ac]+$WH.sprintf(LANG.qty,F),this.showStuff.bind(this,O,[ac],r)];this._menu.push(H);this._trackingIcons.push([ac,O,r])}if(g>0){var H=[ac,LANG.som[ac]+$WH.sprintf(LANG.qty,g),this.showStuff.bind(this,T,["horde",ac],u),null];if(ac=="quest"){H.push({tinyIcon:"quest_start"});if(G>0){aa.push(H);H=["daily",LANG.som.daily+$WH.sprintf(LANG.qty,G),this.showStuff.bind(this,D,["horde","daily"],u),null,{tinyIcon:"quest_start_daily"}];this._trackingIcons.push(["daily",D,u])}}aa.push(H);this._trackingIcons.push([ac,T,u])}if(R>0){var H=[ac,LANG.som[ac]+$WH.sprintf(LANG.qty,R),this.showStuff.bind(this,q,["alliance",ac],M),null];if(ac=="quest"){H.push({tinyIcon:"quest_start"});if(ad>0){J.push(H);H=["daily",LANG.som.daily+$WH.sprintf(LANG.qty,ad),this.showStuff.bind(this,s,["alliance","daily"],M),null,{tinyIcon:"quest_start_daily"}];this._trackingIcons.push(["daily",s,M])}}J.push(H);this._trackingIcons.push([ac,q,M])}}}J.sort(c);aa.sort(c);this._menu.sort(c);if(aa.length>0){this._menu.unshift(["horde",LANG.som.horde,"",aa,{tinyIcon:"side_horde"}])}if(J.length>0){this._menu.unshift(["alliance",LANG.som.alliance,"",J,{tinyIcon:"side_alliance"}])}var z=[-1,LANG.som_nothing,this.showStuff.bind(this,[],[-1],{})];z.checked=true;this._menu.push(z);var v=$WH.createButton(LANG.showonmap,null,{"class":"mapper-som-button fa fa-search"});Menu.add(v,this._menu,{showAtElement:true});ae.append(v);var K;if(!this._legend){this._legend=$("<div/>",{"class":"mapper-legend",css:{display:"none"}});var V=$("<div/>",{"class":"mapper-legend-container"});this._legendLabel=$("<b/>",{text:LANG.som_legend});V.append(this._legendLabel);this._legendContents=$("<div/>",{css:{"float":"right"}});V.append(this._legendContents);var K=$("<div/>",{css:{clear:"right"}});V.append(K);this._legend.append(V)}ae.append(this._legend);K=$("<div/>",{css:{clear:"left"}});ae.append(K);this.setTrackingIcons();var E=[];var U=$WH.getHash();if(U.indexOf("#show:")!=-1){E=U.split(".")}else{if(this.data.instance){E.push("#show:boss")}}if(E.length>0){if(E.length==2&&E[1]=="map"){this.expanded=true;this.mapper.toggleZoom()}var Q=E[0].split(":");if(Q.length<2){return}var ab=this._menu;for(var W=1;W<Q.length;++W){var af=Q.length-1;for(var S=0;S<ab.length;++S){if(ab[S][0]==Q[W]){if(ab[S][3]&&W<af){ab=ab[S][3]}else{ab=ab[S]}break}}}if(ab&&ab[2]&&jQuery.isFunction(ab[2])){ab[2]()}}};ShowOnMap.prototype.setTrackingIcons=function(){var c=this.mapper.parent;var C={repair:"repair",auctioneer:"auctioneer",banker:"banker",battlemaster:"battlemaster",innkeeper:"inn",guildmaster:"guild",stablemaster:"stablemaster",flightmaster:"flightmaster",trainer:"trainer-profession",vendor:"vendor-food",quest:"quest",daily:"daily",anvil:"blacksmithing",herb:"herbalism",vein:"mining",book:"trainer-class",forge:"smelting",spirithealer:"spirithealer",boss:"boss",rare:"hostile-npc",vignettes:"resource",treasure:"treasure",mailbox:"mailbox"};var f=[{name:LANG.types[1][2],icons:["repair","auctioneer","banker","battlemaster","innkeeper","guildmaster","stablemaster","flightmaster","trainer","vendor","spirithealer","boss","rare"],elements:[]},{name:LANG.types[5][2],icons:["quest","daily"],elements:[]},{name:l_guide_categories[2],icons:["anvil","herb","vein","book","forge"],elements:[]},{name:LANG.loot,icons:["vignettes","treasure"],elements:[]},{name:LANG.other,icons:["mailbox"],elements:[]}];var b=this._trackingIcons;b.sort(function(k,j){return $WH.stringCompare(k[0],j[0])});for(var v=1;v<b.length;v++){if(b[v][0]==b[v-1][0]){var s={};for(var w in b[v][1]){if(!b[v][1].hasOwnProperty(w)){continue}s[w]=b[v][1][w]}for(w in b[v-1][1]){if(!b[v-1][1].hasOwnProperty(w)){continue}if(!s.hasOwnProperty(w)){s[w]=b[v-1][1][w]}else{s[w]=s[w].concat(b[v-1][1][w])}}b[v-1][1]=s;var E={};for(var h in b[v][2]){if(!b[v][2].hasOwnProperty(h)){continue}E[h]=b[v][2][h]}for(h in b[v-1][2]){if(!b[v-1][2].hasOwnProperty(h)){continue}E[h]=b[v-1][2][h]}b[v-1][2]=E;b.splice(v--,1)}}b.sort(function(k,j){return $WH.stringCompare(LANG.som[k[0]],LANG.som[j[0]])});var p=$WH.ce("div",{className:"mapper-legend-icons"});for(var F=0,u;u=b[F];F++){if(!C.hasOwnProperty(u[0])){continue}var B=$WH.ce("div");B.className="mapper-legend-icon "+C[u[0]];B.setAttribute("data-legend-icon",u[0]);B.onmousedown=$WH.rf;if(u[1]){var t=[u[0]];if(u[0]!="vignettes"&&u[0]!="treasure"){t.splice(0,0,-2)}$WH.aE(B,"click",this.showStuff.bind(this,u[1],t,u[2],B))}if(u[3]){Menu.add(B,u[3],{showAtElement:true})}if(!Platform.isTouch()){$WH.Tooltip.simple(B,LANG.som[u[0]])}var o=false;for(var D=0,q;q=f[D];D++){if(q.icons.indexOf(u[0])>-1){o=true;f[D].elements.push(B);break}}if(!o){if(typeof console!="undefined"&&typeof console.error=="function"){console.error("Could not find group for "+u[0]+" icon!")}}}for(var A=0,H;H=f[A];A++){if(H.elements.length){var n=$WH.ce("div",{className:"mapper-legend-icons-group"});var g=$WH.ce("div",{className:"mapper-legend-icons-heading",innerHTML:H.name});var I=$WH.ce("div",{className:"mapper-legend-icons-icons"});if(H.style){for(var z in H.style){if(H.style.hasOwnProperty(z)){n.style[z]=H.style[z]}}}for(var y=0,G;G=H.elements[y];y++){$WH.ae(I,G)}$WH.ae(n,g);$WH.ae(n,I);$WH.ae(p,n)}}var r=$WH.ce("div",{className:"mapper-legend-icons-tip",innerHTML:LANG.mapper_clickicon});$("> span:first-child",this.mapper.parent).append(r);$WH.ae(c,p);c.className+=" mapper-autoheight"};ShowOnMap.prototype.setLegend=function(h){this._legendContents.empty();var j=$("<div/>");var f=0;for(var c in h){var g=$("<span/>",{"class":("mapper-pin mapper-pin-"+c+" mapper-legend-pin")});if(h[c][1]){var b=$("<a/>",{href:h[c][1],text:h[c][0]});g.append(b)}else{g.text(h[c][0])}j.append(g);if((++f)%4==0){j.append($("<br/>"))}}this._legendContents.append(j)};ShowOnMap.prototype.showStuff=function(b,k,f){if($WH.isEqualSimpleObject(k,this.currentPath)){this.showStuff.call(this,[],[-1],{});return}Menu.hide();var h=false;for(var c=0,g;g=k[c];c++){if(typeof g!="string"){continue}var j=$('[data-legend-icon="'+g+'"]');if(j.length){j.parents(".mapper-legend-icons").find(".mapper-legend-icon").removeClass("active");j.addClass("active");h=true;break}}if(!h){$(".mapper-legend-icon",this.mapper.parent).removeClass("active")}var l={coords:b,preservelevel:true};if((typeof g_pageInfo!="undefined")&&g_pageInfo.hasOwnProperty("id")){l.zone=g_pageInfo.id}this.mapper.update(l);this.setLegend(f);this.checkMenu(k);this.currentPath=k;if((k.length==1&&k[0]==-1)||(k[0]==-2)){this.pound="";$WH.clearHash();return}this.pound="#show:"+k.join(":");if(this.pound!="#show:boss"){location.replace(this.pound+(this.expanded?".map":""))}};ShowOnMap.prototype.clearChecks=function(c){for(var b=0;b<c.length;++b){c[b].checked=false;if(c[b][3]&&c[b][3].length>0){this.clearChecks(c[b][3])}}this._legend.hide()};ShowOnMap.prototype.checkMenu=function(n){this.clearChecks(this._menu);if(n[0]!=-1){this._legend.show()}else{this._legend.hide()}var b=this._menu;var l=[];for(var f=0;f<n.length;++f){for(var c=0;c<b.length;++c){if(b[c][0]==n[f]){b[c].checked=true;l.push([b[c][0],b[c][1]]);b=b[c][3];break}}}if(n[0]==-2){l.push([n[1],LANG.som[n[1]]])}var g=l.length-1;var k="";var h={rare:true,herb:true,vein:true};for(var f=0;f<l.length;++f){if(f>0&&h[l[0][0]]){var m=$("span",this._legendContents);m.removeClass("mapper-legend-pin");m.append($("<b/>",{text:" "+l[f][1].substr(l[f][1].lastIndexOf("("))}))}else{if(f==g){k+="<span>"}else{k+='<span class="breadcrumb-arrow">'}k+=l[f][1]+"</span>"}}this._legendLabel.html(k)};ShowOnMap.combinePins=function(u,o,h){var g={};var s=null,b=null;var m,l;var w=0;var f=function(C,n){var c=Math.floor(C[0]);var p=Math.floor(C[1]);if(!n){if(c%2==1){c+=1}if(p%2==1){p+=1}}if(g[c]===undefined){g[c]={}}if(g[c][p]===undefined){g[c][p]=[]}return[c,p]};for(var q=0;q<u.length;++q){var j=u[q];if(o){if(!j.quests){continue}var t=true;for(var r=0;r<j.quests.length;++r){if(j.quests[r].daily){t=false;break}}if(t){continue}}else{if(h){s=f([j.id,0],true);m=s[0];l=s[1];var k=$WH.dO(j);k.coord=j.coords[0];g[m][l].push(k);w++;continue}}if(j.point=="start"||j.point=="end"){s=f(j.coord);m=s[0];l=s[1];if(g[m][l].length>3){var z=g[m][l];g[m][l]=[];for(var v=0;v<z.length;++v){b=f(z[v].coord,true);g[b[0]][b[1]].push(z[v])}}g[m][l].push(j);w++}else{for(var A=0;A<j.coords.length;++A){s=f(j.coords[A]);m=s[0];l=s[1];var k=$WH.dO(j);k.coord=j.coords[A];if(g[m][l].length>3){var z=g[m][l];g[m][l]=[];for(var v=0;v<z.length;++v){b=f(z[v].coord,true);g[b[0]][b[1]].push(z[v])}}g[m][l].push(k);w++}}}var B=[];for(m in g){for(l in g[m]){B.push({coord:[g[m][l][0].coord[0],g[m][l][0].coord[1]],level:g[m][l][0].level,list:g[m][l]})}}return[B,w]};ShowOnMap.buildTooltip=function(y,p){var u="";var g="";var c=[];var r=-1;var j={};var h=0;var b={};var z=1;for(var t=0;t<y.length;++t){var k=y[t];g=(g_types[k.type]&&k.id?"/"+g_types[k.type]+"="+k.id:"");var B=g+k.item;var l=g+k.point;if(!j[B]){j[B]={url:g,obj:k,coords:[k.coord],all:[k]};h++}else{if(!b[l]){j[B].all.push(k)}j[B].coords.push(k.coord)}b[l]=1}var t=0;for(var B in j){var g=j[B].url;var f=j[B].all;var k=j[B].obj;var w=j[B].coords;if(t>0){u+="<br />"}c.push([t++,k.name,g]);z=k.type;if(!k.point){if((k.reacthorde==1&&k.reactalliance<1)||k.side==2){if(r==2||r==-1){r=2}else{r=0}}else{if((k.reactalliance==1&&k.reacthorde<1)||k.side==1){if(r==3||r==-1){r=3}else{r=0}}else{r=0}}}u+='<b class="q'+(r==2?" icon-horde":"")+(r==3?" icon-alliance":"")+'">'+k.name+"</b>";if(w.length>0){u+=" ("+w[0][0]+", "+w[0][1]+")<br />"}if(k.quests){if(k.quests.length>1){u+=LANG.som_startsquestpl}else{u+=LANG.som_startsquest}u+='<div class="indent">';for(var m=0;m<k.quests.length;++m){var v=k.quests[m];if(p&&!v.daily){continue}u+='<span class="q0">['+v.level+"]</span> "+v.name+((v.series&&!v.first)?'<sup style="font-size: 8px">(*)</sup>':"")+((v.category<0&&g_quest_sorts[v.category])?' <i class="q0">'+g_quest_sorts[v.category]+"</i>":"")+"<br />"}u+="</div>"}else{if(k.description){u+=k.description+"<br />"}else{if(k.point){for(var t=0;t<f.length;++t){var s=f[t];switch(s.point){case"start":u+=LANG.mapper_startsquest+"<br />";if(r=="end"){r="startend"}else{if(r!="startend"){r="start"}}break;case"end":u+=LANG.mapper_endsquest+"<br />";if(r=="start"){r="startend"}else{if(r!="startend"){r="end"}}break;case"sourcestart":u+=LANG.mapper_sourcestart+"<br />";u+='<div class="indent">'+s.item+"</div>";if(r=="end"){r="startend"}else{if(r!="startend"){r="start"}}break;case"sourceend":u+=LANG.mapper_sourceend+"<br />";u+='<div class="indent">'+s.item+"</div>";if(r=="start"){r="startend"}else{if(r!="startend"){r="end"}}break;case"requirement":u+=LANG.mapper_requiredquest+"<br />";if(r==-1){r=s.objective}break;case"sourcerequirement":u+=LANG.mapper_sourcereq+"<br />";u+='<div class="indent">'+s.item+"</div>";if(r==-1){r=s.objective}break}}}}}}u+='<div class="q2">';if(y.length==1){u+=(y[0].type==1?LANG.som_viewnpc:(y[0].type==2?LANG.som_viewobj:""))}else{if(h==1){u+=(z==1?LANG.som_viewnpc:(z==2?LANG.som_viewobj:""))}else{u+="<br />"+LANG.som_view}}u+="</div>";var A=[];A.push(u);A.push(r);if(y.length==1||h==1){A.push(g);A.push(null)}else{A.push("javascript:;");A.push(c)}return A};var Slider=new function(){var c,o,m;function p(s){s=$WH.normalizeEvent(s);o=this;c=$WH.getCursorPos(s);$WH.aE(document,"mousemove",f);$WH.aE(document,"mouseup",g);return false}function f(t){t=$WH.normalizeEvent(t);if(!c||!o){return}var u=$WH.getCursorPos(t),w=u[o._dir]-c[o._dir],v=q(o,o._pos+w),s=n(o);if(s&&o.input){o.input.value=s.value}if(!v){c=u}if(o.onMove){o.onMove(t,o,s)}}function g(s){s=$WH.normalizeEvent(s);if(o.onMove){o.onMove(s,o,n(o))}o=null;c=null;$WH.dE(document,"mousemove",f);$WH.dE(document,"mouseup",g);return false}function r(v,u){u=$WH.normalizeEvent(u);o=v;c=$WH.getCursorPos(u);var w=$WH.ac(o.parentNode),t=Math.floor(h(o)/2);q(o,c[o._dir]-w[o._dir]-t);var s=n(o);if(s&&o.input){o.input.value=s.value}if(o.onMove){o.onMove(u,o,s)}$WH.aE(document,"mousemove",f);$WH.aE(document,"mouseup",g);return false}function l(t,s){if(m){clearTimeout(m)}if(s.type=="change"||s.type=="keypress"&&s.which==13){b(t,s)}else{m=setTimeout(b.bind(0,t,s),1000)}}function b(v,u){var t=v.input.value,s=n(v);if(isNaN(t)){t=s.value}if(t>v._max){t=v._max}if(t<v._min){t=v._min}Slider.setValue(v,t);if(v.onMove){v.onMove(u,v,n(v))}}function q(s,t){var u=false;if(t<0){t=0;u=true}else{if(t>k(s)){t=k(s);u=true}}s.style[(s._dir=="y"?"top":"left")]=parseInt(t)+"px";s._pos=t;return u}function k(s){return j(s)-h(s)+2}function n(v){var s=v._pos/k(v),u=Math.round((s*(v._max-v._min))+v._min),t=[s,u];t.percent=s;t.value=u;return t}function j(s){if(s._tsz>0){return s._tsz}if(s._dir=="y"){return s.parentNode.offsetHeight}return s.parentNode.offsetWidth}function h(s){if(s._hsz>0){return s._hsz}if(s._dir=="y"){return s.offsetHeight}return s.offsetWidth}this.setPercent=function(t,s){q(t,s*k(t))};this.setValue=function(t,s){if(s<t._min){s=t._min}else{if(s>t._max){s=t._max}}if(t.input){t.input.value=s}this.setPercent(t,(s-t._min)/(t._max-t._min))};this.setSize=function(v,s){var u=n(v),t=k(v);v.parentNode.style[(v._dir=="y"?"height":"width")]=s+"px";if(t!=k(v)){this.setValue(v,u.value)}};this.init=function(v,u){var w=$WH.ce("a");w.href="javascript:;";w.onmousedown=p;w.className="handle";var s=$WH.ce("a");s.href="javascript:;";s.onmousedown=r.bind(0,w);s.className="track";$WH.ae(v,$WH.ce("span"));$WH.ae(v,s);$WH.ae(v,w);w._dir="x";w._min=1;w._max=100;w._pos=0;w._tsz=0;w._hsz=0;if(u!=null){if(u.direction=="y"){w._dir="y"}if(u.minValue){w._min=u.minValue}if(u.maxValue){w._max=u.maxValue}if(u.onMove){w.onMove=u.onMove}if(u.trackSize){w._tsz=u.trackSize}if(u.handleSize){w._hsz=u.handleSize}if(u.showLabels!==false){var t=$WH.ce("div");t.innerHTML=w._min;t.className="label min";$WH.ae(v,t);t=$WH.ce("div");t.innerHTML=w._max;t.className="label max";$WH.ae(v,t);w.input=$WH.ce("input");$(w.input).attr({value:w._max,type:"text"}).bind("click",function(){this.select()}).keypress(function(A){var y=[];var z=A.which;for(i=48;i<58;i++){y.push(i)}if(!($WH.inArray(y,z)>=0)&&z!=13){A.preventDefault()}}).bind("keyup keydown change",l.bind(0,w));w.input.className="input";$WH.ae(v,w.input)}}v.className="slider-"+w._dir+(u==null||u.showLabels!==false?" has-labels":"");return w}};var suDialog;function su_addToSaved(f,g,b,h){if(!f){return}if(!suDialog){suDialog=new Dialog()}var c=function(l){var k=$WH.getWowheadCookie("compare_groups"),j="/compare";if(l.action>1){if(k){f=k+";"+f}$WH.setWowheadCookie("compare_groups",f,true);if(h){$WH.setWowheadCookie("compare_level",h,true)}}else{j+="?items="+f+(h?"&l="+h:"")}if(l.action<3){if(b){window.open(j)}else{location.href=j}}};suDialog.show("docompare",{data:{selecteditems:g,action:1},onSubmit:c})}Dialog.templates.docompare={title:LANG.dialog_compare,width:400,buttons:[["check",LANG.ok],["x",LANG.cancel]],fields:[{id:"selecteditems",type:"caption",compute:function(f,c,b,g){g.innerHTML=$WH.sprintf((c==1?LANG.dialog_selecteditem:LANG.dialog_selecteditems),c)}},{id:"action",type:"radio",label:"",value:3,submitOnDblClick:1,options:{1:LANG.dialog_nosaveandview,2:LANG.dialog_saveandview,3:LANG.dialog_saveforlater}}]};var swfobject=function(){var aq="undefined",aD="object",ab="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",aE="application/x-shockwave-flash",ac="SWFObjectExprInst",ax="onreadystatechange",af=window,aL=document,aB=navigator,aa=false,Z=[aN],aG=[],ag=[],al=[],aJ,ad,ap,at,ak=false,aU=false,aH,an,aI=true,ah=function(){var b=typeof aL.getElementById!=aq&&typeof aL.getElementsByTagName!=aq&&typeof aL.createElement!=aq,h=aB.userAgent.toLowerCase(),f=aB.platform.toLowerCase(),l=f?/win/.test(f):/win/.test(h),n=f?/mac/.test(f):/mac/.test(h),k=/webkit/.test(h)?parseFloat(h.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,g=!+"\v1",j=[0,0,0],o=null;if(typeof aB.plugins!=aq&&typeof aB.plugins[ab]==aD){o=aB.plugins[ab].description;if(o&&!(typeof aB.mimeTypes!=aq&&aB.mimeTypes[aE]&&!aB.mimeTypes[aE].enabledPlugin)){aa=true;g=false;o=o.replace(/^.*\s+(\S+\s+\S+$)/,"$1");j[0]=parseInt(o.replace(/^(.*)\..*$/,"$1"),10);j[1]=parseInt(o.replace(/^.*\.(.*)\s.*$/,"$1"),10);j[2]=/[a-zA-Z]/.test(o)?parseInt(o.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof af.ActiveXObject!=aq){try{var m=new ActiveXObject(X);if(m){o=m.GetVariable("$version");if(o){g=true;o=o.split(" ")[1].split(",");j=[parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10)]}}}catch(c){}}}return{w3:b,pv:j,wk:k,ie:g,win:l,mac:n}}(),aK=function(){if(!ah.w3){return}if((typeof aL.readyState!=aq&&aL.readyState=="complete")||(typeof aL.readyState==aq&&(aL.getElementsByTagName("body")[0]||aL.body))){aP()}if(!ak){if(typeof aL.addEventListener!=aq){aL.addEventListener("DOMContentLoaded",aP,false)}if(ah.ie&&ah.win){aL.attachEvent(ax,function(){if(aL.readyState=="complete"){aL.detachEvent(ax,arguments.callee);aP()}});if(af==top){(function(){if(ak){return}try{aL.documentElement.doScroll("left")}catch(b){setTimeout(arguments.callee,0);return}aP()})()}}if(ah.wk){(function(){if(ak){return}if(!/loaded|complete/.test(aL.readyState)){setTimeout(arguments.callee,0);return}aP()})()}aC(aP)}}();function aP(){if(ak){return}try{var c=aL.getElementsByTagName("body")[0].appendChild(ar("span"));c.parentNode.removeChild(c)}catch(b){return}ak=true;var g=Z.length;for(var f=0;f<g;f++){Z[f]()}}function aj(b){if(ak){b()}else{Z[Z.length]=b}}function aC(b){if(typeof af.addEventListener!=aq){af.addEventListener("load",b,false)}else{if(typeof aL.addEventListener!=aq){aL.addEventListener("load",b,false)}else{if(typeof af.attachEvent!=aq){aM(af,"onload",b)}else{if(typeof af.onload=="function"){var c=af.onload;af.onload=function(){c();b()}}else{af.onload=b}}}}}function aN(){if(aa){Y()}else{am()}}function Y(){var g=aL.getElementsByTagName("body")[0];var c=ar(aD);c.setAttribute("type",aE);var b=g.appendChild(c);if(b){var f=0;(function(){if(typeof b.GetVariable!=aq){var h=b.GetVariable("$version");if(h){h=h.split(" ")[1].split(",");ah.pv=[parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],10)]}}else{if(f<10){f++;setTimeout(arguments.callee,10);return}}g.removeChild(c);b=null;am()})()}else{am()}}function am(){var k=aG.length;if(k>0){for(var l=0;l<k;l++){var f=aG[l].id;var p=aG[l].callbackFn;var b={success:false,id:f};if(ah.pv[0]>0){var m=aS(f);if(m){if(ao(aG[l].swfVersion)&&!(ah.wk&&ah.wk<312)){ay(f,true);if(p){b.success=true;b.ref=av(f);p(b)}}else{if(aG[l].expressInstall&&au()){var h={};h.data=aG[l].expressInstall;h.width=m.getAttribute("width")||"0";h.height=m.getAttribute("height")||"0";if(m.getAttribute("class")){h.styleclass=m.getAttribute("class")}if(m.getAttribute("align")){h.align=m.getAttribute("align")}var j={};var g=m.getElementsByTagName("param");var o=g.length;for(var n=0;n<o;n++){if(g[n].getAttribute("name").toLowerCase()!="movie"){j[g[n].getAttribute("name")]=g[n].getAttribute("value")}}ae(h,j,f,p)}else{aF(m);if(p){p(b)}}}}}else{ay(f,true);if(p){var c=av(f);if(c&&typeof c.SetVariable!=aq){b.success=true;b.ref=c}p(b)}}}}}function av(c){var g=null;var f=aS(c);if(f&&f.nodeName=="OBJECT"){if(typeof f.SetVariable!=aq){g=f}else{var b=f.getElementsByTagName(aD)[0];if(b){g=b}}}return g}function au(){return !aU&&ao("6.0.65")&&(ah.win||ah.mac)&&!(ah.wk&&ah.wk<312)}function ae(j,g,l,h){aU=true;ap=h||null;at={success:false,id:l};var b=aS(l);if(b){if(b.nodeName=="OBJECT"){aJ=aO(b);ad=null}else{aJ=b;ad=l}j.id=ac;if(typeof j.width==aq||(!/%$/.test(j.width)&&parseInt(j.width,10)<310)){j.width="310"}if(typeof j.height==aq||(!/%$/.test(j.height)&&parseInt(j.height,10)<137)){j.height="137"}aL.title=aL.title.slice(0,47)+" - Flash Player Installation";var c=ah.ie&&ah.win?"ActiveX":"PlugIn",f="MMredirectURL="+af.location.toString().replace(/&/g,"%26")+"&MMplayerType="+c+"&MMdoctitle="+aL.title;if(typeof g.flashvars!=aq){g.flashvars+="&"+f}else{g.flashvars=f}if(ah.ie&&ah.win&&b.readyState!=4){var k=ar("div");l+="SWFObjectNew";k.setAttribute("id",l);b.parentNode.insertBefore(k,b);b.style.display="none";(function(){if(b.readyState==4){b.parentNode.removeChild(b)}else{setTimeout(arguments.callee,10)}})()}aA(j,g,l)}}function aF(b){if(ah.ie&&ah.win&&b.readyState!=4){var c=ar("div");b.parentNode.insertBefore(c,b);c.parentNode.replaceChild(aO(b),c);b.style.display="none";(function(){if(b.readyState==4){b.parentNode.removeChild(b)}else{setTimeout(arguments.callee,10)}})()}else{b.parentNode.replaceChild(aO(b),b)}}function aO(c){var g=ar("div");if(ah.win&&ah.ie){g.innerHTML=c.innerHTML}else{var h=c.getElementsByTagName(aD)[0];if(h){var b=h.childNodes;if(b){var j=b.length;for(var f=0;f<j;f++){if(!(b[f].nodeType==1&&b[f].nodeName=="PARAM")&&!(b[f].nodeType==8)){g.appendChild(b[f].cloneNode(true))}}}}}return g}function aA(h,k,f){var g,b=aS(f);if(ah.wk&&ah.wk<312){return g}if(b){if(typeof h.id==aq){h.id=f}if(ah.ie&&ah.win){var j="";for(var m in h){if(h[m]!=Object.prototype[m]){if(m.toLowerCase()=="data"){k.movie=h[m]}else{if(m.toLowerCase()=="styleclass"){j+=' class="'+h[m]+'"'}else{if(m.toLowerCase()!="classid"){j+=" "+m+'="'+h[m]+'"'}}}}}var l="";for(var n in k){if(k[n]!=Object.prototype[n]){l+='<param name="'+n+'" value="'+k[n]+'" />'}}b.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+j+">"+l+"</object>";ag[ag.length]=h.id;g=aS(h.id)}else{var c=ar(aD);c.setAttribute("type",aE);for(var o in h){if(h[o]!=Object.prototype[o]){if(o.toLowerCase()=="styleclass"){c.setAttribute("class",h[o])}else{if(o.toLowerCase()!="classid"){c.setAttribute(o,h[o])}}}}for(var p in k){if(k[p]!=Object.prototype[p]&&p.toLowerCase()!="movie"){aQ(c,p,k[p])}}b.parentNode.replaceChild(c,b);g=c}}return g}function aQ(c,g,f){var b=ar("param");b.setAttribute("name",g);b.setAttribute("value",f);c.appendChild(b)}function aw(b){var c=aS(b);if(c&&c.nodeName=="OBJECT"){if(ah.ie&&ah.win){c.style.display="none";(function(){if(c.readyState==4){aT(b)}else{setTimeout(arguments.callee,10)}})()}else{c.parentNode.removeChild(c)}}}function aT(b){var c=aS(b);if(c){for(var f in c){if(typeof c[f]=="function"){c[f]=null}}c.parentNode.removeChild(c)}}function aS(b){var f=null;try{f=aL.getElementById(b)}catch(c){}return f}function ar(b){return aL.createElement(b)}function aM(b,f,c){b.attachEvent(f,c);al[al.length]=[b,f,c]}function ao(b){var c=ah.pv,f=b.split(".");f[0]=parseInt(f[0],10);f[1]=parseInt(f[1],10)||0;f[2]=parseInt(f[2],10)||0;return(c[0]>f[0]||(c[0]==f[0]&&c[1]>f[1])||(c[0]==f[0]&&c[1]==f[1]&&c[2]>=f[2]))?true:false}function az(c,j,b,f){if(ah.ie&&ah.mac){return}var h=aL.getElementsByTagName("head")[0];if(!h){return}var k=(b&&typeof b=="string")?b:"screen";if(f){aH=null;an=null}if(!aH||an!=k){var g=ar("style");g.setAttribute("type","text/css");g.setAttribute("media",k);aH=h.appendChild(g);if(ah.ie&&ah.win&&typeof aL.styleSheets!=aq&&aL.styleSheets.length>0){aH=aL.styleSheets[aL.styleSheets.length-1]}an=k}if(ah.ie&&ah.win){if(aH&&typeof aH.addRule==aD){aH.addRule(c,j)}}else{if(aH&&typeof aL.createTextNode!=aq){aH.appendChild(aL.createTextNode(c+" {"+j+"}"))}}}function ay(b,f){if(!aI){return}var c=f?"visible":"hidden";if(ak&&aS(b)){aS(b).style.visibility=c}else{az("#"+b,"visibility:"+c)}}function ai(c){var b=/[\\\"<>\.;]/;var f=b.exec(c)!=null;return f&&typeof encodeURIComponent!=aq?encodeURIComponent(c):c}var aR=function(){if(ah.ie&&ah.win){window.attachEvent("onunload",function(){var b=al.length;for(var c=0;c<b;c++){al[c][0].detachEvent(al[c][1],al[c][2])}var g=ag.length;for(var f=0;f<g;f++){aw(ag[f])}for(var h in ah){ah[h]=null}ah=null;for(var j in swfobject){swfobject[j]=null}swfobject=null})}}();return{registerObject:function(b,h,f,c){if(ah.w3&&b&&h){var g={};g.id=b;g.swfVersion=h;g.expressInstall=f;g.callbackFn=c;aG[aG.length]=g;ay(b,false)}else{if(c){c({success:false,id:b})}}},getObjectById:function(b){if(ah.w3){return av(b)}},embedSWF:function(o,h,l,j,f,b,c,m,k,n){var g={success:false,id:h};if(ah.w3&&!(ah.wk&&ah.wk<312)&&o&&h&&l&&j&&f){ay(h,false);aj(function(){l+="";j+="";var u={};if(k&&typeof k===aD){for(var s in k){u[s]=k[s]}}u.data=o;u.width=l;u.height=j;var r={};if(m&&typeof m===aD){for(var t in m){r[t]=m[t]}}if(c&&typeof c===aD){for(var p in c){if(typeof r.flashvars!=aq){r.flashvars+="&"+p+"="+c[p]}else{r.flashvars=p+"="+c[p]}}}if(ao(f)){var q=aA(u,r,h);if(u.id==h){ay(h,true)}g.success=true;g.ref=q}else{if(b&&au()){u.data=b;ae(u,r,h,n);return}else{ay(h,true)}}if(n){n(g)}})}else{if(n){n(g)}}},switchOffAutoHideShow:function(){aI=false},ua:ah,getFlashPlayerVersion:function(){return{major:ah.pv[0],minor:ah.pv[1],release:ah.pv[2]}},hasFlashPlayerVersion:ao,createSWF:function(b,c,f){if(ah.w3){return aA(b,c,f)}else{return undefined}},showExpressInstall:function(c,b,g,f){if(ah.w3&&au()){ae(c,b,g,f)}},removeSWF:function(b){if(ah.w3){aw(b)}},createCSS:function(c,b,f,g){if(ah.w3){az(c,b,f,g)}},addDomLoadEvent:aj,addLoadEvent:aC,getQueryParamValue:function(c){var b=aL.location.search||aL.location.hash;if(b){if(/\?/.test(b)){b=b.split("?")[1]}if(c==null){return ai(b)}var f=b.split("&");for(var g=0;g<f.length;g++){if(f[g].substring(0,f[g].indexOf("="))==c){return ai(f[g].substring((f[g].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(aU){var b=aS(ac);if(b&&aJ){b.parentNode.replaceChild(aJ,b);if(ad){ay(ad,true);if(ah.ie&&ah.win){aJ.style.display="block"}}if(ap){ap(at)}}aU=false}}}}();function Tabs(b){$WH.cO(this,b);if(this.parent){this.parent=$WH.ge(this.parent)}else{return}this.selectedTab=-1;this.ul=null;this.tabs=[];this.nShows=0;if(this.poundable==null){this.poundable=1}this.poundedTab=null;if(this.onLoad==null){this.onLoad=Tabs.onLoad.bind(this)}if(this.onShow==null){this.onShow=Tabs.onShow.bind(this)}if(this.onHide){this.onHide=this.onHide.bind(this)}this.trackClick=Tabs.trackClick.bind(this)}Tabs.prototype={add:function(b,g){var f,c=this.tabs.length;f={caption:b,index:c,owner:this};$WH.cO(f,g);this.tabs.push(f);if(this.ul){var h=this.createTab(f);$WH.ae(this.ul,h)}return c},hide:function(f,h){if(this.tabs[f]){var c=this.selectedTab;if(f==0&&c==-1){this.poundedTab=this.selectedTab=c=0}if(f!=this.poundedTab){this.selectedTab=-1}this.tabs[f].hidden=!h;this.flush();if(!h&&f==c){this.selectedTab=c;for(var g=0,b=this.tabs.length;g<b;++g){if(g!=f&&!this.tabs[g].hidden){return this.show(g,1)}}}}},unlock:function(c,f){if(this.tabs[c]){this.tabs[c].locked=f;b=$WH.gE(this.ul,"a");$(".fa-lock",b[c]).remove();if(f){$("div, b",b[c]).prepend('<span class="fa fa-lock" />')}var b=location.hash.substr(1).split(":")[0];if(this.tabs[c].id==b){this.show(c,1)}}},focus:function(b){if(b<0){b=this.tabs.length+b}this.forceScroll=1;$WH.gE(this.ul,"a")[b].onclick({},true);this.forceScroll=null},show:function(c,f,h){var b;if(isNaN(c)||c<0){c=0}else{if(c>=this.tabs.length){c=this.tabs.length-1}}if((f==null&&c==this.selectedTab)||this.tabs[c].hidden){return}if(this.tabs[c].locked){return this.onShow(this.tabs[c],this.tabs[this.selectedTab])}if(this.selectedTab!=-1){b=this.tabs[this.selectedTab];if(this.onHide&&!this.onHide(b)){return}if(b.onHide&&!b.onHide()){return}}++this.nShows;b=$WH.gE(this.ul,"a");if(this.selectedTab!=-1){b[this.selectedTab].className=""}b[c].className="selected";if(Platform.isMobile()){var g=function(k){var j=$(k).parent().siblings(".tab-responsive-list");if(j.length){if(k.parentNode.getAttribute("data-responsive-hidden")=="true"){$("a",j).addClass("selected");$("div, b",j).html(this.getMoreTabName(true,$("b",k).html()))}else{$("a",j).removeClass("selected");$("div, b",j).html(this.getMoreTabName(true))}}};if(h){setTimeout(g.bind(this,b[c]),250)}else{g.call(this,b[c])}}b=this.tabs[c];if(b.onLoad){b.onLoad();b.onLoad=null}this.onShow(this.tabs[c],this.tabs[this.selectedTab]);if(b.onShow){b.onShow(this.tabs[this.selectedTab])}this.selectedTab=c},flush:function(h){var b;var g=$WH.ce("div");g.className="tabs-container";var k="ul";this.ul=$WH.ce(k);this.ul.className="tabs";$WH.ae(g,this.ul);for(var c=0;c<this.tabs.length;++c){var j=this.tabs[c];var f=this.createTab(j);$WH.ae(this.ul,f)}$WH.ee(this.parent);$WH.ae(this.parent,g);if(this.onLoad){b=this.onLoad();if(b!=null){this.poundedTab=h=b}}this.show(h,null,true);if(Platform.isMobile()){setTimeout((function(){this.collapseExtraTabs()}).bind(this),1)}},createTab:function(k){var h,c,g;h=$WH.ce("li");c=$WH.ce("b");var f=$WH.ce("a");if(k.className){h.className=k.className}if(k.hidden){h.style.display="none"}if(this.poundable&&!k.noPound){f.href="#"+k.id}else{f.href="javascript:;"}$WH.disableOldIESelect(f);if(k.menu){Menu.add(f,k.menu,{showAtElement:true,onShow:k.onShowMenu,onHide:k.onHideMenu})}else{f.onclick=Tabs.onClick.bind(k,f)}var j=$WH.ce("div");if(k.locked){g=$WH.ce("span",{className:"fa fa-lock"});$WH.ae(j,g)}else{if(k.icon){g=$WH.ce("span",{classname:"icontiny"});g.style.backgroundImage="url("+g_staticUrl+"/images/wow/icons/tiny/"+k.icon.toLowerCase()+".gif)";$WH.ae(j,g)}else{if(k.image){g=$WH.ce("img");$.extend(g,k.image);$WH.ae(j,g)}else{if(k.fontIcon){g=$WH.ce("i",{className:"fa fa-"+k.fontIcon});$WH.ae(j,g)}}}}if(k.tooltip){f.onmouseover=(function(b,l){$WH.Tooltip.showAtCursor(l,b,0,0,"q")}).bind(f,k.tooltip);f.onmousemove=$WH.Tooltip.cursorUpdate;f.onmouseout=$WH.Tooltip.hide}if(k["class"]){j.className=k["class"]}$WH.ae(j,$WH.ct(k.caption));$WH.ae(f,j);if(k.locked){g=$WH.ce("span",{className:"fa fa-lock"});$WH.ae(c,g)}else{if(k.icon){g=$WH.ce("span",{className:"icontiny"});g.style.backgroundImage="url("+g_staticUrl+"/images/wow/icons/tiny/"+k.icon.toLowerCase()+".gif)";$WH.ae(c,g)}else{if(k.image){g=$WH.ce("img");$.extend(g,k.image);$WH.ae(c,g)}else{if(k.fontIcon){g=$WH.ce("i",{className:"fa fa-"+k.fontIcon});$WH.ae(c,g)}}}}$WH.ae(c,$WH.ct(k.caption));$WH.ae(f,c);$WH.ae(h,f);return h},collapseExtraTabs:function(){var f=$(this.ul);if(f.height()>140){var j=$("> li",f);var m=[];var c=[];j.each(function(q){var r=$(this);var p=r.position();if(p.top>110){c.push(r)}else{m.push(r);while(m.length>2){m.shift()}}});while(c.length>0&&m.length>0){c.unshift(m.pop())}var b=j.length-c.length;var h=[];var o=/<img[^>]+src="([^">]*)"[^>]*>\s*/;for(var g=0,l;l=c[g];g++){l.attr("data-responsive-hidden","true");var k=[g,$("b",l).html(),(function(p){$("a",p).trigger("click");$("html, body").animate({scrollTop:$(this.ul).offset().top-42},150)}).bind(this,l),null,{checkedFunc:(function(p){return this.selectedTab==p}).bind(this,g+b)}];var n=k[MENU_IDX_NAME].match(o);if(n){k[MENU_IDX_OPT].icon=n[1]}k[MENU_IDX_NAME]=k[MENU_IDX_NAME].replace(/<[^>]*>/,"");h.push(k)}this.add(this.getMoreTabName(false),{className:"tab-responsive-list",fontIcon:"bars",menu:h,onShowMenu:(function(){$(this.currentTabContents).addClass("tab-fade")}).bind(this),onHideMenu:(function(){$(".tab-fade").removeClass("tab-fade")}).bind(this),noPound:false})}},getMoreTabName:function(c,f){var b=c?'<i class="fa fa-bars"></i>':"";if(f){b+=" &ndash; "+f}return b},setTabName:function(f,c){this.tabs[f].caption=c;var b=$WH.gE(this.ul,"a");$WH.setTextNodes(b[f],c)},setTabPound:function(f,b){if(!this.poundable){return}var c=$WH.gE(this.ul,"a");c[f].href="#"+this.tabs[f].id+(b?":"+b:"")},setTabTooltip:function(c,f){this.tabs[c].tooltip=f;var b=$WH.gE(this.ul,"a");if(f==null){b[c].onmouseover=b[c].onmousemove=b[c].onmouseout=null}else{b[c].onmouseover=function(g){$WH.Tooltip.showAtCursor(g,f,0,0,"q2")};b[c].onmousemove=$WH.Tooltip.cursorUpdate;b[c].onmouseout=$WH.Tooltip.hide}},getSelectedTab:function(){return this.selectedTab},getTabById:function(f){for(var c=0,b=this.tabs.length;c<b;++c){if(this.tabs[c].id==f){return c}}}};Tabs.onClick=function(b,h,g){if(g==null&&this.index==this.owner.selectedTab){return}var f=$WH.rfWithoutControlKey(h);if(f==null){return}Menu.hide();this.owner.show(this.index,g);if(this.owner.poundable&&!this.locked){var c=b.href.indexOf("#");c!=-1&&location.replace(b.href.substr(c))}return f};Tabs.onLoad=function(){if(!this.poundable||!location.hash.length){return}var b=location.hash.substr(1).split(":")[0];if(b){return $WH.inArray(this.tabs,b,function(c){if(!c.locked){return c.id}})}};Tabs.onShow=function(g,h){var c;if(g.hidden||g.locked){return}if(h){$WH.ge("tab-"+h.id).style.display="none"}if(this.poundedTab!=null||h){this.trackClick(g)}c=$WH.ge("tab-"+g.id);c.style.display="";this.currentTabContents=c;if(((this.nShows==1&&this.poundedTab!=null&&this.poundedTab>=0)||this.forceScroll)&&!this.noScroll){var f,b;if(this.__st){f=this.__st;b=15}else{f=c;b=this.parent.offsetHeight+15}setTimeout($WH.scrollTo.bind(null,f,b),10)}};Tabs.trackClick=function(b){if(!this.trackable||b.tracked){return}$WH.track.event("Tabs","Show",this.trackable+": "+b.id);b.tracked=1};$WH.track=new function(){var c=10;var f=10000;this.event=function(l,j,k,m,n,o){if(!g()){if($WH.isDev()){return}if(!o){o=0}o++;if(o*c>f){return}setTimeout($WH.track.event.bind(null,l,j,k,m,n,o),c);return}console.info("sending standard event!",l,j,k,m);if(typeof n=="boolean"){ga("send","event",l,j,k,m,{nonInteraction:n?1:0})}else{ga("send","event",l,j,k,m)}};this.captcha=function(j){$WH.track.event("Captcha","Impression",j)};this.addToNode=function(m,k,q){if(!k||!k.actions||!k.category){if($WH.isDev()){$WH.console.log("Tried to add analytics event without appropriate parameters.");$WH.console.log(m);$WH.console.log(k)}return}var l=k.category;var t=$WH.gE(m,"a");for(var p=0,s;s=t[p];p++){var o="Follow link";for(var n in k.actions){if(k.actions.hasOwnProperty(n)&&k.actions[n]&&k.actions[n](s)){o=n;break}}var r=(q?q+"-":"")+b(s);$(s).click($WH.track.event.bind(null,l,o,r))}};this.addLinkTracking=function(l,m,j,k){if(!l.href||l.href.indexOf("javascript:")==0){return}l.onclick=$WH.track.linkClick.bind(null,l,m,j,k,l.onclick)};this.linkClick=function(m,o,j,l,p,n){if(!g()){if(p){p()}return true}if(arguments[arguments.length-1] instanceof MouseEvent){n=arguments[arguments.length-1]}var q=m.target;if(n){if(n.which==2||n.shiftKey||n.ctrlKey||(window.navigator&&window.navigator.platform=="MacIntel"&&n.metaKey)){q="_blank"}}if(typeof o=="function"){o=o(m)}if(typeof j=="function"){j=j(m)}if(typeof l=="function"){l=l(m)}var k=ga.bind(null,"send","event",o,j,l,m.href,{transport:"beacon",hitCallback:(function(r,t,s){if(s){s()}else{if(t&&window.open){window.open(r,t)}else{document.location=r}}}).bind(null,m.href,q,p)});if(l&&l.indexOf("News - View Article")==0){ga("send","event","News","View full version",News.getSubjectFromChild(m),{transport:"beacon",hitCallback:k})}else{k()}return false};function g(){return typeof ga=="function"&&window.ga&&ga.create}function h(){var k={"database-logo":{category:"Homepage Logo",actions:{"Click image":function(m){return true}}},"database-featuredbox":{category:"Featured Box",actions:{"Follow link":function(m){return(m.parentNode.className!="database-featuredbox-links")},"Click image":function(m){return(m.parentNode.className=="database-featuredbox-links")}}},"database-oneliner":{category:"Oneliner",actions:{"Follow link":function(m){return true}}},"sidebar-container":{category:"Page sidebar",actions:{"Click image":function(m){return true}}},"header-promo":{category:"Page header",actions:{"Click image":function(m){return true}}}};for(var l in k){var j=$WH.ge(l);if(j){$WH.track.addToNode(j,k[l])}}}function b(j){var l=null;var k=$WH.getFirstTextContent(j);if(k){l=$WH.urlize(k)}else{if(j.title){l=$WH.urlize(j.title)}else{if(j.id){l=$WH.urlize(j.id)}}}return l}$(h)};$WH.dynamicFixedElements={};$WH.setupDynamicFixedElement=function(c,f){var n=$(f);var m="dynamic-fixed-element-initialized";if(n.data(m)){$WH.console.error("Can't set up an element to be dynamically fixed multiple times!",c,f);return}$WH.dynamicFixedElements[c]={fixed:false,offset:false};var g=n.parent();var k=function(p,o,q,s,r){if(!$WH.dynamicFixedElements[p].fixed||r){b(p,o);o.addClass("fixed-"+p).css("right",($(window).width()-s.left-q.width())+"px");if(o.outerHeight()+10>$(window).height()){o.addClass("scrollable-"+p)}$WH.dynamicFixedElements[p].fixed=true}};var h=function(p,o){if($WH.dynamicFixedElements[p].fixed){o.removeClass("fixed-"+p).removeClass("scrollable-"+p).css("right","");$WH.dynamicFixedElements[p].fixed=false}};var l=function(p,o,q,r){if(!$WH.dynamicFixedElements[p].offset||r){o.css("margin-top",q+"px");$WH.dynamicFixedElements[p].offset=true}};var b=function(p,o){if($WH.dynamicFixedElements[p].offset){o.css("margin-top","");$WH.dynamicFixedElements[p].offset=false}};var j=(function(r,p,s,v){var u=s.get(0).getBoundingClientRect();var o=10;if(u.top<o){var q=(s.height()||0)-(p.height()||0);var t=u.top*-1;t+=o;if(t<q){b(r,p);k(r,p,s,s.offset(),v)}else{h(r,p);l(r,p,Math.min(t,q),v)}}else{h(r,p);b(r,p)}}).bind(null,c,n,g);$(window).scroll(j).resize(j.bind(true));j();n.data(m,true)};$WH.getReputationPlusAchievementText=function(b,c,g,h){var j=$WH.getAchievementText(b,c,g,true);var k=$("<span>").addClass("wsach-pts");k.mouseover(function(l){$WH.Tooltip.showAtCursor(l,LANG.reputationtip,0,0,"q")}).mousemove(function(l){$WH.Tooltip.cursorUpdate(l)}).mouseout(function(){$WH.Tooltip.hide()});k.css("color","white");k.text($WH.numberFormat(h));var f=$("<span>");f.append(" (");f.append(k);f.append(" &ndash; ");f.append(j);f.append(") ");return f};$WH.getAchievementText=function(b,c,h,f){var g=$("<span>").addClass("wsach-pts");g.mouseover(function(k){$WH.Tooltip.showAtCursor(k,LANG.userachcount_tip,0,0,"q")}).mousemove(function(k){$WH.Tooltip.cursorUpdate(k)}).mouseout(function(){$WH.Tooltip.hide()});var j=" ";if(!f){j+=" ("}if(b){j+="<i>"+b+"</i>&middot;"}if(c){j+="<b>"+c+"</b>&middot;"}if(!h){h=0}j+="<u>"+h+"</u>";if(!f){j+=")"}g.html(j);return g};$WH.formatTimeElapsed=function(h){function f(q,p,o){if(o&&LANG.timeunitsab[p]==""){o=0}if(o){return q+" "+LANG.timeunitsab[p]}else{return q+" "+(q==1?LANG.timeunitssg[p]:LANG.timeunitspl[p])}}var k=[31557600,2629800,604800,86400,3600,60,1];var b=[1,3,3,-1,5,-1,-1];h=Math.max(h,1);for(var j=3,l=k.length;j<l;++j){if(h>=k[j]){var g=j;var n=Math.floor(h/k[g]);if(b[g]!=-1){var c=b[g];h%=k[g];var m=Math.floor(h/k[c]);if(m>0){return f(n,g,1)+" "+f(m,c,1)}}return f(n,g,0)}}return"(n/a)"};$WH.getStaffColorFromRoles=function(b){if(b&U_GROUP_ADMIN){return"comment-blue"}if(b&U_GROUP_GREEN_TEXT){return"comment-green"}if(b&U_GROUP_VIP){return"comment-gold"}if(b&U_GROUP_PREMIUMISH){return"comment-gold"}return""};$WH.formatDate=function(f,n,b,g,o){var j=new Date();var c=new Date();c.setTime(j.getTime()-(1000*n));var h;var k=new Date(c.getYear(),c.getMonth(),c.getDate());var p=new Date(j.getYear(),j.getMonth(),j.getDate());var m=(p.getTime()-k.getTime());m/=1000;m/=86400;m=Math.round(m);if(n>=2592000){h=LANG.date_on+$WH.formatDateSimple(b,g)}else{if(m>1){h=$WH.sprintf(LANG.ddaysago,m);if(f){var l=new Date();l.setTime(b.getTime()+(g_localTime-g_serverTime));f.className+=" tip";f.title=l.toLocaleString()}}else{if(n>=43200){if(j.getDay()==c.getDay()){h=LANG.today}else{h=LANG.yesterday}h=$WH.formatTimeSimple(c,h);if(f){var l=new Date();l.setTime(b.getTime()+(g_localTime-g_serverTime));f.className+=" tip";f.title=l.toLocaleString()}}else{h=$WH.sprintf(LANG.date_ago,$WH.formatTimeElapsed(n));if(f){var l=new Date();l.setTime(b.getTime()+(g_localTime-g_serverTime));f.className+=" tip";f.title=l.toLocaleString()}}}}if(o==1){h=h.substr(0,1).toUpperCase()+h.substr(1)}if(f){$WH.ae(f,$WH.ct(h))}else{return h}};$WH.formatDateSimple=function(l,k){function g(b){return(b<10?"0"+b:b)}var c="",f=l.getDate(),j=l.getMonth()+1,h=l.getFullYear();if(h<=1970){c+=LANG.unknowndate_stc}else{c+=$WH.sprintf(LANG.date_simple,g(f),g(j),h)}if(k!=null){c=$WH.formatTimeSimple(l,c)}return c};$WH.formatTimeSimple=function(j,b,g){function f(k){return(k<10?"0"+k:k)}var c=j.getHours(),h=j.getMinutes();if(b==null){b=""}b+=(g?" ":LANG.date_at);if(c==12){b+=LANG.noon}else{if(c==0){b+=LANG.midnight}else{if(c>12){b+=(c-12)+":"+f(h)+" "+LANG.pm}else{b+=c+":"+f(h)+" "+LANG.am}}}return b};$WH.formatStartEndDates=function(h,c){if(!h&&!c){return""}var k=false;var g=false;if(h){k=new Date(h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate())}if(c){g=new Date(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate())}var n="";if(!g){n=LANG.tab_starts+" "+k.toLocaleDateString()}else{if(!k){n=LANG.tab_ends+" "+g.toLocaleDateString()}else{var j=(function(){try{new Date().toLocaleDateString("i")}catch(o){return o.name==="RangeError"}return false})();var f={month:"long",year:"numeric"};var m="",l="",b=0;if(j&&(k.getDate()==1)){m=k.toLocaleDateString(undefined,f);b++}else{m=k.toLocaleDateString()}if(j&&((new Date(g.valueOf()+36*60*60*1000)).getMonth()!=g.getMonth())){l=g.toLocaleDateString(undefined,f);b++}else{l=g.toLocaleDateString()}if(m==l){n=m}else{if(b==1){n=k.toLocaleDateString()+" - "+g.toLocaleDateString()}else{n=m+" - "+l}}}}return n};$WH.createTextGlow=function(l,b){var g=$WH.ce("span");for(var f=-1;f<=1;++f){for(var c=-1;c<=1;++c){var k=$WH.ce("div");k.style.position="absolute";k.style.whiteSpace="nowrap";k.style.left=f+"px";k.style.top=c+"px";if(f==0&&c==0){k.style.zIndex=4}else{k.style.color="black";k.style.zIndex=2}k.innerHTML=l;$WH.ae(g,k)}}g.style.position="relative";g.className="glow"+(b!=null?" "+b:"");var h=$WH.ce("span");h.style.visibility="hidden";$WH.ae(h,$WH.ct(l));$WH.ae(g,h);return g};$WH.createProgressBar=function(f){if(f==null){f={}}if(typeof f.text=="undefined"){f.text=" "}if(f.color==null){f.color="rep0"}if(f.width==null||f.width>100){f.width=100}var g,h;if(f.hoverText){g=$WH.ce("a");g.href="javascript:;"}else{g=$WH.ce("span")}g.className="progressbar";if(f.text||f.hoverText){h=$WH.ce("div");h.className="progressbar-text";if(f.text){var b=$WH.ce("del");$WH.ae(b,$WH.ct(f.text));$WH.ae(h,b)}if(f.hoverText){var c=$WH.ce("ins");$WH.ae(c,$WH.ct(f.hoverText));$WH.ae(h,c)}$WH.ae(g,h)}h=$WH.ce("div");h.className="progressbar-"+f.color;h.style.width=f.width+"%";if(f.height){h.style.height=f.height}$WH.ae(h,$WH.ct(String.fromCharCode(160)));$WH.ae(g,h);if(f.text){var h=$WH.ce("div");h.className="progressbar-text progressbar-hidden";$WH.ae(h,$WH.ct(f.text));$WH.ae(g,h)}return g};$WH.createReputationBar=function(l,h){if(!h){h=0}var k=$WH.getReputationProgress(h);var g=k.length>0?(k[k.length-1][1]+999):0;if(!l){l=0}if(l<0){l=0}else{if(l>g){l=g}}var b=l,j=0,m,f=g;if(g!=0){while(j<k.length){if(l<k[j][1]){break}++j}--j;b-=k[j][1];f=(j+1<k.length)?(k[j+1][1]-k[j][1]):999}if(h){m=g_friendship_reactions[$WH.sprintf("$1-$2",h,j)]}else{m=g_reputation_standings[j]}var c={text:m,hoverText:b+" / "+f,color:"rep"+j,width:parseInt(b/f*100)};return $WH.createProgressBar(c)};$WH.getReputationProgress=function(b){if($WH.isSet("g_friendships_thresholds")&&b&&g_friendships_thresholds[b]&&$WH.isArray(g_friendships_thresholds[b])){return g_friendships_thresholds[b]}return[[0,0],[0,36000],[0,39000],[0,42000],[0,45000],[0,51000],[0,63000],[0,84000]]};$WH.createAchievementBar=function(c,g,b,h){if(!c){c=0}var f={text:c+(h>0?"(+"+h+")":"")+(g>0?" / "+g:""),color:(b?"rep7":"ach"+(g>0?0:1)),width:(g>0?parseInt(c/g*100):100)};return $WH.createProgressBar(f)};$WH.createCaptcha=function(j,h){if(g_captchaType==1){var b={0:"en",2:"fr",3:"de",6:"es",7:"ru"};Recaptcha.create("6Lf127oSAAAAAJ4QhB9VuZPCEyt7jA1xLd2TFEjh",j,{theme:"blackglass",lang:b[Locale.getId()]})}else{var f=$("#"+j);var c=$("<a/>",{href:"javascript:;","class":"captcha",title:LANG.tooltip_captcha,css:{"background-image":"url(/captcha?foo="+Math.random()+")"},click:function(){this.style.backgroundImage="url(/captcha?foo="+Math.random()+")"}});if(h===true){c.css({"margin-left":"auto","margin-right":"auto"})}else{c.css("margin-left","15px")}f.append($("<div/>").append(c));var g=$("<input/>",{type:"text",name:"captcha",maxlength:5,css:{width:"3.3em","text-align":"center"}});f.append("<small>"+LANG.ct_dialog_captcha+"</small>");f.append(g)}};$WH.revealCaptcha=function(h,c,f,g){if($WH.requireCaptcha()||c){var b=$("#"+h);if(b.length==0||b.has("#recaptcha_area").length>0||b.has("a.captcha").length>0){return}$WH.createCaptcha(h,f)}else{if(!c){$("#"+h).append($("<input>",{type:"hidden",name:"skipcaptcha",val:1}))}}if(typeof g!="string"){g="General"}$WH.track.captcha(g)};$WH.addCompletionIcons=function(l,h,k,f){var b=0;for(var g in g_user.lists){var j=g_user.lists[g];if(!(j.id in g_completion[h])||!j.character){continue}var c=$WH.inArray(g_completion[h][j.id],k)!=-1;if(f&&!c){continue}$WH.ae(l,$WH.createCompletionIcon(j,c));b++}return b};$WH.createCompletionIcon=function(g,f,b){var c=$WH.ce("a");c.href="/list="+g.id+"/"+g.url;c.className="progress-icon "+(f?"progress-8":"progress-0");$WH.Tooltip.simple(c,$WH.getCompletionTooltip(g,f),"",true);if(b){c.rel=b}return c};$WH.getCompletionTooltip=function(c,b){return'<span class="q">'+(b?LANG.lvcompletion.identical:LANG.lvcompletion.missing)+LANG.colon+'</span><br><span style="white-space:nowrap"><b class="c'+c.classs+'">'+c.character+'</b><span class="q0">&nbsp; '+c.realm+" "+c.region+"</span></span>"};$WH.getCompletionFlags=function(f,h){var b=0;if(!g_user.lists){return b}for(var c=g_user.lists.length-1;c>=0;c--){var g=g_user.lists[c];if(!(g.id in g_completion[f])||!g.character){continue}b=(b<<1)|($WH.inArray(g_completion[f][g.id],h)!=-1?1:0)}return b};$WH.getMoneyHtml=function(b,k,h,c,p){var n=0,g="";if(k==1||k=="alliance"){k=1}else{if(k==2||k=="horde"){k=2}else{k=3}}if(b>=10000){n=1;var l=Math.floor(b/10000);g+='<span class="moneygold">'+$WH.numberFormat(l)+"</span>";b%=10000}if(b>=100){if(n){g+=" "}else{n=1}var l=Math.floor(b/100);g+='<span class="moneysilver">'+l+"</span>";b%=100}if(b>=1){if(n){g+=" "}else{n=1}g+='<span class="moneycopper">'+b+"</span>"}if(h!=null){for(var f=0;f<h.length;++f){if(n){g+=" "}else{n=1}var q=h[f][0];var j=h[f][1];var m=(g_items[q]&&g_items[q].icon?g_items[q].icon:"inv_misc_questionmark");g+='<a href="/item='+q+'" class="moneyitem" style="background-image: url('+g_staticUrl+"/images/wow/icons/tiny/"+m.toLowerCase()+'.gif)">'+j+"</a>"}}if(c!=null){for(var f=0;f<c.length;++f){if(n){g+=" "}else{n=1}var o=c[f][0];var j=c[f][1];var m=(g_gatheredcurrencies[o]&&g_gatheredcurrencies[o].icon?g_gatheredcurrencies[o].icon:["inv_misc_questionmark","inv_misc_questionmark"]);if(k==3&&m[0]==m[1]){k=1}g+='<a href="/currency='+o+'" class="icontinyr tip q1" onmouseover="Listview.funcBox.moneyCurrencyOver('+o+", "+j+', event)" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()" style="background-image: url('+g_staticUrl+"/images/wow/icons/tiny/"+m[(k==3?1:k-1)].toLowerCase()+'.gif)">'+(k==3?'<span class="icontinyr" style="background-image: url('+g_staticUrl+"/images/wow/icons/tiny/"+m[0].toLowerCase()+'.gif)">':"")+j+(k==3?"</span>":"")+"</a>"}}if(p>0){if(n){g+=" "}else{n=1}g+='<span class="moneyachievement tip" onmouseover="Listview.funcBox.moneyAchievementOver(event)" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">'+$WH.numberFormat(p)+"</span>"}return g};$WH.preventPageScroll=function(b){var c=(b.originalEvent&&b.originalEvent.wheelDelta)||(b.originalEvent&&-b.originalEvent.detail)||b.wheelDelta||-b.detail;this.scrollTop+=(c<0?1:-1)*100;b.preventDefault()};$WH.pickerWheel=function(b){b=$WH.normalizeEvent(b);if(b._wheelDelta<0){this.scrollTop+=27}else{this.scrollTop-=27}};$WH.setSelectedLink=function(f,c){if(!$WH.setSelectedLink.groups){$WH.setSelectedLink.groups={}}var b=$WH.setSelectedLink.groups;if(b[c]){b[c].className=b[c].className.replace("selected","")}f.className+=" selected";b[c]=f};$WH.addPagination=function(n,c){function q(u,s){var t;if(u==c.page){t=$WH.ce("span");t.className="selected"}else{t=$WH.ce("a");t.href=(u>1?c.url+c.sep+u+c.pound:c.url+c.pound)}$WH.ae(t,$WH.ct(s!=null?s:u));return t}if(!c.pound){c.pound=""}if(!c.sep){c.sep="."}if(c.allOrNothing&&c.nPages<=1){return}var f=(c.align&&c.align=="left");var g=$WH.ce("div"),m,r=$WH.ce("var");g.className="pages";if(f){g.className+=" pages-left"}if(c.nPages>1){m=$WH.ce("div");m.className="pages-numbers";var p=Math.max(2,c.page-2);var k=Math.min(c.nPages-1,c.page+2);var o=[];if(c.page!=c.nPages){o.push(q(c.page+1,String.fromCharCode(187)))}o.push(q(c.nPages));if(k<c.nPages-1){var b=$WH.ce("span");$WH.ae(b,$WH.ct("..."));o.push(b)}for(var j=k;j>=p;--j){o.push(q(j))}if(p>2){var b=$WH.ce("span");$WH.ae(b,$WH.ct("..."));o.push(b)}o.push(q(1));if(c.page!=1){o.push(q(c.page-1,String.fromCharCode(171)))}if(f){o.reverse()}for(var j=0,l=o.length;j<l;++j){$WH.ae(m,o[j])}m.firstChild.style.marginRight="0";m.lastChild.style.marginLeft="0"}var r=$WH.ce("var");$WH.ae(r,$WH.ct($WH.sprintf(LANG[c.wording[c.nItems==1?0:1]],c.nItems)));if(c.nPages>1){var b=$WH.ce("span");$WH.ae(b,$WH.ct(String.fromCharCode(8211)));$WH.ae(r,b);var h=$WH.ce("a");h.className="gotopage";h.href="javascript:;";$WH.disableOldIESelect(h);h.onclick=function(){var s=prompt($WH.sprintf(LANG.prompt_gotopage,1,c.nPages),c.page);if(s!=null){s|=0;if(s!=c.page&&s>=1&&s<=c.nPages){document.location.href=(s>1?c.url+c.sep+s+c.pound:c.url+c.pound)}}};h.onmouseover=function(s){$WH.Tooltip.showAtCursor(s,LANG.tooltip_gotopage,0,0,"q2")};h.onmousemove=$WH.Tooltip.cursorUpdate;h.onmouseout=$WH.Tooltip.hide;$WH.ae(r,h)}if(f){$WH.ae(g,r);if(m){$WH.ae(g,m)}}else{if(m){$WH.ae(g,m)}$WH.ae(g,r)}$WH.ae(n,g)};$WH.disclose=function(b,c){c.className="disclosure-"+($WH.toggleDisplay(b)?"on":"off");return false};$WH.toggle=function(b){this.className=this.className.replace(/toggler-(on|off)/,"toggler-"+($WH.toggleDisplay(b,true)?"on":"off"));return false};$WH.setupChangeWarning=function(j,f,c){if(!j){return}function h(){return c}j.submit(function(){window.onbeforeunload=null});var g=[];for(var b in f){var k=f[b];if(!k){continue}g[b]=k.val();k.keydown(function(){for(var l in f){var m=f[l];if(!m){continue}if(m.val()!=g[l]){window.onbeforeunload=h;return}window.onbeforeunload=null}})}};$(document).ready(function(){$("dfn").each(function(){var b=$(this).attr("title");$(this).attr("title","").addClass("tip").mouseover(function(c){$WH.Tooltip.showAtCursor(c,b,0,0,"q")}).mousemove(function(c){$WH.Tooltip.cursorUpdate(c)}).mouseout(function(){$WH.Tooltip.hide()})});$(".text").bind("copy",function(){$("*[unselectable]",this).each(function(f,c){var b=$(c).text();$(c).text("");setTimeout(function(){$(c).text(b)},1)})})});$WH.getExpansionClassName=function(b){switch(b){case 0:return null;case 1:return"icon-bc-right";case 2:return"icon-wotlk-right";case 3:return"icon-cata-right";case 4:return"icon-mop-right";case 5:return"icon-warlords-right";case 6:return"icon-legion-right"}return"icon-unknown"+b+"-right"};$(document).ready(function(){$("input").each(function(){var g=$(this).attr("maxlength");var f=$(this).attr("data-charwarning");var c=f?$("#"+f):null;if(!g||!c){return}var b=function(){c.hide()};var h=function(j){var m=g-j;var n=j/g;var l=parseInt((n>=0.5)?255:(n*2*255)).toString(16);var k=parseInt((n<0.5)?255:(255-((n-0.5)*2*255))).toString(16);if(l.length==1){l="0"+l}if(k.length==1){k="0"+k}c.text($WH.sprintf(LANG.charactersremaining_format,m));c.show();c.css("color","#"+l+k+"00")};$(this).focus(function(){h($(this).val().length)}).blur(function(){b()}).keyup(function(){h($(this).val().length)})})});$WH.getN5=function(c){var b=Math.abs(c);if(b<10000){return $WH.numberFormat(c)}if(b<100000){return(Math.round(c/100)/10)+"k"}if(b<1000000){return Math.round(c/1000)+"k"}if(b<10000000){return(Math.round(c/1000/10)/100)+"m"}if(b<100000000){return(Math.round(c/1000/100)/10)+"m"}if(b<1000000000){return Math.round(c/1000/1000)+"m"}if(b<10000000000){return(Math.round(c/1000/1000/10)/100)+"b"}if(b<10000000000){return(Math.round(c/1000/1000/100)/10)+"b"}return Math.round(c/1000/1000/1000)+"b"};var UrlShortener={get:function(b){var c="http://ggl-shortener.appspot.com/?url="+$WH.urlEncodeHref(b)+"&jsonp=UrlShortener.callback";$.getScript(c)},callback:function(b){if(b&&b.short_url){prompt(LANG.message_sharetheurlbelow,b.short_url)}}};$WH.console={error:function(b){if(typeof console!="undefined"&&typeof console.error=="function"){console.error.apply(console.error,Array.prototype.slice.call(arguments))}},info:function(b){if(typeof console!="undefined"&&typeof console.info=="function"){console.info.apply(console.info,Array.prototype.slice.call(arguments))}},log:function(b){if(typeof console!="undefined"&&typeof console.log=="function"){console.log.apply(console.log,Array.prototype.slice.call(arguments))}}};$WH.userIsLoggedIn=function(){return typeof g_user=="object"&&g_user.id};$WH.getMajorHeading=function(h,g,f,c){if(isNaN(g)||g<1||g>6){g=2}if(isNaN(f)||f<1||f>6){f=g}var b=["heading-size-"+f];return $WH.constructHeading("h"+g,h,b,c)};$WH.getImitationHeading=function(g,f,c){if(isNaN(f)||f<1||f>6){f=2}var b=["imitation-heading","heading-size-"+f];return $WH.constructHeading("div",g,b,c)};$WH.constructHeading=function(b,h,g,f){if(typeof f!="object"){f={}}if(typeof f.classes=="string"){g.push(f.classes)}var j=$WH.ce(b);j.className=g.join(" ");if(typeof f.styles=="string"){j.style=f.styles}if(typeof f.id=="string"){j.id=f.id}if(typeof h=="string"){j.innerHTML=h}else{if(h.nodeType===1||h.nodeType===3){j.appendChild(h)}else{$(j).append(h)}}if(f.asString){var c=$WH.ce("div");$WH.ae(c,j);return c.innerHTML}return j};$WH.createRange=function(g,b){var c={};for(var f=g;f<=b;++f){c[f]=f}return c};$WH.sortIdArray=function(b,c,f){b.sort(f?function(h,g){return $WH.stringCompare(c[h][f],c[g][f])}:function(h,g){return $WH.stringCompare(c[h],c[g])})};$WH.sortJsonArray=function(h,g,j,b){var f=[];for(var c in h){if(h.hasOwnProperty(c)&&g[c]&&(b==null||b(g[c]))){f.push(c)}}if(j!=null){f.sort(j)}else{$WH.sortIdArray(f,g)}return f};$WH.isEqualSimpleObject=function(b,c){for(var g in b){if(typeof b[g]=="object"){if(typeof c[g]!="object"){return false}if(!$WH.isEqualSimpleObject(b[g],c[g])){return false}}else{if(b[g]!==c[g]){return false}}}for(var f in c){if(typeof c[f]=="object"){if(typeof b[f]!="object"){return false}if(!$WH.isEqualSimpleObject(b[f],c[f])){return false}}else{if(b[f]!==c[f]){return false}}}return true};$WH.urlize=function(f,g,c){var b=$WH.ce("textarea");b.innerHTML=f.replace(/</g,"&lt;").replace(/>/g,"&gt;");f=b.value;if(c){if(c==="enus"){f=f.replace(" & "," and ")}else{f=f.replace(LANG.wordspace+LANG.ampersand+LANG.wordspace,LANG.wordspace+LANG.and+LANG.wordspace)}}f=f.replace(/%\w|['#]|^\s*|\s*$/g,"");if(g){f=f.replace(/ \/ |_|[^\u00C0-\u1FFF\u2C00-\uD7FF\w]+/g,"-")}else{f=$WH.removeAccents(f).replace(/ \/ |_|[^a-z0-9]/ig,"-")}f=f.replace(/-{2,}/g,"-");f=f.replace(/^-+|-+$/g,"");f=f.toLocaleLowerCase();f=f.substr(0,80);return f};$WH.ensureUrlProtocol=function(b,c){if(c){if(!c.match(/:$/)){c+=":"}return b.replace(/^https?:/,c).replace(/^(\/[^\/])/,c+"//"+location.host+"$1").replace(/^(\/\/)/,c+"$1")}else{return b.replace(/^(\/[^\/])/,location.protocol+"//"+location.host+"$1").replace(/^(\/\/)/,location.protocol+"$1")}};$WH.getTinyIconUrl=function(b){return b.indexOf("/")!=-1?b:g_staticUrl+"/images/wow/icons/tiny/"+b.toLowerCase()+".gif"};$WH.removeAccents=function(g){var f=g;var c=[["ß","á","ä","à","â","è","ê","é","ë","í","î","ì","ï","ñ","ò","ó","ö","ô","ú","ü","û","ù","œ","Á","Ä","À","Â","È","Ê","É","Ë","Í","Î","Ì","Ï","Ñ","Ò","Ó","Ö","Ô","Ú","Ü","Û","Ù","œ"],["ss","a","a","a","a","e","e","e","e","i","i","i","i","n","o","o","o","o","u","u","u","u","oe","A","A","A","A","E","E","E","E","I","I","I","I","N","O","O","O","O","U","U","U","U","Oe"]];for(var b=0;b<c[0].length;b++){f=f.replace(new RegExp(c[0][b],"g"),c[1][b])}return f};$WH.isDateValid=function(b){return/^(20[0-2]\d)-([01]\d)-([0-3]\d) ([0-2]\d):([0-5]\d):([0-5]\d)$/.exec(b)};$WH.isIpAddress=function(b){return/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/.test(b)};$WH.isEmailValid=function(b){return b.match(/^([a-z0-9._-]+)(\+[a-z0-9._-]+)?(@[a-z0-9.-]+\.[a-z]{2,4})$/i)!=null};$WH.getCurrentDomain=function(){if($WH.getCurrentDomain.CACHE){return $WH.getCurrentDomain.CACHE}var b=location.hostname;if(!$WH.isIpAddress(b)){var c=b.split(".");if(c.length>2){c.splice(0,c.length-2)}b=c.join(".")}$WH.getCurrentDomain.CACHE=b;return b};$WH.getCommentDomain=function(b){if(!$WH.isPtr()&&b=="ptr"){return"//ptr.wowhead.com"}else{if(!$WH.isBeta()&&b=="beta"){return"//beta.wowhead.com"}}return""};$WH.isExternalUrl=function(b){return !(!b||(b.indexOf("http")!=0&&b.indexOf("//")!=0)||b.indexOf("wowhead.com")!=-1||b.indexOf("wowheadnews.")!=-1||b.indexOf($WH.getCurrentDomain())!=-1)};$WH.getRelativeHostPrefix=function(g){if(typeof g=="undefined"){g=(location.protocol=="https:")}var h=g?"_https":"_http";if(!$WH.getRelativeHostPrefix.CACHE){$WH.getRelativeHostPrefix.CACHE={}}if(h in $WH.getRelativeHostPrefix.CACHE){return $WH.getRelativeHostPrefix.CACHE[h]}var f="";if(!!g!=(location.protocol=="https:")&&!/^[0-9\.]+$/.test(location.hostname)){var b=/^([\w\W]*)\.[^\.]+\.com$/.exec(location.hostname);b=b?b[1]:"www";var c="";if(location.port){c=location.port}if(c.substr(0,1)!=":"){c=":"+c}if(c==":80"||c==":"){c=""}f="http://"+b+".wowhead.com"+c}if(g){f=f.replace(/^http:/,"https:")}$WH.getRelativeHostPrefix.CACHE[h]=f;return f};$WH.fixWowheadHTTPS=function(b){return b.replace(/\bhttps?:(\/\/(?:[^\/:]+\.)?(?:wowhead\.com|zamimg\.com)[:\/])/g,"$1")};$WH.createOrRegex=function(f,g){f=f.replace(/(\(|\)|\|\+|\*|\?|\$|\^)/g,"\\$1");var k=f.split(" "),h="";for(var c=0,b=k.length;c<b;++c){if(c>0){h+="|"}h+=k[c]}return new RegExp((g!=null?"("+g+")?":"")+"("+h+")","gi")};$WH.getHash=function(){return"#"+decodeURIComponent(location.href.split("#")[1]||"")};$WH.modifyUrl=function(c,h,f,b){if(!f){f=$.noop}var g="";if(c.match(/(#.+)$/)){g=RegExp.$1;c=c.replace(g,"")}if(typeof f.custom=="function"){c=f.custom(c,b)}if(f.returnAfterCustom){return c+g}$.each(h,function(n,m){var p;var j;var o;var l=c.match(new RegExp("(&|\\?)?"+n+"=?([^&]+)?"));if(l!=null){p=l[0];j=l[1];o=decodeURIComponent(l[2])}if(m==null){if(!p){return}o=null}else{if(m.substr(0,2)=="+="){if(o&&f.onAppendCollision){o=f.onAppendCollision(o,m.substr(2),f.menuUrl)}else{if(!o&&f.onAppendEmpty){o=f.onAppendEmpty(m.substr(2),f.menuUrl)}else{if(!o){o=""}o+=$.trim(m.substr(2))}}}else{o=m}}if(p){var k="";if(j){k+=j}if(o!=null){k+=n;if(o){k+="="+$WH.urlEncodeHref(o)}}c=c.replace(p,k)}else{if(o||m==null||m.substr(0,2)!="+="){c+=(c.indexOf("?")==-1?"?":"&")+n;if(o){c+="="+$WH.urlEncodeHref(o)}}}});c=c.replace("?&","?");c=c.replace(/&&/g,"&");c=c.replace(/\/\?/g,"/");c=c.replace(/(&|\?)+$/,"");return c+g};$WH.assertSession=function(){if($WH.isSet("g_user")&&g_user.id){return}if(typeof $WH.assertSession.asserted!="undefined"){return}$WH.ajaxIshRequest("/account=assertsession",true)};$WH.getPreferredTransmogRace=function(){var b=$WH.localStorage.get("transmog_racegender");if(!b&&g_user&&g_user.hasOwnProperty("cookies")&&g_user.cookies.hasOwnProperty("default_3dmodel")){b=g_user.cookies.default_3dmodel}if(!b||((""+b).indexOf(",")<0)){b="1,2"}b=b.split(",");if(b[0]==25||b[0]==26){b[0]=24}if(!parseInt(b[0],10)){b[0]=1}if(!parseInt(b[1],10)){b[1]=2}return{race:b[0],gender:b[1]}};$WH.getPage=function(){var c=null;var b=location.href.split("/");if(b.length){c=b[3].replace(/^\?(.*)/,"$1").split(/[\?&#=]/)}$WH.getPage=(function(f){return f}).bind(null,c);return c};$WH.isBlizzardReferral=function(){var b=false;var c=$WH.getGets();if(typeof c.brl!="undefined"){b="brl"}if(!b){b=!!(document.referrer&&document.referrer.match(/^https?:\/\/[^\/]*\bbattle\.net\//))}$WH.isBlizzardReferral=(function(f){return f}).bind(null,b);return b};$WH.updateContentHeight=function(){var h=$(".main-contents");var c=h.outerHeight()-h.height();var f=$(".sidebar");var b=f.height()-c;var g=$("#main-precontents");if(g.length){b-=g.outerHeight()}if($(document.body).hasClass("skinned")){b+=10}if(h.height()<b){h.css({"min-height":b+"px"})}};$WH.prepInfobox=function(){if(g_user.lists&&typeof g_pageInfo=="object"&&g_types[g_pageInfo.type]&&typeof g_pageInfo.typeId=="number"){var g=$(".infobox .compact-completion-display");if(g.length){var f=$("span",g);if(f.length){var j=0;f.each(function(){var p=$(this);var l=p.html();try{l=JSON.parse(l)}catch(m){return}var o;for(var k=0,n;n=g_user.lists[k];k++){if(n.id==l.id){o=n;break}}if(o){p.parent().append($WH.createCompletionIcon(o,l.completed,l.rel));p.remove();j++}});if(j){g.parent().parent().show()}}else{if(g.is(":empty")&&$WH.addCompletionIcons(g.get(0),g_types[g_pageInfo.type],g_pageInfo.typeId)){g.parent().parent().show()}}}}$(".infobox .icon-db-link div").each(function(){var k=$(this);k.css("width",k.parent().width()+"px")});if(!Platform.isTouch()){var h=$(".sidebar .infobox .initial-markup-section");if(h.length){var c=$(".sidebar > .top-sidebar-infobox");if(c.length){c.attr("class","infobox");var b=$("<tbody/>").appendTo(c);b.append(h)}}}};$WH.enhanceTextarea=function(p,j){if(!(p instanceof jQuery)){p=$(p)}if(p.data("wh-enhanced")||p.prop("tagName")!="TEXTAREA"){return}if(typeof j!="object"){j={}}var g=(function(D){if(!D.dynamicResizeOption){return true}if($WH.localStorage.get("dynamic-textarea-resizing")==="true"){return true}if($WH.localStorage.get("dynamic-textarea-resizing")==="false"){return false}return !D.hasOwnProperty("dynamicSizing")||D.dynamicSizing}).bind(null,j);var q=p.height()||500;var u=$("<div/>",{"class":"enhanced-textarea-wrapper"}).insertBefore(p).append(p);if(!j.hasOwnProperty("color")){u.addClass("enhanced-textarea-dark")}else{if(j.color){u.addClass("enhanced-textarea-"+j.color)}}if(!j.hasOwnProperty("dynamicSizing")||j.dynamicSizing||j.dynamicResizeOption){var h=$("<div/>",{"class":"enhanced-textarea-expander"}).prependTo(u);var n=function(E,D,F){if(!F()){return}E.css("height",E.siblings(".enhanced-textarea-expander").html($WH.htmlEntities(E.val()).replace(/\n/g,"<br>")+"<br>").height()+(D?14:34)+"px")};p.bind("keydown keyup change",n.bind(this,p,j.exactLineHeights,g));n(p,j.exactLineHeights,g);var v=function(D){D.css("width",D.parent().width()+"px")};v(h);setTimeout(v.bind(null,h),1);if(!j.dynamicResizeOption||(j.dynamicResizeOption&&g())){u.addClass("enhanced-textarea-dynamic-sizing")}}if(!j.hasOwnProperty("focusChanges")||j.focusChanges){u.addClass("enhanced-textarea-focus-changes")}if(j.markup){var w=$("<div/>",{"class":"enhanced-textarea-markup-wrapper"}).prependTo(u);var y=$("<div/>",{"class":"enhanced-textarea-markup"}).appendTo(w);var z=$("<div/>",{"class":"enhanced-textarea-markup-segment"}).appendTo(y);var k=$("<div/>",{"class":"enhanced-textarea-markup-segment"}).appendTo(y);if(j.markup=="inline"){ar_AddInlineToolbar(p.get(0),z.get(0),k.get(0))}else{ar_AddToolbar(p.get(0),z.get(0),k.get(0))}if(j.dynamicResizeOption){var t=$("<div/>",{"class":"enhanced-textarea-markup-segment"}).appendTo(y);var C=$("<label/>").appendTo(t);var A=$("<input/>",{type:"checkbox",checked:g()}).appendTo(C);A.change((function(E,D,H,J,F,G){var I=this.is(":checked");$WH.localStorage.set("dynamic-textarea-resizing",JSON.stringify(I));if(I){D.addClass("enhanced-textarea-dynamic-sizing");G(H,E.exactLineHeights,J)}else{D.removeClass("enhanced-textarea-dynamic-sizing");H.css("height",F+"px")}}).bind(A,j,u,p,g,q,n));$("<span/>",{text:LANG.autoresizetextbox}).appendTo(C)}if(j.scrollingMarkup){if($WH.enhanceTextarea.scrollerCount){$WH.enhanceTextarea.scrollerCount++}else{$WH.enhanceTextarea.scrollerCount=1}var B="fixable-markup-controls-"+$WH.enhanceTextarea.scrollerCount;var o="fixed-markup-controls-"+$WH.enhanceTextarea.scrollerCount;var c=function(D){var E=D.css("backgroundColor");if(E=="rgba(0, 0, 0, 0)"||E=="transparent"){return c(D.parent())}else{return E}};var r=c(y);for(var m,l=0;(m=window.document.styleSheets[l])&&m.href;l++){}if(!m){window.document.head.appendChild(document.createElement("style"));m=window.document.styleSheets[l]}m.insertRule("."+o+" ."+B+" .enhanced-textarea-markup {background:"+r+";padding-bottom:5px;padding-top:10px;position:fixed;top:0;z-index:3}",m.cssRules.length);m.insertRule(".touch-device ."+o+" ."+B+" .enhanced-textarea-markup {padding-top:50px}",m.cssRules.length);w.addClass(B);var s=function(F,D,E,G){var H=this.scrollY||this.pageYOffset||0;if(H>F.offset().top-10-G&&H<D.offset().top+D.height()-100-G){$("body").addClass(E)}else{$("body").removeClass(E)}};var b=Platform.isTouch()?40:0;$(window).scroll(s.bind(window,w,u,o,b));s.call(window,w,u,o,b);var f=(function(D,E){E.css("width",D.width()+"px");D.css("height",E.height()+"px")}).bind(null,w,y);f();$(window).on("resize",f);$(function(){setTimeout(f,2000)})}}p.data("wh-enhanced",true)};$WH.createOptionsMenuWidget=function(b,q,o){var j=0;var m=1;var c=2;var h=3;var l=' <i class="fa fa-chevron-down fa-color-gray"></i>';if(o.noChevron){l=""}var p=$WH.ce("span");p.id="options-menu-widget-"+b;p.className="options-menu-widget "+p.id;p.innerHTML=q+l;if(o.id){p.id=o.id}if(o.className){p.className+=" "+o.className}if(o.options instanceof Array){var f=[];for(var k=0,g;g=o.options[k];k++){var n=[k,g[m]];if((typeof o.selected=="number"||typeof o.selected=="string")&&o.selected==g[j]){p.innerHTML=g[m]+l;if(g[h]){switch(typeof g[h].className){case"string":$.data(p,"options-menu-widget-class",g[h].className);p.className+=" "+g[h].className;break;case"function":$.data(p,"options-menu-widget-class",g[h].className(g,true));p.className+=" "+g[h].className(g,true);break}}}if(g[c]){n.push((function(v,t,r,s){switch(typeof r[c]){case"string":window.location=r[c];break;case"function":if(typeof s.updateWidgetText=="undefined"||s.updateWidgetText){t.innerHTML=r[m]+v;var u=$.data(t,"options-menu-widget-class");if(u){t.className=t.className.replace(new RegExp(" *\\b"+u+"\\b"),"")}if(r[h]){switch(typeof r[h].className){case"string":$.data(t,"options-menu-widget-class",r[h].className);t.className+=" "+r[h].className;break;case"function":$.data(t,"options-menu-widget-class",r[h].className(r,true));t.className+=" "+r[h].className(r,true);break}}}r[c](t,r);break}}).bind(null,l,p,g,o))}else{if(!g[h]||!g[h].menu){n[0]=null}}n[MENU_IDX_OPT]={};if(g[h]){switch(typeof g[h].className){case"string":n[MENU_IDX_OPT].className=g[h].className;break;case"function":n[MENU_IDX_OPT].className=g[h].className.bind(null,g,false);break}switch(typeof g[h].tinyIcon){case"string":n[MENU_IDX_OPT].tinyIcon=g[h].tinyIcon;break;case"function":n[MENU_IDX_OPT].tinyIcon=g[h].tinyIcon.bind(null,g);break}switch(typeof g[h].fontIcon){case"string":n[MENU_IDX_OPT].fontIcon=g[h].fontIcon;break;case"function":n[MENU_IDX_OPT].fontIcon=g[h].fontIcon.bind(null,g);break}if(typeof g[h].isChecked=="function"){n[MENU_IDX_OPT].checkedFunc=g[h].isChecked.bind(null,g)}if(typeof g[h].menu=="object"&&g[h].menu instanceof Array){n[MENU_IDX_SUB]=g[h].menu}}f.push(n)}p.menu=f;if(o.menuOnClick){p.onmousedown=$WH.rf;Menu.add(p,f,{showAtElement:true})}else{Menu.add(p,f)}}if(o.target){$(o.target).append(p)}else{return p}};$WH.setupDynamicNav=function(j){var h=$(j);var c=$(".dynamic-nav-outer",h);var b=$(".dynamic-nav-inner",c);if(!(h.length&&c.length&&b.length)){setTimeout($WH.setupDynamicNav.bind(null,j),9);return}$WH.checkDynamicNavWidth(j);$("> a",b).each(function(){var k=this.href.replace(new RegExp("^"+location.href.replace(/#.*/,"")),"");if(k&&k.substr(0,1)=="#"){$(this).click(function(m,n){if(n.which==2){return}var l=null;if(m==="#top"){l=0}else{l=$(m).offset().top-$(".dynamic-nav-wrapper").height()-20}if(isNaN(l)){return}if(Platform.isTouch()){l-=37}if(m==="#guide-body"){l+=10;if(Platform.isTouch()){l+=$(".dynamic-nav-wrapper").height()}}$("html, body").stop().animate({scrollTop:l},"500","swing");return false}.bind(null,k))}});var g=(function(m,k){var l=this.scrollY||this.pageYOffset||0;if(l>m.offset().top-10-k){$("body").addClass("fixed-dynamic-nav")}else{$("body").removeClass("fixed-dynamic-nav")}}).bind(window,h,Platform.isTouch()?40:0);$(window).scroll(g);g();var f=(function(l,k){k.css("width",l.width()+"px");l.css("height",k.height()-5+"px")}).bind(null,h,c);$(window).resize(f);f()};$WH.checkDynamicNavWidth=function(f){if(!f){f=$(".dynamic-nav-wrapper")}var c=$(f);if(!c.length){return}var b=$(".dynamic-nav-outer",c);b.css({width:c.width()+"px"})};$WH.debugMessage=function(f){var b=$(".layout > .header");if(!b.length){setTimeout($WH.debugMessage.bind(null,f),9);return}var c=$(".debug",b);if(!c.length){c=$("<div/>",{"class":"debug"}).appendTo(b)}$("<div/>",f).appendTo(c)};$WH.countdownClock=function(r){var h=$("#countdown-clock-"+r.id);if(!h.length){return}var o;if(r.url){o=$("<a/>",{href:r.url,target:"_blank"})}else{o=$("<div/>")}o.addClass("countdown-clock-content").css({"background-image":"url("+r.bg+")"});var t=$("<div/>",{"class":"countdown-clock-content-inner"}).appendTo(o);if(r.impressionImage){$("<img>",{src:r.impressionImage,css:{bottom:0,height:"1px",position:"absolute",right:0,width:"1px"}}).appendTo(o)}if(r.text){t.append($("<span/>",{"class":"countdown-clock-text",html:r.text}))}var n=$("<span/>",{"class":"countdown-clock-time"}).appendTo(t);var c=$("<table/>").appendTo(n);var b=$("<tr/>").appendTo(c);var g=$("<tr/>").appendTo(c);$("<td/>").appendTo(b);$("<td/>",{html:":"}).appendTo(b);$("<td/>").appendTo(b);$("<td/>",{html:":"}).appendTo(b);$("<td/>").appendTo(b);$("<td/>",{html:LANG.timeunitspl[3]}).appendTo(g);$("<td/>").appendTo(g);$("<td/>",{html:LANG.timeunitspl[4]}).appendTo(g);$("<td/>").appendTo(g);$("<td/>",{html:LANG.timeunitspl[5]}).appendTo(g);h.addClass("countdown-clock").append(o);var u={days:0,hours:0,minutes:0};var f=new Date().getTime();var m=f;if(typeof r.time=="string"){m=new Date(r.time).getTime()}else{if(typeof r.time=="object"){var s=new Date();if(!r.time.hasOwnProperty("year")){r.time.year=s.getFullYear()}if(!r.time.hasOwnProperty("month")){r.time.month=s.getMonth+1}if(!r.time.hasOwnProperty("day")){r.time.day=s.getDay()}if(!r.time.hasOwnProperty("hour")){r.time.hour=0}if(!r.time.hasOwnProperty("minute")){r.time.minute=0}if(!r.time.hasOwnProperty("second")){r.time.second=0}m=new Date(r.time.year,r.time.month-1,r.time.day,r.time.hour,r.time.minute,r.time.second).getTime()}}var k=parseInt((m-f)/1000);var l=60;var j=l*60;var q=j*24;u.days=parseInt(k/q);k=k-(u.days*24*60*60);u.hours=parseInt(k/j);k=k-(u.hours*60*60);u.minutes=parseInt(k/l);var p=function(v,y,w){if(y.days<=0&&y.hours<=0&&y.minutes<=0){v.html(w.completionText).parent().parent().addClass("countdown-clock-complete");return}$("tr:first-child > td:nth-child(1)",v).html(y.days);$("tr:last-child > td:nth-child(1)",v).html(y.days==1?LANG.timeunitssg[3]:LANG.timeunitspl[3]);$("tr:first-child > td:nth-child(3)",v).html(y.hours);$("tr:last-child > td:nth-child(3)",v).html(y.hours==1?LANG.timeunitssg[4]:LANG.timeunitspl[4]);$("tr:first-child > td:nth-child(5)",v).html(y.minutes);$("tr:last-child > td:nth-child(5)",v).html(LANG.timeunitsab[5]);y.minutes--;if(y.minutes<0){if(y.hours>0||y.days>0){y.minutes=59}else{y.minutes=0}y.hours--}if(y.hours<0){if(y.days>0){y.hours=23}else{y.hours=0}y.days--}if(y.days<0){y.days=0}setTimeout(p.bind(null,v,y,w),60000)};p(n,u,r)};$WH.slashHashEvent=null;try{$WH.slashHashEvent=new Event("slashhash")}catch(e){try{$WH.slashHashEvent=document.createEvent("Event");$WH.slashHashEvent.initEvent("slashhash",true,true)}catch(e){}}$WH.getSlashHash=function(b){var c=""+location.href;var f=c.indexOf(b);if(f==-1){return location.hash?(""+location.hash).replace(/^#/,""):""}var g=c.substr(0,f+b.length);return c.substr(g.length+1)};$WH.setSlashHash=function(b,l,g){var c=""+location.href;var f=c.indexOf(b);if(f==-1){alert("Bad hash update: No root found!");return}var j=c.substr(0,f+b.length);var k=c.substr(j.length+1);if(l.substr(0,1)=="#"){l=l.substr(1)}var h=l?"/"+l:"";if(g){if(window.history&&window.history.pushState){window.history.pushState({},"",j+h);if($WH.slashHashEvent&&window.dispatchEvent){window.dispatchEvent($WH.slashHashEvent)}}else{location.hash="#"+h}}else{if(window.history&&window.history.replaceState){window.history.replaceState({},"",j+h);if($WH.slashHashEvent&&window.dispatchEvent){window.dispatchEvent($WH.slashHashEvent)}}else{location.replace("#"+h)}}return k};$WH.setHash=function(f,b){var c=""+location.hash;if(f.substr(0,1)!="#"){f="#"+f}if(f=="#."){$WH.clearHash(b||false)}else{if(b){location.hash=f}else{location.replace(f)}}return c};$WH.clearHash=function(c){var f=""+location.hash;var b=(""+location.href).replace(/#.*/,"");if(c){if(window.history&&window.history.pushState){window.history.pushState({},"",b)}else{location.hash="#."}}else{if(window.history&&window.history.replaceState){window.history.replaceState({},"",b)}else{location.replace("#.")}}return f};$WH.selectText=function(f){var g=document,h=g.getElementById(f),c,b;if(g.body.createTextRange){c=document.body.createTextRange();c.moveToElementText(h);c.select()}else{if(window.getSelection){b=window.getSelection();c=document.createRange();c.selectNodeContents(h);b.removeAllRanges();b.addRange(c)}}};$WH.ucfirst=function(b){return b.charAt(0).toUpperCase()+b.slice(1)};$WH.loadAssets=function(m,n){var c=function(o){var p=$WH.ce("link");p.rel="stylesheet";p.href=o;$WH.ae(document.getElementsByTagName("head")[0],p)};var g=function(o,q){var p=$WH.ce("script");p.type="text/javascript";p.src=o;if(q){$WH.aE(p,"load",q)}$WH.ae(document.getElementsByTagName("head")[0],p)};switch(m){case"artifact-weapon-calc":if($WH.isSet("ArtifactCalc")){if(n){n()}return}c(g_staticUrl+"/css/ArtifactCalc.css?"+g_wow_build);var j=g_staticUrl+"/js/ArtifactCalc.js?"+g_wow_build;if($WH.isSet("g_artifact_textures")){g(j,n)}else{var b="/data=artifact-calc&w"+g_wow_build;g(b,g.bind(null,j,n))}break;case"battle-pet-team-calc":if($WH.isSet("HonorTalentCalc")){if(n){n()}return}c(g_staticUrl+"/css/BattlePetTeamCalc.css?"+g_wow_build);var k=g_staticUrl+"/js/BattlePetTeamCalcCore.js?"+g_wow_build;if($WH.isSet("g_battlepets")){g(k,n)}else{g("/data=petspecies?"+g_wow_build,g.bind(null,k,n))}break;case"honor-talent-calc":if($WH.isSet("HonorTalentCalc")){if(n){n()}return}c(g_staticUrl+"/css/talent-pvp.css?"+g_wow_build);var l=g_staticUrl+"/js/talent-pvp.js?"+g_wow_build;if($WH.isSet("g_talents_pvp")){g(l,n)}else{var f="/data=talents-pvp?"+g_wow_build;g(f,g.bind(null,l,n))}break;case"talent-calc":if($WH.isSet("TalentCalc")){if(n){n()}return}c(g_staticUrl+"/css/talent.css?"+g_wow_build);var h=g_staticUrl+"/js/talent.js?"+g_wow_build;if($WH.isSet("g_glyphs")){g(h,n)}else{g("/data=glyphs?"+g_wow_build,g.bind(null,h,n))}break;default:alert('Tried to load unknown asset set "'+String(m)+'".')}};$WH.isInt=function(b){return typeof b==="number"&&parseFloat(b)==parseInt(b)&&!isNaN(b)};$WH.ensureObjectPath=function(c,b){var f=Array.prototype.slice.call(arguments,1);if(typeof f[0]!="string"){return c}if(typeof c[f[0]]!="object"){c[f[0]]={}}if(f[1]){c[f[0]]=$WH.ensureObjectPath.apply(this,[c[f[0]]].concat(f.slice(1)))}return c};$WH.preventDefault=function(b){if(b&&b.preventDefault){b.preventDefault()}};$WH.preventTyping=function(f){if(f&&f.preventDefault){var g=("which" in f)?f.which:f.keyCode;var b=(g>=48&&g<=57)||(g>=65&&g<=90)||(g>=96&&g<=105)||(g>=106&&g<=111)||(g>=186&&g<=192)||(g>=219&&g<=222);var c=(f.altKey||f.ctrlKey||f.shiftKey||f.metaKey);if(b&&!c){f.preventDefault()}}};var vi_thumbnails={1:"//i3.ytimg.com/vi/$1/default.jpg"};var vi_siteurls={1:"http://www.youtube.com/watch?v=$1"};var vi_sitevalidation=[/https?:\/\/(?:www\.)?youtube\.com\/watch\?v=([^& ]{11})/i,/https?:\/\/(?:www\.)?youtu\.be\/([^& ]{11})/i];function vi_submitAVideo(){tabsContribute.focus(2)}function vi_validateForm(c){if(!c.elements.videourl.value.length){alert(LANG.message_novideo);return false}var g=false;for(var b in vi_sitevalidation){if(!vi_sitevalidation.hasOwnProperty(b)){continue}if(c.elements.videourl.value.match(vi_sitevalidation[b])){g=true;break}}if(!g){alert(LANG.message_novideo);return false}return true}function vi_appendSticky(){var g=$WH.ge("infobox-sticky-vi");if(!g){return}var h=g_pageInfo.type;var f=g_pageInfo.typeId;var l=$WH.inArray(lv_videos,1,function(m){return m.sticky});if(l!=-1){g.className="has-thumb";var k=lv_videos[l];var b=$WH.ce("a");b.href="#videos:id="+k.id;b.onclick=function(m){VideoViewer.show({videos:lv_videos,pos:l});return $WH.rfWithoutControlKey(m)};var c=$WH.ce("img");c.src=$WH.sprintf(vi_thumbnails[k.videoType].replace(/\/default\.jpg/,"/mqdefault.jpg"),k.videoId);c.className="border";$WH.ae(b,c);$WH.ae(g,b);var j=$("#infobox-videos");if(!j){j=$("th",$(g).parents().prev("tr"))}j.append(" ("+lv_videos.length+")").wrapInner($('<a href="#videos"></a>').click(function(){tabsRelated.focus(tabsRelated.getTabById("videos"));return false}))}else{if(g_user){var b;if(g_user.id>0){b='<a href="javascript:;" onclick="vi_submitAVideo(); return false">'}else{b='<a href="/account=signin">'}g.innerHTML=$WH.sprintf(LANG.infobox_noneyet,b+LANG.infobox_suggestone+"</a>")}else{$("#infobox-videos,#infobox-sticky-vi").closest("td, th").css("display","none")}}vi_appendSticky=function(){}}var g_videos=[];var VideoViewer=new function(){var g,o,f,E,I,t,u=0,z,l,F,b,s,m,B,D,y,k,A,n;function j(){var L=g[o];var J=Math.max(n.offsetHeight-18,0),K=Math.max(50,Math.min(520,$WH.getWindowSize().h-72-J)),M=Math.min(1,K/520);f=Math.round(M*880);E=Math.round(M*520);B.style.height=D.style.height=y.style.height=(E-95)+"px";Lightbox.setSize(Math.max(480,f)+20,E+52+J+(F?96:0))}function c(L){var J=g[L],K="#videos:";if(u==0){K+="id="+J.id}else{K+=z+":"+(L+1)}return K}function w(J){if(J&&(I==1)&&$WH.getWindowSize().h>b.offsetHeight){return}b.style.visibility="hidden";var L=g[o];j();if(!J){var K=(L.caption!=null&&L.caption.length);$WH.track.event("Videos","Show",L.id+(K?" ("+L.caption+")":""));if(L.videoType==1){m.innerHTML=Markup.toHtml("[youtube="+L.videoId+" width="+f+" height="+E+"]")}k.href=$WH.sprintf(vi_siteurls[L.videoType],L.videoId);if(!L.user&&typeof g_pageInfo=="object"){L.user=g_pageInfo.username}var Q=(L.date&&L.user),P=(g.length>1);if(Q){var O=new Date(L.date),S=(g_serverTime-O)/1000;var R=A.firstChild.childNodes[1];R.href="/user="+L.user;R.innerHTML=L.user;var U=A.firstChild.childNodes[3];$WH.ee(U);$WH.formatDate(U,S,O);A.firstChild.style.display=""}else{A.firstChild.style.display="none"}var U=A.childNodes[1];$WH.ee(U);U=A.childNodes[2];if(P){var T="";if(L.user){T=LANG.dash}T+=(o+1)+LANG.lvpage_of+g.length;U.innerHTML=T;U.style.display=""}else{U.style.display="none"}A.style.display=(Q||P?"":"none");var M=(L.subject!=null&&L.subject.length&&L.type&&L.typeId);if(K||M){var N="";if(M){N+=LANG.types[L.type][0]+LANG.colon;N+='<a href="/'+g_types[L.type]+"="+L.typeId+'">';N+=L.subject;N+="</a>"}if(K){if(M){N+=LANG.dash}N+=(L.noMarkup?L.caption:Markup.toHtml(L.caption,{mode:Markup.MODE_SIGNATURE}))}n.innerHTML=N;n.style.display=""}else{n.style.display="none"}if(g.length>1){B.href=c(v(-1));D.href=c(v(1));B.style.display=D.style.display="";y.style.display="none"}else{B.style.display=D.style.display="none";y.style.display=""}location.replace(c(o))}else{$("object, embed",m).each(function(){this.width=f;this.height=E})}Lightbox.reveal();b.style.visibility="visible";setTimeout(q,1)}function v(J){var K=o;K+=J;if(K<0){K=g.length-1}else{if(K>=g.length){K=0}}return K}function C(){o=v(-1);w();return false}function G(){o=v(1);w();return false}function q(){if(l){document.title=l}}function r(J){J=$WH.normalizeEvent(J);switch(J.keyCode){case 37:C();break;case 39:G();break}}function h(){w(1)}function p(){$WH.ee(m);if(g.length>1){$WH.dE(document,"keyup",r)}if(t&&u==0){if(t.indexOf(":id=")!=-1){t="#videos"}$WH.setHash(t)}else{$WH.clearHash()}q()}function H(S,O,L){if(typeof L.videos=="string"){g=g_videos[L.videos];u=1;z=L.videos}else{g=L.videos;u=0;z=null}b=S;o=0;if(L.pos&&L.pos>=0&&L.pos<g.length){o=L.pos}if(O){S.className+=" has-lightbox-caption screenshotviewer";s=$WH.ce("div");s.className="lightbox-content screenshotviewer-screen";var V=$WH.ce("div");var J=$WH.ce("div");V.className="screenshotviewer-page-wrapper screenshotviewer-prev-wrapper";J.className="screenshotviewer-page-wrapper screenshotviewer-next-wrapper";B=$WH.ce("a");D=$WH.ce("a");B.className="screenshotviewer-prev";D.className="screenshotviewer-next";B.href="javascript:;";D.href="javascript:;";var N=$WH.ce("span");N.className="fa fa-chevron-left";$WH.ae(B,N);N=$WH.ce("span");N.className="fa fa-chevron-right";$WH.ae(D,N);B.onclick=C;D.onclick=G;y=$WH.ce("a");y.className="screenshotviewer-cover";y.href="javascript:;";y.onclick=Lightbox.hide;var R=$WH.ce("span");var Q=$WH.ce("b");$WH.ae(Q,$WH.ct(LANG.close));$WH.ae(R,Q);$WH.ae(y,R);$WH.ae(V,B);$WH.ae(J,D);$WH.ae(s,V);$WH.ae(s,J);$WH.ae(s,y);m=$WH.ce("div",{className:"screenshotviewer-image"});$WH.ae(s,m);$WH.ae(S,s);var M=$WH.ce("a");M.className="dialog-x fa fa-times";M.href="javascript:;";M.onclick=Lightbox.hide;$WH.ae(M,$WH.ct(LANG.close));$WH.ae(S,M);k=$WH.ce("a");k.className="dialog-arrow fa fa-external-link";k.href="javascript:;";k.target="_blank";$WH.ae(k,$WH.ct(LANG.original));$WH.ae(S,k);var U=$WH.ce("div",{className:"lightbox-caption"});A=$WH.ce("div");A.className="screenshotviewer-from";var K=$WH.ce("span");$WH.ae(K,$WH.ct(LANG.lvscreenshot_from));$WH.ae(K,$WH.ce("a"));$WH.ae(K,$WH.ct(" "));$WH.ae(K,$WH.ce("span"));$WH.ae(A,K);$WH.ae(A,$WH.ce("span"));$WH.ae(A,$WH.ce("span"));$WH.ae(U,A);n=$WH.ce("div");n.className="screenshotviewer-caption";$WH.ae(U,n);$WH.ae(S,U)}var T=$WH.ge("videoviewer-ad");if(!O&&T){$WH.ee(T)}if(L.displayAd&&T){var P=$WH.ce("div");$WH.ae(T,P);WAS.create("leaderboard",P)}t=location.hash;if(g.length>1){$WH.aE(document,"keyup",r)}w()}this.checkPound=function(){l=$("title").html();if(location.hash&&location.hash.indexOf("#videos")==0){if(!g_listviews.videos){var K=location.hash.split(":");if(K.length==3){var L=g_videos[K[1]],J=parseInt(K[2]);if(L&&J>=1&&J<=L.length){VideoViewer.show({videos:K[1],pos:J-1,displayAd:true})}}}}};this.show=function(J){Lightbox.show("videoviewer",{onShow:H,onHide:p,onResize:h},J);return false};$(document).ready(this.checkPound)};$(document).ready(function(){$("form.vote-comment input").click(function(){var b=$(this).attr("data-vote");var j=$(this).parent();var h=j.find(".ajax");var g=j.find("input");var c=j.attr("data-post");var f=j.attr("data-type");g.prop("disabled",true);h.show();$.post("/vote",{post:c,type:f,vote:b},function(k){if(k!="ok"){g.prop("disabled",false);h.hide();alert(LANG.voteerror_tip);return}j.remove()});return false})});var WAS=new function(){var p={defaultChannel:"Other",blizzardGracePeriod:1000*60*10,skins:{bodyClass:"skinned",bodyClass3rdParty:"skinned-3rd-party",classPrefix:"skin",linkCount:2},MonkeyBroker:{siteIDs:[1664,1829],slotIDs:{horizontal:["728x90","970x90","970x250"],horizontalBTF:[22,38,37],vertical:["300x250","Stacked 300x250","160x600","300x600"],verticalBTF:[26,40,39],leaderboard:["728x90"],leaderboard2:["728x90"],leaderboardBTF:[22],leaderboardBTF2:[22],medrec:["300x250"],medrecBTF:[26],medrecBTF2:[26],medrecMobile:["300x250"],skyscraper:["160x600"],skin:[30],largeSkin:[41],fixedFooter:[25],mobileFooter:["320x50"]}},units:{horizontal:{applyClasses:{parent:["horizontal-bg is-atf"]}},horizontalBTF:{applyClasses:{parent:["horizontal-bg is-btf"]}},vertical:{applyClasses:{parent:["vertical-bg is-atf"]}},verticalBTF:{applyClasses:{parent:["vertical-bg is-btf"]}},leaderboard:{applyClasses:{parent:["header-bg is-atf"]}},leaderboardBTF:{applyClasses:{parent:["footer-bg is-btf"]}},medrec:{applyClasses:{parent:["block-bg is-atf"]}},medrecBTF:{applyClasses:{parent:["block-bg is-btf"]}},medrecBTF2:{applyClasses:{parent:["block-bg is-btf"]}},skyscraper:{applyClasses:{parent:["sidebar-bg is-atf"]}},skin:{applyClasses:{parent:["skin-bg"]}},largeSkin:{applyClasses:{parent:["large-bg"]}},fixedFooter:{applyClasses:{parent:["fixed-footer-bg"]}},mobileFooter:{applyClasses:{parent:["mobile-fixed-footer-bg"]}}},channels:{achievement:{name:"Achievement"},achievements:{name:"Achievement List"},ads:{name:"Test"},faction:{name:"Faction"},factions:{name:"Faction List"},forums:{name:"Forums",board:{name:"Forum Board"},topic:{name:"Forum Topic"}},guide:{name:"Guide"},guides:{name:"Guide List"},home:{name:"Home"},item:{name:"Item"},items:{name:"Item List"},itemset:{name:"Item Set"},itemsets:{name:"Item Set List"},map:{name:"Map"},maps:{name:"Map List"},news:{name:"News"},npc:{name:"NPC"},npcs:{name:"NPC List"},object:{name:"Object"},objects:{name:"Object List"},pet:{name:"Pet"},pets:{name:"Pet List"},quest:{name:"Quest"},quests:{name:"Quest List"},search:{name:"Search"},skills:{name:"Skill List"},spell:{name:"Spell"},spells:{name:"Spell List"},talent:{name:"Calculator"},"transmog-set":{name:"Transmog Set"},"transmog-sets":{name:"Transmog Set List"},"warcraft-movie":{name:"Warcraft Hub"},zone:{name:"Zone"},zones:{name:"Zone List"}}};var k={pending:[],postSkinSetupCallbacks:[],removed:false,slotsAdded:{}};this.defined={};this.getSiteId=function(){var v=0;if(typeof I10C!=="undefined"&&I10C.Morph==1){v=1}return p.MonkeyBroker.siteIDs&&p.MonkeyBroker.siteIDs[v]?p.MonkeyBroker.siteIDs[v]:0};this.getConfig=function(v){return p[v]};this.checkInitConditions=function(){return typeof g_user!="undefined"&&typeof Platform!="undefined"&&Platform.known};this.showAds=function(){return g_user.ads&&!k.removed};this.getChannelName=function(){var v=p.channels;var y=p.defaultChannel;var z={};var w=$WH.getPage();if(w){if(w.length==1&&w[0]==""){w[0]="home"}if(w.length==1&&w[0]=="guides"&&location.href.match(/https?:\/\/[^\/]+\.com\/guides\/.+/)){w[0]="guide"}if(w.length>1&&v[w[0]]&&v[w[0]][w[1]]){z=v[w[0]][w[1]]}else{if(v[w[0]]){z=v[w[0]]}else{z={name:y}}}if(typeof $WH.getGets().adtest=="string"){z=v.ads}}return z.name||y};this.create=function(v,w){if(k.slotsAdded[v]){if(typeof console!="undefined"&&console&&typeof console.error=="function"&&typeof v=="string"){console.error(v+" unit already added!")}return false}if(!this.checkCreateConditions(v,w)){if(typeof w=="string"){w=document.getElementById(w)}$(w).parent().attr("data-disabled-block","true");return false}if(typeof w=="string"){w=document.getElementById(w);if(!w){return false}}if(!this.showAds()){if(typeof w=="string"){w=document.getElementById(w)}if(w){j(w)}return false}if(r(w,true)){k.pending.push({type:v,target:w});return false}if(p.units[v]&&p.MonkeyBroker.slotIDs[v]&&w){return g(v,w)}return false};this.updateSlotSize=function(v){m(v)};this.addPostSkinSetupCallback=function(v){if(typeof v=="function"){k.postSkinSetupCallbacks.push(v)}};function g(w,z,y){if((z.getElementsByTagName("iframe")).length){return false}if(z.zamAdUnitName){return}if(!z.className||z.className.indexOf("banner-ad")<0){z.parentNode.setAttribute("data-was-parent","true");z.setAttribute("data-was-unit","true");z.className+=" banner-ad";t(w,z)}if(typeof MonkeyBroker=="undefined"){y=typeof y=="number"?y+1:1;setTimeout(g.bind(this,w,z,y),9*y);return false}z.zamAdUnitName=w;var v=p.MonkeyBroker.slotIDs[w];if(MonkeyBroker.went){l(MonkeyBroker,v,w,z)}else{u(MonkeyBroker,v,w,z)}k.slotsAdded[w]=true}function l(z,w,v,A){if(v=="fixedFooter"||v=="largeSkin"){z.inventoryConditionalPlacement({sizes:w,rm:true,reportBadAd:false});return}else{if(v=="skin"){setTimeout(function(){z.inventoryConditionalPlacement({sizes:w,dataTag:true})},500);return}}var y={slot:v,sizes:w,el:A};z.defineSlot(y);z.registerSlotCallback(v,m);z.adPlacement(y)}function u(z,y,w,A){var v={slot:w,sizes:y,el:A};if(w=="fixedFooter"||w=="largeSkin"){v.rm=true;v.reportBadAd=false;delete v.el;z.addSlot(v);return}if(w=="skin"){v.dataTag=true;v.callback=WAS.displaySkin;delete v.el;z.addSlot(v);return}z.registerSlotCallback(w,m);z.addSlot(v)}function j(v){var w=b(v);$WH.de(w)}this.layoutComplete=function(v){if(typeof MonkeyBroker=="undefined"){v=typeof v=="number"?v+1:1;setTimeout(this.layoutComplete.bind(this,v),9*v);return false}if(!MonkeyBroker.went){MonkeyBroker.registerSizeCallback(30,WAS.displaySkin);MonkeyBroker.go({autofillSlots:1})}this.layoutComplete=function(){return true};return true};function t(w,y){var v=p.units[w];if(v.applyClasses){if(v.applyClasses.unit){$(y).addClass(v.applyClasses.unit)}if(v.applyClasses.parent){$(y.parentNode).addClass(v.applyClasses.parent)}}}this.checkCreateConditions=function(y,z,v){if(v===true){switch(Platform.get()){case"mobile":switch(y){case"horizontal":case"horizontalBTF":case"vertical":case"verticalBTF":case"leaderboard":case"leaderboard2":case"leaderboardBTF":case"leaderboardBTF2":case"skyscraper":case"skin":case"largeSkin":case"fixedFooter":return false;case"medrec":case"medrecBTF":case"medrecBTF2":case"medrecMobile":case"mobileFooter":}break;case"tablet":switch(y){case"vertical":case"verticalBTF":case"medrecMobile":case"skyscraper":case"skin":case"largeSkin":case"fixedFooter":case"mobileFooter":return false;case"horizontal":case"horizontalBTF":case"leaderboard":case"leaderboard2":case"leaderboardBTF":case"leaderboardBTF2":case"medrec":case"medrecBTF":case"medrecBTF2":}break;case"pointer":switch(y){case"medrecMobile":case"mobileFooter":return false;case"horizontal":case"horizontalBTF":case"vertical":case"verticalBTF":case"leaderboard":case"leaderboard2":case"leaderboardBTF":case"leaderboardBTF2":case"medrec":case"medrecBTF":case"medrecBTF2":case"skyscraper":case"skin":case"largeSkin":case"fixedFooter":}break}}if(y=="mobileFooter"&&!Platform.isTouch()){return false}if(y=="skin"&&o()){return false}if(y=="skin"||y=="largeSkin"||y=="fixedFooter"){if(Platform.isTouch()){return false}var w=$WH.getPage();if(w){switch(w[0]){case"news":case"guides":case"guide":case"map":return false}}if($WH.isDev()){return false}}if(Platform.isTouch()){if(["skyscraper","skin","largeSkin","fixedFooter"].indexOf(y)>-1){return false}if((y=="vertical"||y=="verticalBTF")&&z=="ad-vertical"&&$("#ad-vertical").parents(".sidebar").length){return false}if(Platform.isMobile()){if(["vertical","verticalBTF","horizontal","horizontalBTF","leaderboard","leaderboardBTF"].indexOf(y)>-1){return false}if(y=="medrec"&&this.getChannelName()=="Map"){return false}}}if(!Platform.isMobile()){if(typeof z=="string"&&z.match(/mobile/)){return false}}return true};this.addMobileMedrec=function(w){if(!Platform.isMobile()){return}if($WH.ge("ad-mobile-medrec")){return}var v=$(w);if(!v.length){return}v.append('<div class="block-bg"><div id="ad-mobile-medrec"></div></div>');this.create("medrec","ad-mobile-medrec")};function m(C){if(!C.el){return}if(typeof C.el=="string"){C.el=document.getElementById(C.el)}if(typeof C.el!="object"||!C.el.parentNode){return}var w=b(C.el);if(!w){return}w.className=w.className.replace(/ *\bis-[0-9]+x[0-9]+\b/g,"");w.className+=" is-"+C.w+"x"+C.h;if(C.slot=="mobileFooter"){var v=document.createElement("a");v.className="mobile-dashboard-closer";v.onclick=function(){var D=this.parentNode;D.parentNode.removeChild(D)};w.appendChild(v)}var y=C.w+"x"+C.h;if(C.w==728||C.w==970){var B=C.el;if(B){var A=B.parentNode.parentNode.parentNode;A.setAttribute("data-contains-block",y);if(A.parentNode&&A.parentNode.parentNode&&A.parentNode.parentNode.parentNode&&A.parentNode.parentNode.parentNode.setAttribute){A.parentNode.parentNode.parentNode.setAttribute("data-contains-block",y)}}}else{if(typeof C.slot=="string"&&C.slot.match(/^vertical/)){var z=$(C.el).parents("#sidebar");if(z.length){z.attr("data-contains-sidebar-block",y);$("#layout").attr("data-contains-sidebar-block",y);$WH.updateContentHeight()}}}}this.remove=function(v){if(v){v.parentNode.removeChild(v)}};this.removeSkin=function(){if(document.body.className){document.body.className=document.body.className.replace(new RegExp(" "+p.skins.bodyClass+"(-[^ ]+)?"),"")}$("#skin-wrap").empty()};this.removeAll=function(){k.removed=true;var F=333;var v=$("#main > .blocks, #wrapper > .blocks, #page-content > .blocks");v.slideUp({complete:function(){v.remove();$(".horizontal-bg, .header-bg, .footer-bg").remove()},duration:F});$(".sidebar").animate({top:"0px"},F,false);var C=$(".block-bg");C.slideUp({complete:function(){C.remove();C.parent(":empty").remove()},duration:F});var D=false;var w=$WH.ge("sidebar");if(w){for(var B=0,y;y=w.childNodes[B];B++){if(y.getAttribute&&!y.getAttribute("data-was-parent")&&y.className!="top-sidebar-infobox"){D=true;break}}}var A=$(".vertical-bg, .sidebar-bg");if(D){A.slideUp({complete:function(){A.remove()},duration:F})}else{A.remove()}var E=function(I,G){var H=function(){$("#zam_footer_ad, #zam_footer_ad_interior").remove()};if(G){I.animate({top:"0px"},{complete:H,duration:F})}else{I.slideUp({complete:H,duration:F})}};var z=$("#zam_footer_ad_interior");if(z.length){E(z,true)}else{z=$("#zam_footer_ad");if(z.length){E(z)}}setTimeout(function(){$("[data-contains-block]").removeAttr("data-contains-block");$("[data-left-contains-block]").removeAttr("data-left-contains-block")},F+1)};this.getUserName=function(){if(g_user.name){return g_user.name}return null};this.displaySkin=function(K){if(!WAS.checkCreateConditions("skin",null)){return false}var I=p.skins;var y=document.getElementById(I.classPrefix+"-wrap");if(y){y.innerHTML=""}else{y=document.body}var J="H";if(K.sidesOnly){J="sides-only"}else{if(K.usePageLeaderboard){J+=" "+I.classPrefix+"-use-page-leaderboard"}}document.body.className+=" "+I.bodyClass+" "+I.bodyClass+"-"+J;var G=I.classPrefix+"-link-";var C=0;var v=I.linkCount;while(C++<v){var F=y.insertBefore(document.createElement("a"),y.firstChild);F.className=G+C;F.target="_blank";F.href=K.link;F.style.backgroundImage="url("+K.image+")"}var w=function(O,N,M){var L=N.insertBefore(document.createElement("img"),N.firstChild);L.className=O.classPrefix+"-pixel";L.src=M};switch(typeof K.impressionTracking){case"string":w(I,y,K.impressionTracking);break;case"object":for(var B in K.impressionTracking){if(K.impressionTracking.hasOwnProperty(B)&&typeof K.impressionTracking[B]=="string"){w(I,y,K.impressionTracking[B])}}break}var z=K.splitHeight||90;if(K.superLeaderboard){var D=K.superLeaderboardHeight||"90";var E=K.superLeaderboardWidth||"970";z=D;var H=y.insertBefore(document.createElement("div"),y.firstChild);H.className=I.classPrefix+"-"+E+"x"+D;var A=document.createElement("iframe");A.src=K.superLeaderboard;A.marginWidth=A.marginHeight=A.hspace=A.vspace=A.frameBorder=A.frameborder=A.border=0;A.style.height=D+"px";A.style.width=E+"px";A.scrolling="no";H.appendChild(A)}document.body.className+=" "+I.bodyClass+"-height-"+z;WAS.postSkinSetup.call(WAS,K,y);return true};this.make3rdPartySkinAdjustments=function(w){if(Platform.isTouch()){return}var v=p.skins;document.body.className+=" "+v.bodyClass3rdParty};this.postSkinSetup=function(z,y){if(!z.usePageLeaderboard&&!z.sidesOnly){$("#main > .blocks").remove()}$WH.updateContentHeight();for(var v=0,w;w=k.postSkinSetupCallbacks[v];v++){w(z,y)}};this.intersect=function(C,w){var D;var y;var A=this.getUnitParents();for(var B=0,v=A.length;B<v;++B){var z=A[B];if(z){if(!r(z)){D=$WH.ac(z);y=$WH.createRect(D.x,D.y,z.offsetWidth,z.offsetHeight);if($WH.intersectRect(C,y)){if(w){this.hide(z)}return z}}}}return false};this.getUnitClasses=function(){var v=[];for(var w in p.units){if(p.units[w].applyClasses&&p.units[w].applyClasses.parent&&v.indexOf(p.units[w].applyClasses.parent[0])==-1){v.push(p.units[w].applyClasses.parent[0])}}this.getUnitClasses=(function(y){return y}).bind(null,v);return v};this.getUnitParents=function(){return $("."+(this.getUnitClasses()).join(", ."))};this.isHidden=function(w,v){return r(w,v)};this.hide=function(w){var v=b(w);v.setAttribute("data-hidden-by-was","true")};this.hideAll=function(){var v=this.getUnitParents();v.attr("data-hidden-by-was","true")};this.restoreHidden=function(){$('[data-hidden-by-was="true"]').attr("data-hidden-by-was","false")};this.report=function(y,v){if(v){WAS.remove(b(v)||v)}var w=document.createElement("iframe");w.src=y;w.height=w.width=0;document.getElementsByTagName("body")[0].appendChild(w);alert(LANG.ads_reportresponse)};function b(A){if(A.getAttribute("data-was-unit")=="true"){return A.parentNode}if(A.getAttribute("data-was-parent")=="true"){return A}if(A.parentNode.getAttribute("data-was-unit")=="true"){return A.parentNode.parentNode}if(A.parentNode.getAttribute("data-was-parent")=="true"){return A.parentNode}if(A.className){var y=WAS.getUnitClasses();var z=false;if(y.indexOf(A.className)>-1){z=true}if(!z){for(var w=0,v;v=y[w];w++){if(A.className.indexOf(v)>-1){z=true;break}}}if(!z){return A.parentNode}}else{return A.parentNode}return A}function r(y,w){var v=b(y);if(v){if(w){return v.style.visibility=="hidden"}else{return v.getAttribute("data-hidden-by-was")=="true"}}return false}function o(){var y=$WH.isBlizzardReferral();var w=$WH.localStorage.get("blizz-skin-suppression");if(w){w=parseInt(w);var v=Date.now?Date.now():new Date().getTime();if(!isNaN(w)&&w>v&&w<v+p.blizzardGracePeriod+(1000*20)){y=true}else{$WH.localStorage.remove("blizz-skin-suppression")}}o=(function(z){return z}).bind(null,y);return y}var h=$WH.isBlizzardReferral();if(h){var f=Date.now?Date.now():new Date().getTime();$WH.localStorage.set("blizz-skin-suppression",f+p.blizzardGracePeriod);if(h=="brl"){var c=(""+location.href).replace(/[\?&]brl=[^\?&#]*/,"").replace(/[\?&]brl\b/,"").replace(/^(https?:\/\/[^\/]+\/)home$/,"$1");if(window.history&&window.history.replaceState){window.history.replaceState({},"",c)}else{location.replace(c)}}}if(o()){if(typeof ads_prepare=="object"){var s=[];for(var n=0,q;q=ads_prepare[n];n++){if(q.type!="skin"){s.push(q)}}ads_prepare=s}}};function pnetInitSkin(b){WAS.make3rdPartySkinAdjustments(b)}var Ads=new function(){this.displaySkin=function(){return WAS.displaySkin.apply(WAS,Array.prototype.slice.call(arguments,0))}};Ads.site=new function(){this.postSkinSetup=function(){return WAS.postSkinSetup.apply(WAS,Array.prototype.slice.call(arguments,0))}};function wt_getScaleFacetOptions(c,n){var b=[];if(c){for(var g=0,k;k=items_filterConfig.filters[g];g++){if(LANG.traits[k.name]&&c[k.name]){b.push([k.id,c[k.name]])}}}b.sort(function(p,j){return -$WH.stringCompare(p[1],j[1])});var m=[],o=[];for(var f=0,l;l=b[f];f++){m.push(l[0]);o.push(l[1])}if(m.length&&o.length){var h={weights:m.join(":"),"weight-values":o.join(":")};if(n){h["gem-quality"]=3}return h}return{}}function wt_getScaleFilter(f,b){var g=wt_getScaleFacetOptions(f,b);if(g.weights&&g["weight-values"]){var c=";";if(b){c="&"}else{if(typeof g["gem-quality"]!="undefined"){c+="gm="+g["gem-quality"]+";"}}c+="weights="+g.weights+(b?"&":";")+"weight-values="+g["weight-values"];return c}return""}function wt_getScaleUrlSegment(f,b){var g=wt_getScaleFacetOptions(f,b);if(g.weights&&g["weight-values"]){var c="";if(!b&&typeof g["gem-quality"]!="undefined"){c+="/gem-quality:"+g["gem-quality"]}c+="/weights:"+g.weights+"/weight-values:"+g["weight-values"];return c}return""}function wt_showClassPresetMenu(G,h,v,m,I,D){if(!(h&&m&&I)){return}var g=[[,LANG.menu_chooseclassspec]];var n="/items";for(var z=0,y;y=items_filterConfig.categories[z];z++){if(y.id==m){n+="/"+y.url;break}}if(m==4&&I){n+="/slot:"+I}var o="";var w="/live-only:on/group-by:"+(m==2?"slot":"source")+"?filter=161;1;0";if(m==2){if(Locale.getName()=="enus"){if(g_item_slots[I]){w+="#"+$WH.urlize(g_item_slots[I])}}else{w+="#slot-"+I}}if(g_user.weightscales&&g_user.weightscales.length){var B=[0,LANG.ficustom,,[]];g.push(B);for(var E=0,H;H=g_user.weightscales[E];E++){o=wt_getScaleUrlSegment(H)+"/upgrade-for:"+h;if(v&&v.length){o+="/upgrade-bonuses:"+v.join(":")}B[3].push([H.id,H.name,n+o+w])}}var s=$WH.isSet("g_items")&&g_items[h]?g_items[h].specs:null;for(var F in wt_presets){if(!wt_presets.hasOwnProperty(F)){continue}var r=[F,g_chr_classes[F],,[],{className:"c"+F,tinyIcon:"class_"+g_file_classes[F]}];if(s!=null&&s.length>0&&g_chr_specs_by_class[F]){var t=g_chr_specs_by_class[F];var b=false;for(var C in t){if(t.hasOwnProperty(C)&&$WH.inArray(s,t[C])!=-1){b=true;break}}if(!b){continue}}g.push(r);var A=0;for(var f in wt_presets[F]){if(!wt_presets[F].hasOwnProperty(f)){continue}r[3].push([,LANG.presets[f]?LANG.presets[f]:$WH.sprintf(LANG.presets.ilvlformat.replace("%s","$1"),f)]);for(var u in wt_presets[F][f]){if(!wt_presets[F][f].hasOwnProperty(u)){continue}b=(s==null||s.length==0);if(!b){for(var q in s){if(s.hasOwnProperty(q)&&LANG.presets[u].indexOf(g_chr_specs[s[q]])!=-1){b=true;break}}}if(b){o="/class:"+F+wt_getScaleUrlSegment(wt_presets[F][f][u])+"/upgrade-for:"+h;if(v&&v.length){o+="/upgrade-bonuses:"+v.join(":")}r[3].push([A,LANG.presets[u],n+o+w,,{tinyIcon:wt_presets[F][f][u].__icon}]);A++}}}}Menu.sort(g);Menu.show(g,G)}(function(){if((User.hasPermissions(U_GROUP_ADMIN)||$WH.isDev())&&!location.pathname.match(/^\/(admin|edit)=/)){if(!document.title){$WH.debugMessage({text:"No page title!","class":"debug-seo-error"})}$(function(){setTimeout(function(){if(!$("h1").length){$WH.debugMessage({text:"No H1!","class":"debug-seo-error"})}},1000)});var c=function(j){return j.match(/(%s|\$\d)/)};var g=$('meta[name="description"]').attr("content");if(g){var f={html:'<span class="q0">SEO Description:</span> '+g,"class":"debug-seo"};if(c(g)){f["class"]+="-error"}if(g.length<130){f.html+=' <span class="q0">(short)</span>';f["class"]+="-warn"}else{if(g.length>160){f.html+=' <span class="q0">(long)</span>';f["class"]+="-warn"}}$WH.debugMessage(f)}else{$WH.debugMessage({text:"No SEO description!","class":"debug-seo-error"})}var b=$('meta[name="keywords"]').attr("content");if(b){var h={html:'<span class="q0">SEO Keywords:</span> '+b.split(",").join(", "),"class":"debug-seo"};if(c(b)){h["class"]+="-error"}$WH.debugMessage(h)}else{$WH.debugMessage({text:"No SEO keywords!","class":"debug-seo-error"})}}})();var g_npcs={},g_objects={},g_items={},g_itemsets={},g_quests={},g_spells={},g_gatheredzones={},g_factions={},g_pets={},g_achievements={},g_titles={},g_transmogsets={},g_outfits={},g_holidays={},g_classes={},g_races={},g_skills={},g_gatheredcurrencies={},g_petabilities={},g_sounds={},g_buildings={},g_followers={},g_champions={},g_missionabilities={},g_threats={},g_missions={},g_ships={},g_resources={},g_orderadvancements={},g_affixes={},g_icons={},g_bluetweets={},g_charts={},g_guides={};var g_types={1:"npc",2:"object",3:"item",4:"item-set",5:"quest",6:"spell",7:"zone",8:"faction",9:"pet",10:"achievement",11:"title",12:"event",13:"class",14:"race",15:"skill",17:"currency",19:"sound",20:"building",21:"follower",22:"mission-ability",23:"mission",25:"ship",26:"threat",27:"resource",28:"champion",29:"icon",30:"order-advancement",31:"follower_a",32:"follower_h",33:"ship_a",34:"ship_h",35:"champion_a",36:"champion_h",40:"affix",100:"guide",101:"transmog-set",110:"outfit",200:"pet-ability"};var g_gathered_types={1:g_npcs,2:g_objects,3:g_items,4:g_itemsets,5:g_quests,6:g_spells,7:g_zones,8:g_factions,9:g_pets,10:g_achievements,11:g_titles,12:g_holidays,13:g_classes,14:g_races,15:g_skills,17:g_currencies,19:g_sounds,20:g_buildings,21:g_followers,22:g_missionabilities,23:g_missions,25:g_ships,26:g_threats,27:g_resources,28:g_champions,29:g_icons,30:g_orderadvancements,31:g_followers,32:g_followers,33:g_ships,34:g_ships,35:g_champions,36:g_champions,40:g_affixes,100:g_guides,101:g_transmogsets,110:g_outfits,200:g_petabilities};var g_completion_categories={1:[12],3:[2,4,9,"15-2","15-5"],6:[-5,-6,9,11]};$WH.cO(g_items,{add:function(c,b){if(g_items[c]!=null){$WH.cO(g_items[c],b)}else{g_items[c]=b}},getIcon:function(j,f,h){var c=g_items[j];var g="inv_misc_questionmark";if(c!=null&&c.icon){g=c.icon}var b=g_items.getAppearance(j,f,h);if(b!=null&&b[1]){g=b[1]}return g},getAppearance:function(f,c,j){var h=null;var g=g_items[f];var m=-1;var b=(g&&g.appearances)?g.appearances:(g&&g.jsonequip&&g.jsonequip.appearances?g.jsonequip.appearances:null);if(j&&b&&b[j]){h=b[j]}else{if($WH.isSet("g_itembonuses")&&c&&c.length>0){for(var l in c){var k=c[l];if(k>0&&g_itembonuses[k]){$WH.arrayWalk(g_itembonuses[k],function(n){if(n[0]==7){m=n[1]}})}if(m!=-1&&b&&b[m]){h=b[m];break}}}}return h},createIcon:function(j,c,b,h,f){var g=(f&&f.length>0)?("&bonus="+f.join(":")):"";return Icon.create(g_items.getIcon(j,f),c,null,"/item="+j+g,b,h)},getItemQualityColor:function(c){var b=["9d9d9d","ffffff","1eff00","0070dd","a335ee","ff8000","e5cc80","00ccff","00ccff"];return b[c]}});$WH.cO(g_spells,{ZAM_IDS:1000000,add:function(c,b){if(g_spells[c]!=null){$WH.cO(g_spells[c],b)}else{g_spells[c]=b}},getIcon:function(b){if(g_spells[b]!=null&&g_spells[b].icon){return g_spells[b].icon}else{return"inv_misc_questionmark"}},createIcon:function(g,c,b,f){return Icon.create(g_spells.getIcon(g),c,null,"/spell="+g,b,f)}});$WH.cO(g_petabilities,{add:function(c,b){if(g_petabilities[c]!=null){$WH.cO(g_petabilities[c],b)}else{g_petabilities[c]=b}},getIcon:function(b){if(g_petabilities[b]!=null&&g_petabilities[b].icon){return g_petabilities[b].icon}else{return"inv_misc_questionmark"}},createIcon:function(g,c,b,f){return Icon.create(g_petabilities.getIcon(g),c,null,"/pet-ability="+g,b,f)}});$WH.cO(g_achievements,{getIcon:function(b){if(g_achievements[b]!=null&&g_achievements[b].icon){return g_achievements[b].icon}else{return"inv_misc_questionmark"}},createIcon:function(g,c,b,f){return Icon.create(g_achievements.getIcon(g),c,null,"/achievement="+g,b,f)}});$WH.cO(g_classes,{getIcon:function(b){if(g_file_classes[b]){return"class_"+g_file_classes[b]}else{return"inv_misc_questionmark"}},createIcon:function(g,c,b,f){return Icon.create(g_classes.getIcon(g),c,null,"/class="+g,b,f)}});$WH.cO(g_races,{getIcon:function(c,b){if(b===undefined){b=0}if(g_file_races[c]&&g_file_genders[b]){return"race_"+g_file_races[c]+"_"+g_file_genders[b]}else{return"inv_misc_questionmark"}},createIcon:function(g,c,b,f){return Icon.create(g_races.getIcon(g),c,null,"/race="+g,b,f)}});$WH.cO(g_skills,{getIcon:function(b){if(g_skills[b]!=null&&g_skills[b].icon){return g_skills[b].icon}else{return"inv_misc_questionmark"}},createIcon:function(g,c,b,f){return Icon.create(g_skills.getIcon(g),c,null,"/skill="+g,b,f)}});$WH.cO(g_gatheredcurrencies,{getIcon:function(c,b){if(g_gatheredcurrencies[c]!=null&&g_gatheredcurrencies[c].icon){if($WH.isArray(g_gatheredcurrencies[c].icon)&&!isNaN(b)){return g_gatheredcurrencies[c].icon[b]}return g_gatheredcurrencies[c].icon}else{return"inv_misc_questionmark"}},createIcon:function(g,c,b,f){return Icon.create(g_gatheredcurrencies.getIcon(g,(b>0?0:1)),c,null,null,Math.abs(b),f)}});$WH.cO(g_holidays,{getIcon:function(b){if(g_holidays[b]!=null&&g_holidays[b].icon){return g_holidays[b].icon}else{return"inv_misc_questionmark"}},createIcon:function(g,c,b,f){return Icon.create(g_holidays.getIcon(g),c,null,"/event="+g,b,f)}});$WH.cO(g_missionabilities,{getIcon:function(b){if(g_missionabilities[b]!=null&&g_missionabilities[b].icon){return g_missionabilities[b].icon}else{return"inv_misc_questionmark"}},createIcon:function(h,f,b,g){var c=Icon.create(g_missionabilities.getIcon(h),f,null,"/mission-ability="+h,b,g);c.className+=" garrison-ability";return c}});$WH.getIngameLink=function(b,f,c){c=c.replace(/:+$/,"");return'/script DEFAULT_CHAT_FRAME:AddMessage("\\124c'+b+"\\124H"+f+"\\124h["+c.replace(/"/g,'\\"')+']\\124h\\124r");'};var g_artifact_knowledge_max_level=25;var g_file_races={10:"bloodelf",11:"draenei",3:"dwarf",7:"gnome",1:"human",4:"nightelf",2:"orc",6:"tauren",8:"troll",5:"scourge",9:"goblin",22:"worgen",24:"pandaren",25:"pandaren",26:"pandaren"};var g_file_classes={6:"deathknight",12:"demonhunter",11:"druid",3:"hunter",8:"mage",10:"monk",2:"paladin",5:"priest",4:"rogue",7:"shaman",9:"warlock",1:"warrior"};var g_file_genders={0:"male",1:"female"};var g_file_factions={1:"alliance",2:"horde"};var g_file_racefactions={10:2,11:1,3:1,7:1,1:1,4:1,2:2,6:2,8:2,5:2,9:2,22:1,24:3,25:1,26:2};var g_race_classes={1:[1,2,3,4,5,6,8,9,10],2:[1,3,4,6,7,8,9,10],3:[1,2,3,4,5,6,7,8,9,10],4:[1,3,4,5,6,8,10,11,12],5:[1,3,4,5,6,8,9,10],6:[1,2,3,5,6,7,10,11],7:[1,3,4,5,6,8,9,10],8:[1,3,4,5,6,7,8,9,10,11],9:[1,3,4,5,6,7,8,9],10:[1,2,3,4,5,6,8,9,10,12],11:[1,2,3,5,6,7,8,10],22:[1,3,4,5,6,8,9,11],24:[1,3,4,5,7,8,10],25:[1,3,4,5,7,8,10],26:[1,3,4,5,7,8,10]};var g_class_races={1:[1,2,3,4,5,6,7,8,9,10,11,22,24,25,26],2:[1,3,6,10,11],3:[1,2,3,4,5,6,7,8,9,10,11,22,24,25,26],4:[1,2,3,4,5,7,8,9,10,22,24,25,26],5:[1,3,4,5,6,7,8,9,10,11,22,24,25,26],6:[1,2,3,4,5,6,7,8,9,10,11,22],7:[2,3,6,8,9,11,24,25,26],8:[1,2,3,4,5,7,8,9,10,11,22,24,25,26],9:[1,2,3,5,7,8,9,10,22],10:[1,2,3,4,5,6,7,8,10,11,24,25,26],11:[4,6,8,22],12:[4,10]};var g_class_forums={6:18,12:29,11:3,3:4,8:6,10:28,2:7,5:8,4:5,7:9,9:10,1:11};var g_file_gems={1:"meta",2:"red",4:"yellow",6:"orange",8:"blue",10:"purple",12:"green",14:"prismatic",16:"hydraulic",32:"cogwheel"};var g_chr_specs_by_class={12:["577","581"],6:["250","251","252"],11:["102","103","104","105"],3:["253","254","255"],8:["62","63","64"],10:["268","270","269"],2:["65","66","70"],5:["256","257","258"],4:["259","260","261"],7:["262","263","264"],9:["265","266","267"],1:["71","72","73"]};var g_battlepet_types={1:"humanoid",2:"dragonkin",3:"flying",4:"undead",5:"critter",6:"magic",7:"elemental",8:"beast",9:"aquatic",10:"mechanical"};var g_battlepet_passives={1:238,2:245,3:239,4:242,5:236,6:243,7:241,8:237,9:240,10:244};var g_skill_recipe_subclass={171:6,164:4,185:5,333:8,202:3,129:7,356:9,773:11,755:10,165:1,186:12,197:2};var g_skill_recipe_subclass_url={171:"alchemy",164:"blacksmithing",185:"cooking",333:"enchanting",202:"engineering",129:"first-aid",356:"fishing",773:"inscription",755:"jewelcrafting",165:"leatherworking",186:"mining",197:"tailoring"};var g_world_bosses={71953:true,62346:true,60491:true,72057:true,69099:true,69161:true,71952:true,71954:true,71955:true};var g_grayedOutStats={3:[250,251,252,102,105,62,63,64,270,65,66,70,256,257,258,262,264,265,266,267,71,72,73],4:[102,103,104,105,253,254,255,62,63,64,268,270,269,65,256,257,258,259,260,261,262,263,264,265,266,267],5:[71,72,73,259,260,261,253,254,255,103,104,250,251,252,66,70,263,268,269],6:[250,251,252,102,103,104,253,254,255,62,63,64,268,269,66,70,258,259,260,261,262,263,265,266,267,71,72,73],50:[251,252,102,103,105,253,254,255,62,63,64,270,269,65,70,256,257,258,259,260,261,262,263,264,265,266,267,71,72]};var g_specDependantStats=[71,72,73,74];var g_specPrimaryStatOrders={62:[5,3,4],63:[5,3,4],64:[5,3,4],65:[5,4,3],66:[4,3,5],70:[4,3,5],71:[4,3,5],72:[4,3,5],73:[4,3,5],102:[5,3,4],103:[3,4,5],104:[3,4,5],105:[5,3,4],250:[4,3,5],251:[4,3,5],252:[4,3,5],253:[3,5,4],254:[3,5,4],255:[3,5,4],256:[5,3,4],257:[5,3,4],258:[5,3,4],259:[3,4,5],260:[3,4,5],261:[3,4,5],262:[5,3,4],263:[3,5,4],264:[5,3,4],265:[5,3,4],266:[5,3,4],267:[5,3,4],268:[3,5,4],269:[3,5,4],270:[5,3,4]};var g_spec_to_role={62:2,63:2,64:2,65:1,66:0,70:2,71:2,72:2,73:0,74:2,79:2,81:0,102:2,103:2,104:0,105:1,250:0,251:2,252:2,253:2,254:2,255:2,256:1,257:1,258:2,259:2,260:2,261:2,262:2,263:2,264:1,265:2,266:2,267:2,268:0,269:2,270:1,535:2,536:2,537:0,577:2,581:0};var g_item_slots_to_character_slots={1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,10:10,11:[11,12],12:[13,14],13:[16,17],14:17,15:16,16:15,17:16,18:null,19:19,20:5,21:16,22:17,23:17,24:null,25:null,28:null};var g_character_slots_data=[{id:1,name:"head",itemSlots:[1]},{id:2,name:"neck",itemSlots:[2],noModel:1},{id:3,name:"shoulder",itemSlots:[3]},{id:15,name:"back",itemSlots:[16]},{id:5,name:"chest",itemSlots:[5,20]},{id:4,name:"shirt",itemSlots:[4]},{id:19,name:"tabard",itemSlots:[19]},{id:9,name:"wrists",itemSlots:[9]},{id:10,name:"hands",itemSlots:[10]},{id:6,name:"waist",itemSlots:[6]},{id:7,name:"legs",itemSlots:[7]},{id:8,name:"feet",itemSlots:[8]},{id:11,name:"finger",itemSlots:[11],noModel:1,simCraftName:"finger1"},{id:12,name:"finger",itemSlots:[11],noModel:1,simCraftName:"finger2"},{id:13,name:"trinket",itemSlots:[12],noModel:1,simCraftName:"trinket1"},{id:14,name:"trinket",itemSlots:[12],noModel:1,simCraftName:"trinket2"},{id:16,name:"mainhand",itemSlots:[21,13,17,15,25,28],simCraftName:"main_hand"},{id:17,name:"offhand",itemSlots:[22,13,23,14],simCraftName:"off_hand"}];var g_classes_allowed_armor={6:[1,2,3,4,5],12:[1,2,5],11:[1,2,5],3:[1,2,3,5],8:[1,5],10:[1,2,5],2:[1,2,3,4,5,6],5:[1,5],4:[1,2,5],7:[1,2,3,5],9:[1,5],1:[1,2,3,4,5,6]};var g_classes_allowed_weapon={6:[0,1,4,5,6,7,8],12:[0,7,9,13,15],11:[4,5,6,10,13,15],3:[2,3,6,10,18],8:[7,10,15,19],10:[0,4,6,7,10,13],2:[0,1,4,5,6,7,8],5:[4,10,15,19],4:[0,2,3,4,7,13,15,18],7:[0,1,4,5,6,10,13,15],9:[7,10,15,19],1:[0,1,2,3,4,5,6,7,8,10,13,15,18]};var g_character_slots_to_item_slots={1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,10:10,11:11,12:11,13:12,14:12,15:16,16:[13,15,17,21],17:[13,14,22,23],19:19};$WH.formatVersion=function(b){b=parseInt(b);if(isNaN(b)){return""}return Math.floor(b/10000)+"."+Math.floor((b%10000)/100)+"."+(b%100)};$WH.getPatchVersion=function(b){return($WH.getPatchVersionObject(b)).version};$WH.getPatchVersionObject=function(c){if(!c){c=Date.now()}if(!$WH.getPatchVersionObject.hasOwnProperty("parsed")){$WH.getPatchVersionObject.parsed=true;var b=function(p,l){var m=l.split("|");var n={build:parseInt(p,10),timestamp:parseInt(m[0],10)*1000};if(m.length==2){n.version=m[1];n.versionnum=0;var k=m[1].split(".");for(var j=0;j<k.length;j++){n.versionnum+=Math.max(99,parseInt(k[j],10))*Math.pow(10,2*(k.length-j-1))}}else{if(m.length==3){n.versionnum=parseInt(m[1],10);n.version=m[2]}}return n};for(var h in g_wow_builds){if(!g_wow_builds.hasOwnProperty(h)){continue}g_wow_builds[h]=b(h,g_wow_builds[h])}}var g,f={build:999999,timestamp:9999999999999,version:"?????",versionnum:999999};for(var h in g_wow_builds){if(!g_wow_builds.hasOwnProperty(h)){continue}g=g_wow_builds[h];if((g.timestamp<=c)&&(f.version=="?????"||f.build<g.build)){f=g}}return f};(function(k){var r=3;var b=new Array();var l=2650;var h=k("<audio />").get(0),c=g_staticUrl+"/sfx/wsa.wav",g=1,o=0,n=3,q;function j(t,u){if(u<=0){if(t==true||t=="true"){k("#wsa-overflow").fadeOut(1000,function(){k("#wsa-overflow").remove();g=1})}else{k("#wsa-overflow").remove();g=1}clearInterval(q)}return(u-1)}function p(t,v,s){var w=new Date();w.setDate(w.getDate()+s);var u=escape(v)+((s==null)?"":"; expires="+w.toUTCString());document.cookie=t+"="+u}function m(u){var t,s,w,v=document.cookie.split(";");for(t=0;t<v.length;t++){s=v[t].substr(0,v[t].indexOf("="));w=v[t].substr(v[t].indexOf("=")+1);s=s.replace(/^\s+|\s+$/g,"");if(s==u){return unescape(w)}}}function f(){for(key in b){clearTimeout(b[key])}}k(function(){k("body").delegate(".wsa-vol","click",function(){k(this).toggleClass("alt");if(k(this).hasClass("alt")==true){k.post("/account=setsound",{muted:1})}else{k.post("/account=setsound",{muted:0})}}).delegate(".wsa-notification","mouseover mouseout",function(s){if(s.type=="mouseover"){f();k(".wsa-notification").stop();k(this).css("z-index",1500000);if(k(this).attr("data-animated")=="true"){k(".wsa-notification").fadeTo(100,1)}}else{k(this).css("z-index",999999);if(k(this).attr("data-persistent")!="true"){k(".wsa-notification").each(function(u,t){var w=k(this).attr("id");if(k(this).attr("data-animated")=="true"){b[w]=setTimeout("$('#"+w+"').fadeOut(3000,function(){ $('#"+w+"').remove(); })",1000)}else{b[w]=setTimeout("$('#"+w+"').remove()",3000)}})}}}).delegate(".wsa-notification","click",function(s){if(!(k(s.target).is("a")||k(s.target).hasClass("wsa-vol"))){k(this).remove()}})});k.fn.wsaNotification=function(s){var w={caption:"??? No name",rank:1,href:"/user#achievements",animate:true,playsfx:true,desc:"",persist:false};var s=k.extend(w,s);var A=k("body").children("#wsa-overflow").length;var u=k("body").children(".wsa-notification").length;if(u<r&&A==0){var z=new Date(),z="wsan"+z.getTime();if(u!=(o%r)){o=0}var v=!s.playsfx;var y=s.rank==0?LANG.newprivilege:$WH.sprintf(LANG.achievementunlocked_format,l_achievement_qualities[s.rank]);var t='<div class="wsa-notification" data-animated="'+s.animate+'" data-persistent="'+s.persist+'" style="bottom: '+(((o%r)*125)+15).toString()+'px" id="'+z+'"><em></em><ins></ins><span class="wsar'+s.rank+'"></span><div><var><i>'+y+'</i><a title="'+s.desc+'" href="'+s.href+'">'+LANG.viewdetails+" &rarr;</a></var>"+$WH.getImitationHeading(s.caption,2,{asString:true})+'</div><div class="wsa-vol'+(v?" alt":"")+'"></div></div>';k("body").prepend(t);if(s.playsfx==true||s.playsfx=="true"){if(!k(h).attr("src")){k(h).attr("src",c)}if(h.play){h.play()}else{k(".wsa-sound").remove();k("body").append('<embed class="wsa-sound" src="'+c+'" autostart="true" hidden="true" loop="false" />')}}if(s.animate==true||s.animate=="true"){k("#"+z+" em").css("filter","");k("#"+z+" em").fadeOut(750,function(){k("#"+z+" em").remove()});k("#"+z+" ins").delay(250).animate({marginLeft:"355px",opacity:0},750,function(){k(this).remove();if(!s.persist){b[z]=setTimeout("$('#"+z+"').fadeOut(3000,function(){ $('#"+z+"').remove(); })",l)}})}else{k("#"+z+" em").remove();k("#"+z+" ins").remove();if(!s.persist){b[z]=setTimeout("$('#"+z+"').remove()",l+1000)}}o++}else{var t='<div class="wsa-overflow" id="wsa-overflow" style="bottom: '+0+'px"><a href="/user">'+$WH.sprintf(LANG.wsamore_format,1)+"</a></div>";if(A==0){k("body").prepend(t);n=3;if(s.animate==true||s.animate=="true"){k("#wsa-overflow").slideDown()}else{k("#wsa-overflow").show()}q=setInterval(function(){n=j(s.animate,n)},1000)}else{n=3;g++;k("#wsa-overflow b").text(g)}}}})(jQuery);function AchievementCheck(){$.ajax({cache:false,url:"/ajax-achievement-check",type:"POST",success:function(data){if(data){eval("("+data+")")}}})}$(document).ready(function(){$("a.wsach").each(function(){var b=$(this).text();var n=$(this).attr("title");var g=parseInt($(this).attr("data-earned"));var f=$(this).attr("data-user");var k=$(this).parent().parent().attr("id")=="user-achievement-list";var l=$(this).attr("data-progress");var o=$(this).attr("data-quality");var j=$(this).attr("data-count");$(this).attr("title","");var m=$("<div>");m.append('<table><tr><td style="padding-bottom: 0.35em"><b class="q" data-quality="'+o+'"></b></td></tr><tr><td><span></span></td></tr></table>');m.find("b").text(b);m.find("span").text(n);if(g){var h=null;var c=(new Date()).getTime()/1000;if(f){if(g>31*24*60*60){m.append('<span class="q0"><br />'+$WH.sprintf(j>1?LANG.earnedwsafirsttime4_format:LANG.earnedwsatime4_format,f,$WH.formatDateSimple(new Date((c-g)*1000)))+"</span>")}else{m.append('<span class="q0"><br />'+$WH.sprintf(j>1?LANG.earnedwsafirsttime2_format:LANG.earnedwsatime2_format,f,$WH.formatTimeElapsed(g))+"</span>")}}else{if(!k){if(g>31*24*60*60){m.append('<span class="q0"><br />'+$WH.sprintf(j>1?LANG.earnedwsafirsttime3_format:LANG.earnedwsatime3_format,$WH.formatDateSimple(new Date((c-g)*1000)))+"</span>")}else{m.append('<span class="q0"><br />'+$WH.sprintf(j>1?LANG.earnedwsafirsttime_format:LANG.earnedwsatime_format,$WH.formatTimeElapsed(g))+"</span>")}}}if(h){m.append('<span class="q0"><br />'+h+"</span>")}}else{if(!k&&l){m.append('<span class="q0"><br /><small></small>'+LANG.progress+": "+l+"</td></tr>")}}if(Platform.isTouch()){$(this).click(function(){$WH.Tooltip.show(this,m.html(),0,0);return false})}else{$(this).mouseover(function(p){$WH.Tooltip.showAtCursor(p,m.html(),0,0)}).mousemove(function(p){$WH.Tooltip.cursorUpdate(p)}).mouseout(function(){$WH.Tooltip.hide()})}})});(function(){var k="//";var c=location.pathname+location.search+location.hash;var g=Locale.getId();var f=[];var j=null;$.each(Locale.getAllByName(),function(l,n){var m={type:"link",innerHTML:n.description,href:k+n.domain+c};if(n.id==g){m.checked=true;j=n}f.push(m)});var b=function(n,l,m){return m};var h=function(n,l,m){return !m};ZUL.setOptions({site:"wowhead",bodyIsRelative:false,mobileLoadCheck:function(){return Platform.isTouch()},mobileBackText:LANG.back_verb,mobileIconSpacing:true,states:{loggedOut:{pre:[{type:"custom",custom:function(o,m,n){var l=$WH.ce("span");l.id=l.className="zul-bar-"+(n?"mobile":"user")+"-item-loginwith";l.innerHTML=LANG.zul_loginwith;$WH.ae(o,l)},condition:h},{type:"link",name:"battlenet",innerHTML:"Battle.net",href:$WH.getRelativeHostPrefix(true)+"/account=battlenet?r=1",className:function(o,m,n,l){return n?"blizzard-blue":"btn btn-site"},click:function(){$WH.visitUrlWithPostData($WH.getRelativeHostPrefix(true)+"/account=battlenet",{r:1});return false},condition:h},{type:"link",name:"zam",innerHTML:"<span>ZAM</span>",href:"#login",className:function(o,m,n,l){return n?"zam-silver":"btn btn-site"},click:function(){LoginDialog.show();return false},condition:h},{type:"custom",custom:function(q,n,p){q.style.paddingLeft="32px";var m=$WH.ce("span");m.id=m.className="zul-bar-mobile-loginwithcolon";m.innerHTML=LANG.zul_loginwith;$WH.ae(q,m);m=$WH.ce("span");m.id=m.className="zul-bar-mobile-logincolon";m.innerHTML=LANG.zul_login+LANG.colon;$WH.ae(q,m);var o=$WH.ce("a",{id:"zul-bar-mobile-battlenet",className:"zul-bar-mobile-item-battlenet btn btn-site",innerHTML:"Battle.net",href:$WH.getRelativeHostPrefix(true)+"/account=battlenet"});$WH.aE(o,"tap",function(){$WH.visitUrlWithPostData($WH.getRelativeHostPrefix(true)+"/account=battlenet",{r:1});return false});$WH.ae(q,o);var l=$WH.ce("a",{id:"zul-bar-mobile-zam",className:"zul-bar-mobile-item-zam btn btn-site",innerHTML:"<span>ZAM</span>",href:"#login"});$WH.aE(l,"tap",function(){ZUL.closeMobileMenu();LoginDialog.show();return false});$WH.ae(q,l)},condition:b},{type:"link",name:"register",innerHTML:LANG.zul_register,href:$WH.getRelativeHostPrefix(true)+"/account=signup"},{type:"link",name:"get-premium",innerHTML:LANG.zul_premium,href:"/premium",fontIcon:"star"}]},loggedIn:{pre:[{type:"link",name:"favorites",innerHTML:LANG.favorites,href:"javascript:;",className:"hassubmenu",menu:{mobile:function(){return Menu.prepareForZul(Favorites.getMenu())}},condition:function(n,l,m){return !m||Favorites.hasFavorites()}},{type:"custom",custom:function(q,n,p){if(!n.user.battlenetAvatar){return}var l="/user="+n.user.name;if(n.user.favoriteList){var o=li_getCurrentUserList(n.user.favoriteList);if(o){l=li_generateListUrl(o)}else{l="/list="+n.user.favoriteList}}var m=Icon.create(n.user.battlenetAvatar,1,null,l);m.id="zul-bar-"+(p?"mobile":"user")+"-item-avatar";m.className+=" "+m.id;$WH.ae(q,m)},condition:h},{type:"link",name:"user",innerHTML:function(n,l,m){if(m){return l.user.name+" <small>("+$WH.numberFormat(l.user.reputation)+" "+LANG.reputation+")</small>"}else{return l.user.name}},href:function(n,l,m){return m?null:"/user=%NAME%"},mobileMenuText:"%NAME%",menu:{mobile:Menu.prepareForZul(PageTemplate.getUserMenu())}},{type:"custom",custom:function(p,n,o){var m=$WH.ce("span");m.id=m.className="zul-bar-"+(o?"mobile":"user")+"-item-reputation";m.title=LANG.reputationtip;$WH.ae(m,$WH.ct("("));var l=$WH.ce("a");l.href="/reputation";l.innerHTML=$WH.numberFormat(n.user.reputation);$WH.ae(m,l);$WH.ae(m,$WH.ct(")"));$WH.ae(p,m)},condition:h},{type:"link",name:"characters",innerHTML:LANG.li_myprofiles,menu:{mobile:Menu.prepareForZul(PageTemplate.getListsSubmenu())},condition:b},{type:"link",name:"upgrade",innerHTML:LANG.zul_upgrade,href:"/premium",fontIcon:"arrow-up",condition:function(n,l,m){return !l.user.premium}}]},universal:{pre:[{type:"link",name:"mobileheader",href:"/",heading:true,condition:b},{type:"concatenation",content:function(n,l,m){return b(n,l,m)?Menu.prepareForZul(mn_featuredContent,b):[]},condition:function(n,l,m){return m}},{type:"link",text:LANG.zul_nav,heading:true,condition:function(n,l,m){return m}},{type:"concatenation",content:function(n,l,m){return b(n,l,m)?Menu.prepareForZul(Menu.getMenu(),b):[]},condition:b},{type:"link",text:"",heading:true,condition:b}],content:[{type:"link",name:"feedback",innerHTML:LANG.zul_feedback,href:"javascript:;",fontIcon:"envelope",click:function(){ZUL.closeMobileMenu();ContactTool.show()}},{type:"link",name:"locale",innerHTML:j?j.description:LANG.zul_language,href:"javascript:;",mobileMenuText:LANG.zul_language,menu:{mobile:f}},{type:"link",name:"subsite",innerHTML:function(o,m,n){var l=LANG.zul_live;if($WH.isPtr()){l=LANG.zul_ptr}else{if($WH.isBeta()){l=LANG.zul_beta}}return $WH.sprintf(LANG.zul_viewingdata,"<b>"+l+"</b>")},condition:function(n,l,m){return m&&($WH.ptrIsActive()||$WH.betaIsActive())},mobileMenuText:LANG.zul_changedataview,menu:{mobile:[{type:"link",innerHTML:$WH.sprintf(LANG.zul_data,LANG.zul_live),href:window.location.protocol+"//www.wowhead.com"+window.location.pathname+(window.location.hash?"#"+window.location.hash:""),checked:function(n,l,m){return !$WH.isPtr()&&!$WH.isBeta()}},{type:"link",innerHTML:$WH.sprintf(LANG.zul_data,LANG.zul_ptr),href:window.location.protocol+"//ptr.wowhead.com"+window.location.pathname+(window.location.hash?"#"+window.location.hash:""),checked:function(n,l,m){return $WH.isPtr()},condition:function(n,l,m){return $WH.ptrIsActive()}},{type:"link",innerHTML:$WH.sprintf(LANG.zul_data,LANG.zul_beta),href:window.location.protocol+"//beta.wowhead.com"+window.location.pathname+(window.location.hash?"#"+window.location.hash:""),checked:function(n,l,m){return $WH.isBeta()},condition:function(n,l,m){return $WH.betaIsActive()}}]}}],post:[{type:"link",name:"choose-platform",text:LANG.platform_change,menu:{mobile:Menu.prepareForZul(mn_footer_platform)},condition:b},{type:"sites",text:LANG.zul_zamsites}],mobileBarContent:[{type:"form",name:"search",action:"/search",method:"get",fields:[{type:"text",name:"q",label:LANG.zul_searchdb,value:function(){var l=function(){var m=$(".header-search form input");if(!m.length){setTimeout(l,5);return}$("#zul-bar-form-q").val(m.val()||"")};l();setTimeout(function(){LiveSearch.attach($("#zul-bar-form-search-q"))},0);return""},focus:function(){document.body.scrollTop=0;document.body.scrollLeft=0;var l=$WH.ge("zul-bar");l.style.position="absolute";setTimeout(function(){document.body.scrollTop=0;document.body.scrollLeft=0;var m=document.createElement("div");m.className="zul-bar-fade zul-bar-fade-body-only";m.onclick=function(){this.parentNode.removeChild(this)};$("#zul-bar").append(m)},5)},blur:function(){$(".zul-bar-fade.zul-bar-fade-body-only").remove();var l=$WH.ge("zul-bar");l.style.position="fixed"}}]}]}},onCreateBar:function(){PageTemplate.initUserMenus()},onShowMobileBarStart:function(){Menu.hide()}})})();