function $(c){if(arguments.length>1){var b=[];var a;for(var d=0,a=arguments.length;d<a;++d){b.push($(arguments[d]))}return b}if(typeof c=="string"){c=ge(c)}return c}function $E(a){if(!a){if(typeof event!="undefined"){a=event}else{return null}}if(a.which){a._button=a.which}else{a._button=a.button;if(Browser.ie){if(a._button&4){a._button=2}else{if(a._button&2){a._button=3}}}else{a._button=a.button+1}}a._target=a.target?a.target:a.srcElement;a._wheelDelta=a.wheelDelta?a.wheelDelta:-a.detail;return a}function $A(c){var e=[];for(var d=0,b=c.length;d<b;++d){e.push(c[d])}return e}Function.prototype.bind=function(){var c=this,a=$A(arguments),b=a.shift();return function(){return c.apply(b,a.concat($A(arguments)))}};if(!String.prototype.ltrim){String.prototype.ltrim=function(){return this.replace(/^\s*/,"")}}if(!String.prototype.rtrim){String.prototype.rtrim=function(){return this.replace(/\s*$/,"")}}if(!String.prototype.trim){String.prototype.trim=function(){return this.ltrim().rtrim()}}if(!String.prototype.removeAllWhitespace){String.prototype.removeAllWhitespace=function(){return this.replace("/s+/g","")}}function strcmp(d,c){if(d==c){return 0}if(d==null){return -1}if(c==null){return 1}var f=parseFloat(d),e=parseFloat(c);if(!isNaN(f)&&!isNaN(e)&&f!=e){return f<e?-1:1}return d<c?-1:1}function trim(a){return a.replace(/(^\s*|\s*$)/g,"")}function rtrim(c,d){var b=c.length;while(--b>0&&c.charAt(b)==d){}c=c.substring(0,b+1);if(c==d){c=""}return c}function sprintf(b){var a;for(a=1,len=arguments.length;a<len;++a){b=b.replace("$"+a,arguments[a])}return b}function sprintfa(b){var a;for(a=1,len=arguments.length;a<len;++a){b=b.replace(new RegExp("\\$"+a,"g"),arguments[a])}return b}function sprintfo(c){if(typeof c=="object"&&c.length){var a=c;c=a[0];var b;for(b=1;b<a.length;++b){c=c.replace("$"+b,a[b])}return c}}function str_replace(e,d,c){while(e.indexOf(d)!=-1){e=e.replace(d,c)}return e}function urlencode(a){a=encodeURIComponent(a);a=str_replace(a,"+","%2B");return a}function urlencode2(a){a=encodeURIComponent(a);a=str_replace(a,"%20","+");return a}function number_format(a){x=(""+parseFloat(a)).split(".");a=x[0];x=x.length>1?"."+x[1]:"";if(a.length<=3){return a+x}return number_format(a.substr(0,a.length-3))+","+a.substr(a.length-3)+x}function is_array(b){return !!(b&&b.constructor==Array)}function in_array(c,g,h,e){if(c==null){return -1}if(h){return in_arrayf(c,g,h,e)}for(var d=e||0,b=c.length;d<b;++d){if(c[d]==g){return d}}return -1}function in_arrayf(c,g,h,e){for(var d=e||0,b=c.length;d<b;++d){if(h(c[d])==g){return d}}return -1}function isset(a){return typeof window[a]!="undefined"}function array_walk(d,h,c){var g;for(var e=0,b=d.length;e<b;++e){g=h(d[e],c,d,e);if(g!=null){d[e]=g}}}function array_apply(d,h,c){var g;for(var e=0,b=d.length;e<b;++e){h(d[e],c,d,e)}}function ge(a){return document.getElementById(a)}function gE(a,b){return a.getElementsByTagName(b)}function ce(d,b,e){var a=document.createElement(d);if(b){cOr(a,b)}if(e){ae(a,e)}return a}function de(a){a.parentNode.removeChild(a)}function ae(a,b){if(is_array(b)){array_apply(b,a.appendChild.bind(a));return b}else{return a.appendChild(b)}}function aef(a,b){return a.insertBefore(b,a.firstChild)}function ee(a,b){if(!b){b=0}while(a.childNodes[b]){a.removeChild(a.childNodes[b])}}function ct(a){return document.createTextNode(a)}function st(a,b){if(a.firstChild&&a.firstChild.nodeType==3){a.firstChild.nodeValue=b}else{aef(a,ct(b))}}function nw(a){a.style.whiteSpace="nowrap"}function rf(){return false}function rf2(a){a=$E(a);if(a.ctrlKey||a.shiftKey||a.altKey||a.metaKey){return}return false}function tb(){this.blur()}function ac(c,d){var a=0,g=0,b;while(c){a+=c.offsetLeft;g+=c.offsetTop;b=c.parentNode;while(b&&b!=c.offsetParent&&b.offsetParent){if(b.scrollLeft||b.scrollTop){a-=(b.scrollLeft|0);g-=(b.scrollTop|0);break}b=b.parentNode}c=c.offsetParent}if(Lightbox.isVisible()){d=true}if(d&&!Browser.ie6){var f=g_getScroll();a+=f.x;g+=f.y}var e=[a,g];e.x=a;e.y=g;return e}function aE(b,c,a){if(Browser.ie){b.attachEvent("on"+c,a)}else{b.addEventListener(c,a,false)}}function dE(b,c,a){if(Browser.ie){b.detachEvent("on"+c,a)}else{b.removeEventListener(c,a,false)}}function sp(a){if(!a){a=event}if(Browser.ie){a.cancelBubble=true}else{a.stopPropagation()}}function sc(h,i,d,f,g){var e=new Date();var c=h+"="+escape(d)+"; ";e.setDate(e.getDate()+i);c+="expires="+e.toUTCString()+"; ";if(f){c+="path="+f+"; "}if(g){c+="domain="+g+"; "}document.cookie=c;gc.C[h]=d}function dc(a){sc(a,-1);gc.C[a]=null}function gc(f){if(gc.I==null){var e=unescape(document.cookie).split("; ");gc.C={};for(var c=0,a=e.length;c<a;++c){var g=e[c].indexOf("="),b,d;if(g!=-1){b=e[c].substr(0,g);d=e[c].substr(g+1)}else{b=e[c];d=""}gc.C[b]=d}gc.I=1}if(!f){return gc.C}else{return gc.C[f]}}function ns(a){if(Browser.ie){a.onfocus=tb;a.onmousedown=a.onselectstart=a.ondragstart=rf}}function eO(b){for(var a in b){delete b[a]}}function cO(f,c,b){for(var e in c){if(b&&typeof c[e]=="object"&&c[e].length){f[e]=c[e].slice(0)}else{f[e]=c[e]}}}function cOr(f,c,b){for(var e in c){if(typeof c[e]=="object"){if(b&&c[e].length){f[e]=c[e].slice(0)}else{if(!f[e]){f[e]={}}cOr(f[e],c[e],b)}}else{f[e]=c[e]}}}var Browser={ie:!!(window.attachEvent&&!window.opera),opera:!!window.opera,safari:navigator.userAgent.indexOf("Safari")!=-1,gecko:navigator.userAgent.indexOf("Gecko")!=-1&&navigator.userAgent.indexOf("KHTML")==-1,chrome:navigator.userAgent.indexOf("Chrome")!=-1};Browser.ie8=Browser.ie&&navigator.userAgent.indexOf("MSIE 8.0")!=-1;Browser.ie7=Browser.ie&&navigator.userAgent.indexOf("MSIE 7.0")!=-1&&!Browser.ie8;Browser.ie6=Browser.ie&&navigator.userAgent.indexOf("MSIE 6.0")!=-1&&!Browser.ie7;Browser.ie67=Browser.ie6||Browser.ie7;navigator.userAgent.match(/Gecko\/([0-9]+)/);Browser.geckoVersion=parseInt(RegExp.$1)|0;var OS={windows:navigator.appVersion.indexOf("Windows")!=-1,mac:navigator.appVersion.indexOf("Macintosh")!=-1,linux:navigator.appVersion.indexOf("Linux")!=-1};var DomContentLoaded=new function(){var b=[];var a=[];this.now=function(){array_apply(b,function(c){c()})};this.delayed=function(){array_apply(a,function(c){c()});DomContentLoaded=null};this.addEvent=function(c){b.push(c)};this.addDelayedEvent=function(c){a.push(c)}};function g_getWindowSize(){var a=0,b=0;if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){a=document.documentElement.clientWidth;b=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){a=document.body.clientWidth;b=document.body.clientHeight}else{if(typeof window.innerWidth=="number"){a=window.innerWidth;b=window.innerHeight}}}return{w:a,h:b}}function g_getScroll(){var a=0,b=0;if(typeof(window.pageYOffset)=="number"){a=window.pageXOffset;b=window.pageYOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){a=document.body.scrollLeft;b=document.body.scrollTop}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){a=document.documentElement.scrollLeft;b=document.documentElement.scrollTop}}}return{x:a,y:b}}function g_getCursorPos(c){var a,d;if(window.innerHeight){a=c.pageX;d=c.pageY}else{var b=g_getScroll();a=c.clientX+b.x;d=c.clientY+b.y}return{x:a,y:d}}function g_scrollTo(c,b){var l,k=g_getWindowSize(),m=g_getScroll(),i=k.w,e=k.h,g=m.x,d=m.y;c=$(c);if(b==null){b=[]}else{if(typeof b=="number"){b=[b]}}l=b.length;if(l==0){b[0]=b[1]=b[2]=b[3]=0}else{if(l==1){b[1]=b[2]=b[3]=b[0]}else{if(l==2){b[2]=b[0];b[3]=b[1]}else{if(l==3){b[3]=b[1]}}}}l=ac(c);var a=l[0]-b[3],h=l[1]-b[0],j=l[0]+c.offsetWidth+b[1],f=l[1]+c.offsetHeight+b[2];if(j-a>i||a<g){g=a}else{if(j-i>g){g=j-i}}if(f-h>e||h<d){d=h}else{if(f-e>d){d=f-e}}scrollTo(g,d)}function g_addCss(b){var c=ce("style");c.type="text/css";if(c.styleSheet){c.styleSheet.cssText=b}else{ae(c,ct(b))}var a=document.getElementsByTagName("head")[0];ae(a,c)}function g_setTextNodes(c,b){if(c.nodeType==3){c.nodeValue=b}else{for(var a=0;a<c.childNodes.length;++a){g_setTextNodes(c.childNodes[a],b)}}}function g_setInnerHtml(d,c,a){if(d.nodeName.toLowerCase()==a){d.innerHTML=c}else{for(var b=0;b<d.childNodes.length;++b){g_setInnerHtml(d.childNodes[b],c,a)}}}function g_getTextContent(c){var a="";for(var b=0;b<c.childNodes.length;++b){if(c.childNodes[b].nodeValue){a+=c.childNodes[b].nodeValue}else{if(c.childNodes[b].nodeName=="BR"){if(Browser.ie){a+="\r"}else{a+="\n"}}}a+=g_getTextContent(c.childNodes[b])}return a}function g_setSelectedLink(c,b){if(!g_setSelectedLink.groups){g_setSelectedLink.groups={}}var a=g_setSelectedLink.groups;if(a[b]){a[b].className=a[b].className.replace("selected","")}c.className+=" selected";a[b]=c}function g_toggleDisplay(a){if(a.style.display=="none"){a.style.display="";return true}else{a.style.display="none";return false}}function g_enableScroll(a){if(!a){aE(document,"mousewheel",g_enableScroll.F);aE(window,"DOMMouseScroll",g_enableScroll.F)}else{dE(document,"mousewheel",g_enableScroll.F);dE(window,"DOMMouseScroll",g_enableScroll.F)}}g_enableScroll.F=function(a){if(a.stopPropagation){a.stopPropagation()}if(a.preventDefault){a.preventDefault()}a.returnValue=false;a.cancelBubble=true;return false};function g_getGets(){if(g_getGets.C!=null){return g_getGets.C}var e={};if(location.search){var f=decodeURIComponent(location.search.substr(1)).split("&");for(var c=0,a=f.length;c<a;++c){var g=f[c].indexOf("="),b,d;if(g!=-1){b=f[c].substr(0,g);d=f[c].substr(g+1)}else{b=f[c];d=""}e[b]=d}}g_getGets.C=e;return e}function g_createRect(d,c,a,b){return{l:d,t:c,r:d+a,b:c+b}}function g_intersectRect(d,c){return !(d.l>=c.r||c.l>=d.r||d.t>=c.b||c.t>=d.b)}function g_createRange(c,a){range={};for(var b=c;b<=a;++b){range[b]=b}return range}function g_sortIdArray(a,b,c){a.sort(c?function(e,d){return strcmp(b[e][c],b[d][c])}:function(e,d){return strcmp(b[e],b[d])})}function g_sortJsonArray(e,d,f,a){var c=[];for(var b in e){if(d[b]&&(a==null||a(d[b]))){c.push(b)}}if(f!=null){c.sort(f)}else{g_sortIdArray(c,d)}return c}function g_urlize(a,b){a=str_replace(a,"'","");a=trim(a);if(b){a=str_replace(a," ","-")}else{a=a.replace(/[^a-z0-9]/ig,"-")}a=str_replace(a,"--","-");a=str_replace(a,"--","-");a=rtrim(a,"-");a=a.toLowerCase();return a}function g_getLocale(a){if(a&&g_locale.id==25){return 0}return g_locale.id}function g_createReverseLookupJson(b){var c={};for(var a in b){c[b[a]]=a}return c}function g_isUsernameValid(a){return(a.match(/[^a-z0-9]/i)==null&&a.length>=4&&a.length<=16)}function g_createHeader(c){var k=ce("dl"),o=(c==5);for(var j=0,l=mn_path.length;j<l;++j){var f=ce("dt");var p=ce("a");var m=ce("ins");var g=ce("big");var e=ce("span");var n=mn_path[j][0];var h=(n==c);var d=(!h&&mn_path[j][3]);if(o&&n==5){d=true;mn_path[j][3]=mn_profiles}if(d){p.menu=mn_path[j][3];p.onmouseover=Menu.show;p.onmouseout=Menu.hide}else{p.onmouseover=Menu._hide}if(mn_path[j][2]){p.href=mn_path[j][2]}else{p.href="javascript:;";ns(p);p.style.cursor="default"}if(h){p.className="selected"}ae(g,ct(mn_path[j][1].charAt(0)));ae(m,g);ae(m,ct(mn_path[j][1].substr(1)));ae(p,m);ae(p,e);ae(f,p);ae(k,f)}ae(ge("ptewhjkst46"),k);var b=ge("kbl34h6b43");if(c!=null&&c>=0&&c<mn_path.length){c=parseInt(c);switch(c){case 0:Menu.addButtons(b,Menu.explode(mn_database));break;case 1:Menu.addButtons(b,mn_tools);break;case 2:Menu.addButtons(b,Menu.explode(mn_more));break;case 3:Menu.addButtons(b,Menu.explode(mn_forums));break;case 5:pr_initTopBarSearch();break}}else{ae(b,ct(String.fromCharCode(160)))}}function g_updateHeader(a){ee(ge("ptewhjkst46"));ee(ge("kbl34h6b43"));g_createHeader(a)}function g_initHeader(a){g_createHeader(a);var d=ge("oh2345v5ks");var b=d.previousSibling;var c=d.parentNode;ns(b);b.onclick=function(){this.parentNode.onsubmit()};if(Browser.ie){setTimeout(function(){d.value=""},1)}if(d.value==""){d.className="search-database"}d.onmouseover=function(){if(trim(this.value)!=""){this.className=""}};d.onfocus=function(){this.className=""};d.onblur=function(){if(trim(this.value)==""){this.className="search-database";this.value=""}};c.onsubmit=function(){var e=this.elements[0].value;if(trim(e)==""){return false}this.submit()}}function g_initHeaderMenus(){var c=ge("toptabs-menu-user");if(c){c.menu=[[0,LANG.userpage,"/?user="+g_user.name],[0,LANG.settings,"/?account"],[0,LANG.signout,"/?account=signout"]];if(location.href.match(new RegExp("/?user="+g_user.name+"$","i"))){c.menu[0].checked=1}else{if(location.href.indexOf("/?account")!=-1){c.menu[1].checked=1}}c.onmouseover=Menu.show;c.onmouseout=Menu.hide;c.href="/?user="+g_user.name}c=ge("toptabs-menu-profiles");if(c){c.menu=[];if(g_user.characters){c.menu.push([,LANG.tab_characters]);for(var f=0,b=g_user.characters.length;f<b;++f){var h=g_user.characters[f],e=[0,h.name+" ("+h.realmname+LANG.hyphen+h.region.toUpperCase()+")","/?profile="+h.region+"."+h.realm+"."+g_cleanCharacterName(h.name)];e.smallIcon=h.icon?h.icon:"chr_"+g_file_races[h.race]+"_"+g_file_genders[h.gender]+"_"+g_file_classes[h.classs]+"0"+(h.level>59?(Math.floor((h.level-60)/10)+2):1);c.menu.push(e)}}c.menu.push([,LANG.tab_profiles]);if(g_user.profiles){for(var f=0,b=g_user.profiles.length;f<b;++f){var h=g_user.profiles[f],e=[0,h.name,"/?profile="+h.id];e.smallIcon=h.icon?h.icon:"chr_"+g_file_races[h.race]+"_"+g_file_genders[h.gender]+"_"+g_file_classes[h.classs]+"0"+(h.level>59?(Math.floor((h.level-60)/10)+2):1);c.menu.push(e)}}var e=[0,"("+LANG.button_new+")","/?profile&new"];e.smallIcon="inv_misc_questionmark";c.menu.push(e);c.menu.rightAligned=1;c.onmouseover=Menu.show;c.onmouseout=Menu.hide;c.href="/?user="+g_user.name+(g_user.profiles?"#profiles":(g_user.characters?"#characters":""))}c=ge("toptabs-menu-language");if(c){var g="www",d=location.href,j=location.hostname.indexOf(".");if(j!=-1&&j<=5){g=location.hostname.substr(0,j)}j=d.indexOf("#");if(j!=-1){d=d.substr(0,j)}c.menu=[[0,"Deutsch",(g_locale.id!=3?d.replace(g,"de"):null)],[0,"English",(g_locale.id!=0?d.replace(g,"www"):null)],[0,"Espa"+String.fromCharCode(241)+"ol",(g_locale.id!=6?d.replace(g,"es"):null)],[0,"Fran"+String.fromCharCode(231)+"ais",(g_locale.id!=2?d.replace(g,"fr"):null)],[0,String.fromCharCode(1056,1091,1089,1089,1082,1080,1081),(g_locale.id!=7?d.replace(g,"ru"):null)]];c.menu.rightAligned=1;if(g_locale.id!=25){c.menu[{0:1,2:3,3:0,6:2,7:4}[g_locale.id]].checked=1}c.onmouseover=Menu.show;c.onmouseout=Menu.hide}}function g_initPath(p,f){var h=mn_path,c=null,k=null,o=0,l=ge("main-precontents"),n=ce("div");ee(l);if(g_initPath.lastIt){g_initPath.lastIt.checked=null}n.className="path";if(f!=null){var m=ce("div");m.className="path-right";var q=ce("a");q.href="javascript:;";q.id="fi_toggle";ns(q);q.onclick=fi_toggle;if(f){q.className="disclosure-on";ae(q,ct(LANG.fihide))}else{q.className="disclosure-off";ae(q,ct(LANG.fishow))}ae(m,q);ae(l,m)}for(var g=0;g<p.length;++g){var q,b,r=0;for(var e=0;e<h.length;++e){if(h[e][0]==p[g]){r=1;h=h[e];h.checked=1;break}}if(!r){o=1;break}q=ce("a");b=ce("span");if(h[2]){q.href=h[2]}else{q.href="javascript:;";ns(q);q.style.textDecoration="none";q.style.color="white";q.style.cursor="default"}if(g<p.length-1&&h[3]){b.className="menuarrow"}ae(q,ct(h[4]==null?h[1]:h[4]));if(g==0){q.menu=mn_path}else{q.menu=c[3]}q.onmouseover=Menu.show;q.onmouseout=Menu.hide;ae(b,q);ae(n,b);k=b;c=h;h=h[3];if(!h){o=1;break}}if(o&&k){k.className=""}else{if(c&&c[3]){k.className="menuarrow";q=ce("a");b=ce("span");q.href="javascript:;";ns(q);q.style.textDecoration="none";q.style.paddingRight="16px";q.style.color="white";q.style.cursor="default";ae(q,ct("..."));q.menu=c[3];q.onmouseover=Menu.show;q.onmouseout=Menu.hide;ae(b,q);ae(n,b)}}var m=ce("div");m.className="clear";ae(n,m);ae(l,n);g_initPath.lastIt=c}function g_formatTimeElapsed(e){function c(m,l,i){if(i&&LANG.timeunitsab[l]==""){i=0}if(i){return m+" "+LANG.timeunitsab[l]}else{return m+" "+(m==1?LANG.timeunitssg[l]:LANG.timeunitspl[l])}}var g=[31557600,2629800,604800,86400,3600,60,1];var a=[1,3,3,-1,5,-1,-1];e=Math.max(e,1);for(var f=3,h=g.length;f<h;++f){if(e>=g[f]){var d=f;var k=Math.floor(e/g[d]);if(a[d]!=-1){var b=a[d];e%=g[d];var j=Math.floor(e/g[b]);if(j>0){return c(k,d,1)+" "+c(j,b,1)}}return c(k,d,0)}}return"(n/a)"}function g_formatDateSimple(g,c){function a(b){return(b<10?"0"+b:b)}var i="",j=g.getDate(),f=g.getMonth()+1,h=g.getFullYear();i+=sprintf(LANG.date_simple,a(j),a(f),h);if(c==1){var k=g.getHours()+1,e=g.getMinutes()+1;i+=LANG.date_at+a(k)+":"+a(e)}return i}function g_cleanCharacterName(e){var d="";for(var c=0,a=e.length;c<a;++c){var b=e.charAt(c).toLowerCase();if(b>="a"&&b<="z"){d+=b}else{d+=e.charAt(c)}}return d}function g_createGlow(a,h){var e=ce("span");for(var c=-1;c<=1;++c){for(var b=-1;b<=1;++b){var g=ce("div");g.style.position="absolute";g.style.whiteSpace="nowrap";g.style.left=c+"px";g.style.top=b+"px";if(c==0&&b==0){g.style.zIndex=4}else{g.style.color="black";g.style.zIndex=2}g.innerHTML=a;ae(e,g)}}e.style.position="relative";e.className="glow"+(h!=null?" "+h:"");var f=ce("span");f.style.visibility="hidden";ae(f,ct(a));ae(e,f);return e}function g_createProgressBar(c){if(c==null){c={}}if(!c.text){c.text=" "}if(c.color==null){c.color="rep0"}if(c.width==null){c.width=100}var d,e;if(c.hoverText){d=ce("a");d.href="javascript:;"}else{d=ce("span")}d.className="progressbar";if(c.text||c.hoverText){e=ce("div");e.className="progressbar-text";if(c.text){var a=ce("del");ae(a,ct(c.text));ae(e,a)}if(c.hoverText){var b=ce("ins");ae(b,ct(c.hoverText));ae(e,b)}ae(d,e)}e=ce("div");e.className="progressbar-"+c.color;e.style.width=c.width+"%";ae(e,ct(String.fromCharCode(160)));ae(d,e);return d}function g_createReputationBar(g){var f=g_createReputationBar.P;if(!g){g=0}g+=42000;if(g<0){g=0}else{if(g>84999){g=84999}}var e=g,h,b=0;for(var d=0,a=f.length;d<a;++d){if(f[d]>e){break}if(d<a-1){e-=f[d];b=d+1}}h=f[b];var c={text:g_reputation_standings[b],hoverText:e+" / "+h,color:"rep"+b,width:parseInt(e/h*100)};return g_createProgressBar(c)}g_createReputationBar.P=[36000,3000,3000,3000,6000,12000,21000,999];function g_createAchievementBar(a,c){if(!a){a=0}var b={text:a+(c>0?" / "+c:""),color:(c>700?"rep7":"ach"+(c>0?0:1)),width:(c>0?parseInt(a/c*100):100)};return g_createProgressBar(b)}function g_createCaptcha(c){var b=ce("a");b.href="javascript:;";b.className="captcha";b.title=LANG.tooltip_captcha;if(c&1){b.style.marginLeft=b.style.marginRight="auto"}if(Browser.ie6){var d=ce("img");d.src="/?captcha&foo="+Math.random();ae(b,d);b.onclick=function(){de(this.firstChild);var a=ce("img");a.src="/?captcha&foo="+Math.random();ae(b,a);this.blur()}}else{b.style.backgroundImage="url(/?captcha&foo="+Math.random()+")";b.onclick=function(){this.style.backgroundImage="url(/?captcha&foo="+Math.random()+")"}}return b}function g_revealCaptcha(a){if((g_user.permissions&1)==0){var c=ge("klrbetkjerbt46");if(!c.firstChild){var b=g_createCaptcha(a);ae(c,b);c.parentNode.style.display=""}}}function g_convertRatingToPercent(g,b,f,d){var e={12:1.5,13:12,14:15,15:5,16:10,17:10,18:8,19:14,20:14,21:14,22:10,23:10,24:0,25:0,26:0,27:0,28:10,29:10,30:10,31:10,32:14,33:0,34:0,35:25,36:10,37:2.5,44:3.756097412109376};if(g<0){g=1}else{if(g>80){g=80}}if((b==14||b==12||b==15)&&g<34){g=34}if((b==28||b==36)&&(d==2||d==6||d==7||d==11)){e[b]/=1.3}if(f<0){f=0}var a;if(e[b]==null){a=0}else{var c;if(g>70){c=(82/52)*Math.pow((131/63),((g-70)/10))}else{if(g>60){c=(82/(262-3*g))}else{if(g>10){c=((g-8)/52)}else{c=2/52}}}a=f/e[b]/c}return a}function g_setRatingLevel(f,e,b,c){var d=prompt(sprintf(LANG.prompt_ratinglevel,1,80),e);if(d!=null){d|=0;if(d!=e&&d>=1&&d<=80){e=d;var a=g_convertRatingToPercent(e,b,c);a=(Math.round(a*100)/100);if(b!=12&&b!=37){a+="%"}f.innerHTML=sprintf(LANG.tooltip_combatrating,a,e);f.onclick=g_setRatingLevel.bind(0,f,e,b,c)}}}function g_convertScalingFactor(c,b,h,e,k){var d={1:"health",2:"mana",3:"agi",4:"str",5:"int",6:"spi",7:"sta",12:"defrtng",13:"dodgertng",14:"parryrtng",15:"blockrtng",16:"mlehitrtng",17:"rgdhitrtng",18:"splhitrtng",19:"mlecritstrkrtng",20:"rgdcritstrkrtng",21:"splcritstrkrtng",22:"_mlehitrtng",23:"_rgdhitrtng",24:"_splhitrtng",25:"_mlecritstrkrtng",26:"_rgdcritstrkrtng",27:"_splcritstrkrtng",28:"mlehastertng",29:"rgdhastertng",30:"splhastertng",31:"hitrtng",32:"critstrkrtng",33:"_hitrtng",34:"_critstrkrtng",35:"resirtng",36:"hastertng",37:"exprtng",38:"atkpwr",43:"manargn",44:"armorpenrtng",45:"splpwr"};var g={1:[2,2,1,1,10,32,32,64,6,8,6,8,6,8,1,3,0,7,13,43,43,85],2:[3,3,1,1,12,35,35,70,6,9,6,9,7,9,2,3,0,8,16,47,47,93],3:[3,3,1,1,13,39,39,76,7,9,7,9,7,10,3,4,0,9,17,52,52,101],4:[3,3,1,1,14,42,42,83,7,10,7,10,8,11,3,4,0,9,19,56,56,111],5:[4,4,2,2,16,45,45,89,8,10,8,10,8,12,4,5,0,11,21,60,60,119],6:[4,4,2,2,17,48,48,95,8,11,8,11,9,12,5,5,0,11,23,64,64,127],7:[4,4,3,2,19,51,51,101,9,11,9,11,9,13,6,6,0,13,25,68,68,135],8:[5,5,3,2,20,54,54,107,9,12,9,12,9,14,7,7,0,13,27,72,72,143],9:[5,5,3,2,22,56,56,113,10,13,10,13,10,15,7,7,0,15,29,75,75,151],10:[6,6,3,2,23,57,57,119,10,13,10,13,10,16,8,8,0,15,31,76,76,159],11:[6,6,4,3,24,59,59,125,11,14,11,14,11,16,9,8,0,16,32,79,79,167],12:[7,7,4,3,25,60,60,131,11,15,11,15,12,17,10,9,0,17,33,80,80,175],13:[7,7,4,3,26,61,61,133,12,16,12,16,12,18,10,9,0,17,35,81,81,177],14:[8,8,4,3,27,63,63,136,12,16,12,16,13,19,11,10,0,18,36,84,84,181],15:[8,8,5,3,28,64,64,138,13,17,13,17,13,20,12,11,0,19,37,85,85,184],16:[8,8,5,4,29,65,65,141,14,18,14,18,14,21,13,11,0,19,39,87,87,188],17:[9,9,5,4,30,67,67,143,14,19,14,19,14,22,14,12,0,20,40,89,89,191],18:[9,9,5,4,30,68,68,146,15,19,15,19,15,23,14,12,0,20,40,91,91,195],19:[10,10,6,4,31,69,69,148,15,20,15,20,15,24,15,13,0,21,41,92,92,197],20:[10,10,6,4,32,71,71,151,16,21,16,21,16,25,16,14,0,21,43,95,95,201],21:[11,11,6,5,33,72,72,153,16,21,16,21,16,26,17,14,0,22,44,96,96,204],22:[11,11,6,5,34,73,73,156,17,22,17,22,17,27,18,15,0,23,45,97,97,208],23:[12,12,7,5,34,75,75,158,17,23,17,23,17,28,18,15,0,23,45,100,100,211],24:[12,12,7,5,35,76,76,161,18,23,18,23,18,29,19,16,0,23,47,101,101,215],25:[12,12,7,5,35,77,77,163,19,24,19,24,19,29,20,17,0,23,47,103,103,217],26:[13,13,7,5,36,78,78,166,19,25,19,25,19,30,21,17,0,24,48,104,104,221],27:[13,13,8,6,37,80,80,168,20,26,20,26,20,31,22,18,0,25,49,107,107,224],28:[14,14,8,6,37,81,81,171,21,27,21,27,21,32,22,18,0,25,49,108,108,228],29:[14,14,8,6,38,82,82,173,22,29,22,29,22,32,23,19,0,25,51,109,109,231],30:[15,15,8,6,38,84,84,176,23,30,23,30,22,33,24,20,0,25,51,112,112,235],31:[15,15,9,6,39,85,85,178,24,31,24,31,23,34,25,20,0,26,52,113,113,237],32:[16,16,9,7,40,86,86,181,25,32,25,32,24,34,25,21,0,27,53,115,115,241],33:[16,16,9,7,41,88,88,184,25,33,25,33,25,35,26,21,0,27,55,117,117,245],34:[16,16,9,7,43,90,90,187,26,34,26,34,26,36,27,22,0,29,57,120,120,249],35:[17,17,10,7,44,91,91,190,27,35,27,35,26,37,28,23,0,29,59,121,121,253],36:[17,17,10,7,44,93,93,193,28,36,28,36,27,38,29,23,0,29,59,124,124,257],37:[18,18,10,8,46,95,95,196,28,37,28,37,28,39,29,24,0,31,61,127,127,261],38:[18,18,10,8,47,97,97,199,29,38,29,38,28,40,30,24,0,31,63,129,129,265],39:[19,19,11,8,48,99,99,202,29,38,29,38,29,41,31,25,0,32,64,132,132,269],40:[19,19,11,8,49,100,205,360,30,39,30,39,30,42,32,26,0,33,65,133,273,480],41:[20,20,11,8,50,102,209,368,31,40,31,40,30,43,33,26,0,33,67,136,279,491],42:[20,20,11,8,51,104,213,375,31,41,31,41,31,44,33,27,0,34,68,139,284,500],43:[20,20,12,9,52,106,217,382,32,41,32,41,31,45,34,27,0,35,69,141,289,509],44:[21,21,12,9,53,108,221,389,32,42,32,42,32,47,35,28,0,35,71,144,295,519],45:[21,21,12,9,54,109,225,396,33,43,33,43,33,48,36,28,0,36,72,145,300,528],46:[22,22,12,9,55,111,229,403,34,44,34,44,33,50,37,29,0,37,73,148,305,537],47:[22,22,13,9,56,113,233,410,34,45,34,45,34,51,37,30,0,37,75,151,311,547],48:[23,23,13,10,57,115,238,418,35,45,35,45,34,52,38,30,0,38,76,153,317,557],49:[23,23,13,10,58,117,242,425,35,46,35,46,35,53,39,31,0,39,77,156,323,567],50:[24,24,13,10,59,118,246,433,36,47,36,47,36,54,40,31,0,39,79,157,328,577],51:[24,24,14,10,60,120,250,440,37,48,37,48,36,54,40,32,0,40,80,160,333,587],52:[24,24,14,10,61,122,254,448,37,49,37,49,37,55,41,33,0,41,81,163,339,597],53:[25,25,14,11,62,124,258,455,38,49,38,49,38,57,42,33,0,41,83,165,344,607],54:[25,25,14,11,63,126,262,463,38,50,38,50,38,58,43,34,0,42,84,168,349,617],55:[26,26,15,11,64,127,266,470,39,51,39,51,39,59,44,34,0,43,85,169,355,627],56:[26,26,15,11,65,129,270,478,40,52,40,52,39,61,44,35,0,43,87,172,360,637],57:[27,27,15,11,66,131,274,485,40,53,40,53,40,62,45,36,0,44,88,175,365,647],58:[34,34,19,14,83,159,344,611,50,65,46,60,48,85,46,46,0,55,111,212,459,815],59:[36,36,20,15,86,164,356,633,51,67,47,61,50,88,52,47,0,57,115,219,475,844],60:[37,37,21,16,88,169,368,655,53,68,47,62,51,91,57,49,0,59,117,225,491,873],61:[39,39,22,16,91,174,380,677,54,70,48,63,52,94,63,51,0,61,121,232,507,903],62:[40,40,22,17,94,178,392,699,55,72,49,64,53,97,68,53,0,63,125,237,523,932],63:[41,41,23,17,97,183,404,721,56,73,50,65,54,100,73,54,0,65,129,244,539,961],64:[42,42,24,18,100,187,416,742,58,75,50,66,55,104,80,55,0,67,133,249,555,989],65:[43,43,24,18,102,192,428,764,60,78,52,67,57,109,89,57,0,68,136,256,571,1019],66:[44,44,25,18,105,197,440,786,62,81,53,69,59,113,98,58,0,70,140,263,587,1048],67:[45,45,25,19,108,203,452,808,65,84,54,71,61,117,107,59,0,72,144,271,603,1077],68:[62,62,36,26,157,294,654,1169,91,119,70,91,82,168,220,84,0,105,209,392,872,1559],69:[64,64,37,27,161,303,675,1206,93,121,71,92,84,172,228,87,0,107,215,404,900,1608],70:[67,67,39,28,166,312,695,1242,95,124,72,94,86,175,238,90,0,111,221,416,927,1656],71:[69,69,40,29,171,321,715,1278,97,127,73,95,88,179,246,93,0,114,228,428,953,1704],72:[72,72,42,30,176,331,736,1315,99,129,75,97,90,183,255,97,0,117,235,441,981,1753],73:[75,75,43,32,181,340,756,1351,102,132,76,99,92,187,265,101,0,121,241,453,1008,1801],74:[78,78,45,33,186,349,776,1387,104,135,77,100,94,191,275,104,0,124,248,465,1035,1849],75:[81,81,46,34,191,358,797,1423,106,138,79,102,96,196,285,108,0,127,255,477,1063,1897],76:[84,84,48,35,196,367,817,1460,109,141,80,104,98,200,296,113,0,131,261,489,1089,1947],77:[87,87,50,37,200,376,837,1496,111,145,81,106,101,205,307,117,0,133,267,501,1116,1995],78:[90,90,52,38,205,386,858,1532,114,148,83,108,103,210,319,121,0,137,273,515,1144,2043],79:[94,94,54,40,208,390,868,1551,117,152,85,110,105,215,331,126,0,139,277,520,1157,2068],80:[97,97,56,41,210,395,878,1570,120,156,86,112,108,220,343,131,0,140,280,527,1171,2093]};var f={1:[4,7,32,-1,-1,-1,-1,-1,-1,-1,5259,7888,5259,0,0,0,0,0,0,0,80],2:[38,3,31,-1,-1,-1,-1,-1,-1,-1,14532,4106,3193,0,0,0,0,0,0,0,80],3:[38,7,32,-1,-1,-1,-1,-1,-1,-1,5068,5065,6666,0,0,0,0,0,0,0,80],4:[38,32,31,-1,-1,-1,-1,-1,-1,-1,13332,4767,3900,0,0,0,0,0,0,0,80],5:[7,5,32,-1,-1,-1,-1,-1,-1,-1,7150,5850,4766,0,0,0,0,0,0,0,80],6:[7,5,43,-1,-1,-1,-1,-1,-1,-1,5067,7601,1350,0,0,0,0,0,0,0,80],7:[4,7,32,-1,-1,-1,-1,-1,-1,-1,6666,6666,4445,0,0,0,0,0,0,0,80],8:[38,3,7,5,-1,-1,-1,-1,-1,-1,10518,5258,5641,3076,0,0,0,0,0,0,80],9:[45,7,5,43,-1,-1,-1,-1,-1,-1,5201,6666,4444,1778,0,0,0,0,0,0,80],10:[38,31,7,-1,-1,-1,-1,-1,-1,-1,14532,4106,4789,0,0,0,0,0,0,0,80],11:[45,7,5,6,-1,-1,-1,-1,-1,-1,6153,3996,3997,5258,0,0,0,0,0,0,80],12:[0,5,0,0,0,0,0,0,0,0,5000,5000,0,0,0,0,0,0,0,0,10],13:[42,0,0,0,0,0,0,0,0,0,10000,0,0,0,0,0,0,0,0,0,10],14:[38,39,40,41,42,43,0,0,0,0,6500,6500,10000,10000,10000,10000,0,0,0,0,15],15:[40,41,42,0,0,0,0,0,0,0,4200,5200,6200,0,0,0,0,0,0,0,10],16:[45,7,5,6,-1,-1,-1,-1,-1,-1,6153,3996,3997,5258,0,0,0,0,0,0,80],21:[12,13,14,15,16,0,0,0,0,0,5000,6000,7000,8000,9000,0,0,0,0,0,10],41:[3,4,5,6,7,12,13,14,15,16,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10],42:[17,18,19,20,21,22,23,24,25,26,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10],43:[27,28,29,30,31,32,33,34,35,36,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10],102:[44,0,0,0,0,0,0,0,0,0,10000,0,0,0,0,0,0,0,0,0,15],103:[3,-1,-1,-1,-1,-1,-1,-1,-1,-1,10000,0,0,0,0,0,0,0,0,0,0],104:[32,-1,-1,-1,-1,-1,-1,-1,-1,-1,10000,0,0,0,0,0,0,0,0,0,80],105:[13,-1,-1,-1,-1,-1,-1,-1,-1,-1,10000,0,0,0,0,0,0,0,0,0,0],221:[4,7,32,36,-1,-1,-1,-1,-1,-1,4844,7266,4106,3193,0,0,0,0,0,0,80],222:[3,44,7,-1,-1,-1,-1,-1,-1,-1,5259,3506,5259,0,0,0,0,0,0,0,80],223:[7,5,32,-1,-1,-1,-1,-1,-1,-1,4859,5732,2519,0,0,0,0,0,0,0,80],224:[38,3,31,7,-1,-1,-1,-1,-1,-1,9688,4844,3193,6159,0,0,0,0,0,0,80],241:[45,0,0,0,0,0,0,0,0,0,10000,0,0,0,0,0,0,0,0,0,80],251:[36,-1,-1,-1,-1,-1,-1,-1,-1,-1,6666,0,0,0,0,0,0,0,0,0,80],271:[45,-1,-1,-1,-1,-1,-1,-1,-1,-1,7800,0,0,0,0,0,0,0,0,0,80],291:[38,-1,-1,-1,-1,-1,-1,-1,-1,-1,23252,0,0,0,0,0,0,0,0,0,0],292:[38,7,35,-1,-1,-1,-1,-1,-1,-1,10518,7888,5258,0,0,0,0,0,0,0,80],293:[4,7,35,-1,-1,-1,-1,-1,-1,-1,7266,4789,4106,0,0,0,0,0,0,0,80],294:[38,32,35,-1,-1,-1,-1,-1,-1,-1,8212,7266,3193,0,0,0,0,0,0,0,80],295:[7,35,43,-1,-1,-1,-1,-1,-1,-1,6666,6666,1777,0,0,0,0,0,0,0,80],296:[7,31,35,-1,-1,-1,-1,-1,-1,-1,7888,5259,5258,0,0,0,0,0,0,0,80],297:[35,-1,-1,-1,-1,-1,-1,-1,-1,-1,5259,0,0,0,0,0,0,0,0,0,80],298:[35,-1,-1,-1,-1,-1,-1,-1,-1,-1,6667,0,0,0,0,0,0,0,0,0,80],299:[35,-1,-1,-1,-1,-1,-1,-1,-1,-1,6667,0,0,0,0,0,0,0,0,0,80],300:[4,7,35,-1,-1,-1,-1,-1,-1,-1,5259,7888,5258,0,0,0,0,0,0,0,80],301:[45,7,43,35,-1,-1,-1,-1,-1,-1,5200,6666,1776,4444,0,0,0,0,0,0,80],302:[38,3,7,35,-1,-1,-1,-1,-1,-1,8888,4444,6668,4444,0,0,0,0,0,0,80],303:[45,7,5,35,-1,-1,-1,-1,-1,-1,6153,5259,3506,5258,0,0,0,0,0,0,80],304:[38,3,7,35,-1,-1,-1,-1,-1,-1,8888,3899,6666,4767,0,0,0,0,0,0,80],305:[45,7,6,35,-1,-1,-1,-1,-1,-1,6153,5259,3506,5258,0,0,0,0,0,0,80],306:[45,7,32,35,-1,-1,-1,-1,-1,-1,6153,5259,3506,5258,0,0,0,0,0,0,80],311:[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0],331:[38,3,7,5,-1,-1,-1,-1,-1,-1,10518,5258,5259,3506,0,0,0,0,0,0,80],332:[45,7,5,43,-1,-1,-1,-1,-1,-1,6153,3997,3997,2629,0,0,0,0,0,0,80],333:[4,7,32,-1,-1,-1,-1,-1,-1,-1,5996,5996,5258,0,0,0,0,0,0,0,80],334:[45,7,5,6,-1,-1,-1,-1,-1,-1,6153,3997,3997,5259,0,0,0,0,0,0,80],335:[38,7,31,-1,-1,-1,-1,-1,-1,-1,10518,7888,5259,0,0,0,0,0,0,0,80],336:[45,7,5,6,-1,-1,-1,-1,-1,-1,6153,3997,3997,5259,0,0,0,0,0,0,80],351:[3,38,7,32,-1,-1,-1,-1,-1,-1,5259,7012,7889,3506,0,0,0,0,0,0,80],352:[3,44,7,38,-1,-1,-1,-1,-1,-1,5259,3506,7889,7012,0,0,0,0,0,0,80]};var j={},i=g[c],a=f[h];if(!a||!(e>=0&&e<=9)){j.v=i[b]}else{j.n=d[a[e]];j.s=a[e];j.v=Math.floor(i[b]*(a[e+10]/10000))}return(k?j:j.v)}function g_setHeirloomLevel(D,h,a,v){var s;if(v){var w=prompt(sprintf(LANG.prompt_ratinglevel,1,80),a);if(w!=null){w|=0;if(w!=a&&w>=1&&w<=80){a=w;s=ge(v);if(!s||!s.innerHTML){return}h=s.innerHTML}}}if(a<1||a>80){return}if(D){if(!D.scadist||!D.scaflags){return}var b=-1,u=-1,r=-1,f=-1,o=98229,y=4063472,t=16128,E=16384,k=5120;for(var z=0;z<22;++z){var A=1<<z;if(A&D.scaflags){if(A&o&&b<0){b=z}else{if(A&y&&u<0){u=z}else{if(A&t&&r<0){r=z}else{if(A&E&&f<0){f=z}}}}}}if(b>=0){for(var z=0;z<10;++z){var g=g_convertScalingFactor(a,b,D.scadist,z,1);if(g.n){D[g.n]=g.v}}}if(u>=0){D.armor=g_convertScalingFactor(a,u)}if(r>=0){var C=(D.scaflags&k?0.2:0.3),q=(D.mledps?"mle":"rgd");D.dps=D[q+"dps"]=g_convertScalingFactor(a,r);D.dmgmin=D[q+"dmgmin"]=Math.floor(D.dps*(D.speed/1000)*(1-C));D.dmgmax=D[q+"dmgmax"]=Math.floor(D.dps*(D.speed/1000)*(1+C))}if(f>=0){D.splpwr=g_convertScalingFactor(a,f)}if(D.gearscore!=null){if(D._gearscore==null){D._gearscore=D.gearscore}var m=Math.min(80,a+1);if(m>=70){w=((m-70)*9.5)+105}else{if(m>=60){w=((m-60)*4.5)+60}else{w=m+5}}D.gearscore=(D._gearscore*w)/1.8}}if(!h){return}h=str_replace(h,"\n","");h=str_replace(h,'<span style="display: none;">',"");h=str_replace(h,"</span><!--br-->","<br />");var j,e=new RegExp("(>(.+?))<!--h[0-9]+:([0-9:]+)-->[0-9]+((.+?)<br(.*?)>)","g");while(j=e.exec(h)){var B=j[1],l=j[4],d=j[3].split(":"),g=g_convertScalingFactor(a,parseInt(d[0]),parseInt(d[1]),parseInt(d[2]),1);if(!g.v){B='><span style="display: none;"'+B;l=j[5]+"</span><!--br-->"}h=h.replace(j[0],B+"<!--h"+a+":"+d.join(":")+"-->"+g.v+l);if(g.s){var p=g_convertRatingToPercent(a,g.s,g.v);p=(Math.round(p*100)/100);if(g.s!=12&&g.s!=37){p+="%"}h=h.replace(new RegExp("<!--r([0-9]+):"+g.s+":([0-9]+)-->"),"<!--r"+a+":"+g.s+":"+g.v+"-->");h=h.replace(new RegExp("g_setRatingLevel\\(this,[0-9]+,"+g.s+",[0-9]+\\)(.+?)>(.+?)</a>"),"g_setRatingLevel(this,"+a+","+g.s+","+g.v+")$1>"+sprintf(LANG.tooltip_combatrating,p,a)+"</a>")}}if(j=h.match(new RegExp("<!--ha[0-9]+:([0-9]+)-->([a-zA-Z]+)"))){var c;switch(parseInt(j[1])){case 4:case 18:c=1;break;case 5:case 19:c=2;break;case 6:case 20:c=(a<40?2:3);break;case 7:case 21:c=(a<40?3:4);break}if(g_itemset_types[c]){h=str_replace(h,j[0],"<!--ha"+a+":"+j[1]+"-->"+g_itemset_types[c])}}h=h.replace(new RegExp("g_setHeirloomLevel\\(null,null,[0-9]+,'([a-zA-Z0-9]+)'\\)(.+?)>([0-9]+)</a>"),"g_setHeirloomLevel(null,null,"+a+",'$1')$2>"+a+"</a>");if(s){s.innerHTML=h}return h}function g_getMoneyHtml(c){var b=0,a="";if(c>=10000){b=1;a+='<span class="moneygold">'+Math.floor(c/10000)+"</span>";c%=10000}if(c>=100){if(b){a+=" "}else{b=1}a+='<span class="moneysilver">'+Math.floor(c/100)+"</span>";c%=100}if(c>=1){if(b){a+=" "}else{b=1}a+='<span class="moneycopper">'+c+"</span>"}return a}function g_getMoneyHtml2(f,c,b,a){var e=g_getMoneyHtml(f);if(c!==undefined&&c!==null&&c!=0){if(e.length>0){e+=" "}e+='<span class="money'+(c<0?"horde":"alliance")+' tip" onmouseover="Listview.funcBox.moneyHonorOver(event)" onmousemove="Tooltip.cursorUpdate(event)" onmouseout="Tooltip.hide()">'+g_numberFormat(Math.abs(c))+"</span>"}if(b!==undefined&&b!==null&&b>0){if(e.length>0){e+=" "}e+='<span class="moneyarena tip" onmouseover="Listview.funcBox.moneyArenaOver(event)" onmousemove="Tooltip.cursorUpdate(event)" onmouseout="Tooltip.hide()">'+g_numberFormat(b)+"</span>"}if(a!==undefined&&a!==null&&a.length>0){for(var d=0;d<a.length;++d){if(e.length>0){e+=" "}var h=a[d][0];var g=a[d][1];e+='<a href="/?item='+h+'" class="moneyitem" style="background-image: url(http://static.wowhead.com/images/icons/tiny/'+(g_items[h]["icon"]?g_items[h]["icon"]:"inv_misc_questionmark").toLowerCase()+'.gif)">'+g+"</a>"}}return e}function g_numberFormat(f,b,l,h){var c=f,a=b;var e=function(r,q){var i=Math.pow(10,q);return(Math.round(r*i)/i).toString()};c=!isFinite(+c)?0:+c;a=!isFinite(+a)?0:Math.abs(a);var p=(typeof h==="undefined")?",":h;var d=(typeof l==="undefined")?".":l;var o=(a>0)?e(c,a):e(Math.round(c),a);var m=e(Math.abs(c),a);var k,g;if(m>=1000){k=m.split(/\D/);g=k[0].length%3||3;k[0]=o.slice(0,g+(c<0))+k[0].slice(g).replace(/(\d{3})/g,p+"$1");o=k.join(d)}else{o=o.replace(".",d)}var j=o.indexOf(d);if(a>=1&&j!==-1&&(o.length-j-1)<a){o+=new Array(a-(o.length-j-1)).join(0)+"0"}else{if(a>=1&&j===-1){o+=d+new Array(a).join(0)+"0"}}return o}function g_getPatchVersionIndex(e){var d=g_getPatchVersion;var b=0,c=d.T.length-2,a;while(c>b){a=Math.floor((c+b)/2);if(e>=d.T[a]&&e<d.T[a+1]){return a}if(e>=d.T[a]){b=a+1}else{c=a-1}}a=Math.ceil((c+b)/2);return a}function g_getPatchVersion(b){var a=g_getPatchVersionIndex(b);return g_getPatchVersion.V[a]}g_getPatchVersion.V=["1.12.0","1.12.1","1.12.2","2.0.1","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8","2.0.10","2.0.12","2.1.0","2.1.1","2.1.2","2.1.3","2.2.0","2.2.2","2.2.3","2.3.0","2.3.2","2.3.3","2.4.0","2.4.1","2.4.2","2.4.3","3.0.2","3.0.3","3.0.8","3.0.9","3.1.0","3.1.1","3.1.2","3.1.3","3.2.0","3.2.2","???"];g_getPatchVersion.T=[1153540800000,1159243200000,1160712000000,1165294800000,1168318800000,1168578000000,1168750800000,1169528400000,1171342800000,1171602000000,1173157200000,1175572800000,1179806400000,1181016000000,1182225600000,1184040000000,1190692800000,1191297600000,1191902400000,1194930000000,1199768400000,1200978000000,1206417600000,1207022400000,1210651200000,1216094400000,1223956800000,1225774800000,1232427600000,1234242000000,1239681600000,1240286400000,1242705600000,1243915200000,1249358400000,1253595600000,9999999999999];function g_expandSite(){ge("wrapper").className="nosidebar";Ads.removeAll();var a=ge("topbar-expand");if(a){de(a)}a=ge("sidebar");if(a){de(a)}}function g_insertTag(d,a,i,j){var b=$(d);b.focus();if(b.selectionStart!=null){var l=b.selectionStart,h=b.selectionEnd,k=b.scrollLeft,c=b.scrollTop;var g=b.value.substring(l,h);if(typeof j=="function"){g=j(g)}b.value=b.value.substr(0,l)+a+g+i+b.value.substr(h);b.selectionStart=b.selectionEnd=h+a.length;b.scrollLeft=k;b.scrollTop=c}else{if(document.selection&&document.selection.createRange){var f=document.selection.createRange();if(f.parentElement()!=b){return}var g=f.text;if(typeof j=="function"){g=j(g)}f.text=a+g+i}}if(b.onkeyup){b.onkeyup()}}function g_getLocaleFromDomain(a){var c=g_getLocaleFromDomain.L;if(a){var b=a.indexOf(".");if(b!=-1){a=a.substring(0,b)}}return(c[a]?c[a]:0)}g_getLocaleFromDomain.L={fr:2,de:3,es:6,ru:7,ptr:25};function g_getDomainFromLocale(a){var b;if(g_getDomainFromLocale.L){b=g_getDomainFromLocale.L}else{b=g_getDomainFromLocale.L=g_createReverseLookupJson(g_getLocaleFromDomain.L)}return(b[a]?b[a]:"www")}function g_getIdFromTypeName(a){var b=g_getIdFromTypeName.L;return(b[a]?b[a]:-1)}g_getIdFromTypeName.L={npc:1,object:2,item:3,itemset:4,quest:5,spell:6,zone:7,faction:8,pet:9,achievement:10,title:11,profile:100};function g_getIngameLink(a,c,b){prompt(LANG.prompt_ingamelink,'/script DEFAULT_CHAT_FRAME:AddMessage("\\124c'+a+"\\124H"+c+"\\124h["+b+']\\124h\\124r");')}function g_isEmailValid(a){return a.match(/^([a-z0-9._-]+)(\+[a-z0-9._-]+)?(@[a-z0-9.-]+\.[a-z]{2,4})$/i)!=null}function g_onAfterTyping(a,d,c){var e;var b=function(){if(e){clearTimeout(e);e=null}e=setTimeout(d,c)};a.onkeyup=b}function g_onClick(c,d){var b=0;function a(e){if(b){if(b!=e){return}}else{b=e}d(true)}c.oncontextmenu=function(){a(1);return false};c.onmouseup=function(f){f=$E(f);if(f._button==3||f.shiftKey||f.ctrlKey){a(2)}else{if(f._button==1){d(false)}}return false}}function g_isLeftClick(a){a=$E(a);return(a&&a._button==1)}function g_createOrRegex(c){var e=c.split(" "),d="";for(var b=0,a=e.length;b<a;++b){if(b>0){d+="|"}d+=e[b]}return new RegExp("("+d+")","gi")}function g_addPages(l,b){function o(q,d){var i;if(q==b.page){i=ce("span");i.className="selected"}else{i=ce("a");i.href=(q>1?b.url+b.sep+q+b.pound:b.url+b.pound)}ae(i,ct(d!=null?d:q));return i}if(!b.pound){b.pound=""}if(!b.sep){b.sep="."}if(b.allOrNothing&&b.nPages<=1){return}var c=(b.align&&b.align=="left");var e=ce("div"),k,p=ce("var");e.className="pages";if(c){e.className+=" pages-left"}if(b.nPages>1){k=ce("div");k.className="pages-numbers";var n=Math.max(2,b.page-3);var h=Math.min(b.nPages-1,b.page+3);var m=[];if(b.page!=b.nPages){m.push(o(b.page+1,LANG.lvpage_next+String.fromCharCode(8250)))}m.push(o(b.nPages));if(h<b.nPages-1){var a=ce("span");ae(a,ct("..."));m.push(a)}for(var g=h;g>=n;--g){m.push(o(g))}if(n>2){var a=ce("span");ae(a,ct("..."));m.push(a)}m.push(o(1));if(b.page!=1){m.push(o(b.page-1,String.fromCharCode(8249)+LANG.lvpage_previous))}if(c){m.reverse()}for(var g=0,j=m.length;g<j;++g){ae(k,m[g])}k.firstChild.style.marginRight="0";k.lastChild.style.marginLeft="0"}var p=ce("var");ae(p,ct(sprintf(LANG[b.wording[b.nItems==1?0:1]],b.nItems)));if(b.nPages>1){var a=ce("span");ae(a,ct(String.fromCharCode(8211)));ae(p,a);var f=ce("a");f.className="gotopage";f.href="javascript:;";ns(f);if(Browser.ie){ae(f,ct(" "))}f.onclick=function(){var d=prompt(sprintf(LANG.prompt_gotopage,1,b.nPages),b.page);if(d!=null){d|=0;if(d!=b.page&&d>=1&&d<=b.nPages){document.location.href=(d>1?b.url+b.sep+d+b.pound:b.url+b.pound)}}};f.onmouseover=function(d){Tooltip.showAtCursor(d,LANG.tooltip_gotopage,0,0,"q")};f.onmousemove=Tooltip.cursorUpdate;f.onmouseout=Tooltip.hide;ae(p,f)}if(c){ae(e,p);if(k){ae(e,k)}}else{if(k){ae(e,k)}ae(e,p)}ae(l,e)}function g_disclose(a,b){b.className="disclosure-"+(g_toggleDisplay(a)?"on":"off");return false}function co_addYourComment(){tabsContribute.focus(0);var a=gE(document.forms.addcomment,"textarea")[0];a.focus()}function co_cancelReply(){ge("gjkdlfgkjh436").style.display="none";document.forms.addcomment.elements.replyto.value=""}function co_validateForm(b){var a=gE(b,"textarea")[0];if(Listview.funcBox.coValidate(a)){if(g_user.permissions&1){return true}if(b.elements.captcha.value.length==5){return true}else{alert(LANG.message_codenotentered);b.elements.captcha.focus()}}return false}function ss_submitAScreenshot(){tabsContribute.focus(1)}function ss_validateForm(a){if(!a.elements.screenshotfile.value.length){alert(LANG.message_noscreenshot);return false}return true}function ss_appendSticky(){var m=ge("infobox-sticky");var i=g_pageInfo.type;var h=g_pageInfo.typeId;var k=in_array(lv_screenshots,1,function(a){return a.sticky});if(k!=-1){var c=lv_screenshots[k];var l=ce("a");l.href="#screenshots:id="+c.id;l.onclick=function(a){ScreenshotViewer.show({screenshots:lv_screenshots,pos:k});return rf2(a)};var f=ce("img"),e=Math.min(150/c.width,150/c.height);f.src="http://static.wowhead.com/uploads/screenshots/thumb/"+c.id+".jpg";f.className="border";ae(l,f);ae(m,l);var g=ce("div");var n=ce("small");l=ce("a");if(g_user.id>0){l.href="javascript:;";l.onclick=ss_submitAScreenshot}else{l.href="/?account=signin"}ae(l,ct(LANG.infobox_submitone));ae(n,l);ae(n,ct(" "+String.fromCharCode(160)));var j=ce("b");ae(j,ct("|"));ae(n,j);ae(n,ct(String.fromCharCode(160)+" "));l=ce("a");l.href="javascript:;";l.onclick=function(){tabsRelated.focus(-1);return false};ae(l,ct(sprintf(LANG.infobox_showall,lv_screenshots.length)));ae(n,l);ae(g,n);ae(m,g)}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=sprintf(LANG.infobox_noneyet,l+LANG.infobox_submitone+"</a>")}}var suDialog;function su_addToSaved(c,d,a,e){if(!c||!Dialog){return}if(!Dialog.templates.docompare){Dialog.templates.docompare={title:LANG.dialog_compare,width:400,height:138,buttons:["okay","cancel"],fields:[{id:"selecteditems",type:"caption",compute:function(h,g,f,i){i.innerHTML=sprintf((g==1?LANG.dialog_selecteditem:LANG.dialog_selecteditems),g)}},{id:"action",type:"radio",label:"",value:3,submitOnDblClick:1,options:{1:LANG.dialog_nosaveandview,2:LANG.dialog_saveandview,3:LANG.dialog_saveforlater}}]}}if(!suDialog){suDialog=new Dialog()}var b=function(h){var g=gc("compare_groups"),f="/?compare";if(h.action>1){if(g){c=g+";"+c}sc("compare_groups",20,c,"/",".wowhead.com");if(e){sc("compare_level",20,e,"/",".wowhead.com")}}else{f+="="+c+(e?"&l="+e:"")}if(h.action<3){if(a){window.open(f)}else{location.href=f}}};suDialog.show("docompare",{data:{selecteditems:d,action:1},onSubmit:b})}function Ajax(b,c){if(!b){return}var a;try{a=new XMLHttpRequest()}catch(d){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){if(window.createRequest){a=window.createRequest()}else{alert(LANG.message_ajaxnotsupported);return}}}}this.request=a;cO(this,c);this.method=this.method||(this.params&&"POST")||"GET";a.open(this.method,b,this.async==null?true:this.async);a.onreadystatechange=Ajax.onReadyStateChange.bind(this);if(this.method.toUpperCase()=="POST"){a.setRequestHeader("Content-Type",(this.contentType||"application/x-www-form-urlencoded")+"; charset="+(this.encoding||"UTF-8"))}a.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)}}};function g_ajaxIshRequest(b){var c=document.getElementsByTagName("head")[0],a=g_getGets();if(a.refresh!=null){b+="&refresh"}ae(c,ce("script",{type:"text/javascript",src:b}))}var Menu={iframes:[],divs:[],selection:[],show:function(){try{clearTimeout(Menu.timer);if(Menu.currentLink){Menu._show(this)}else{if(this.className.indexOf("open")==-1){this.className+=" open"}Menu.timer=setTimeout(Menu._show.bind(0,this),100)}}catch(a){}},_show:function(b){if(Menu.currentLink!=b){var a=ac(b);Menu._hide();Menu.selection=[-1];Menu.currentLink=b;Menu.showDepth(0,b.menu,a[0],a[1]+b.offsetHeight+1,b.offsetHeight+8,b.offsetWidth,a[1],false);if(b.className.indexOf("open")==-1){b.className+=" open"}}else{Menu.truncate(0);Menu.clean(0)}},showAtCursor:function(b,a,d){clearTimeout(Menu.timer);Menu._hide();Menu.selection=[-1];Menu.currentLink=null;if(!(a&&d)){b=$E(b);var c=g_getCursorPos(b);a=c.x;d=c.y}if(Browser.ie6){a-=2;d-=2}Menu.showDepth(0,this.menu,a,d,0,0,0,true)},hide:function(){try{clearTimeout(Menu.timer);if(Menu.currentLink){Menu.timer=setTimeout(Menu._hide,333)}else{this.className=this.className.replace("open","")}}catch(a){}},_hide:function(){for(var b=0,a=Menu.selection.length;b<a;++b){Menu.divs[b].style.display="none";Menu.divs[b].style.visibility="hidden";if(Browser.ie6){Menu.iframes[b].style.display="none"}}Menu.selection=[];if(Menu.currentLink){Menu.currentLink.className=Menu.currentLink.className.replace("open","")}Menu.currentLink=null},sepOver:function(){var b=this.d;var a=b.i;Menu.truncate(a);Menu.clean(a);Menu.selection[a]=-1},elemOver:function(){var g=this.d;var f=g.i;var e=this.i;var a=this.k;var b=this.firstChild.className=="menusub";Menu.truncate(f+b);if(b&&a!=Menu.selection[f]){var h=ac(this);Menu.selection[f+1]=-1;Menu.showDepth(f+1,g.menuArray[e][3],h[0],h[1]-2,this.offsetHeight,this.offsetWidth-3,0,false)}Menu.clean(f);Menu.selection[f]=a;if(this.className.length){this.className+=" open"}else{this.className="open"}},elemClick:function(a){Menu._hide();a()},getIframe:function(a){var b;if(Menu.iframes[a]==null){b=ce("iframe");b.src="javascript:0;";b.frameBorder=0;ae(ge("layers"),b);Menu.iframes[a]=b}else{b=Menu.iframes[a]}return b},getDiv:function(a,b){var c;if(Menu.divs[a]==null){c=ce("div");c.className="menu";ae(ge("layers"),c);Menu.divs[a]=c}else{c=Menu.divs[a]}c.i=a;c.menuArray=b;return c},showDepth:function(M,c,C,B,N,F,z,v){var W,T=Menu.getDiv(M,c);while(T.firstChild){de(T.firstChild)}var u=ce("table"),A=ce("tbody"),R=ce("tr"),e=ce("td"),P=ce("div"),J=ce("div");var I=999;var b=g_getWindowSize(),l=g_getScroll(),f=b.w,n=b.h,V=l.x,O=l.y;if(N>0&&(M>0||c.length>20)){if((25+1)*c.length>n-25-z){for(var L=2;L<4;++L){if(N/L*c.length+30<n-z){break}}I=Math.floor(c.length/L)}}var r=0;var K=0;for(var L=0,t=c.length;L<t;++L){var Q=c[L];if(Q[0]==null){var q=ce("span");q.className="separator";ns(q);ae(q,ct(Q[1]));q.d=T;q.onmouseover=Menu.sepOver;ae(J,q)}else{var U=ce("a");U.d=T;U.k=K++;U.i=L;if(Q[2]){if(Menu.currentLink&&Menu.currentLink.menuappend){if(Q[2].indexOf(Menu.currentLink.menuappend)==-1){U.href=Q[2]+Menu.currentLink.menuappend}else{U.href=Q[2]}}else{if(typeof Q[2]=="function"){U.href="javascript:;";U.onclick=Menu.elemClick.bind(0,Q[2]);ns(U)}else{U.href=Q[2]}}}else{U.href="javascript:;";U.style.cursor="default";ns(U)}U.onmouseover=Menu.elemOver;var G=ce("span"),S=ce("span");if(Q[3]!=null){G.className="menusub"}if(Q.checked){S.className="menucheck"}if(Q.newWindow){U.target="_blank"}if(Q.className){S.className+=Q.className}if(Q.tinyIcon){S.style.background="url(http://static.wowhead.com/images/icons/tiny/"+Q.tinyIcon.toLowerCase()+".gif) left center no-repeat"}else{if(Q.socketColor){S.className+=" socket-"+g_file_gems[Q.socketColor]}else{if(Q.smallIcon){U.style.padding=0;S.style.padding="4px 18px 4px 28px";S.style.background="url(http://static.wowhead.com/images/icon_border_small.png) left center no-repeat transparent";G.style.background="url(http://static.wowhead.com/images/icons/small/"+Q.smallIcon.toLowerCase()+".jpg) 4px 3px no-repeat transparent"}}}ae(S,ct(Q[1]));ae(G,S);ae(U,G);ae(J,U)}if(r++==I){P.onmouseover=Menu.divOver;P.onmouseout=Menu.divOut;ae(P,J);if(!Browser.ie6){var H=ce("p");ae(H,ce("em"));ae(H,ce("var"));ae(H,ce("strong"));ae(H,P);ae(e,H)}else{ae(e,P)}ae(R,e);e=ce("td");H=ce("p");P=ce("div");J=ce("div");r=0}}P.onmouseover=Menu.divOver;P.onmouseout=Menu.divOut;ae(P,J);if(!Browser.ie6){if(I!=999){var H=ce("p");ae(H,ce("em"));ae(H,ce("var"));ae(H,ce("strong"));ae(H,P);ae(e,H)}else{ae(T,ce("em"));ae(T,ce("var"));ae(T,ce("strong"));ae(e,P)}}else{ae(e,P)}ae(R,e);ae(A,R);ae(u,A);ae(T,u);T.style.left=T.style.top="-2323px";T.style.display="";var g=u.offsetWidth,o=u.offsetHeight,E=true,D=true;if(!Browser.ie6){g+=5;o+=6}if(C+g>f+V||c.rightAligned){E=false}if(E){if(C+F+g>f){C=Math.max(0,C-g)}else{if(M>0){C+=F}}}else{C=C+F-g;if(Browser.ie){C-=3}}if((M>0||v)&&B+o>n+O){B=Math.max(O+5,n+O-o)}T.style.left=C+"px";T.style.top=B+"px";if(Browser.ie6){W=Menu.getIframe(M);W.style.left=C+"px";W.style.top=B+"px";W.style.width=g+"px";W.style.height=o+"px";W.style.display="";W.style.visibility="visible"}T.style.visibility="visible";if(Browser.opera){T.style.display="none";T.style.display=""}},divOver:function(){clearTimeout(Menu.timer)},divOut:function(){clearTimeout(Menu.timer);Menu.timer=setTimeout(Menu._hide,333)},truncate:function(b){var c;while(Menu.selection.length-1>b){c=Menu.selection.length-1;Menu.divs[c].style.display="none";Menu.divs[c].style.visibility="hidden";if(Browser.ie6){Menu.iframes[c].style.display="none"}Menu.selection.pop()}},clean:function(b){for(var c=b;c<Menu.selection.length;++c){if(Menu.selection[c]!=-1){var e=gE(Menu.divs[c],"a")[Menu.selection[c]];if(e.className.indexOf("sub")!=-1){e.className="sub"}else{e.className=""}Menu.selection[c]=-1}}},append:function(b,c){b[2]+=c;if(b[3]!=null){Menu._append(b[3],c)}},_append:function(b,d){var e,g=0;for(var c=0;c<b.length;++c){var f=b[c][2].indexOf("&filter=");if(f!=-1&&d.indexOf("&filter=")==0){d=Menu._fixCollision(b[c][2].substr(f),d)}b[c][2]+=d;if(b[c][3]){Menu._append(b[c][3],d)}}},_splitFilter:function(b){var g=b.substr(8).split(";"),c={};for(var e=0,a=g.length;e<a;++e){var h=g[e].indexOf("="),d,f;if(h!=-1){d=g[e].substr(0,h);f=g[e].substr(h+1)}else{d=g[e];f=""}c[d]=f}return c},_fixCollision:function(d,a){var b=Menu._splitFilter(d),c=Menu._splitFilter(a);a="";for(var e in c){if(!b[e]&&e!="sl"&&e!="cl"){a+=";";a+=e+"="+c[e]}}return a},fixUrls:function(g,c,e,b,f){if(!f){f=0}for(var d=0,a=g.length;d<a;++d){if(g[d][2]==null){g[d][2]=c+g[d][0]+(e?e:"")}if(g[d][3]){if(b==true||(typeof b=="object"&&b[f]==true)){Menu.fixUrls(g[d][3],c,e,b,f+1)}else{Menu.fixUrls(g[d][3],c+g[d][0]+".",e,b,f+1)}}}},addButtons:function(h,g){for(var e=0,b=g.length;e<b;++e){if(g[e][0]==null){continue}var c=ce("a"),f=ce("span");if(g[e][2]){c.href=g[e][2]}else{c.href="javascript:;";c.style.cursor="default";c.style.textDecoration="none";ns(c)}if(g[e][3]!=null){f.className="menuarrowd";c.menu=g[e][3];c.onmouseover=Menu.show;c.onmouseout=Menu.hide}else{c.onmouseover=Menu._hide}ae(f,ct(g[e][1]));ae(c,f);ae(h,c)}},explode:function(f){var d=[],e=null,c;for(var b=0,a=f.length;b<a;++b){if(f[b][0]!=null){if(e!=null){c.push(f[b])}else{d.push(f[b])}}if(e!=null&&(f[b][0]==null||b==a-1)){d.push([0,e[1],,c])}if(f[b][0]==null){e=f[b];c=[]}}return d}};function Tabs(a){cO(this,a);if(this.parent){this.parent=$(this.parent)}else{return}this.oldMode=(Browser.geckoVersion>20000000&&Browser.geckoVersion<=20060414);this.selectedTab=-1;this.uls=[];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)}}Tabs.prototype={add:function(a,d){var c,b=this.tabs.length;c={caption:a,index:b,owner:this};cO(c,d);this.tabs.push(c);return b},del:function(a){if(this.tabs[a]){ge("tab-"+this.tabs[a].id).style.display="none";this.selectedTab=-1;this.uls=[];this.tabs.splice(a,1);this.nShows=0;while(this.parent.firstChild){de(this.parent.firstChild)}this.flush()}},focus:function(a){if(a<0){a=this.tabs.length+a}this.forceScroll=1;gE(this.uls[this.oldMode?0:2],"a")[a].onclick({},true);this.forceScroll=null},show:function(c,e){var b;if(isNaN(c)||c<0){c=0}else{if(c>=this.tabs.length){c=this.tabs.length-1}}if(e==null&&c==this.selectedTab){return}if(this.selectedTab!=-1){b=this.tabs[this.selectedTab];if(this.onHide&&!this.onHide(b)){return}if(b.onHide&&!b.onHide()){return}}++this.nShows;var a=this.oldMode?0:3;for(var d=0;d<=a;++d){b=gE(this.uls[d],"a");if(this.selectedTab!=-1){b[this.selectedTab].className=""}b[c].className="selected"}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(p){if(this.oldMode){var m,s,e,r;m=ce("ul");m.className="old-tabs";for(var k=0;k<this.tabs.length;++k){var f=this.tabs[k];s=ce("li");e=ce("div");r=ce("a");if(this.poundable){r.href="#"+f.id}else{r.href="javascript:;"}ns(r);r.onclick=Tabs.onClick.bind(f,r);ae(r,ct(f.caption));ae(s,e);ae(s,r);ae(m,s)}this.uls[0]=m;ae(this.parent,m);var t=ce("div");t.style.cssFloat=t.style.styleFloat="left";ae(this.parent,t)}else{var t,g,r,q,o,c;var n=ce("div");n.className="tabs-container";o=ce("div");o.style.visibility="hidden";this.uls[0]=ce("ul");this.uls[0].className="tabs";ae(o,this.uls[0]);ae(n,o);o=ce("div");o.className="tabs-levels";for(var k=1;k<=3;++k){c=ce("div");c.className="tabs-level";this.uls[k]=ce("ul");this.uls[k].className="tabs";this.uls[k].style.top=(-30*(3-k))+"px";ae(c,this.uls[k]);ae(o,c)}ae(n,o);for(var k=0;k<this.tabs.length;++k){var f=this.tabs[k];for(var h=0;h<=3;++h){g=ce("li");r=ce("a");q=ce("b");if(this.poundable){r.href="#"+f.id}else{r.href="javascript:;"}if(h>0){ns(r);r.onclick=Tabs.onClick.bind(f,r)}if(!Browser.ie6){o=ce("div");ae(o,ct(f.caption));ae(r,o)}ae(q,ct(f.caption));ae(r,q);ae(g,r);ae(this.uls[h],g)}}ae(this.parent,n)}if(this.onLoad){t=this.onLoad();if(t!=null){this.poundedTab=p=t}}this.show(p)},setTabName:function(d,c){var a=this.oldMode?0:3;this.tabs[d].caption=c;for(var e=0;e<=a;++e){var b=gE(this.uls[e],"a");g_setTextNodes(b[d],c)}},setTabPound:function(d,a){if(!this.poundable){return}var b=this.oldMode?0:3;for(var e=0;e<=b;++e){var c=gE(this.uls[e],"a");c[d].href="#"+this.tabs[d].id+":"+a}},getSelectedTab:function(){return this.selectedTab}};Tabs.onClick=function(b,g,f){if(f==null&&this.index==this.owner.selectedTab){return}var d=rf2(g);if(d==null){return}this.owner.show(this.index,f);if(this.owner.poundable){var c=b.href.indexOf("#");c!=-1&&location.replace(b.href.substr(c))}return d};Tabs.onLoad=function(){if(!this.poundable||!location.hash.length){return}var a=location.hash.substr(1).split(":")[0];if(a){return in_array(this.tabs,a,function(b){return b.id})}};Tabs.onShow=function(d,e){var b;if(e){ge("tab-"+e.id).style.display="none"}b=ge("tab-"+d.id);b.style.display="";if((this.nShows==1&&this.poundedTab!=null&&this.poundedTab>=0)||this.forceScroll){var c,a;if(this.__st){c=this.__st;a=15}else{c=b;a=this.parent.offsetHeight+15}if(Browser.ie){setTimeout(g_scrollTo.bind(this,c,a),1)}else{g_scrollTo(c,a)}}};var Icon={sizes:["small","medium","large"],sizes2:[18,36,56],premiumOffsets:[[-56,-36],[-56,0],[0,0]],create:function(c,k,h,b,e,j){var g=ce("div"),d=ce("ins"),f=ce("del");if(k==null){k=1}g.className="icon"+Icon.sizes[k];ae(g,d);ae(g,f);Icon.setTexture(g,k,c);if(b){var i=ce("a");i.href=b;ae(g,i)}else{if(Browser.opera){g.onclick=Icon.onClick}else{g.ondblclick=Icon.onDblClick}}Icon.setNumQty(g,e,j);return g},createUser:function(d,f,c,b,a){if(d==2){f="http://static.wowhead.com/uploads/avatars/"+f+".jpg"}var e=Icon.create(f,c,null,b);if(a){e.className+=" "+e.className+"-premium"}if(d==2){Icon.moveTexture(e,c,Icon.premiumOffsets[c][0],Icon.premiumOffsets[c][1],true)}return e},setTexture:function(d,c,b){if(!b){return}var a=d.firstChild.style;if(b.indexOf("/")!=-1){a.backgroundImage="url("+b+")"}else{a.backgroundImage="url(http://static.wowhead.com/images/icons/"+Icon.sizes[c]+"/"+b.toLowerCase()+".jpg)"}Icon.moveTexture(d,c,0,0)},moveTexture:function(e,c,a,f,d){var b=e.firstChild.style;if(a||f){if(d){b.backgroundPosition=a+"px "+f+"px"}else{b.backgroundPosition=(-a*Icon.sizes2[c])+"px "+(-f*Icon.sizes2[c])+"px"}}else{if(b.backgroundPosition){b.backgroundPosition=""}}},setNumQty:function(e,c,f){var b=gE(e,"span");for(var d=0,a=b.length;d<a;++d){if(b[d]){de(b[d])}}if(c!=null&&((c>1&&c<2147483647)||c.length)){b=g_createGlow(c,"q1");b.style.right="0";b.style.bottom="0";b.style.position="absolute";ae(e,b)}if(f!=null&&f>0){b=g_createGlow("("+f+")","q");b.style.left="0";b.style.top="0";b.style.position="absolute";ae(e,b)}},getLink:function(a){return gE(a,"a")[0]},showIconName:function(a){if(a.firstChild){var c=a.firstChild.style;if(c.backgroundImage.length&&c.backgroundImage.indexOf("http://static.wowhead.com")>=4){var d=c.backgroundImage.lastIndexOf("/"),b=c.backgroundImage.indexOf(".jpg");if(d!=-1&&b!=-1){prompt("",c.backgroundImage.substring(d+1,b))}}}},onDblClick:function(){if(this.firstChild){var b=this.firstChild.style;if(b.backgroundImage.length&&b.backgroundImage.indexOf("http://static.wowhead.com")>=4){var c=b.backgroundImage.lastIndexOf("/"),a=b.backgroundImage.indexOf(".jpg");if(c!=-1&&a!=-1){prompt("",b.backgroundImage.substring(c+1,a))}}}},onClick:function(){if(this.lastClick){var a=new Date().getTime();if(a-this.lastClick<400){Icon.onDblClick.bind(this)();this.lastClick=null}else{this.lastClick=a}}else{this.lastClick=new Date().getTime()}}};var RedButton={create:function(k,g,j){var d=ce("a"),f=ce("em"),c=ce("b"),e=ce("i"),h=ce("span");d.href="javascript:;";d.className="button-red";ae(c,e);ae(f,c);ae(f,h);ae(d,f);RedButton.setText(d,k);RedButton.enable(d,g);RedButton.setFunc(d,j);return d},setText:function(a,b){st(a.firstChild.childNodes[0].firstChild,b);st(a.firstChild.childNodes[1],b)},enable:function(a,b){if(b||b==null){a.className=a.className.replace("button-red-disabled","")}else{if(a.className.indexOf("button-red-disabled")==-1){a.className+=" button-red-disabled"}}},setFunc:function(a,b){a.onclick=(b?b:null)}};var Tooltip={create:function(h){var f=ce("div"),k=ce("table"),b=ce("tbody"),e=ce("tr"),c=ce("tr"),a=ce("td"),j=ce("th"),i=ce("th"),g=ce("th");f.className="tooltip";j.style.backgroundPosition="top right";i.style.backgroundPosition="bottom left";g.style.backgroundPosition="bottom right";if(h){a.innerHTML=h}ae(e,a);ae(e,j);ae(b,e);ae(c,i);ae(c,g);ae(b,c);ae(k,b);Tooltip.icon=ce("p");Tooltip.icon.style.visibility="hidden";ae(Tooltip.icon,ce("div"));ae(f,Tooltip.icon);ae(f,k);return f},fix:function(d,b,f){var e=gE(d,"table")[0],h=gE(e,"td")[0],g=h.childNodes;if(g.length>=2&&g[0].nodeName=="TABLE"&&g[1].nodeName=="TABLE"){g[0].style.whiteSpace="nowrap";var a;if(g[1].offsetWidth>300){a=Math.max(300,g[0].offsetWidth)+20}else{a=Math.max(g[0].offsetWidth,g[1].offsetWidth)+20}if(a>20){d.style.width=a+"px";g[0].style.width=g[1].style.width="100%";if(!b&&d.offsetHeight>document.body.clientHeight){e.className="shrink"}}}if(f){d.style.visibility="visible"}},fixSafe:function(c,b,a){if(Browser.ie){setTimeout(Tooltip.fix.bind(this,c,b,a),1)}else{Tooltip.fix(c,b,a)}},append:function(c,b){var c=$(c);var a=Tooltip.create(b);ae(c,a);Tooltip.fixSafe(a,1,1)},prepare:function(){if(Tooltip.tooltip){return}var b=Tooltip.create();b.style.position="absolute";b.style.left=b.style.top="-2323px";var a=ge("layers");ae(a,b);Tooltip.tooltip=b;Tooltip.tooltipTable=gE(b,"table")[0];Tooltip.tooltipTd=gE(b,"td")[0];if(Browser.ie6){b=ce("iframe");b.src="javascript:0;";b.frameBorder=0;ae(a,b);Tooltip.iframe=b}},set:function(b){var a=Tooltip.tooltip;a.style.width="550px";a.style.left="-2323px";a.style.top="-2323px";Tooltip.tooltipTd.innerHTML=b;a.style.display="";Tooltip.fix(a,0,0)},moveTests:[[null,null],[null,false],[false,null],[false,false]],move:function(m,l,d,n,c,a){if(!Tooltip.tooltipTable){return}var k=Tooltip.tooltip,g=Tooltip.tooltipTable.offsetWidth,b=Tooltip.tooltipTable.offsetHeight,o;k.style.width=g+"px";var j,e;for(var f=0,h=Tooltip.moveTests.length;f<h;++f){o=Tooltip.moveTests[f];j=Tooltip.moveTest(m,l,d,n,c,a,o[0],o[1]);if(!Ads.intersect(j)){e=true;break}}if(!e){Ads.intersect(j,true)}k.style.left=j.l+"px";k.style.top=j.t+"px";k.style.visibility="visible";if(Browser.ie6&&Tooltip.iframe){var o=Tooltip.iframe;o.style.left=j.l+"px";o.style.top=j.t+"px";o.style.width=g+"px";o.style.height=b+"px";o.style.display="";o.style.visibility="visible"}},moveTest:function(e,l,n,w,c,a,m,b){var k=e,v=l,f=Tooltip.tooltip,i=Tooltip.tooltipTable.offsetWidth,p=Tooltip.tooltipTable.offsetHeight,g=g_getWindowSize(),j=g_getScroll(),h=g.w,o=g.h,d=j.x,u=j.y,t=d,s=u,r=d+h,q=u+o;if(m==null){m=(e+n+i<=r)}if(b==null){b=(l-p>=s)}if(m){e+=n+c}else{e=Math.max(e-i,t)-c}if(b){l-=p+a}else{l+=w+a}if(e<t){e=t}else{if(e+i>r){e=r-i}}if(l<s){l=s}else{if(l+p>q){l=Math.max(u,q-p)}}if(Tooltip.iconVisible){if(k>=e-48&&k<=e&&v>=l-4&&v<=l+48){l-=48-(v-l)}}return g_createRect(e,l,i,p)},show:function(f,e,d,b,c){if(Tooltip.disabled){return}if(!d||d<1){d=1}if(!b||b<1){b=1}if(c){e='<span class="'+c+'">'+e+"</span>"}var a=ac(f);Tooltip.prepare();Tooltip.set(e);Tooltip.move(a.x,a.y,f.offsetWidth,f.offsetHeight,d,b)},showAtCursor:function(d,f,c,a,b){if(Tooltip.disabled){return}if(!c||c<10){c=10}if(!a||a<10){a=10}if(b){f='<span class="'+b+'">'+f+"</span>"}d=$E(d);var g=g_getCursorPos(d);Tooltip.prepare();Tooltip.set(f);Tooltip.move(g.x,g.y,0,0,c,a)},showAtXY:function(d,a,e,c,b){if(Tooltip.disabled){return}Tooltip.prepare();Tooltip.set(d);Tooltip.move(a,e,0,0,c,b)},cursorUpdate:function(b,a,d){if(Tooltip.disabled||!Tooltip.tooltip){return}b=$E(b);if(!a||a<10){a=10}if(!d||d<10){d=10}var c=g_getCursorPos(b);Tooltip.move(c.x,c.y,0,0,a,d)},hide:function(){if(Tooltip.tooltip){Tooltip.tooltip.style.display="none";Tooltip.tooltip.visibility="hidden";Tooltip.tooltipTable.className="";if(Browser.ie6){Tooltip.iframe.style.display="none"}Tooltip.setIcon(null);Ads.restoreHidden()}},setIcon:function(a){Tooltip.prepare();if(a){Tooltip.icon.style.backgroundImage="url(http://static.wowhead.com/images/icons/medium/"+a.toLowerCase()+".jpg)";Tooltip.icon.style.visibility="visible"}else{Tooltip.icon.style.backgroundImage="none";Tooltip.icon.style.visibility="hidden"}Tooltip.iconVisible=a?1:0}};var g_listviews={};function Listview(a){cO(this,a);if(this.id){var n=(this.tabs?"tab-":"lv-")+this.id;if(this.parent){var l=ce("div");l.id=n;ae($(this.parent),l);this.container=l}else{this.container=ge(n)}}else{return}var c=g_getGets();if(c.debug!=null&&g_user.roles&26){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.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.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.createNote==null&&this.template.createNote!=null){this.createNote=this.template.createNote}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.clip==null&&this.template.clip!=null){this.clip=this.template.clip}if(this.mode==null){this.mode=this.template.mode}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 r=this.template.nItemsPerRow;this.nItemsPerRow=(r!=null?r:4)}this.nItemsPerRow|=0;if(this.nItemsPerRow<=1){this.nItemsPerRow=1}}else{this.nItemsPerRow=1}this.columns=[];if(this.debug){this.columns.push(Listview.funcBox.createSimpleCol("id","ID","5%","id"))}for(var f=0,k=this.template.columns.length;f<k;++f){var q=this.template.columns[f],e={};cO(e,q);this.columns.push(e)}if(this.extraCols!=null){for(var f=0,k=this.extraCols.length;f<k;++f){var m=null;var b=this.extraCols[f];if(b.after||b.before){var j=in_array(this.columns,(b.after?b.after:b.before),function(d){return d.id});if(j!=-1){m=(b.after?j+1:j-1)}}if(m==null){m=this.columns.length}this.columns.splice(m,0,b)}}this.visibility=[];var o=[],p=[];if(this.visibleCols!=null){array_walk(this.visibleCols,function(d){o[d]=1})}if(this.hiddenCols!=null){array_walk(this.hiddenCols,function(d){p[d]=1})}for(var f=0,k=this.columns.length;f<k;++f){var b=this.columns[f];if(o[b.id]!=null||(!b.hidden&&p[b.id]==null)){this.visibility.push(f)}}if(this.sort==null&&this.template.sort){this.sort=this.template.sort.slice(0)}else{if(this.sort!=null){var h=this.sort;this.sort=[];for(var f=0,k=h.length;f<k;++f){var b=parseInt(h[f]);if(isNaN(b)){var g=0;if(h[f].charAt(0)=="-"){g=1;h[f]=h[f].substring(1)}var j=in_array(this.columns,h[f],function(d){return d.id});if(j!=-1){if(g){this.sort.push(-(j+1))}else{this.sort.push(j+1)}}}else{this.sort.push(b)}}}else{this.sort=[]}}if(this.debug){for(var f=0,k=this.sort.length;f<k;++f){this.sort[f]=this.sort[f]+1}}if(this.tabs){this.tabIndex=this.tabs.add(this.getTabName(),{id:this.id,onLoad:this.initialize.bind(this)})}else{this.initialize()}}Listview.MODE_DEFAULT=0;Listview.MODE_CHECKBOX=1;Listview.MODE_DIV=2;Listview.MODE_TILED=3;Listview.prototype={initialize:function(){if(this.data.length){if(this.computeDataFunc!=null){for(var d=0,a=this.data.length;d<a;++d){this.computeDataFunc(this.data[d])}}}if(this.tabs){this.pounded=(this.tabs.poundedTab==this.tabIndex);if(this.pounded){this.readPound()}}else{this.readPound()}var b;if(this.onBeforeCreate!=null){if(typeof this.onBeforeCreate=="function"){b=this.onBeforeCreate()}else{for(var d=0;d<this.onBeforeCreate.length;++d){(this.onBeforeCreate[d].bind(this))()}}}this.noData=ce("div");this.noData.className="listview-nodata text";if(this.mode==Listview.MODE_DIV){this.mainContainer=this.mainDiv=ce("div");this.mainContainer.className="listview-mode-div"}else{this.mainContainer=this.table=ce("table");this.thead=ce("thead");this.tbody=ce("tbody");if(this.clickable){this.tbody.className="clickable"}if(this.mode==Listview.MODE_TILED){this.table.className="listview-mode-tiled";var e=(100/this.nItemsPerRow)+"%",f=ce("colgroup"),c;for(var d=0;d<this.nItemsPerRow;++d){c=ce("col");c.style.width=e;ae(f,c)}ae(this.mainContainer,f)}else{this.table.className="listview-mode-default";this.createHeader();this.updateSortArrow()}ae(this.table,this.thead);ae(this.table,this.tbody);if(this.mode==Listview.MODE_CHECKBOX&&Browser.ie){setTimeout(Listview.cbIeFix.bind(this),1)}}this.createBands();if(this.customFilter!=null){this.updateFilters()}this.updateNav();this.refreshRows();if(this.onAfterCreate!=null){this.onAfterCreate(b)}},createHeader:function(){var h=ce("tr");if(this.mode==Listview.MODE_CHECKBOX){var g=ce("th"),j=ce("div"),c=ce("a");g.style.width="33px";c.href="javascript:;";c.className="listview-cb";ns(c);ae(c,ct(String.fromCharCode(160)));ae(j,c);ae(g,j);ae(h,g)}for(var f=0,b=this.visibility.length;f<b;++f){var e=this.visibility[f],d=this.columns[e],g=ce("th");j=ce("div"),c=ce("a"),outerSpan=ce("span"),innerSpan=ce("span");d.__th=g;c.href="javascript:;";if(this.filtrable&&(d.filtrable==null||d.filtrable)){c.onmouseup=Listview.headerClick.bind(this,d,e);c.onclick=c.oncontextmenu=rf}else{c.onclick=this.sortBy.bind(this,e+1)}c.onmouseover=Listview.headerOver.bind(this,c,d);c.onmouseout=Tooltip.hide;ns(c);if(d.width!=null){g.style.width=d.width}if(d.align!=null){g.style.textAlign=d.align}if(d.span!=null){g.colSpan=d.span}ae(innerSpan,ct(d.name));ae(outerSpan,innerSpan);ae(c,outerSpan);ae(j,c);ae(g,j);ae(h,g)}if(this.hideHeader){this.thead.style.display="none"}ae(this.thead,h)},createBands:function(){var h=ce("div"),j=ce("div"),k=ce("div"),i=ce("div");this.bandTop=h;this.bandBot=j;this.noteTop=k;this.noteBot=i;h.className="listview-band-top";j.className="listview-band-bottom";this.navTop=this.createNav(true);this.navBot=this.createNav(false);k.className=i.className="listview-note";if(this.note){k.innerHTML=this.note}else{if(this.createNote){this.createNote(k,i)}}if(!k.firstChild&&this.mode!=Listview.MODE_CHECKBOX){ae(k,ct(String.fromCharCode(160)))}if(this.mode!=Listview.MODE_CHECKBOX){ae(i,ct(String.fromCharCode(160)))}ae(h,this.navTop);if(this.searchable){var l=this.updateFilters.bind(this,true),d=(this._truncated?"search-within-results2":"search-within-results"),c=ce("span"),b=ce("em"),g=ce("a"),f=ce("input");c.className="listview-quicksearch";ae(c,b);g.href="javascript:;";g.onclick=function(){var a=this.nextSibling;a.value="";a.className=d;l()};g.style.display="none";ae(g,ce("span"));ae(c,g);ns(g);f.setAttribute("type","text");f.className=d;f.style.width=(this._truncated?"19em":"15em");g_onAfterTyping(f,l,this.searchDelay);f.onmouseover=function(){if(trim(this.value)!=""){this.className=""}};f.onfocus=function(){this.className=""};f.onblur=function(){if(trim(this.value)==""){this.className=d;this.value=""}};f.onkeypress=this.submitSearch.bind(this);if(Browser.ie){setTimeout(function(){f.value=""},1)}ae(c,f);this.quickSearchBox=f;this.quickSearchGlass=b;this.quickSearchClear=g;ae(h,c)}ae(h,k);ae(j,this.navBot);ae(j,i);if(this.mode==Listview.MODE_CHECKBOX){if(this.note){k.style.paddingBottom="5px"}this.cbBarTop=this.createCbBar(true);this.cbBarBot=this.createCbBar(false);ae(h,this.cbBarTop);ae(j,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.noteTop.style.paddingBottom="6px"}if(this.noteBot.firstChild&&this.cbBarBot.firstChild){this.noteBot.style.paddingBottom="6px"}}if(this.hideBands&1){h.style.display="none"}if(this.hideBands&2){j.style.display="none"}ae(this.container,this.bandTop);if(this.clip){var e=ce("div");e.className="listview-clip";e.style.width=this.clip.w+"px";e.style.height=this.clip.h+"px";this.clipDiv=e;ae(e,this.mainContainer);ae(e,this.noData);ae(this.container,e)}else{ae(this.container,this.mainContainer);ae(this.container,this.noData)}ae(this.container,this.bandBot)},createNav:function(g){var c=ce("div"),d=ce("a"),b=ce("a"),a=ce("a"),j=ce("a"),i=ce("span"),h=ce("b"),f=ce("b"),e=ce("b");c.className="listview-nav";d.href=b.href=a.href=j.href="javascript:;";ae(d,ct(String.fromCharCode(171)+LANG.lvpage_first));ae(b,ct(String.fromCharCode(8249)+LANG.lvpage_previous));ae(a,ct(LANG.lvpage_next+String.fromCharCode(8250)));ae(j,ct(LANG.lvpage_last+String.fromCharCode(187)));ns(d);ns(b);ns(a);ns(j);d.onclick=this.firstPage.bind(this);b.onclick=this.previousPage.bind(this);a.onclick=this.nextPage.bind(this);j.onclick=this.lastPage.bind(this);ae(h,ct("a"));ae(f,ct("a"));ae(e,ct("a"));ae(i,h);ae(i,ct(LANG.hyphen));ae(i,f);ae(i,ct(LANG.lvpage_of));ae(i,e);ae(c,d);ae(c,b);ae(c,i);ae(c,a);ae(c,j);if(g){if(this.hideNav&1){c.style.display="none"}}else{if(this.hideNav&2){c.style.display="none"}}return c},createCbBar:function(a){var b=ce("div");if(this.createCbControls){this.createCbControls(b,a)}if(b.firstChild){b.className="listview-withselected"+(a?"":"2")}return b},refreshRows:function(){var a=(this.mode==Listview.MODE_DIV?this.mainContainer:this.tbody);ee(a);if(this.nRowsVisible==0){if(!this.filtered){this.bandTop.style.display=this.bandBot.style.display="none";this.mainContainer.style.display="none"}this.noData.style.display="";this.showNoData();return}var n,b,c;if(!(this.hideBands&1)){this.bandTop.style.display=""}if(!(this.hideBands&2)){this.bandBot.style.display=""}if(this.nItemsPerPage>0){n=this.rowOffset;b=Math.min(n+this.nRowsVisible,n+this.nItemsPerPage);if(this.filtered&&this.rowOffset>0){for(var f=0,g=0;f<this.data.length&&g<this.rowOffset;++f){var o=this.data[f];if(o.__hidden||o.__deleted){++n}else{++g}}b+=(n-this.rowOffset)}}else{n=0;b=this.nRowsVisible}var h=b-n;if(this.mode==Listview.MODE_DIV){for(var e=0;e<h;++e){var f=n+e,o=this.data[f];if(!o){break}if(o.__hidden||o.__deleted){++h;continue}ae(this.mainDiv,this.getDiv(f))}}else{if(this.mode==Listview.MODE_TILED){var d=0,l=ce("tr");for(var e=0;e<h;++e){var f=n+e,o=this.data[f];if(!o){break}if(o.__hidden||o.__deleted){++h;continue}ae(l,this.getCell(f));if(++d==this.nItemsPerRow){ae(this.tbody,l);if(e+1<h){l=ce("tr")}d=0}}if(d!=0){for(;d<4;++d){var m=ce("td");m.className="empty-cell";ae(l,m)}ae(this.tbody,l)}}else{for(var e=0;e<h;++e){var f=n+e,o=this.data[f];if(!o){break}if(o.__hidden||o.__deleted){++h;continue}ae(this.tbody,this.getRow(f))}}}this.mainContainer.style.display="";this.noData.style.display="none"},showNoData:function(){var b=this.noData;ee(b);var a=-1;if(this.template.onNoData){a=(this.template.onNoData.bind(this,b))()}if(a==-1){ae(this.noData,ct(this.filtered?LANG.lvnodata2:LANG.lvnodata))}},getDiv:function(a){var b=this.data[a];if(b.__div==null||this.minPatchVersion!=b.__minPatch){this.createDiv(b,a)}return b.__div},createDiv:function(b,a){var c=ce("div");b.__div=c;if(this.minPatchVersion){b.__minPatch=this.minPatchVersion}(this.template.compute.bind(this,b,c,a))()},getCell:function(a){var b=this.data[a];if(b.__div==null){this.createCell(b,a)}return b.__td},createCell:function(b,a){var c=ce("td");b.__td=c;(this.template.compute.bind(this,b,c,a))();if(this.template.getItemLink){c.onclick=this.itemClick.bind(this,b)}if(Browser.ie6){c.onmouseover=Listview.itemOver;c.onmouseout=Listview.itemOut}},getRow:function(a){var b=this.data[a];if(b.__tr==null){this.createRow(b)}return b.__tr},setRow:function(a){if(this.data[a.pos]){this.data[a.pos]=a;this.data[a.pos].__tr=a.__tr;this.createRow(this.data[a.pos]);this.refreshRows()}},createRow:function(j){var g=ce("tr");j.__tr=g;if(this.mode==Listview.MODE_CHECKBOX){var c=ce("td");if(!j.__nochk){c.className="listview-cb";c.onclick=Listview.cbCellClick;var b=ce("input");ns(b);b.type="checkbox";b.onclick=Listview.cbClick;if(j.__chk){b.checked=true;if(Browser.ie){b.defaultChecked=true}}j.__cb=b;ae(c,b)}ae(g,c)}for(var d=0,e=this.visibility.length;d<e;++d){var f=this.visibility[d],a=this.columns[f],c=ce("td"),h;if(a.align!=null){c.style.textAlign=a.align}if(a.compute){h=(a.compute.bind(this,j,c,g,f))()}else{if(j[a.value]!=null){h=j[a.value]}else{h=-1}}if(h!=-1&&h!=null){c.insertBefore(ct(h),c.firstChild)}ae(g,c)}if(this.mode==Listview.MODE_CHECKBOX&&j.__chk){g.className="checked"}if(this.template.getItemLink){g.onclick=this.itemClick.bind(this,j)}if(Browser.ie6){g.onmouseover=Listview.itemOver;g.onmouseout=Listview.itemOut}},itemClick:function(d,c){c=$E(c);var a=0,b=c._target;while(b&&a<3){if(b.nodeName=="A"){return}b=b.parentNode}location.href=this.template.getItemLink(d)},submitSearch:function(c){c=$E(c);if(!this.onSearchSubmit||c.keyCode!=13){return}for(var b=0,a=this.data.length;b<a;++b){if(this.data[b].__hidden){continue}(this.onSearchSubmit.bind(this,this.data[b]))()}},validatePage:function(){var c=this.nItemsPerPage,b=this.rowOffset,a=this.nRowsVisible;if(b<0){this.rowOffset=0}else{this.rowOffset=this.getRowOffset(b+c>a?a-1:b)}},getRowOffset:function(b){var a=this.nItemsPerPage;return(a>0&&b>0?Math.floor(b/a)*a:0)},resetRowVisibility:function(){for(var b=0,a=this.data.length;b<a;++b){this.data[b].__hidden=false}this.filtered=false;this.rowOffset=0;this.nRowsVisible=this.data.length},getColText:function(b,a){if(a.getVisibleText){return a.getVisibleText(b)}if(a.getValue){return a.getValue(b)}if(a.value){return b[a.value]}if(a.compute){return a.compute(b)}return""},updateFilters:function(d){Tooltip.hide();this.resetRowVisibility();var w,q,c;if(this.searchable){this.quickSearchBox.parentNode.style.display="";w=trim(this.quickSearchBox.value);if(w){this.quickSearchGlass.style.display="none";this.quickSearchClear.style.display="";w=w.toLowerCase().replace(/\s+/g," ");q=w.split(" ");c=q.length}else{this.quickSearchGlass.style.display="";this.quickSearchClear.style.display="none"}}else{this.quickSearchBox.parentNode.style.display="none"}if(!w&&this.nFilters==0&&this.customFilter==null){if(d){this.updateNav();this.refreshRows()}return}var A={1:function(i,j){return i>j},2:function(i,j){return i==j},3:function(i,j){return i<j},4:function(i,j){return i>=j},5:function(i,j){return i<=j},6:function(i,k,j){return k<=i&&i<=j}};var p={1:function(j,i,k){return i>k},2:function(j,i,k){return j<=k&&k<=i},3:function(j,i,k){return j<k},4:function(j,i,k){return i>=k},5:function(j,i,k){return j<=k},6:function(j,i,C,k){return C<=i&&j<=k}};var o=0;for(var u=0,v=this.data.length;u<v;++u){var g=this.data[u],m=0;nSearchMatches=0,matches=[];g.__hidden=true;if(this.customFilter&&!this.customFilter(g,u)){continue}for(var t=0,h=this.visibility.length;t<h;++t){var n=this.visibility[t];var e=this.columns[n];if(e.__filter){var a=e.__filter,b=false;if(e.type==null||e.type=="num"||a.type>0){var r=null;if(e.getValue){r=e.getValue(g)}else{if(e.value){r=parseFloat(g[e.value])}}if(!r){r=0}b=(A[a.type])(r,a.value,a.value2)}else{if(e.type=="range"){var B=e.getMinValue(g),z=e.getMaxValue(g);b=(p[a.type])(B,z,a.value,a.value2)}else{var l=this.getColText(g,e);if(l){l=l.toString().toLowerCase();if(a.invert){b=l.match(a.regex)!=null}else{var y=0;for(var s=0,f=a.words.length;s<f;++s){if(l.indexOf(a.words[s])!=-1){++y}else{break}}b=(y==a.words.length)}}}}if(a.invert){b=!b}if(b){++m}else{break}}if(w){var l=this.getColText(g,e);if(l){l=l.toString().toLowerCase();for(var s=0,f=q.length;s<f;++s){if(!matches[s]){if(l.indexOf(q[s])!=-1){matches[s]=1;++nSearchMatches}}}}}}if(g.__alwaysvisible||((this.nFilters==0||m==this.nFilters)&&(!w||nSearchMatches==c))){g.__hidden=false;++o}}this.filtered=(o<this.data.length);this.nRowsVisible=o;if(d){this.updateNav();this.refreshRows()}},changePage:function(){this.validatePage();this.refreshRows();this.updateNav();this.updatePound();var a=g_getScroll(),b=ac(this.container);if(a.y>b[1]){scrollTo(a.x,b[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(a,c){var b=in_array(a,Math.abs(c),function(d){return Math.abs(d)});if(b!=-1){c=a[b];a.splice(b,1)}a.splice(0,0,c)},sortBy:function(a){if(a<=0||a>this.columns.length){return}if(Math.abs(this.sort[0])==a){this.sort[0]=-this.sort[0]}else{var b=-1;if(this.columns[a-1].type=="text"){b=1}this.addSort(this.sort,b*a)}this.applySort();this.refreshRows();this.updateSortArrow();this.updatePound()},applySort:function(){if(this.sort.length==0){return}Listview.sort=this.sort;Listview.columns=this.columns;if(this.indexCreated){this.data.sort(Listview.sortIndexedRows)}else{this.data.sort(Listview.sortRows)}this.updateSortIndex()},setSort:function(b,c,a){if(this.sort.toString()!=b.toString()){this.sort=b;this.applySort();if(c){this.refreshRows()}if(a){this.updatePound()}}},readPound:function(){if(!this.poundable||!location.hash.length){return(this.poundable==2?false:this.applySort())}var b=location.hash.substr(1);if(this.tabs){var g=b.indexOf(":");if(g==-1){return(this.poundable==2?false:this.applySort())}b=b.substr(g+1)}var a=parseInt(b);if(!isNaN(a)){this.rowOffset=a;this.validatePage();if(this.poundable!=2){var d=[];var f=b.match(/(\+|\-)[0-9]+/g);if(f!=null){for(var c=f.length-1;c>=0;--c){var e=parseInt(f[c])|0;var b=Math.abs(e);if(b<=0||b>this.columns.length){break}this.addSort(d,e)}this.setSort(d,false,false);this.applySort()}}if(this.tabs){this.tabs.setTabPound(this.tabIndex,this.getTabPound())}}},updateSortArrow:function(){if(!this.sort.length||!this.thead){return}var a=in_array(this.visibility,Math.abs(this.sort[0])-1);if(a==-1){return}if(this.mode==Listview.MODE_CHECKBOX){a+=1}var b=this.thead.firstChild.childNodes[a].firstChild.firstChild.firstChild;if(this.lsa&&this.lsa!=b){this.lsa.className=""}b.className=(this.sort[0]<0?"sortdesc":"sortasc");this.lsa=b},updateSortIndex:function(){var b=this.data;for(var c=0,a=b.length;c<a;++c){b[c].__si=c}this.indexCreated=true},updateTabName:function(){if(this.tabs&&this.tabIndex!=null){this.tabs.setTabName(this.tabIndex,this.getTabName())}},updatePound:function(){if(!this.poundable){return}var a=this.getTabPound();if(this.tabs){this.tabs.setTabPound(this.tabIndex,a);location.replace("#"+this.id+":"+a)}else{location.replace("#"+a)}},updateNav:function(){var e=[this.navTop,this.navBot],j=this.nItemsPerPage,h=this.rowOffset,d=this.nRowsVisible,g=0,b=0,f=0,k=0;if(d>0){if(!(this.hideNav&1)){e[0].style.display=""}if(!(this.hideNav&2)){e[1].style.display=""}}else{e[0].style.display=e[1].style.display="none"}if(j){if(h>0){b=1;if(h>=j+j){g=1}}if(h+j<d){f=1;if(h+j+j<d){k=1}}}for(var c=0;c<2;++c){var a=e[c].childNodes;a[0].style.display=(g?"":"none");a[1].style.display=(b?"":"none");a[3].style.display=(f?"":"none");a[4].style.display=(k?"":"none");a=a[2].childNodes;a[0].firstChild.nodeValue=h+1;a[2].firstChild.nodeValue=j?Math.min(h+j,d):d;a[4].firstChild.nodeValue=d}},getTabName:function(){var b=this.name,d=this.data.length;for(var c=0,a=this.data.length;c<a;++c){if(this.data[c].__hidden||this.data[c].__deleted){--d}}if(d>0&&!this.hideCount){b+=sprintf(LANG.qty,d)}return b},getTabPound:function(){var a="";a+=this.rowOffset;if(this.poundable!=2&&this.sort.length){a+=("+"+this.sort.join("+")).replace(/\+\-/g,"-")}return a},getCheckedRows:function(){var d=[];for(var c=0,a=this.data.length;c<a;++c){var b=this.data[c];if((b.__cb&&b.__cb.checked)||(!b.__cb&&b.__chk)){d.push(b)}}return d},deleteRows:function(c){if(!c||!c.length){return}for(var b=0,a=c.length;b<a;++b){var d=c[b];if(!d.__hidden&&!d.__hidden){this.nRowsVisible-=1}d.__deleted=true}this.updateTabName();if(this.rowOffset>=this.nRowsVisible){this.previousPage()}else{this.refreshRows();this.updateNav()}},setData:function(a){this.data=a;this.indexCreated=false;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.updateFilters()}this.updateNav();this.refreshRows()},getClipDiv:function(){return this.clipDiv},getNoteTopDiv:function(){return this.noteTop},focusSearch:function(){this.quickSearchBox.focus()},clearSearch:function(){this.quickSearchBox.value=""}};Listview.sortRows=function(e,d){var j=Listview.sort,k=Listview.columns;for(var h=0,c=j.length;h<c;++h){var g,f=k[Math.abs(j[h])-1];if(f.sortFunc){g=f.sortFunc(e,d,j[h])}else{g=strcmp(e[f.value],d[f.value])}if(g!=0){return g*j[h]}}return 0},Listview.sortIndexedRows=function(d,c){var g=Listview.sort,h=Listview.columns,e=h[Math.abs(g[0])-1],f;if(e.sortFunc){f=e.sortFunc(d,c,g[0])}else{f=strcmp(d[e.value],c[e.value])}if(f!=0){return f*g[0]}return(d.__si-c.__si)},Listview.cbSelect=function(b){for(var d=0,a=this.data.length;d<a;++d){var c=this.data[d];var f=b;if(!c.__nochk&&c.__tr){var e=c.__tr.firstChild.firstChild;if(f==null){f=!e.checked}if(e.checked!=f){e.checked=f;c.__tr.className=(e.checked?"checked":"");if(Browser.ie){e.defaultChecked=f;if(Browser.ie6){(Listview.itemOut.bind(c.__tr))()}}}}else{if(f==null){f=true}}c.__chk=f}};Listview.cbClick=function(a){setTimeout(Listview.cbUpdate.bind(0,0,this,this.parentNode.parentNode),1);sp(a)};Listview.cbCellClick=function(a){setTimeout(Listview.cbUpdate.bind(0,1,this.firstChild,this.parentNode),1);sp(a)};Listview.cbIeFix=function(){var d=gE(this.tbody,"tr");for(var c=0,a=d.length;c<a;++c){var b=d[c].firstChild.firstChild;if(b){b.checked=b.defaultChecked=false}}};Listview.cbUpdate=function(c,a,b){if(c){a.checked=!a.checked}b.className=(a.checked?"checked":"");if(Browser.ie){a.defaultChecked=a.checked;if(Browser.ie6){(Listview.itemOver.bind(b))()}}};Listview.itemOver=function(){this.style.backgroundColor=(this.className=="checked"?"#2C2C2C":"#202020")};Listview.itemOut=function(){this.style.backgroundColor=(this.className=="checked"?"#242424":"transparent")};Listview.headerClick=function(a,b,c){c=$E(c);if(c._button==3||c.shiftKey||c.ctrlKey){Tooltip.hide();setTimeout(Listview.headerFilter.bind(this,a,null),1)}else{this.sortBy(b+1)}return false};Listview.headerFilter=function(c,f){var j="";if(c.__filter){if(c.__filter.invert){j+="!"}j+=c.__filter.text}if(f==null){var f=prompt(sprintf(LANG.prompt_colfilter1+(c.type=="text"?LANG.prompt_colfilter2:LANG.prompt_colfilter3),c.name),j)}if(f!=null){var e={text:"",type:-1};f=trim(f.replace(/\s+/g," "));if(f){if(f.charAt(0)=="!"||f.charAt(0)=="-"){e.invert=1;f=f.substr(1)}if(c.type=="text"){e.type=0;e.text=f;if(e.invert){e.regex=g_createOrRegex(f)}else{e.words=f.toLowerCase().split(" ")}}var i,b;if(f.match(/(>|=|<|>=|<=)\s*([0-9\.]+)/)){i=parseFloat(RegExp.$2);if(!isNaN(i)){switch(RegExp.$1){case">":e.type=1;break;case"=":e.type=2;break;case"<":e.type=3;break;case">=":e.type=4;break;case"<=":e.type=5;break}e.value=i;e.text=RegExp.$1+" "+i}}else{if(f.match(/([0-9\.]+)\s*\-\s*([0-9\.]+)/)){i=parseFloat(RegExp.$1);b=parseFloat(RegExp.$2);if(!isNaN(i)&&!isNaN(b)){if(i>b){var g=i;i=b;b=g}if(i==b){e.type=2;e.value=i;e.text="= "+i}else{e.type=6;e.value=i;e.value2=b;e.text=i+" - "+b}}}else{var d=f.toLowerCase().split(" ");if(d.length==1&&!isNaN(i=parseFloat(d[0]))){e.type=2;e.value=i;e.text="= "+i}else{if(c.type=="text"){e.type=0;e.text=f;if(e.invert){e.regex=g_createOrRegex(f)}else{e.words=d}}}}}if(e.type==-1){alert(LANG.message_invalidfilter);return}}if(!c.__filter||e.text!=c.__filter.text||e.invert!=c.__filter.invert){var h=c.__th.firstChild.firstChild;if(f&&e.text){if(!c.__filter){h.className="q5";++(this.nFilters)}c.__filter=e}else{if(c.__filter){h.className="";--(this.nFilters)}c.__filter=null}this.updateFilters(1)}}};Listview.headerOver=function(b,c,f){var d="";d+='<b class="q1">'+(c.tooltip?c.tooltip:c.name)+"</b>";if(c.__filter){d+="<br />"+sprintf((c.__filter.invert?LANG.tooltip_colfilter2:LANG.tooltip_colfilter1),c.__filter.text)}d+='<br /><span class="q2">'+LANG.tooltip_lvheader1+"</span>";if(this.filtrable&&(c.filtrable==null||c.filtrable)){d+='<br /><span class="q2">'+(Browser.opera?LANG.tooltip_lvheader3:LANG.tooltip_lvheader2)+"</span>"}Tooltip.show(b,d,0,0,"q")};Listview.extraCols={cost:{id:"cost",name:LANG.cost,getValue:function(a){if(a.cost){return(a.cost[3]&&a.cost[3][0]?a.cost[3][0][1]:0)||a.cost[2]||a.cost[1]||a.cost[0]}},compute:function(a,b){if(a.cost){Listview.funcBox.appendMoney(b,a.cost[0],null,a.cost[1],a.cost[2],a.cost[3])}},sortFunc:function(d,c,e){if(d.cost==null){return -1}else{if(c.cost==null){return 1}}var g=0,f=0;if(d.cost[3]!=null){array_walk(d.cost[3],function(a,b,j,h){g+=Math.pow(10,h)+a[1]})}if(c.cost[3]!=null){array_walk(c.cost[3],function(a,b,j,h){f+=Math.pow(10,h)+a[1]})}return strcmp(g,f)||strcmp(d.cost[2],c.cost[2])||strcmp(d.cost[1],c.cost[1])||strcmp(d.cost[0],c.cost[0])}},count:{id:"count",name:LANG.count,width:"11%",value:"count",compute:function(b,c){if(!(this._totalCount>0||b.outof>0)){return}if(b.outof){var a=ce("div");a.className="small q0";ae(a,ct(sprintf(LANG.lvdrop_outof,b.outof)));ae(c,a)}return b.count},getVisibleText:function(a){var b=a.count;if(a.outof){b+=" "+a.outof}return b}},percent:{id:"percent",name:"%",width:"10%",value:"percent",compute:function(a,b){if(a.count==-1){return"??"}if(a.percent>=1.95){return a.percent.toFixed(0)}else{return parseFloat(a.percent.toFixed(1))}},getVisibleText:function(a){if(a.count==-1){return"??"}if(a.percent>=1.95){return a.percent.toFixed(0)}else{return parseFloat(a.percent.toFixed(1))}}},stock:{id:"stock",name:LANG.stock,width:"10%",value:"stock",compute:function(a,b){if(a.stock>0){return a.stock}else{b.style.fontFamily="Verdana, sans-serif";return String.fromCharCode(8734)}},getVisibleText:function(a){if(a.stock>0){return a.stock}else{return String.fromCharCode(8734)+" infinity"}}}};Listview.funcBox={createSimpleCol:function(c,d,a,b){return{id:c,name:(LANG[d]!==undefined?LANG[d]:d),width:a,value:b}},initLootTable:function(b){var a;if(this._totalCount!=null){a=this._totalCount}else{a=b.outof}if(a==0){if(b.count!=-1){b.percent=b.count}else{b.percent=0}}else{b.percent=b.count/a*100}},assocArrCmp:function(e,d,c){if(e==null){return -1}else{if(d==null){return 1}}var h=Math.max(e.length,d.length);for(var g=0;g<h;++g){if(e[g]==null){return -1}else{if(d[g]==null){return 1}}var f=strcmp(c[e[g]],c[d[g]]);if(f!=0){return f}}return 0},location:function(f,g){if(f.location==null){return -1}for(var d=0,b=f.location.length;d<b;++d){if(d>0){ae(g,ct(LANG.comma))}var e=f.location[d];if(e==-1){ae(g,ct(LANG.ellipsis))}else{var c=ce("a");c.className="q1";c.href="/?zone="+e;ae(c,ct(g_zones[e]));ae(g,c)}}},arrayText:function(b,e){if(b==null){return}var d="";for(var c=0,a=b.length;c<a;++c){if(c>0){d+=" "}if(!e[b[c]]){continue}d+=e[b[c]]}return d},createCenteredIcons:function(h,c,p,m){if(h!=null){var l=ce("div"),a=ce("div");if(p){var k=ce("div");k.style.position="relative";k.style.width="1px";var n=ce("div");n.className="q0";n.style.position="absolute";n.style.right="2px";n.style.lineHeight="26px";n.style.fontSize="11px";n.style.whiteSpace="nowrap";ae(n,ct(p));ae(k,n);ae(l,k)}var g=g_items;if(m==1){g=g_spells}for(var e=0,j=h.length;e<j;++e){var o;if(h[e]==null){o=ce("div");o.style.width=o.style.height="26px"}else{var b,f;if(typeof h[e]=="object"){b=h[e][0];f=h[e][1]}else{b=h[e]}if(b){o=g.createIcon(b,0,f)}else{o=Icon.create("inventoryslot_empty",0,null,"javascript:;")}}o.style.cssFloat=o.style.styleFloat="left";ae(l,o)}l.style.margin="0 auto";l.style.textAlign="left";l.style.width=(26*h.length)+"px";a.className="clear";ae(c,l);ae(c,a);return true}},createSocketedIcons:function(b,e,c,g,n){var m=0,k=ce("div"),a=ce("div");for(var f=0,h=b.length;f<h;++f){var l,j=c[f];if(!c||!j){l=Icon.create(null,0,null,"javascript:;")}else{if(g_items[j]){l=g_items.createIcon(j,0)}else{l=Icon.create(g_gems[j].icon,0,null,"/?item="+j)}}l.className+=" iconsmall-socket-"+g_file_gems[b[f]]+(!c||!j?"-empty":"");l.style.cssFloat=l.style.styleFloat="left";if(g&&g[f]){l.insertBefore(ce("var"),l.childNodes[1]);++m}ae(k,l)}k.style.margin="0 auto";k.style.textAlign="left";k.style.width=(26*b.length)+"px";a.className="clear";ae(e,k);ae(e,a);if(n&&m==b.length){k=ce("div");k.style.paddingTop="4px";ae(k,ct(n));ae(e,k)}},getItemType:function(c,a,b){if(b!=null&&g_item_subsubclasses[c]!=null&&g_item_subsubclasses[c][a]!=null){return{url:"/?items="+c+"."+a+"."+b,text:g_item_subsubclasses[c][a][b]}}if(g_item_subclasses[c]!=null){return{url:"/?items="+c+"."+a,text:g_item_subclasses[c][a]}}else{return{url:"/?items="+c,text:g_item_classes[c]}}},getQuestCategory:function(a){if(a>0){return g_zones[a]}else{return g_quest_sorts[-a]}},getQuestReputation:function(d,b){if(b.reprewards){for(var c=0,a=b.reprewards.length;c<a;++c){if(b.reprewards[c][0]==d){return b.reprewards[c][1]}}}},getFactionCategory:function(b,a){if(b){return g_faction_categories[b]}else{return g_faction_categories[a]}},createTextRange:function(b,a){b|=0;a|=0;if(b>1||a>1){if(b!=a&&a>0){return b+"-"+a}else{return b+""}}return null},coReport:function(d,b,f){if(!g_user.id||!g_report_reasons[f]){return}var a="";if(f==4){a=prompt(LANG.prompt_details,"")}else{if(d==2){if(!confirm((f==5?LANG.confirm_report3:LANG.confirm_report4))){return}}else{if(!confirm(sprintf((d==0?LANG.confirm_report:LANG.confirm_report2),g_report_reasons[f]))){return}}}if(a!=null){var e="/?report&type="+d+"&typeid="+b+"&reason="+f;if(a){e+="&reasonmore="+urlencode(a)}new Ajax(e);var c=ce("span");ae(c,ct(LANG.lvcomment_reported));this.parentNode.replaceChild(c,this)}},coReportClick:function(b,a,c){this.menu=[[2,g_report_reasons[2],Listview.funcBox.coReport.bind(this,a,b.id,2)],[1,g_report_reasons[1],Listview.funcBox.coReport.bind(this,a,b.id,1)],[3,g_report_reasons[3],Listview.funcBox.coReport.bind(this,a,b.id,3)],[4,g_report_reasons[4],Listview.funcBox.coReport.bind(this,a,b.id,4)]];if(a==1&&b.op&&typeof g_pageInfo!="undefined"&&!g_pageInfo.sticky){this.menu.splice(3,0,[0,g_report_reasons[0],Listview.funcBox.coReport.bind(this,a,b.id,0)])}if(a==1&&g_users[b.user].avatar==2){this.menu.push([5,g_report_reasons[5],Listview.funcBox.coReport.bind(this,2,g_users[b.user].avatarmore,5)])}(Menu.showAtCursor.bind(this,c))()},coGetColor:function(c,a){if(c.user&&g_customColors[c.user]){return" comment-"+g_customColors[c.user]}switch(a){case -1:var b=c.divPost.childNodes[1].className.match(/comment-([a-z]+)/);if(b!=null){return" comment-"+b[1]}break;case 3:case 4:if(c.roles&56){return" comment-green"}else{if(c.roles&64){return" comment-gold"}}break}if(c.roles&2){return" comment-blue"}else{if(c.rating>=10){return" comment-green"}else{if(c.rating<0){return" comment-bt"}}}return""},coToggleVis:function(b){this.firstChild.nodeValue=(g_toggleDisplay(b.divBody)?LANG.lvcomment_hide:LANG.lvcomment_show);var a=b.divHeader.firstChild.lastChild;if(b.ratable){a.style.display=""}else{if(b.deleted||b.purged){a.style.fontWeight="normal";a.className="q10";a.innerHTML=(b.deleted?LANG.lvcomment_deleted:LANG.lvcomment_purged);a.style.display=""}}g_toggleDisplay(b.divLinks);if(b.lastEdit!=null){g_toggleDisplay(b.divLastEdit)}},coRate:function(e,a){if(a==0){var c=5;if(g_user.roles&2){c=25}else{if(g_user.roles&16){c=15}}var d=prompt(sprintf(LANG.prompt_customrating,c,c),0);if(d==null){return}else{d|=0;if(d!=0&&Math.abs(d)<=c){a=d}}if(a==0){return}}else{if(g_user.roles&26){a*=5}}new Ajax("/?comment=rate&id="+e.id+"&rating="+a);e.rating+=a;var b=e.divHeader.firstChild;b=b.childNodes[b.childNodes.length-3];b.lastChild.firstChild.nodeValue=(e.rating>0?"+":"")+e.rating;Tooltip.hide();de(b.nextSibling);de(b.nextSibling)},coDelete:function(a){if(a.purged){alert(LANG.message_cantdeletecomment)}else{if(confirm(LANG.confirm_deletecomment)){new Ajax("/?comment=delete&id="+a.id);this.deleteRows([a])}}},coDetach:function(a){if(a.replyTo==0){alert(LANG.message_cantdetachcomment)}else{if(confirm(LANG.confirm_detachcomment)){new Ajax("/?comment=detach&id="+a.id);a.replyTo=0;alert(LANG.message_commentdetached)}}},coEdit:function(g,e){g.divBody.style.display="none";g.divLinks.firstChild.style.display="none";var f=ce("div");f.className="comment-edit";g.divEdit=f;if(e==-1){if(g_users[g.user]!=null){g.roles=g_users[g.user].roles}}var a=Listview.funcBox.coEditAppend(f,g,e);var b=ce("div");b.className="comment-edit-buttons";var d=ce("input");d.type="button";d.value=LANG.compose_save;d.onclick=Listview.funcBox.coEditButton.bind(d,g,true,e);ae(b,d);ae(b,ct(" "));d=ce("input");d.type="button";d.value=LANG.compose_cancel;d.onclick=Listview.funcBox.coEditButton.bind(d,g,false,e);ae(b,d);ae(f,b);var c=f;if(Browser.ie6){c=ce("div");c.style.width="99%";ae(c,f)}if(e==-1){g.divPost.insertBefore(c,g.divBody.nextSibling)}else{g.__div.insertBefore(c,g.divBody.nextSibling)}a.focus()},coEditAppend:function(m,b,l){var f=Listview.funcBox.coGetCharLimit(l);if(l==1||l==3||l==4){b.user=g_user.name;b.roles=g_user.roles;b.rating=1}else{if(l==2){b.roles=g_user.roles;b.rating=1}}if(l==-1||l==0){var j=ce("div");j.className="comment-edit-modes";ae(j,ct(LANG.compose_mode));var o=ce("a");o.className="selected";o.onclick=Listview.funcBox.coModeLink.bind(o,1,l,b);o.href="javascript:;";ae(o,ct(LANG.compose_edit));ae(j,o);ae(j,ct("|"));var u=ce("a");u.onclick=Listview.funcBox.coModeLink.bind(u,2,l,b);u.href="javascript:;";ae(u,ct(LANG.compose_preview));ae(j,u);ae(m,j)}var a=ce("div");a.style.display="none";a.className="comment-body"+Listview.funcBox.coGetColor(b,l);ae(m,a);var h=ce("div");h.className="comment-edit-body";var e=ce("div");e.className="toolbar";var g=ce("textarea");g.className="comment-editbox";g.rows=10;g.value=b.body;switch(l){case 1:g.name="commentbody";g.onfocus=g_revealCaptcha;break;case 2:g.name="desc";g.originalValue=b.body;break;case 3:g.name="body";g.onfocus=g_revealCaptcha;break;case 4:g.name="sig";g.originalValue=b.body;g.rows=(Browser.gecko?2:3);g.style.height="auto";break}if(l!=-1&&l!=0){var d=ce("h3"),v=ce("a"),t=ce("div"),s=ce("div");var c=Listview.funcBox.coLivePreview.bind(g,b,l,t);if(b.body){v.className="disclosure-off";t.style.display="none"}else{v.className="disclosure-on"}ae(v,ct(LANG.compose_livepreview));ae(d,v);v.href="javascript:;";v.onclick=function(){c(1);v.className="disclosure-"+(g_toggleDisplay(t)?"on":"off")};ns(v);d.className="first";s.className="pad";ae(a,d);ae(a,t);ae(a,s);g_onAfterTyping(g,c,50);aE(g,"focus",function(){c();a.style.display="";if(l!=4){g.style.height="22em"}})}else{if(l!=4){aE(g,"focus",function(){g.style.height="22em"})}}var r=[{id:"b",title:LANG.markup_b,pre:"[b]",post:"[/b]"},{id:"i",title:LANG.markup_i,pre:"[i]",post:"[/i]"},{id:"u",title:LANG.markup_u,pre:"[u]",post:"[/u]"},{id:"s",title:LANG.markup_s,pre:"[s]",post:"[/s]"},{id:"small",title:LANG.markup_small,pre:"[small]",post:"[/small]"},{id:"url",title:LANG.markup_url,onclick:function(){var i=prompt(LANG.prompt_linkurl,"http://");if(i){g_insertTag(g,"[url="+i+"]","[/url]")}}},{id:"quote",title:LANG.markup_quote,pre:"[quote]",post:"[/quote]"},{id:"code",title:LANG.markup_code,pre:"[code]",post:"[/code]"},{id:"ul",title:LANG.markup_ul,pre:"[ul]\n[li]",post:"[/li]\n[/ul]",rep:function(i){return i.replace(/\n/g,"[/li]\n[li]")}},{id:"ol",title:LANG.markup_ol,pre:"[ol]\n[li]",post:"[/li]\n[/ol]",rep:function(i){return i.replace(/\n/g,"[/li]\n[li]")}},{id:"li",title:LANG.markup_li,pre:"[li]",post:"[/li]"}];for(var p=0,q=r.length;p<q;++p){var k=r[p];if(l==4&&k.id=="quote"){break}var n=ce("button");var w=ce("img");n.setAttribute("type","button");n.title=k.title;if(k.onclick!=null){n.onclick=k.onclick}else{n.onclick=g_insertTag.bind(0,g,k.pre,k.post,k.rep)}w.src="http://static.wowhead.com/images/pixel.gif";w.className="toolbar-"+k.id;ae(n,w);ae(e,n)}ae(h,e);ae(h,g);ae(h,ce("br"));if(l==4){ae(h,ct(sprintf(LANG.compose_limit2,f,3)))}else{ae(h,ct(sprintf(LANG.compose_limit,f)))}ae(m,h);return g},coLivePreview:function(f,e,a,b){if(b!=1&&a.style.display=="none"){return}var c=this,i=Listview.funcBox.coGetCharLimit(e),g=(c.value.length>i?c.value.substring(0,i):c.value);if(e==4){var h;if((h=g.indexOf("\n"))!=-1&&(h=g.indexOf("\n",h+1))!=-1&&(h=g.indexOf("\n",h+1))!=-1){g=g.substring(0,h)}}var d=Markup.toHtml(g,{mode:Markup.MODE_COMMENT,roles:f.roles});if(d){a.innerHTML=d}else{a.innerHTML='<span class="q6">...</span>'}},coEditButton:function(f,d,e){if(d){var a=gE(f.divEdit,"textarea")[0];if(!Listview.funcBox.coValidate(a,e)){return}if(a.value!=f.body){var c=0;if(f.lastEdit!=null){c=f.lastEdit[1]}++c;f.lastEdit=[g_serverTime,c,g_user.name];Listview.funcBox.coUpdateLastEdit(f);var b=Listview.funcBox.coGetCharLimit(e);f.divBody.innerHTML=Markup.toHtml((a.value.length>b?a.value.substring(0,b):a.value),{mode:Markup.MODE_COMMENT,roles:f.roles});f.body=a.value;if(e==-1){new Ajax("/?forums=editpost&id="+f.id,{method:"POST",params:"body="+urlencode(f.body)})}else{new Ajax("/?comment=edit&id="+f.id,{method:"POST",params:"body="+urlencode(f.body)})}}}f.divBody.style.display="";f.divLinks.firstChild.style.display="";de(f.divEdit);f.divEdit=null},coGetCharLimit:function(a){if(a==2){return 7500}if(a==4){return 250}if(g_user.roles&254){return 16000000}var b=1;if(g_user.premium){b=3}switch(a){case 0:case 1:return 7500*b;case -1:case 3:return 15000*b}},coModeLink:function(e,b,f){var j=Listview.funcBox.coGetCharLimit(b);var c=Markup.MODE_COMMENT;array_walk(gE(this.parentNode,"a"),function(k){k.className=""});this.className="selected";var d=gE(this.parentNode.parentNode,"textarea")[0],i=d.parentNode,a=i.previousSibling;if(b==4){c=Markup.MODE_SIGNATURE}switch(e){case 1:i.style.display="";a.style.display="none";i.firstChild.focus();break;case 2:i.style.display="none";var g=(d.value.length>j?d.value.substring(0,j):d.value);if(b==4){var h;if((h=g.indexOf("\n"))!=-1&&(h=g.indexOf("\n",h+1))!=-1&&(h=g.indexOf("\n",h+1))!=-1){g=g.substring(0,h)}}a.innerHTML=Markup.toHtml(g,{mode:c,roles:f.roles});a.style.display="";break}},coReply:function(b){document.forms.addcomment.elements.replyto.value=b.replyTo;var a=ge("gjkdlfgkjh436");gE(a,"span")[0].innerHTML=b.user;a.style.display="";co_addYourComment()},coValidate:function(a,c){c|=0;if(c==1||c==-1){if(trim(a.value).length<1){alert(LANG.message_forumposttooshort);return false}}else{if(trim(a.value).length<10){alert(LANG.message_commenttooshort);return false}}var b=Listview.funcBox.coGetCharLimit(c);if(a.value.length>b){if(!confirm(sprintf(c==1?LANG.confirm_forumposttoolong:LANG.confirm_commenttoolong,b,a.value.substring(b-30,b)))){return false}}return true},coCustomRatingOver:function(a){Tooltip.showAtCursor(a,LANG.tooltip_customrating,0,0,"q")},coPlusRatingOver:function(a){Tooltip.showAtCursor(a,LANG.tooltip_uprate,0,0,"q2")},coMinusRatingOver:function(a){Tooltip.showAtCursor(a,LANG.tooltip_downrate,0,0,"q10")},coSortDate:function(a){a.nextSibling.nextSibling.className="";a.className="selected";this.mainDiv.className+=" listview-aci";this.setSort([1],true,false)},coSortHighestRatedFirst:function(a){a.previousSibling.previousSibling.className="";a.className="selected";this.mainDiv.className=this.mainDiv.className.replace("listview-aci","");this.setSort([-3,2],true,false)},coFilterByPatchVersion:function(a){this.minPatchVersion=a.value;this.refreshRows()},coUpdateLastEdit:function(f){var b=f.divLastEdit;if(!b){return}if(f.lastEdit!=null){var e=f.lastEdit;b.childNodes[1].firstChild.nodeValue=e[2];b.childNodes[1].href="/?user="+e[2];var c=new Date(e[0]);var d=(g_serverTime-c)/1000;if(b.childNodes[3].firstChild){de(b.childNodes[3].firstChild)}Listview.funcBox.coFormatDate(b.childNodes[3],d,c);var a="";if(f.rating!=null){a+=LANG.lvcomment_patch1+g_getPatchVersion(c)+LANG.lvcomment_patch2}if(e[1]>1){a+=LANG.dash+sprintf(LANG.lvcomment_nedits,e[1])}b.childNodes[4].nodeValue=a;b.style.display=""}else{b.style.display="none"}},coFormatDate:function(f,e,b,g,h){var d;if(e<2592000){var a=sprintf(LANG.date_ago,g_formatTimeElapsed(e));var c=new Date();c.setTime(b.getTime()+(g_localTime-g_serverTime));f.style.cursor="help";f.title=c.toLocaleString()}else{a=LANG.date_on+g_formatDateSimple(b,g)}if(h==1){a=a.substr(0,1).toUpperCase()+a.substr(1)}d=ct(a);ae(f,d)},coFormatFileSize:function(c){var b=-1;var a="KMGTPEZY";while(c>=1024&&b<7){c/=1024;++b}if(b<0){return c+" byte"+(c>1?"s":"")}else{return c.toFixed(1)+" "+a[b]+"B"}},ssCellOver:function(){this.className="screenshot-caption-over"},ssCellOut:function(){this.className="screenshot-caption"},ssCellClick:function(b,d){d=$E(d);if(d.shiftKey||d.ctrlKey){return}var a=0,c=d._target;while(c&&a<3){if(c.nodeName=="A"){return}if(c.nodeName=="IMG"){break}c=c.parentNode}ScreenshotViewer.show({screenshots:this.data,pos:b})},moneyHonorOver:function(a){Tooltip.showAtCursor(a,LANG.tooltip_honorpoints,0,0,"q")},moneyArenaOver:function(a){Tooltip.showAtCursor(a,LANG.tooltip_arenapoints,0,0,"q")},moneyAchievementOver:function(a){Tooltip.showAtCursor(a,LANG.tooltip_achievementpoints,0,0,"q")},appendMoney:function(g,a,f,m,j,c,l){var k,h=0;if(a>=10000){h=1;k=ce("span");k.className="moneygold";ae(k,ct(Math.floor(a/10000)));ae(g,k);a%=10000}if(a>=100){if(h){ae(g,ct(" "))}else{h=1}k=ce("span");k.className="moneysilver";ae(k,ct(Math.floor(a/100)));ae(g,k);a%=100}if(a>=1||f!=null){if(h){ae(g,ct(" "))}else{h=1}k=ce("span");k.className="moneycopper";ae(k,ct(a));ae(g,k)}if(m!=null&&m!=0){if(h){ae(g,ct(" "))}else{h=1}k=ce("span");k.className="money"+(m<0?"horde":"alliance")+" tip";k.onmouseover=Listview.funcBox.moneyHonorOver;k.onmousemove=Tooltip.cursorUpdate;k.onmouseout=Tooltip.hide;ae(k,ct(number_format(Math.abs(m))));ae(g,k)}if(j>=1){if(h){ae(g,ct(" "))}else{h=1}k=ce("span");k.className="moneyarena tip";k.onmouseover=Listview.funcBox.moneyArenaOver;k.onmousemove=Tooltip.cursorUpdate;k.onmouseout=Tooltip.hide;ae(k,ct(number_format(j)));ae(g,k)}if(c!=null){for(var b=0;b<c.length;++b){if(h){ae(g,ct(" "))}else{h=1}var n=c[b][0];var e=c[b][1];k=ce("a");k.href="/?item="+n;k.className="moneyitem";k.style.backgroundImage="url(http://static.wowhead.com/images/icons/tiny/"+g_items.getIcon(n).toLowerCase()+".gif)";ae(k,ct(e));ae(g,k)}}if(l!=null){if(h){ae(g,ct(" "))}else{h=1}k=ce("span");k.className="moneyachievement tip";k.onmouseover=Listview.funcBox.moneyAchievementOver;k.onmousemove=Tooltip.cursorUpdate;k.onmouseout=Tooltip.hide;ae(k,ct(number_format(l)));ae(g,k)}},getUpperSource:function(a,b){switch(a){case 2:if(b.z){return LANG.source_zonedrop}break;case 4:return LANG.source_quests;case 5:return LANG.source_vendors}return g_sources[a]},getLowerSource:function(a,d,c){switch(a){case 3:if(d.p&&g_sources_pvp[d.p]){return{text:g_sources_pvp[d.p]}}break}switch(c){case 0:case 1:case 2:if(d.z){var b={url:"/?zone="+d.z,text:g_zones[d.z]};if(d.t&&a==5){b.pretext=LANG.lvitem_vendorin}if(d.dd&&d.dd!=99){if(d.dd<0){b.posttext=sprintf(LANG.lvitem_dd,"",(d.dd<-1?LANG.lvitem_heroic:LANG.lvitem_normal))}else{b.posttext=sprintf(LANG.lvitem_dd,(d.dd&1?LANG.lvitem_raid10:LANG.lvitem_raid25),(d.dd>2?LANG.lvitem_heroic:LANG.lvitem_normal))}}return b}break;case 5:return{url:"/?quests="+d.c2+"."+d.c,text:Listview.funcBox.getQuestCategory(d.c)};break;case 6:if(d.c&&d.s){return{url:"/?spells="+d.c+"."+d.s,text:g_spell_skills[d.s]}}else{return{url:"/?spells=0",text:"??"}}break}}};Listview.templates={faction:{sort:[1],nItemsPerPage:-1,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",compute:function(d,e){var b=ce("a");b.style.fontFamily="Verdana, sans-serif";b.href=this.template.getItemLink(d);ae(b,ct(d.name));if(d.expansion){var c=ce("span");c.className=(d.expansion==1?"bc-icon":"wotlk-icon");ae(c,b);ae(e,c)}else{ae(e,b)}},getVisibleText:function(a){var b=a.name;if(a.expansion==1){b+=" bc"}else{if(a.expansion==2){b+="wotlk wrath"}}return b}},{id:"side",name:LANG.side,type:"text",compute:function(a,c){if(a.side&&a.side!=3){var b=ce("span");b.className=(a.side==1?"alliance-icon":"horde-icon");b.onmouseover=function(d){Tooltip.showAtCursor(d,g_sides[a.side],0,0,"q")};b.onmousemove=Tooltip.cursorUpdate;b.onmouseout=Tooltip.hide;ae(c,b)}},getVisibleText:function(a){if(a.side){return g_sides[a.side]}},sortFunc:function(d,c,e){return strcmp(g_sides[d.side],g_sides[c.side])}},{id:"category",name:LANG.category,type:"text",width:"16%",compute:function(d,e){if(d.category2!=null){e.className="small q1";var b=ce("a"),c="/?factions="+d.category2;if(d.category){c+="."+d.category}b.href=c;ae(b,ct(Listview.funcBox.getFactionCategory(d.category,d.category2)));ae(e,b)}},getVisibleText:function(a){return Listview.funcBox.getFactionCategory(a.category,a.category2)},sortFunc:function(d,c,f){var e=Listview.funcBox.getFactionCategory;return strcmp(e(d.category,d.category2),e(c.category,c.category2))}}],getItemLink:function(a){return"/?faction="+a.id}},item:{sort:[1],searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",span:2,value:"name",compute:function(n,e,l){var g=ce("td");g.style.width="1px";g.style.padding="0";g.style.borderRight="none";var h=null,o=null;if(n.stack!=null){h=Listview.funcBox.createTextRange(n.stack[0],n.stack[1])}if(n.avail!=null){o=n.avail}ae(g,g_items.createIcon(n.id,(this.iconSize==null?1:this.iconSize),h,o));ae(l,g);e.style.borderLeft="none";var m=ce("a");m.className="q"+(7-parseInt(n.name.charAt(0)));m.style.fontFamily="Verdana, sans-serif";m.href=this.template.getItemLink(n);if(n.rel){Icon.getLink(g.firstChild).rel=n.rel;m.rel=n.rel}ae(m,ct(n.name.substring(1)));var b=ce("div");b.style.position="relative";ae(b,m);if(n.heroic){var j=ce("div");j.className="small q2";j.style.fontStyle="italic";j.style.position="absolute";j.style.right="3px";j.style.bottom="3px";ae(j,ct(LANG.lvitem_heroicitem));ae(b,j)}ae(e,b);if(typeof fi_nExtraCols=="number"&&fi_nExtraCols>=5){if(n.source!=null&&n.source.length==1){var j=ce("div");j.className="small2";var c=(n.sourcemore?n.sourcemore[0]:{});var k=0;if(c.t){k=c.t;var m=ce("a");if(c.q!=null){m.className="q"+c.q}else{m.className="q1"}m.href="/?"+g_types[c.t]+"="+c.ti;if(c.n.length<=30){ae(m,ct(c.n))}else{m.title=c.n;ae(m,ct(trim(c.n.substr(0,27))+"..."))}ae(j,m)}else{ae(j,ct(Listview.funcBox.getUpperSource(n.source[0],c)))}var f=Listview.funcBox.getLowerSource(n.source[0],c,k);if(f!=null){ae(j,ct(LANG.hyphen));if(f.pretext){ae(j,ct(f.pretext))}if(f.url){var m=ce("a");m.className="q1";m.href=f.url;ae(m,ct(f.text));ae(j,m)}else{ae(j,ct(f.text))}if(f.posttext){ae(j,ct(f.posttext))}}ae(e,j)}}},getVisibleText:function(c){var e=c.name.substring(1);if(typeof fi_nExtraCols=="number"&&fi_nExtraCols>=5){if(c.source!=null&&c.source.length==1){var d=(c.sourcemore?c.sourcemore[0]:{});var b=0;if(d.t){b=d.t;e+=" "+d.n}else{e+=" "+Listview.funcBox.getUpperSource(c.source[0],d)}var a=Listview.funcBox.getLowerSource(c.source[0],d,b);if(a!=null){if(a.pretext){e+=" "+a.pretext}e+=" "+a.text;if(a.posttext){e+=" "+a.posttext}}}}return e}},{id:"level",name:LANG.level,value:"level"},{id:"reqlevel",name:LANG.req,tooltip:LANG.tooltip_reqlevel,value:"reqlevel",compute:function(a,b){if(a.reqlevel>1){return a.reqlevel}}},{id:"side",name:LANG.side,type:"text",compute:function(a,c){if(a.side&&a.side!=3){var b=ce("span");b.className=(a.side==1?"alliance-icon":"horde-icon");b.onmouseover=function(d){Tooltip.showAtCursor(d,g_sides[a.side],0,0,"q")};b.onmousemove=Tooltip.cursorUpdate;b.onmouseout=Tooltip.hide;ae(c,b)}},getVisibleText:function(a){if(a.side){return g_sides[a.side]}},sortFunc:function(d,c,e){return strcmp(g_sides[d.side],g_sides[c.side])}},{id:"dps",name:LANG.dps,value:"dps",compute:function(a,b){return(a.dps||0).toFixed(1)},hidden:true},{id:"speed",name:LANG.speed,value:"speed",compute:function(a,b){return(a.speed||0).toFixed(2)},hidden:true},{id:"armor",name:LANG.armor,value:"armor",compute:function(a,b){if(a.armor>0){return a.armor}},hidden:true},{id:"slot",name:LANG.slot,type:"text",compute:function(a,b){nw(b);return g_item_slots[a.slot]},getVisibleText:function(a){return g_item_slots[a.slot]},sortFunc:function(d,c,e){return strcmp(g_item_slots[d.slot],g_item_slots[c.slot])},hidden:true},{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(a,b){if(a.glyph){return g_item_glyphs[a.glyph]}},getVisibleText:function(a){return g_item_glyphs[a.glyph]},sortFunc:function(d,c,e){return strcmp(g_item_glyphs[d.glyph],g_item_glyphs[c.glyph])},hidden:true},{id:"source",name:LANG.source,type:"text",compute:function(k,d){if(this.iconSize==0){d.className="small"}if(k.source!=null){if(k.source.length==1){nw(d);var c=(k.sourcemore?k.sourcemore[0]:{});var h=0;if(c.t){h=c.t;var j=ce("a");if(c.q!=null){j.className="q"+c.q}else{j.className="q1"}j.href="/?"+g_types[c.t]+"="+c.ti;if(this.iconSize==0||c.n.length<=20){ae(j,ct(c.n))}else{j.title=c.n;ae(j,ct(trim(c.n.substr(0,17))+"..."))}ae(d,j)}else{ae(d,ct(Listview.funcBox.getUpperSource(k.source[0],c)))}var f=Listview.funcBox.getLowerSource(k.source[0],c,h);if(this.iconSize!=0&&f!=null){var b=ce("div");b.className="small2";if(f.pretext){ae(b,ct(f.pretext))}if(f.url){var j=ce("a");j.className="q1";j.href=f.url;ae(j,ct(f.text));ae(b,j)}else{ae(b,ct(f.text))}if(f.posttext){ae(b,ct(f.posttext))}ae(d,b)}}else{var l="";for(var e=0,g=k.source.length;e<g;++e){if(e>0){l+=LANG.comma}l+=g_sources[k.source[e]]}return l}}},getVisibleText:function(c){if(c.source!=null){if(c.source.length==1){var e="";var d=(c.sourcemore?c.sourcemore[0]:{});var b=0;if(d.t){b=d.t;e+=" "+d.n}else{e+=" "+Listview.funcBox.getUpperSource(c.source[0],d)}var a=Listview.funcBox.getLowerSource(c.source[0],d,b);if(a!=null){if(a.pretext){e+=" "+a.pretext}e+=" "+a.text;if(a.posttext){e+=" "+a.posttext}}return e}else{return Listview.funcBox.arrayText(c.source,g_sources)}}},sortFunc:function(f,d){var g=Listview.funcBox.assocArrCmp(f.source,d.source,g_sources);if(g!=0){return g}var e=(f.sourcemore&&f.source.length==1?f.sourcemore[0].n:null),c=(d.sourcemore&&d.source.length==1?d.sourcemore[0].n:null);return strcmp(e,c)}},{id:"type",name:LANG.type,type:"text",compute:function(d,e){e.className="small q1";nw(e);var b=ce("a");var c=Listview.funcBox.getItemType(d.classs,d.subclass,d.subsubclass);b.href=c.url;ae(b,ct(c.text));ae(e,b)},getVisibleText:function(a){return Listview.funcBox.getItemType(a.classs,a.subclass,a.subsubclass).text},sortFunc:function(d,c,f){var e=Listview.funcBox.getItemType;return strcmp(e(d.classs,d.subclass,d.subsubclass).text,e(c.classs,c.subclass,c.subsubclass).text)}}],getItemLink:function(a){return"/?item="+a.id},onBeforeCreate:function(){var b=false;for(var c=0,a=this.data.length;c<a;++c){var d=this.data[c];if(d.slot>0&&d.slot!=18){++b}else{d.__nochk=1}}if(b>0){this.mode=1;this._nComparable=b}},createCbControls:function(d,c){if(!c&&this._nComparable<15){return}var b=ce("input"),a=ce("input");b.type=a.type="button";b.value=LANG.button_compare;a.value=LANG.button_deselect;b.onclick=this.template.compareItems.bind(this);a.onclick=Listview.cbSelect.bind(this,false);ae(d,b);ae(d,a)},compareItems:function(){var b=this.getCheckedRows();if(!b.length){return}var a="";array_walk(b,function(c){a+=c.id+";"});su_addToSaved(rtrim(a,";"),b.length)}},itemset:{sort:[1],nItemsPerPage:75,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",compute:function(c,g){var b=ce("a");b.className="q"+(7-parseInt(c.name.charAt(0)));b.style.fontFamily="Verdana, sans-serif";b.href=this.template.getItemLink(c);ae(b,ct(c.name.substring(1)));var f=ce("div");f.style.position="relative";ae(f,b);if(c.heroic){var e=ce("div");e.className="small q2";e.style.fontStyle="italic";e.style.position="absolute";e.style.right="3px";e.style.bottom="3px";ae(e,ct(LANG.lvitem_heroicitem));ae(f,e)}ae(g,f);if(c.note){var e=ce("div");e.className="small";ae(e,ct(g_itemset_notes[c.note]));ae(g,e)}},getVisibleText:function(a){var b=a.name.substring(1);if(a.note){b+=" "+g_itemset_notes[a.note]}return b}},{id:"level",name:LANG.level,type:"range",getMinValue:function(a){return a.minlevel},getMaxValue:function(a){return a.maxlevel},compute:function(a,b){if(a.minlevel>0&&a.maxlevel>0){if(a.minlevel!=a.maxlevel){return a.minlevel+LANG.hyphen+a.maxlevel}else{return a.minlevel}}else{return -1}},sortFunc:function(d,c,e){if(e>0){return strcmp(d.minlevel,c.minlevel)||strcmp(d.maxlevel,c.maxlevel)}else{return strcmp(d.maxlevel,c.maxlevel)||strcmp(d.minlevel,c.minlevel)}}},{id:"pieces",name:LANG.pieces,getValue:function(a){return a.pieces.length},compute:function(a,b){b.style.padding="0";Listview.funcBox.createCenteredIcons(a.pieces,b)},sortFunc:function(d,c){var f=(d.pieces!=null?d.pieces.length:0);var e=(c.pieces!=null?c.pieces.length:0);return strcmp(f,e)}},{id:"type",name:LANG.type,type:"text",compute:function(a,b){return g_itemset_types[a.type]},sortFunc:function(d,c,e){return strcmp(g_itemset_types[d.type],g_itemset_types[c.type])}},{id:"classes",name:LANG.classes,type:"text",compute:function(c,e){if(c.classes!=null){var d="";for(var b=0,a=c.classes.length;b<a;++b){if(b>0){d+=LANG.comma}d+=g_chr_classes[c.classes[b]]}return d}},sortFunc:function(d,c,e){return Listview.funcBox.assocArrCmp(d.classes,c.classes,g_chr_classes)}}],getItemLink:function(a){return"/?itemset="+a.id}},npc:{sort:[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=ce("a");b.style.fontFamily="Verdana, sans-serif";b.href=this.template.getItemLink(c);ae(b,ct(c.name));ae(f,b);if(c.tag!=null){var e=ce("div");e.className="small";ae(e,ct("<"+c.tag+">"));ae(f,e)}},getVisibleText:function(a){var b=a.name;if(a.tag){b+=" <"+a.tag+">"}return b}},{id:"level",name:LANG.level,type:"range",width:"10%",getMinValue:function(a){return a.minlevel},getMaxValue:function(a){return a.maxlevel},compute:function(a,c){if(a.classification){var b=ce("div");b.className="small";ae(b,ct(g_npc_classifications[a.classification]));ae(c,b)}if(a.classification==3){return"??"}if(a.minlevel>0&&a.maxlevel>0){if(a.minlevel!=a.maxlevel){return a.minlevel+LANG.hyphen+a.maxlevel}else{return a.minlevel}}return -1},getVisibleText:function(a){var b="";if(a.classification){b+=" "+g_npc_classifications[a.classification]}if(a.minlevel>0&&a.maxlevel>0){b+=" ";if(a.minlevel!=a.maxlevel){b+=a.minlevel+LANG.hyphen+a.maxlevel}else{b+=a.minlevel}}return b},sortFunc:function(d,c,e){if(e>0){return strcmp(d.minlevel,c.minlevel)||strcmp(d.maxlevel,c.maxlevel)||strcmp(d.classification,c.classification)}else{return strcmp(d.maxlevel,c.maxlevel)||strcmp(d.minlevel,c.minlevel)||strcmp(d.classification,c.classification)}}},{id:"location",name:LANG.location,type:"text",compute:function(a,b){return Listview.funcBox.location(a,b)},getVisibleText:function(a){return Listview.funcBox.arrayText(a.location,g_zones)},sortFunc:function(d,c,e){return Listview.funcBox.assocArrCmp(d.location,c.location,g_zones)}},{id:"react",name:LANG.react,type:"text",width:"10%",value:"react",filtrable:0,compute:function(b,g){if(b.react==null){return -1}var d=[LANG.lvnpc_alliance,LANG.lvnpc_horde];var f=0;for(var a=0;a<2;++a){if(b.react[a]!=null){if(f++>0){ae(g,ct(" "))}var e=ce("span");e.className=(b.react[a]<0?"q10":(b.react[a]>0?"q2":"q"));ae(e,ct(d[a]));ae(g,e)}}}},{id:"skin",name:LANG.skin,type:"text",value:"skin",compute:function(c,d){if(c.skin){var b=ce("a");b.className="q1";b.href="/?npcs&filter=cr=35;crs=0;crv="+c.skin;ae(b,ct(c.skin));ae(d,b)}},hidden:1},{id:"petfamily",name:LANG.petfamily,type:"text",width:"12%",compute:function(c,d){d.className="q1";var b=ce("a");b.href="/?pet="+c.family;ae(b,ct(g_pet_families[c.family]));ae(d,b)},getVisibleText:function(a){return g_pet_families[a.family]},sortFunc:function(d,c,e){return strcmp(g_pet_families[d.family],g_pet_families[c.family])},hidden:1},{id:"type",name:LANG.type,type:"text",width:"12%",compute:function(c,d){d.className="small q1";var b=ce("a");b.href="/?npcs="+c.type;ae(b,ct(g_npc_types[c.type]));ae(d,b)},getVisibleText:function(a){return g_npc_types[a.type]},sortFunc:function(d,c,e){return strcmp(g_npc_types[d.type],g_npc_types[c.type])}}],getItemLink:function(a){return"/?npc="+a.id}},object:{sort:[1],nItemsPerPage:100,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",compute:function(c,d){var b=ce("a");b.style.fontFamily="Verdana, sans-serif";b.href=this.template.getItemLink(c);ae(b,ct(c.name));ae(d,b)}},{id:"location",name:LANG.location,type:"text",compute:function(a,b){return Listview.funcBox.location(a,b)},getVisibleText:function(a){return Listview.funcBox.arrayText(a.location,g_zones)},sortFunc:function(d,c,e){return Listview.funcBox.assocArrCmp(d.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,d){d.className="small q1";var b=ce("a");b.href="/?objects="+c.type;ae(b,ct(g_object_types[c.type]));ae(d,b)},getVisibleText:function(a){return g_object_types[a.type]},sortFunc:function(d,c,e){return strcmp(g_object_types[d.type],g_object_types[c.type])}}],getItemLink:function(a){return"/?object="+a.id}},quest:{sort:[1,2],nItemsPerPage:100,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",compute:function(c,d){var b=ce("a");b.style.fontFamily="Verdana, sans-serif";b.href=this.template.getItemLink(c);ae(b,ct(c.name));ae(d,b)}},{id:"level",name:LANG.level,width:"7%",value:"level",compute:function(a,c){if(a.type||a.daily||a.weekly){var b=ce("div");b.className="small";nw(b);if(a.daily){if(a.type){ae(b,ct(sprintf(LANG.lvquest_daily,g_quest_types[a.type])))}else{ae(b,ct(LANG.daily))}}else{if(a.weekly){if(a.type){ae(b,ct(sprintf(LANG.lvquest_weekly,g_quest_types[a.type])))}else{ae(b,ct(LANG.weekly))}}else{if(a.type){ae(b,ct(g_quest_types[a.type]))}}}ae(c,b)}return a.level},getVisibleText:function(a){var b="";if(a.type){b+=" "+g_quest_types[a.type]}if(a.daily){b+=" "+LANG.daily}else{if(a.weekly){b+=" "+LANG.weekly}}if(a.level){b+=" "+a.level}return b},sortFunc:function(d,c,e){return strcmp(d.level,c.level)||strcmp(d.type,c.type)}},{id:"reqlevel",name:LANG.req,tooltip:LANG.tooltip_reqlevel,width:"7%",value:"reqlevel"},{id:"side",name:LANG.side,type:"text",compute:function(a,c){if(a.side&&a.side!=3){var b=ce("span");b.className=(a.side==1?"alliance-icon":"horde-icon");b.onmouseover=function(d){Tooltip.showAtCursor(d,g_sides[a.side],0,0,"q")};b.onmousemove=Tooltip.cursorUpdate;b.onmouseout=Tooltip.hide;ae(c,b)}},getVisibleText:function(a){if(a.side){return g_sides[a.side]}},sortFunc:function(d,c,e){return strcmp(g_sides[d.side],g_sides[c.side])}},{id:"rewards",name:LANG.rewards,filtrable:0,width:"25%",compute:function(b,g){var a=(b.itemchoices!=null||b.itemrewards!=null);if(a){g.style.padding="0";var f,e;if(b.itemchoices&&b.itemchoices.length>1){f=LANG.lvquest_pickone;if(b.itemrewards&&b.itemrewards.length>0){e=LANG.lvquest_alsoget}}Listview.funcBox.createCenteredIcons(b.itemchoices,g,f);Listview.funcBox.createCenteredIcons(b.itemrewards,g,e)}if(b.xp>0||b.money>0){var c=ce("div");if(a){c.style.padding="4px"}if(b.xp>0){ae(c,ct(sprintf(LANG.lvquest_xp,b.xp)+(b.money>0?" + ":"")))}if(b.money>0){Listview.funcBox.appendMoney(c,b.money)}ae(g,c)}},getVisibleText:function(a){var b="";if(a.itemchoices&&a.itemchoices.length){b+=" "+LANG.lvquest_pickone;if(a.itemrewards&&a.itemrewards.length){b+=" "+LANG.lvquest_alsoget}}if(a.xp>0){b+=" "+sprintf(LANG.lvquest_xp,a.xp)}return b},sortFunc:function(d,c,e){var g=(d.itemchoices!=null?d.itemchoices.length:0)+(d.itemrewards!=null?d.itemrewards.length:0);var f=(c.itemchoices!=null?c.itemchoices.length:0)+(c.itemrewards!=null?c.itemrewards.length:0);return strcmp(g,f)||strcmp((d.xp|0)+(d.money|0),(c.xp|0)+(c.money|0))}},{id:"reputation",name:LANG.reputation,width:"14%",value:"id",hidden:true},{id:"category",name:LANG.category,type:"text",width:"16%",compute:function(c,d){if(c.category!=0){d.className="small q1";var b=ce("a");b.href="/?quests="+c.category2+"."+c.category;ae(b,ct(Listview.funcBox.getQuestCategory(c.category)));ae(d,b)}},getVisibleText:function(a){return Listview.funcBox.getQuestCategory(a.category)},sortFunc:function(d,c,f){var e=Listview.funcBox.getQuestCategory;return strcmp(e(d.category),e(c.category))}}],getItemLink:function(a){return"/?quest="+a.id}},spell:{sort:[1,2],searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",span:2,value:"name",compute:function(g,e,k){var f=ce("td"),o;f.style.width="44px";f.style.padding="0";f.style.borderRight="none";if(g.creates!=null){o=g_items.createIcon(g.creates[0],1,Listview.funcBox.createTextRange(g.creates[1],g.creates[2]))}else{o=g_spells.createIcon(g.id,1)}o.style.cssFloat=o.style.styleFloat="left";ae(f,o);ae(k,f);e.style.borderLeft="none";var b=ce("div");var n=ce("a");var l=g.name.charAt(0);if(l!="@"){n.className="q"+(7-parseInt(l))}n.style.fontFamily="Verdana, sans-serif";n.href=this.template.getItemLink(g);ae(n,ct(g.name.substring(1)));ae(b,n);if(g.rank){var j=ce("div");j.className="small2";ae(j,ct(g.rank));ae(b,j)}if(g.races!=null){b.style.position="relative";var j=ce("div");j.className="small";j.style.fontStyle="italic";j.style.position="absolute";j.style.right=j.style.bottom="3px";var m=g.races.toString();if(m=="1,3,4,7,11"){ae(j,ct(g_sides[1]))}else{if(m=="2,5,6,8,10"){ae(j,ct(g_sides[2]))}else{for(var f=0,h=g.races.length;f<h;++f){if(f>0){ae(j,ct(LANG.comma))}ae(j,ct(g_chr_races[g.races[f]]))}}}ae(b,j)}ae(e,b)},getVisibleText:function(a){var b=a.name;if(a.rank){b+=" "+a.rank}if(a.races){b+=" "+Listview.funcBox.arrayText(a.races,g_chr_races)}return b}},{id:"level",name:LANG.level,width:"10%",value:"level",compute:function(a,b){if(a.level>0){return a.level}},hidden:true},{id:"school",name:LANG.school,type:"text",width:"10%",hidden:true,compute:function(a,b){return g_spell_resistances[a.school]},sortFunc:function(d,c,e){return strcmp(g_spell_resistances[d.school],g_spell_resistances[c.school])}},{id:"reagents",name:LANG.reagents,align:"left",width:"9%",getValue:function(a){return(a.reagents?a.reagents.length:0)},compute:function(g,c){var a=(g.reagents!=null);if(a){c.style.padding="0";var k=ce("div");var j=g.reagents;k.style.width=(44*j.length)+"px";for(var e=0,h=j.length;e<h;++e){var b=j[e][0];var f=j[e][1];var l=g_items.createIcon(b,1,f);l.style.cssFloat=l.style.styleFloat="left";ae(k,l);if(this.centerReagents){k.style.margin="0 auto"}}ae(c,k)}},sortFunc:function(d,c){var f=(d.reagents!=null?d.reagents.length:0);var e=(c.reagents!=null?c.reagents.length:0);if(f>0&&f==e){return strcmp(d.reagents.toString(),c.reagents.toString())}else{return strcmp(f,e)}}},{id:"tp",name:LANG.tp,tooltip:LANG.tooltip_trainingpoints,width:"7%",hidden:true,value:"tp",compute:function(a,b){if(a.tp>0){return a.tp}}},{id:"source",name:LANG.source,type:"text",width:"12%",hidden:true,compute:function(b,e){if(b.source!=null){var d="";for(var c=0,a=b.source.length;c<a;++c){if(c>0){d+=LANG.comma}d+=g_sources[b.source[c]]}return d}},sortFunc:function(d,c,e){return Listview.funcBox.assocArrCmp(d.source,c.source,g_sources)}},{id:"skill",name:LANG.skill,type:"text",width:"16%",getValue:function(a){return a.learnedat},compute:function(f,d,j,n){if(f.skill!=null){this.skillsColumn=n;var b=ce("div");b.className="small";for(var e=0,g=f.skill.length;e<g;++e){if(e>0){ae(b,ct(LANG.comma))}if(f.skill[e]==-1){ae(b,ct(LANG.ellipsis))}else{if(in_array([7,-2,-3,-5,-6,-7,11,9],f.cat)!=-1){var l=ce("a");l.className="q1";if(in_array([-5,-6,-7],f.cat)!=-1){l.href="/?spells="+f.cat}else{l.href="/?spells="+f.cat+"."+(f.chrclass?(1+Math.log(f.chrclass)/Math.LN2)+".":"")+f.skill[e]}ae(l,ct(g_spell_skills[f.skill[e]]));ae(b,l)}else{ae(b,ct(g_spell_skills[f.skill[e]]))}}}if(f.learnedat>0){ae(b,ct(" ("));var c=ce("span");if(f.learnedat==9999){c.className="q0";ae(c,ct("??"))}else{if(f.learnedat>0){ae(c,ct(f.learnedat));c.style.fontWeight="bold"}}ae(b,c);ae(b,ct(")"))}ae(d,b);if(f.colors!=null){this.template.columns[n].type=null;var h=f.colors,m=0;for(var e=0;e<h.length;++e){if(h[e]>0){++m;break}}if(m>0){m=0;b=ce("div");b.className="small";b.style.fontWeight="bold";for(var e=0;e<h.length;++e){if(h[e]>0){if(m++>0){ae(b,ct(" "))}var k=ce("span");k.className="r"+(e+1);ae(k,ct(h[e]));ae(b,k)}}ae(d,b)}}}},getVisibleText:function(a){var b=Listview.funcBox.arrayText(a.skill,g_spell_skills);if(a.learnedat>0){b+=" "+(a.learnedat==9999?"??":a.learnedat)}return b},sortFunc:function(e,c){var d=[e.learnedat,c.learnedat];for(var g=0;g<2;++g){var h=(g==0?e:c);if(d[g]==9999&&h.colors!=null){var f=0;while(h.colors[f]==0&&f<h.colors.length){f++}if(f<h.colors.length){d[g]=h.colors[f]}}}var j=strcmp(d[0],d[1]);if(j!=0){return j}if(e.colors!=null&&c.colors!=null){for(var f=0;f<4;++f){j=strcmp(e.colors[f],c.colors[f]);if(j!=0){return j}}}return Listview.funcBox.assocArrCmp(e.skill,c.skill,g_spell_skills)}}],getItemLink:function(a){return"/?spell="+a.id},onBeforeCreate:function(){if(this.centerReagents){this.columns[3].align=null}}},zone:{sort:[1],nItemsPerPage:-1,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",compute:function(c,e){var b=ce("a");b.style.fontFamily="Verdana, sans-serif";b.href=this.template.getItemLink(c);ae(b,ct(c.name));if(c.expansion){var d=ce("span");d.className=(c.expansion==1?"bc-icon":"wotlk-icon");ae(d,b);ae(e,d)}else{ae(e,b)}},getVisibleText:function(a){var b=a.name;if(a.expansion==1){b+=" bc"}else{if(a.expansion==2){b+="wotlk wrath"}}return b}},{id:"level",name:LANG.level,type:"range",width:"10%",getMinValue:function(a){return a.minlevel},getMaxValue:function(a){return a.maxlevel},compute:function(a,b){if(a.minlevel>0&&a.maxlevel>0){if(a.minlevel!=a.maxlevel){return a.minlevel+LANG.hyphen+a.maxlevel}else{return a.minlevel}}},sortFunc:function(d,c,e){if(e>0){return strcmp(d.minlevel,c.minlevel)||strcmp(d.maxlevel,c.maxlevel)}else{return strcmp(d.maxlevel,c.maxlevel)||strcmp(d.minlevel,c.minlevel)}}},{id:"territory",name:LANG.territory,type:"text",width:"13%",compute:function(a,c){var b=ce("span");switch(a.territory){case 0:b.className="alliance-icon";break;case 1:b.className="horde-icon";break;case 4:b.className="ffapvp-icon";break}ae(b,ct(g_zone_territories[a.territory]));ae(c,b)},getVisibleText:function(a){return g_zone_territories[a.territory]},sortFunc:function(d,c,e){return strcmp(g_zone_territories[d.territory],g_zone_territories[c.territory])}},{id:"instancetype",name:LANG.instancetype,type:"text",compute:function(a,d){if(a.instance>0){var b=ce("span");if((a.instance>=1&&a.instance<=5)||a.instance==7){b.className="instance-icon"+a.instance}if(a.nplayers==-2){a.nplayers="10/25"}var c=g_zone_instancetypes[a.instance];if(a.nplayers&&((a.instance!=2&&a.instance!=5)||a.nplayers>5)){c+=" (";if(a.instance==4){c+=sprintf(LANG.lvzone_xvx,a.nplayers,a.nplayers)}else{c+=sprintf(LANG.lvzone_xman,a.nplayers)}c+=")"}ae(b,ct(c));ae(d,b)}},getVisibleText:function(a){if(a.instance>0){var b=g_zone_instancetypes[a.instance];if(a.nplayers&&((a.instance!=2&&a.instance!=5)||a.nplayers>5)){if(a.instance==4){b+=" "+sprintf(LANG.lvzone_xvx,a.nplayers,a.nplayers)}else{b+=" "+sprintf(LANG.lvzone_xman,a.nplayers)}}return b}},sortFunc:function(d,c,e){return strcmp(g_zone_instancetypes[d.instance],g_zone_instancetypes[c.instance])||strcmp(d.instance,c.instance)||strcmp(d.nplayers,c.nplayers)}},{id:"category",name:LANG.category,type:"text",width:"15%",compute:function(c,d){d.className="small q1";var b=ce("a");b.href="/?zones="+c.category;ae(b,ct(g_zone_categories[c.category]));ae(d,b)},getVisibleText:function(a){return g_zone_categories[a.category]},sortFunc:function(d,c,e){return strcmp(g_zone_categories[d.category],g_zone_categories[c.category])}}],getItemLink:function(a){return"/?zone="+a.id}},comment:{sort:[1],mode:2,nItemsPerPage:40,poundable:2,columns:[{value:"number"},{value:"id"},{value:"rating"}],compute:function(t,I){var M,s=new Date(t.date),G=(g_serverTime-s)/1000,d=(g_user.roles&26)!=0,J=t.rating<0||t.purged||t.deleted||(t.__minPatch&&g_getPatchVersion.T[t.__minPatch]>s),D=d||t.user.toLowerCase()==g_user.name.toLowerCase(),v=D&&t.deleted==0,c=D&&t.replyTo!=t.id,K=((t.roles&26)==0),E=t.purged==0&&t.deleted==0&&g_user.id&&t.user.toLowerCase()!=g_user.name.toLowerCase()&&in_array(t.raters,g_user.id,function(N){return N[0]})==-1,i=t.rating>=0&&(g_user.id==0||E);t.ratable=E;I.className="comment";if(t.indent){I.className+=" comment-indent"}var w=ce("div");var m=ce("div");var k=ce("div");t.divHeader=w;t.divBody=m;t.divLinks=k;w.className=(J?"comment-header-bt":"comment-header");var g=ce("div");g.className="comment-rating";if(J){var p=ce("a");p.href="javascript:;";p.onclick=Listview.funcBox.coToggleVis.bind(p,t);ae(p,ct(LANG.lvcomment_show));ae(g,p);ae(g,ct(" "+String.fromCharCode(160)+" "))}var n=ce("b");ae(n,ct(LANG.lvcomment_rating));var q=ce("span");ae(q,ct((t.rating>0?"+":"")+t.rating));ae(n,q);ae(g,n);ae(g,ct(" "));var C=ce("span");var j=ce("a"),L=ce("a");if(E){j.href=L.href="javascript:;";j.onclick=Listview.funcBox.coRate.bind(j,t,1);L.onclick=Listview.funcBox.coRate.bind(L,t,-1);if(d){var B=ce("a");B.href="javascript:;";B.onclick=Listview.funcBox.coRate.bind(B,t,0);B.onmouseover=Listview.funcBox.coCustomRatingOver;B.onmousemove=Tooltip.cursorUpdate;B.onmouseout=Tooltip.hide;ae(B,ct("[~]"));ae(C,B);ae(C,ct(" "))}}else{j.href=L.href="/?account=signin"}ae(j,ct("[+]"));j.onmouseover=Listview.funcBox.coPlusRatingOver;L.onmouseover=Listview.funcBox.coMinusRatingOver;j.onmousemove=L.onmousemove=Tooltip.cursorUpdate;j.onmouseout=L.onmouseout=Tooltip.hide;ae(L,ct("[-]"));ae(C,L);ae(C,ct(" "));ae(C,j);ae(g,C);if(!i){C.style.display="none"}ae(w,g);ae(w,ct(LANG.lvcomment_by));var H=ce("a");H.href="/?user="+t.user;ae(H,ct(t.user));ae(w,H);ae(w,ct(" "));var a=ce("a");a.className="q0";a.id="comments:id="+t.id;a.href="#"+a.id;Listview.funcBox.coFormatDate(a,G,s);a.style.cursor="pointer";ae(w,a);ae(w,ct(LANG.lvcomment_patch1+g_getPatchVersion(s)+LANG.lvcomment_patch2));ae(I,w);m.className="comment-body"+Listview.funcBox.coGetColor(t);if(t.indent){m.className+=" comment-body-indent"}m.innerHTML=Markup.toHtml(t.body,{mode:Markup.MODE_COMMENT,roles:t.roles});ae(I,m);if((t.roles&26)==0||g_user.roles&26){var F=ce("div");t.divLastEdit=F;F.className="comment-lastedit";ae(F,ct(LANG.lvcomment_lastedit));var o=ce("a");ae(o,ct(" "));ae(F,o);ae(F,ct(" "));var A=ce("span");ae(F,A);ae(F,ct(" "));Listview.funcBox.coUpdateLastEdit(t);if(J){F.style.display="none"}ae(I,F)}k.className="comment-links";if(D){var b=ce("span");var z=ce("a");ae(z,ct(LANG.lvcomment_edit));z.onclick=Listview.funcBox.coEdit.bind(this,t,0);ns(z);z.href="javascript:;";ae(b,z);ae(b,ct("|"));ae(k,b)}if(v){var l=ce("span");var r=ce("a");ae(r,ct(LANG.lvcomment_delete));r.onclick=Listview.funcBox.coDelete.bind(this,t);ns(r);r.href="javascript:;";ae(l,r);ae(l,ct("|"));ae(k,l)}if(c){var y=ce("span");var e=ce("a");ae(e,ct(LANG.lvcomment_detach));e.onclick=Listview.funcBox.coDetach.bind(this,t);ns(e);e.href="javascript:;";ae(y,e);ae(y,ct("|"));ae(k,y)}if(K){var u=ce("span");var f=ce("a");ae(f,ct(LANG.lvcomment_report));if(g_user.id>0){f.onclick=Listview.funcBox.coReportClick.bind(f,t,0);f.href="javascript:;"}else{f.href="/?account=signin"}ae(u,f);ae(u,ct("|"));ae(k,u)}var h=ce("a");ae(h,ct(LANG.lvcomment_reply));if(g_user.id>0){h.onclick=Listview.funcBox.coReply.bind(this,t);h.href="javascript:;"}else{h.href="/?account=signin"}ae(k,h);if(J){m.style.display="none";k.style.display="none"}ae(I,k)},createNote:function(b){var g=ce("small");var l=ce("a");if(g_user.id>0){l.href="javascript:;";l.onclick=co_addYourComment}else{l.href="/?account=signin"}ae(l,ct(LANG.lvcomment_add));ae(g,l);var e=ce("span");e.style.padding="0 5px";e.style.color="white";ae(e,ct("|"));ae(g,e);ae(g,ct(LANG.lvcomment_sort));var m=ce("a");m.href="javascript:;";ae(m,ct(LANG.lvcomment_sortdate));m.onclick=Listview.funcBox.coSortDate.bind(this,m);ae(g,m);ae(g,ct(LANG.comma));var n=ce("a");n.href="javascript:;";ae(n,ct(LANG.lvcomment_sortrating));n.onclick=Listview.funcBox.coSortHighestRatedFirst.bind(this,n);ae(g,n);m.onclick();var e=ce("span");e.style.padding="0 5px";e.style.color="white";ae(e,ct("|"));ae(g,e);var o=ce("select");var f=ce("option");f.value=0;f.selected="selected";ae(o,f);var k={};for(var i=0;i<this.data.length;++i){var h=new Date(this.data[i].date).getTime();k[g_getPatchVersionIndex(h)]=true}var j=[];for(var c in k){j.push(c)}j.sort(function(p,d){return d-p});for(var c=0;c<j.length;++c){var f=ce("option");f.value=j[c];ae(f,ct(g_getPatchVersion.V[j[c]]));ae(o,f)}o.onchange=Listview.funcBox.coFilterByPatchVersion.bind(this,o);ae(g,ct(LANG.lvcomment_patchfilter));ae(g,o);ae(b,g)},onNoData:function(c){if(typeof g_pageInfo=="object"&&g_pageInfo.type>0){var a="<b>"+LANG.lvnodata_co1+'</b><div class="pad2"></div>';if(g_user.id>0){var b=LANG.lvnodata_co2;b=b.replace("<a>",'<a href="javascript:;" onclick="co_addYourComment()" onmousedown="return false">');a+=b}else{var b=LANG.lvnodata_co3;b=b.replace("<a>",'<a href="/?account=signin">');b=b.replace("<a>",'<a href="/?account=signup">');a+=b}c.style.padding="1.5em 0";c.innerHTML=a}},onBeforeCreate:function(){if(location.hash&&location.hash.match(/:id=([0-9]+)/)!=null){var a=in_array(this.data,parseInt(RegExp.$1),function(b){return b.id});this.rowOffset=this.getRowOffset(a);return this.data[a]}},onAfterCreate:function(a){if(a!=null){var b=a.__div;this.tabs.__st=b;b.firstChild.style.border="1px solid #505050"}}},commentpreview:{sort:[3],nItemsPerPage:75,columns:[{id:"subject",name:LANG.subject,align:"left",value:"subject",compute:function(f,e){var b=ce("a");b.style.fontFamily="Verdana, sans-serif";b.href=this.template.getItemLink(f);ae(b,ct(f.subject));ae(e,b);var c=ce("div");c.className="small";ae(c,ct(LANG.types[f.type][0]));ae(e,c)}},{id:"preview",name:LANG.preview,align:"left",width:"50%",value:"preview",compute:function(j,i){var g=ce("div");g.className="crop";if(j.rating>=10){g.className+=" comment-green"}ae(g,ct(Markup.removeTags(j.preview,{mode:Markup.MODE_ARTICLE})));ae(i,g);var e=j.rating!=null;var f=j.user!=null;if(e||f){g=ce("div");g.className="small3";if(f){ae(g,ct(LANG.lvcomment_by));var b=ce("a");b.href="/?user="+j.user;ae(b,ct(j.user));ae(g,b);if(e){ae(g,ct(LANG.hyphen))}}if(e){ae(g,ct(LANG.lvcomment_rating+(j.rating>0?"+":"")+j.rating));var c=ce("span"),h="";c.className="q10";if(j.deleted){h=LANG.lvcomment_deleted}else{if(j.purged){h=LANG.lvcomment_purged}}ae(c,ct(h));ae(g,c)}ae(i,g)}}},{id:"posted",name:LANG.posted,width:"16%",value:"elapsed",compute:function(e,d){var a=new Date(e.date),c=(g_serverTime-a)/1000;var b=ce("span");Listview.funcBox.coFormatDate(b,c,a,0,1);ae(d,b)}}],getItemLink:function(a){return"/?"+g_types[a.type]+"="+a.typeId+(a.id!=null?"#comments:id="+a.id:"")}},screenshot:{sort:[],mode:3,nItemsPerPage:40,nItemsPerRow:4,poundable:2,columns:[],compute:function(k,e,l){var u,o=new Date(k.date),f=(g_serverTime-o)/1000;e.className="screenshot-cell";e.vAlign="bottom";var q=ce("a");q.href="#screenshots:id="+k.id;q.onclick=rf2;var v=ce("img"),t=Math.min(150/k.width,150/k.height);v.src="http://static.wowhead.com/uploads/screenshots/thumb/"+k.id+".jpg";ae(q,v);ae(e,q);var p=ce("div");p.className="screenshot-cell-user";var m=(k.user!=null&&k.user.length);if(m){q=ce("a");q.href="/?user="+k.user;ae(q,ct(k.user));ae(p,ct(LANG.lvscreenshot_from));ae(p,q);ae(p,ct(" "))}var j=ce("span");if(m){Listview.funcBox.coFormatDate(j,f,o)}else{Listview.funcBox.coFormatDate(j,f,o,0,1)}ae(p,j);ae(e,p);p=ce("div");p.style.position="relative";p.style.height="1em";if(g_getLocale(true)!=0&&k.caption){k.caption=""}var h=(k.caption!=null&&k.caption.length);var g=(k.subject!=null&&k.subject.length);if(h||g){var r=ce("div");r.className="screenshot-caption";if(g){var c=ce("small");ae(c,ct(LANG.types[k.type][0]+LANG.colon));var b=ce("a");ae(b,ct(k.subject));b.href="/?"+g_types[k.type]+"="+k.typeId;ae(c,b);ae(r,c);if(h&&k.caption.length){ae(c,ct(" (...)"))}ae(c,ce("br"))}if(h){aE(e,"mouseover",Listview.funcBox.ssCellOver.bind(r));aE(e,"mouseout",Listview.funcBox.ssCellOut.bind(r));var n=ce("span");n.innerHTML=k.caption;ae(r,n)}ae(p,r)}aE(e,"click",Listview.funcBox.ssCellClick.bind(this,l));ae(e,p)},createNote:function(d){if(typeof g_pageInfo=="object"&&g_pageInfo.type>0){var c=ce("small");var b=ce("a");if(g_user.id>0){b.href="javascript:;";b.onclick=ss_submitAScreenshot}else{b.href="/?account=signin"}ae(b,ct(LANG.lvscreenshot_submit));ae(c,b);ae(d,c)}},onNoData:function(c){if(typeof g_pageInfo=="object"&&g_pageInfo.type>0){var a="<b>"+LANG.lvnodata_ss1+'</b><div class="pad2"></div>';if(g_user.id>0){var b=LANG.lvnodata_ss2;b=b.replace("<a>",'<a href="javascript:;" onclick="ss_submitAScreenshot()" onmousedown="return false">');a+=b}else{var b=LANG.lvnodata_ss3;b=b.replace("<a>",'<a href="/?account=signin">');b=b.replace("<a>",'<a href="/?account=signup">');a+=b}c.style.padding="1.5em 0";c.innerHTML=a}else{return -1}},onBeforeCreate:function(){if(location.hash&&location.hash.match(/:id=([0-9]+)/)!=null){var a=in_array(this.data,parseInt(RegExp.$1),function(b){return b.id});this.rowOffset=this.getRowOffset(a);return a}},onAfterCreate:function(a){if(a!=null){setTimeout((function(){ScreenshotViewer.show({screenshots:this.data,pos:a})}).bind(this),1)}}},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,k,g){var e=ce("td");e.style.width="1px";e.style.padding="0";e.style.borderRight="none";ae(e,Icon.create(b.icon,0));ae(g,e);k.style.borderLeft="none";var j=ce("div");var c=ce("a");c.style.fontFamily="Verdana, sans-serif";c.href=this.template.getItemLink(b);ae(c,ct(b.name));if(b.expansion){var f=ce("span");f.className=(b.expansion==1?"bc-icon":"wotlk-icon");ae(f,c);ae(j,f)}else{ae(j,c)}if(b.exotic){j.style.position="relative";var h=ce("div");h.className="small";h.style.fontStyle="italic";h.style.position="absolute";h.style.right="3px";h.style.bottom="0px";ae(h,ct(LANG.lvpet_exotic));ae(j,h)}ae(k,j)},getVisibleText:function(a){var b=a.name;if(a.expansion==1){b+=" bc"}else{if(a.expansion==2){b+="wotlk wrath"}}if(a.exotic){b+=" "+LANG.lvpet_exotic}return b}},{id:"level",name:LANG.level,type:"range",getMinValue:function(a){return a.minlevel},getMaxValue:function(a){return a.maxlevel},compute:function(a,b){if(a.minlevel>0&&a.maxlevel>0){if(a.minlevel!=a.maxlevel){return a.minlevel+LANG.hyphen+a.maxlevel}else{return a.minlevel}}else{return -1}},sortFunc:function(d,c,e){if(e>0){return strcmp(d.minlevel,c.minlevel)||strcmp(d.maxlevel,c.maxlevel)}else{return strcmp(d.maxlevel,c.maxlevel)||strcmp(d.minlevel,c.minlevel)}}},{id:"damage",name:LANG.damage,value:"damage",compute:function(a,b){ae(b,this.template.getStatPct(a.damage))}},{id:"armor",name:LANG.armor,value:"armor",compute:function(a,b){ae(b,this.template.getStatPct(a.armor))}},{id:"health",name:LANG.health,value:"health",compute:function(a,b){ae(b,this.template.getStatPct(a.health))}},{id:"abilities",name:LANG.abilities,type:"text",getValue:function(b){if(!b.spells){return""}if(b.spells.length>0){var d="";for(var c=0,a=b.spells.length;c<a;++c){if(b.spells[c]){d+=g_spells[b.spells[c]]["name_"+g_locale.name]}}return d}},compute:function(a,b){if(!a.spells){return""}if(a.spells.length>0){b.style.padding="0";Listview.funcBox.createCenteredIcons(a.spells,b,"",1)}},sortFunc:function(d,c){if(!d.spells||!c.spells){return 0}return strcmp(d.spellCount,c.spellCount)||strcmp(d.spells,c.spells)},hidden:true},{id:"diet",name:LANG.diet,type:"text",compute:function(a,e){if(e){e.className="small"}var b=0,c="";for(var d in g_pet_foods){if(a.diet&d){if(b++>0){c+=LANG.comma}c+=g_pet_foods[d]}}return c},sortFunc:function(d,c){return strcmp(c.foodCount,d.foodCount)||Listview.funcBox.assocArrCmp(d.diet,c.diet,g_pet_foods)}},{id:"type",name:LANG.type,type:"text",compute:function(b,d){if(b.type!=null){d.className="small q1";var c=ce("a");c.href="/?pets="+b.type;ae(c,ct(g_pet_types[b.type]));ae(d,c)}},getVisibleText:function(a){if(a.type!=null){return g_pet_types[a.type]}},sortFunc:function(d,c,e){return strcmp(g_pet_types[d.type],g_pet_types[c.type])}}],getItemLink:function(a){return"/?pet="+a.id},getStatPct:function(b){var a=ce("span");if(!isNaN(b)&&b>0){a.className="q2";ae(a,ct("+"+b+"%"))}else{if(!isNaN(b)&&b<0){a.className="q10";ae(a,ct(b+"%"))}}return a}},achievement:{sort:[1,2],nItemsPerPage:100,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",span:2,compute:function(c,j,g){var b=null;if(c.who&&c.completed){b="who="+c.who+"&when="+c.completed.getTime()}var f=ce("td");f.style.width="1px";f.style.padding="0";f.style.borderRight="none";ae(f,g_achievements.createIcon(c.id,1));Icon.getLink(f.firstChild).rel=b;ae(g,f);j.style.borderLeft="none";var e=ce("a");e.style.fontFamily="Verdana, sans-serif";e.href=this.template.getItemLink(c);e.rel=b;ae(e,ct(c.name));ae(j,e);if(c.description!=null){var h=ce("div");h.className="small";ae(h,ct(c.description));ae(j,h)}},getVisibleText:function(a){var b=a.name;if(a.description){b+=" "+a.description}return b}},{id:"location",name:LANG.location,type:"text",width:"15%",compute:function(b,d){if(b.zone){var c=ce("a");c.className="q1";c.href="/?zone="+b.zone;ae(c,ct(g_zones[b.zone]));ae(d,c)}},getVisibleText:function(a){return Listview.funcBox.arrayText(a.zone,g_zones)},sortFunc:function(d,c,e){return strcmp(g_zones[d.zone],g_zones[c.zone])}},{id:"side",name:LANG.side,type:"text",compute:function(a,c){if(a.side&&a.side!=3){var b=ce("span");b.className=(a.side==1?"alliance-icon":"horde-icon");b.onmouseover=function(d){Tooltip.showAtCursor(d,g_sides[a.side],0,0,"q")};b.onmousemove=Tooltip.cursorUpdate;b.onmouseout=Tooltip.hide;ae(c,b)}},getVisibleText:function(a){if(a.side){return g_sides[a.side]}},sortFunc:function(d,c,e){return strcmp(g_sides[d.side],g_sides[c.side])}},{id:"points",name:LANG.points,type:"number",width:"10%",value:"points",compute:function(a,b){if(a.points){Listview.funcBox.appendMoney(b,0,null,0,0,0,a.points)}}},{id:"category",name:LANG.category,type:"text",width:"15%",compute:function(b,d){d.className="small q1";var c=ce("a");c.href="/?achievements="+b.category;ae(c,ct(g_achievement_categories[b.category]));ae(d,c)},getVisibleText:function(a){return g_achievement_categories[a.category]},sortFunc:function(d,c,e){return strcmp(g_achievement_categories[d.category],g_achievement_categories[c.category])},hidden:true}],getItemLink:function(a){return"/?achievement="+a.id}},title:{sort:[1],nItemsPerPage:-1,searchable:1,filtrable:1,clickable:0,columns:[{id:"name",name:LANG.name,type:"text",align:"left",value:"name",compute:function(e,g,d){var c=ce("span"),f=ce("span"),b=ct(str_replace(e.name,"%s",""));g.style.whiteSpace="nowrap";ae(f,ct("<"+LANG.name+">"));f.className="q0";if(e.name.indexOf("%s")>0){ae(c,b);ae(c,f)}else{if(e.name.indexOf("%s")==0){ae(c,f);ae(c,b)}}if(e.expansion){var a=ce("span");a.className=(e.expansion==1?"bc-icon":"wotlk-icon");ae(a,c);ae(g,a)}else{ae(g,c)}},sortFunc:function(d,c,e){return strcmp(d.sort,c.sort)},getVisibleText:function(a){var b=a.name;if(a.expansion==1){b+=" bc"}else{if(a.expansion==2){b+="wotlk wrath"}}return b}},{id:"side",name:LANG.side,type:"text",compute:function(a,c){if(a.side&&a.side!=3){var b=ce("span");b.className=(a.side==1?"alliance-icon":"horde-icon");b.onmouseover=function(d){Tooltip.showAtCursor(d,g_sides[a.side],0,0,"q")};b.onmousemove=Tooltip.cursorUpdate;b.onmouseout=Tooltip.hide;ae(c,b)}},getVisibleText:function(a){if(a.side){return g_sides[a.side]}},sortFunc:function(d,c,e){return strcmp(g_sides[d.side],g_sides[c.side])}},{id:"source",name:LANG.source,type:"text",width:"50%",compute:function(p,d){var m={achievements:g_achievements,quests:g_quests},f=0;for(var h in m){var l=m[h],b=p[h],c=(h=="achievements"?"name":"name_"+g_locale.name);if(!l||!b||(b.length==1&&!b[0])){continue}b.sort(function(j,i){return l[j]&&l[i]?l[j].side-l[i].side:j|i});for(var g=0,e=b.length;g<e;++g){if(l[b[g]]){if(f++>0){ae(d,ct(" / "))}var o=ce("a");o.style.fontFamily="Verdana, sans-serif";o.href="/?"+h.slice(0,-1)+"="+b[g];switch(h){case"achievements":if(l[b[g]].side!=3){o.className=(l[b[g]].side==1?"alliance-icon":"horde-icon")}break;case"quests":o.className="icontiny";o.style.backgroundImage="url(http://static.wowhead.com/images/icons/tiny/quest_start.gif)";break}ae(o,ct(l[b[g]][c]));ae(d,o)}}}},getVisibleText:function(l){var h={achievements:g_achievements,quests:g_quests},m="",d=0;for(var f in h){var g=h[f],a=l[f];if(!g||!a){continue}for(var e=0,c=a.length;e<c;++e){if(g[a[e]]){var b=(f=="achievements"?"name":"name_"+g_locale.name);if(d++>0){m+=" "}m+=g[a[e]][b]}}}return m},sortFunc:function(d,c,e){return strcmp(this.getVisibleText(d),this.getVisibleText(c))}},{id:"category",name:LANG.category,type:"text",width:"15%",compute:function(c,d){d.className="small q1";var b=ce("a");b.href="/?titles="+c.category;ae(b,ct(g_title_categories[c.category]));ae(d,b)},getVisibleText:function(a){return g_title_categories[a.category]},sortFunc:function(d,c,e){return strcmp(g_title_categories[d.category],g_title_categories[c.category])},hidden:true}]},profile:{sort:[],nItemsPerPage:50,searchable:1,filtrable:1,columns:[{id:"name",name:LANG.name,value:"name",type:"text",align:"left",span:2,compute:function(f,c,h){if(f.level){var e=ce("td");e.style.width="1px";e.style.padding="0";e.style.borderRight="none";ae(e,Icon.create(f.icon?f.icon:"chr_"+g_file_races[f.race]+"_"+g_file_genders[f.gender]+"_"+g_file_classes[f.classs]+"0"+(f.level>59?(Math.floor((f.level-60)/10)+2):1),1,null,this.template.getItemLink(f)));ae(h,e);c.style.borderLeft="none"}else{c.colSpan=2}var b=ce("div");b.style.position="relative";var k=ce("a");k.style.fontFamily="Verdana, sans-serif";k.href=this.template.getItemLink(f);ae(k,ct(f.name));ae(b,k);var g=ce("div");g.className="small";if(f.guild){var k=ce("a");k.className="q1";k.href="/?profiles="+f.region+"."+f.realm+"&filter=cr=9;crs=0;crv="+str_replace(urlencode(f.guild),"%20","+")+"&roster=1";ae(k,ct(f.guild));ae(g,ct("<"));ae(g,k);ae(g,ct(">"))}else{if(f.description){ae(g,ct(f.description))}}var l=ce("span"),j="";l.className="q10";if(f.deleted){j=LANG.lvcomment_deleted}ae(l,ct(j));ae(g,l);ae(b,g);var g=ce("div");g.className="small";g.style.fontStyle="italic";g.style.position="absolute";g.style.right="3px";g.style.bottom="0px";if(!f.published&&!f.region&&!f.realm){ae(g,ct(LANG.privateprofile))}ae(b,g);ae(c,b)},getVisibleText:function(a){var b=a.name;if(a.guild){b+=" "+a.guild}return b}},{id:"faction",name:LANG.faction,type:"text",compute:function(a,f){if(!a.size&&!a.members&&!a.level){return}var e=ce("div"),c=ce("div"),b;b=Icon.create("faction_"+g_file_factions[a.faction+1],0);b.onmouseover=function(d){Tooltip.showAtCursor(d,g_sides[a.faction+1],0,0,"q")};b.onmousemove=Tooltip.cursorUpdate;b.onmouseout=Tooltip.hide;b.style.cssFloat=b.style.syleFloat="left";e.style.margin="0 auto";e.style.textAlign="left";e.style.width="26px";c.className="clear";ae(e,b);ae(f,e);ae(f,c)},getVisibleText:function(a){return g_sides[a.faction+1]},sortFunc:function(d,c,e){return strcmp(this.getVisibleText(d),this.getVisibleText(c))}},{id:"members",name:LANG.members,value:"members",hidden:1},{id:"size",name:"Size",value:"size",hidden:1},{id:"rank",name:"Rank",value:"rank",hidden:1},{id:"race",name:LANG.race,type:"text",compute:function(a,f){if(a.race){var e=ce("div"),c=ce("div"),b;b=Icon.create("race_"+g_file_races[a.race]+"_"+g_file_genders[a.gender],0);b.onmouseover=function(d){Tooltip.showAtCursor(d,g_chr_races[a.race],0,0,"q")};b.onmousemove=Tooltip.cursorUpdate;b.onmouseout=Tooltip.hide;b.style.cssFloat=b.style.syleFloat="left";e.style.margin="0 auto";e.style.textAlign="left";e.style.width="26px";c.className="clear";ae(e,b);ae(f,e);ae(f,c)}},getVisibleText:function(a){return g_file_genders[a.gender]+" "+g_chr_races[a.race]},sortFunc:function(d,c,e){return strcmp(g_chr_races[d.race],g_chr_races[c.race])},hidden:1},{id:"classs",name:LANG.classs,type:"text",compute:function(a,f){if(a.classs){var e=ce("div"),c=ce("div"),b;b=Icon.create("class_"+g_file_classes[a.classs],0);b.onmouseover=function(d){Tooltip.showAtCursor(d,g_chr_classes[a.classs],0,0,"q")};b.onmousemove=Tooltip.cursorUpdate;b.onmouseout=Tooltip.hide;b.style.cssFloat=b.style.syleFloat="left";e.style.margin="0 auto";e.style.textAlign="left";e.style.width="26px";c.className="clear";ae(e,b);ae(f,e);ae(f,c)}else{return -1}},getVisibleText:function(a){if(a.classs){return g_chr_classes[a.classs]}},sortFunc:function(d,c,e){return strcmp(this.getVisibleText(d),this.getVisibleText(c))},hidden:1},{id:"level",name:LANG.level,value:"level",hidden:1},{id:"talents",name:LANG.talents,type:"text",compute:function(e,j){if(!e.level){return}var i=[e.talenttree1,e.talenttree2,e.talenttree3],f=pr_getSpecFromTalents(e.classs,i),c,g,b=ce("a");var h=ce("div");h.style.width="82px";h.style.height="23px";h.style.margin="0 auto";h.style.lineHeight="23px";h.style.backgroundImage="url("+f.icon+")";h.style.backgroundRepeat="no-repeat";h.style.backgroundPosition="left";var b=ce("a");b.className="small q1";b.style.padding="7px 0 7px 28px";b.style.fontWeight="bold";b.rel="np";b.href=this.template.getItemLink(e)+"#talents";b.onmouseover=function(a){Tooltip.showAtCursor(a,f.name,0,0,"q")};b.onmousemove=Tooltip.cursorUpdate;b.onmouseout=Tooltip.hide;ae(b,ct(e.talenttree1+" / "+e.talenttree2+" / "+e.talenttree3));ae(h,b);ae(j,h)},getVisibleText:function(a){if(a.talenttree1||a.talenttree2||a.talenttree3){if(a.talentspec>0){return g_chr_specs[a.classs][a.talentspec-1]}else{return g_chr_specs[0]}}else{return g_chr_specs["-1"]}},sortFunc:function(d,c,e){return strcmp(this.getVisibleText(d),this.getVisibleText(c))},hidden:1},{id:"gearscore",name:LANG.gearscore,value:"gearscore",compute:function(a,c){var b=(a.level?a.level:(a.members?80:0));if(isNaN(a.gearscore)||!b){return}c.className="q"+pr_getGearScoreQuality(b,a.gearscore,(in_array([2,6,7,11],a.classs)!=-1));return(a.gearscore?number_format(a.gearscore):0)},hidden:1},{id:"achievementpoints",name:LANG.points,value:"achievementpoints",compute:function(a,b){if(a.achievementpoints){Listview.funcBox.appendMoney(b,0,null,0,0,0,a.achievementpoints)}},hidden:1},{id:"wins",name:LANG.wins,value:"wins",hidden:1},{id:"losses",name:LANG.losses,compute:function(a,b){return a.games-a.wins},hidden:1},{id:"guildrank",name:LANG.guildrank,value:"guildrank",compute:function(c,d){if(c.guildrank>0){return sprintf(LANG.rankno,c.guildrank)}else{if(c.guildrank==0){var a=ce("b");ae(a,ct(LANG.guildleader));ae(d,a)}}},getVisibleText:function(a){if(a.guildrank>0){return sprintf(LANG.rankno,a.guildrank)}else{if(a.guildrank==0){return LANG.guildleader}}},sortFunc:function(d,c,e){return strcmp((d.guildrank>=0?d.guildrank:11),(c.guildrank>=0?c.guildrank:11))},hidden:1},{id:"rating",name:LANG.rating,value:"rating",compute:function(a,b){if(a.roster){return a.arenateam[a.roster].rating}return a.rating},sortFunc:function(d,c,e){if(d.roster&&c.roster){return strcmp(d.arenateam[d.roster].rating,c.arenateam[c.roster].rating)}return strcmp(d.rating,c.rating)},hidden:1},{id:"location",name:LANG.location,type:"text",compute:function(c,e){var b;if(c.region){if(c.realm){b=ce("a");b.className="q1";b.href="/?profiles="+c.region+"."+c.realm;ae(b,ct(c.realmname));ae(e,b);ae(e,ce("br"))}var d=ce("small");b=ce("a");b.className="q1";b.href="/?profiles="+c.region;ae(b,ct(c.region.toUpperCase()));ae(d,b);if(c.battlegroup){ae(d,ct(LANG.hyphen));b=ce("a");b.className="q1";b.href="/?profiles="+c.region+"."+c.battlegroup;ae(b,ct(c.battlegroupname));ae(d,b)}ae(e,d)}},getVisibleText:function(a){var b="";if(a.region){b+=" "+a.region}if(a.battlegroup){b+=" "+a.battlegroup}if(a.realm){b+=" "+a.realm}return trim(b)},sortFunc:function(d,c,e){if(d.region!=c.region){return strcmp(d.region,c.region)}if(d.battlegroup!=c.battlegroup){return strcmp(d.battlegroup,c.battlegroup)}return strcmp(d.realm,c.realm)}},{id:"guild",name:LANG.guild,value:"guild",type:"text",compute:function(c,d){if(!c.region||!c.battlegroup||!c.realm||!c.guild){return}var b=ce("a");b.className="q1";b.href="/?profiles="+c.region+"."+c.realm+"&filter=cr=9;crs=0;crv="+str_replace(urlencode(c.guild),"%20","+")+"&roster=1";ae(b,ct(c.guild));ae(d,b)}}],getItemLink:function(a){if(a.size){return"/?profiles="+a.region+"."+a.realm+"&filter=cr="+(a.size==2?12:(a.size==3?15:18))+";crs=0;crv="+str_replace(urlencode(a.name),"%20","+")+"&roster="+(a.size==5?4:a.size)}else{if(a.members){return"/?profiles="+a.region+"."+a.realm+"&filter=cr=9;crs=0;crv="+str_replace(urlencode(a.name),"%20","+")+"&roster=1"}else{if(a.region&&a.realm){return"/?profile="+a.region+"."+a.realm+"."+g_cleanCharacterName(a.name)}else{return"/?profile="+a.id}}}}},model:{sort:[],mode:3,nItemsPerPage:40,nItemsPerRow:4,poundable:2,columns:[],compute:function(c,k,e){k.className="screenshot-cell";k.vAlign="bottom";var j=ce("div");j.className="pet-model";var b=ce("a");b.className="pet-zoom";b.href="javascript:;";b.onclick=this.template.modelShow.bind(this.template,c.npcId,c.displayId);ae(j,b);var g=ce("div");g.id="pm"+c.displayId;ae(j,g);ae(k,j);j=ce("div");j.className="screenshot-cell-user";b=ce("a");b.href=this.template.getItemLink(c);ae(b,ct(c.skin));ae(j,b);ae(j,ct(" ("+c.count+")"));ae(k,j);j=ce("div");j.style.position="relative";j.style.height="1em";var h=ce("div");h.className="screenshot-caption";var f=ce("small");ae(f,ct(LANG.level+": "));ae(f,ct(c.minLevel+(c.minLevel==c.maxLevel?"":LANG.hyphen+(c.maxLevel==9999?"??":c.maxLevel))));ae(f,ce("br"));ae(h,f);ae(j,h);ae(k,j);setTimeout(this.template.appendFlash.bind(g,c),1)},getItemLink:function(a){return"/?npcs=1&filter="+(a.family?"fa="+a.family+";":"")+"minle=1;cr=35;crs=0;crv="+a.skin},modelShow:function(b,a){ModelViewer.show({type:1,typeId:b,displayId:a,noPound:1})},appendFlash:function(a){var c={model:a.displayId,modelType:8,contentPath:"http://static.wowhead.com/modelviewer/",blur:(OS.mac?"0":"1")};var b={quality:"high",allowscriptaccess:"always",menu:false,wmode:"opaque",bgcolor:"#101010"};swfobject.embedSWF("http://static.wowhead.com/modelviewer/ModelView.swf",this.id,"100%","100%","10.0.0","http://static.wowhead.com/modelviewer/expressInstall.swf",c,b)}}};Menu.fixUrls(mn_items,"/?items=");Menu.fixUrls(mn_itemSets,"/?itemsets&filter=cl=","#0-2+1");Menu.fixUrls(mn_npcs,"/?npcs=");Menu.fixUrls(mn_objects,"/?objects=");Menu.fixUrls(mn_quests,"/?quests=");Menu.fixUrls(mn_spells,"/?spells=");Menu.fixUrls(mn_zones,"/?zones=");Menu.fixUrls(mn_pets,"/?pets=");Menu.fixUrls(mn_factions,"/?factions=");Menu.fixUrls(mn_achievements,"/?achievements=",null,true);Menu.fixUrls(mn_titles,"/?titles=",null,true);Menu.fixUrls(mn_petCalc,"/?petcalc=");Menu.fixUrls(mn_forums,"/?forums&board=",null,true);var g_dev=false;var g_locale={id:0,name:"enus"};var g_localTime=new Date();var g_user={id:0,name:"",roles:0};var g_npcs={};var g_objects={};var g_items={};var g_itemsets={};var g_quests={};var g_spells={};var g_gatheredzones={};var g_factions={};var g_pets={};var g_achievements={};var g_users={};var g_types={1:"npc",2:"object",3:"item",4:"itemset",5:"quest",6:"spell",7:"zone",8:"faction",9:"pet",10:"achievement"};var g_locales={0:"enus",2:"frfr",3:"dede",6:"eses",7:"ruru",25:"ptr"};var g_file_races={10:"bloodelf",11:"draenei",3:"dwarf",7:"gnome",1:"human",4:"nightelf",2:"orc",6:"tauren",8:"troll",5:"scourge"};var g_file_classes={6:"deathknight",11:"druid",3:"hunter",8:"mage",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_gems={1:"meta",2:"red",4:"yellow",6:"orange",8:"blue",10:"purple",12:"green",14:"prismatic"};var g_customColors={Miyari:"pink"};g_items.add=function(b,a){if(g_items[b]!=null){cO(g_items[b],a)}else{g_items[b]=a}};g_items.getIcon=function(a){if(g_items[a]!=null){return g_items[a].icon}else{return"inv_misc_questionmark"}};g_items.createIcon=function(d,b,a,c){return Icon.create(g_items.getIcon(d),b,null,"/?item="+d,a,c)};g_spells.getIcon=function(a){if(g_spells[a]!=null){return g_spells[a].icon}else{return"inv_misc_questionmark"}};g_spells.createIcon=function(d,b,a,c){return Icon.create(g_spells.getIcon(d),b,null,"/?spell="+d,a,c)};g_achievements.getIcon=function(a){if(g_achievements[a]!=null){return g_achievements[a].icon}else{return"inv_misc_questionmark"}};g_achievements.createIcon=function(d,b,a,c){return Icon.create(g_achievements.getIcon(d),b,null,"/?achievement="+d,a,c)};var $WowheadPower=new function(){var B=true,g,H,L,s,N,F,D,i=0,G={},h={},d={},K=0,I=1,j=2,t=3,J=4,u=1,l=2,y=3,C=5,v=6,o=10,k=100,q=15,A=15,r={1:[G,"npc"],2:[h,"object"],3:[g_items,"item"],5:[g_quests,"quest"],6:[g_spells,"spell"],10:[g_achievements,"achievement"],100:[d,"profile"]},e={0:"enus",2:"frfr",3:"dede",6:"eses",7:"ruru"},b={wotlk:"www"};if(B){e[25]="ptr"}else{b.ptr="www"}function O(){aE(document,"mouseover",w)}function p(S){var T=g_getCursorPos(S);F=T.x;D=T.y}function Q(ag,aa){if(ag.nodeName!="A"&&ag.nodeName!="AREA"){return -2323}if(!ag.href.length){return}if(ag.rel.indexOf("np")!=-1){return}var X,W,U,T,Y={};s=Y;var S=function(ah,aj,ai){if(aj=="buff"||aj=="sock"){Y[aj]=true}else{if(aj=="rand"||aj=="ench"||aj=="lvl"||aj=="c"){Y[aj]=parseInt(ai)}else{if(aj=="gems"||aj=="pcs"){Y[aj]=ai.split(":")}else{if(aj=="who"||aj=="domain"){Y[aj]=ai}else{if(aj=="when"){Y[aj]=new Date(parseInt(ai))}}}}}};W=2;U=3;if(ag.href.indexOf("http://")==0){X=1;T=ag.href.match(/^http:\/\/(.+?)?\.?wowhead\.com\/\?(item|quest|spell|achievement|npc|object)=([0-9]+)/);if(T==null){T=ag.href.match(/^http:\/\/(.+?)?\.?wowhead\.com\/\?(profile)=([^&#]+)/)}}else{T=ag.href.match(/()\?(item|quest|spell|achievement|npc|object)=([0-9]+)/);if(T==null){T=ag.href.match(/()\?(profile)=([^&#]+)/)}}if(T==null&&ag.rel){X=0;W=1;U=2;T=ag.rel.match(/(item|quest|spell|achievement|npc|object).?([0-9]+)/);if(T==null){T=ag.rel.match(/(profile).?([^&#]+)/)}}if(ag.rel){ag.rel.replace(/([a-zA-Z]+)=?([a-zA-Z0-9:-]*)/g,S);if(Y.gems&&Y.gems.length>0){var Z;for(Z=Math.min(3,Y.gems.length-1);Z>=0;--Z){if(parseInt(Y.gems[Z])){break}}++Z;if(Z==0){delete Y.gems}else{if(Z<Y.gems.length){Y.gems=Y.gems.slice(0,Z)}}}}if(T){var af,V="www";N=ag;if(Y.domain){V=Y.domain}else{if(X&&T[X]){V=T[X]}}if(b[V]){V=b[V]}af=g_getLocaleFromDomain(V);if(ag.href.indexOf("#")!=-1&&document.location.href.indexOf(T[W]+"="+T[U])!=-1){return}i=(ag.parentNode.className.indexOf("icon")==0?1:0);if(!ag.onmouseout){if(i==0){ag.onmousemove=a}ag.onmouseout=P}p(aa);var ad=g_getIdFromTypeName(T[W]),ab=T[U];if(ad==k&&!g_dev){af=0}z(ad,ab,af,Y)}}function w(U){U=$E(U);var T=U._target;var S=0;while(T!=null&&S<5&&Q(T,U)==-2323){T=T.parentNode;++S}}function a(S){S=$E(S);p(S);Tooltip.move(F,D,0,0,q,A)}function P(){g=null;N=null;Tooltip.hide()}function M(S){return(s.buff?"buff_":"tooltip_")+g_locales[S]}function m(T,V,U){var S=r[T][0];if(S[V]==null){S[V]={}}if(S[V].status==null){S[V].status={}}if(S[V].status[U]==null){S[V].status[U]=K}}function z(T,X,V,W){if(!W){W={}}var U=f(X,W);g=T;H=U;L=V;s=W;m(T,U,V);var S=r[T][0];if(S[U].status[V]==J||S[U].status[V]==t){R(S[U][M(V)],S[U].icon)}else{if(S[U].status[V]==I){R(LANG.tooltip_loading)}else{c(T,X,V,null,W)}}}function c(ab,W,ad,U,X){var S=f(W,X);var Z=r[ab][0];if(Z[S].status[ad]!=K&&Z[S].status[ad]!=j){return}Z[S].status[ad]=I;if(!U){Z[S].timer=setTimeout(function(){n.apply(this,[ab,S,ad])},333)}var V="";for(var Y in X){if(Y!="rand"&&Y!="ench"&&Y!="gems"&&Y!="sock"){continue}if(typeof X[Y]=="object"){V+="&"+Y+"="+X[Y].join(":")}else{if(Y=="sock"){V+="&sock"}else{V+="&"+Y+"="+X[Y]}}}var T="";if(!g_dev){T+="http://"+g_getDomainFromLocale(ad)+".wowhead.com"}else{if(document.domain.indexOf("dev.wowhead.com")!=-1){var aa=g_getDomainFromLocale(ad);if(aa!="www"){T+="http://"+g_getDomainFromLocale(ad)+"."+document.domain}}}T+="/?"+r[ab][1]+"="+W+"&power"+V;g_ajaxIshRequest(T)}function R(V,W){if(N._fixTooltip){V=N._fixTooltip(V,g,H,N)}if(!V){V=LANG["tooltip_"+g_types[g]+"notfound"];W="inv_misc_questionmark"}else{if(s!=null){if(s.pcs&&s.pcs.length){var X=0;for(var U=0,T=s.pcs.length;U<T;++U){var S;if(S=V.match(new RegExp("<span><!--si([0-9]+:)*"+s.pcs[U]+"(:[0-9]+)*-->"))){V=V.replace(S[0],'<span class="q8"><!--si'+s.pcs[U]+"-->");++X}}if(X>0){V=V.replace("(0/","("+X+"/");V=V.replace(new RegExp("<span>\\(([0-"+X+"])\\)","g"),'<span class="q2">($1)')}}if(s.c){V=V.replace(/<span class="c([0-9]+?)">(.+?)<\/span><br \/>/g,'<span class="c$1" style="display: none">$2</span>');V=V.replace(new RegExp('<span class="c('+s.c+')" style="display: none">(.+?)</span>',"g"),'<span class="c$1">$2</span><br />')}if(s.lvl){V=V.replace(/\(<!--r([0-9]+):([0-9]+):([0-9]+)-->([0-9.%]+)(.+?)([0-9]+)\)/g,function(ab,af,ad,aa,Y,ah,Z){var ag=g_convertRatingToPercent(s.lvl,ad,aa);ag=(Math.round(ag*100)/100);if(ad!=12&&ad!=37){ag+="%"}return"(<!--r"+s.lvl+":"+ad+":"+aa+"-->"+ag+ah+s.lvl+")"})}if(s.who&&s.when){V=V.replace("<table><tr><td><br />",'<table><tr><td><br /><span class="q2">'+sprintf(LANG.tooltip_achievementcomplete,s.who,s.when.getMonth()+1,s.when.getDate(),s.when.getFullYear())+"</span><br /><br />");V=V.replace(/class="q0"/g,'class="r3"')}}}if(i==1){Tooltip.setIcon(null);Tooltip.show(N,V)}else{Tooltip.setIcon(W);Tooltip.showAtXY(V,F,D,q,A)}}function n(T,V,U){if(g==T&&H==V&&L==U){R(LANG.tooltip_loading);var S=r[T][0];S[V].timer=setTimeout(function(){E.apply(this,[T,V,U])},3850)}}function E(T,V,U){var S=r[T][0];S[V].status[U]=j;if(g==T&&H==V&&L==U){R(LANG.tooltip_noresponse)}}function f(T,S){return T+(S.rand?"r"+S.rand:"")+(S.ench?"e"+S.ench:"")+(S.gems?"g"+S.gems.join(","):"")+(S.sock?"s":"")}this.register=function(U,W,V,T){var S=r[U][0];m(U,W,V);if(S[W].timer){clearTimeout(S[W].timer);S[W].timer=null}cO(S[W],T);if(S[W].status[V]==I){if(S[W][M(V)]){S[W].status[V]=J}else{S[W].status[V]=t}}if(g==U&&W==H&&L==V){R(S[W][M(V)],S[W].icon)}};this.registerNpc=function(U,T,S){this.register(u,U,T,S)};this.registerObject=function(U,T,S){this.register(l,U,T,S)};this.registerItem=function(U,T,S){this.register(y,U,T,S)};this.registerQuest=function(U,T,S){this.register(C,U,T,S)};this.registerSpell=function(U,T,S){this.register(v,U,T,S)};this.registerAchievement=function(U,T,S){this.register(o,U,T,S)};this.registerProfile=function(U,T,S){this.register(k,U,T,S)};this.request=function(S,W,U,V){if(!V){V={}}var T=f(W,V);m(S,T,U);c(S,W,U,1,V)};this.requestItem=function(T,S){this.request(y,T,g_locale.id,S)};this.requestSpell=function(S){this.request(v,S,g_locale.id)};this.getStatus=function(T,V,U){var S=r[T][0];if(S[V]!=null){return S[V].status[U]}else{return K}};this.getItemStatus=function(T,S){this.getStatus(y,T,S)};this.getSpellStatus=function(T,S){this.getStatus(v,T,S)};O()};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,g_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=ac(currentTextbox);container.style.left=(c[0]-2)+"px";container.style.top=(c[1]+currentTextbox.offsetHeight+1)+"px";container.style.width=currentTextbox.offsetWidth+"px"}function prepare(){if(prepared){return}prepared=1;container=ce("div");container.className="live-search";container.style.display="none";ae(ge("layers"),container);aE(window,"resize",adjust.bind(0,1));aE(document,"click",hide)}function show(){if(container&&!isVisible()){adjust();container.style.display=""}}function hide(){if(container){container.style.display="none"}}function highlight(match){return"<b><u>"+match+"</u></b>"}function display(textbox,search,suggz,dataz){prepare();show();lastA=null;hasData=1;selection=null;while(container.firstChild){de(container.firstChild)}if(!Browser.ie6){ae(container,ce("em"));ae(container,ce("var"));ae(container,ce("strong"))}search=search.replace(/[^a-z0-9\-]/i," ");search=trim(search.replace(/\s+/g," "));var regex=g_createOrRegex(search);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=ce("a"),sp=ce("i"),sp2=ce("span"),div=ce("div"),div2=ce("div");div.i=i;a.onmouseover=aOver;a.href="/?"+g_types[type]+"="+typeId;if(textbox._append){a.rel+=textbox._append}if(type==3&&param2!=null){a.className+=" q"+param2}else{if(type==4&&param1!=null){a.className+=" q"+param1}}if((type==3||type==6||type==9||type==10)&&param1){div.className+=" live-search-icon";div.style.backgroundImage="url(http://static.wowhead.com/images/icons/small/"+param1.toLowerCase()+".jpg)"}else{if(type==5&&param1>=1&&param1<=2){div.className+=" live-search-icon-quest-"+(param1==1?"alliance":"horde")}}ae(sp,ct(LANG.types[type][0]));ae(a,sp);var buffer=suggz[i];buffer=buffer.replace(regex,highlight);sp2.innerHTML=buffer;ae(a,sp2);if(type==6&&param2){ae(a,ct(" ("+param2+")"))}ae(div2,a);ae(div,div2);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){var url="/?search="+urlencode(search);if(textbox._type){url+="&json&type="+textbox._type}else{url+="&opensearch"}new Ajax(url,{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=$E(e);var textbox=e._target;switch(e.keyCode){case 48:case 96:case 107:case 109:if(Browser.gecko&&e.ctrlKey){adjust(textbox);break}break}var search=trim(textbox.value.replace(/\s+/g," "));if(search==lastSearch[textbox.id]){return}lastSearch[textbox.id]=search;if(search.length){preFetch(textbox,search)}else{hide()}}function onKeyDown(e){e=$E(e);var textbox=e._target;switch(e.keyCode){case 27:hide();break;case 38:cycle(0);break;case 40:cycle(1);break}}function onFocus(e){e=$E(e);var textbox=e._target;if(textbox!=document){currentTextbox=textbox}}this.attach=function(textbox){if(textbox.getAttribute("autocomplete")=="off"){return}textbox.setAttribute("autocomplete","off");aE(textbox,"focus",onFocus);aE(textbox,"keyup",onKeyUp);aE(textbox,Browser.opera?"keypress":"keydown",onKeyDown)};this.reset=function(textbox){lastSearch[textbox.id]=null;textbox.value="";hasData=0;hide()};this.hide=function(){hide()}};var Lightbox=new function(){var d,m,n,h={},c={},i,f;function o(){aE(d,"click",e);aE(document,Browser.opera?"keypress":"keydown",g);aE(window,"resize",a);if(Browser.ie6){aE(window,"scroll",j)}}function l(){dE(d,"click",e);dE(document,Browser.opera?"keypress":"keydown",g);dE(window,"resize",a);if(Browser.ie6){dE(window,"scroll",j)}}function b(){if(i){return}i=1;var p=ge("layers");d=ce("div");d.className="lightbox-overlay";m=ce("div");m.className="lightbox-outer";n=ce("div");n.className="lightbox-inner";d.style.display=m.style.display="none";ae(p,d);ae(m,n);ae(p,m)}function g(p){p=$E(p);switch(p.keyCode){case 27:e();break}}function a(p){if(p!=1234){if(c.onResize){c.onResize()}}d.style.height=document.body.offsetHeight+"px";if(Browser.ie6){j()}}function j(){var q=g_getScroll().y,p=g_getWindowSize().h;m.style.top=(q+p/2)+"px"}function e(){l();if(c.onHide){c.onHide()}d.style.display=m.style.display="none";Ads.restoreHidden();g_enableScroll(true)}function k(){d.style.display=m.style.display=h[f].style.display=""}this.setSize=function(p,q){n.style.visibility="hidden";n.style.width=p+"px";n.style.height=q+"px";n.style.left=-parseInt(p/2)+"px";n.style.top=-parseInt(q/2)+"px";n.style.visibility="visible"};this.show=function(t,s,p){c=s||{};Ads.hideAll();b();o();if(f!=t&&h[f]!=null){h[f].style.display="none"}f=t;var r=0,q;if(h[t]==null){r=1;q=ce("div");ae(n,q);h[t]=q}else{q=h[t]}if(c.onShow){c.onShow(q,r,p)}a(1234);k();g_enableScroll(false)};this.reveal=function(){k()};this.hide=function(){e()};this.isVisible=function(){return(d&&d.style.display!="none")}};var ModelViewer=new function(){var d,y,A=[],h,u,n,w,g,p,q,e,m,s,l,o=[{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:1,name:g_chr_races[1],model:"human"},{id:4,name:g_chr_races[4],model:"nightelf"},{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"}],i=[{id:1,name:LANG.female,model:"female"},{id:0,name:LANG.male,model:"male"}];function v(){u.style.display="none";n.style.display="none";w.style.display="none"}function a(){var B,C;if(p.style.display==""){B=(p.selectedIndex>=0?p.options[p.selectedIndex].value:"")}else{B=(q.selectedIndex>=0?q.options[q.selectedIndex].value:"")}C=(e.selectedIndex>=0?e.options[e.selectedIndex].value:0);return{r:B,s:C}}function c(B,C){return(!isNaN(B)&&B>0&&in_array(o,B,function(D){return D.id})!=-1&&!isNaN(C)&&C>=0&&C<=1)}function t(){if(s==2&&!f()){s=0}if(s==2){var E='<object id="3dviewer-plugin" type="application/x-zam-wowmodel" width="600" height="400"><param name="model" value="'+d+'" /><param name="modelType" value="'+y+'" /><param name="contentPath" value="http://static.wowhead.com/modelviewer/" />';if(y==16&&A.length){E+='<param name="equipList" value="'+A.join(",")+'" />'}E+='<param name="bgColor" value="#181818" /></object>';w.innerHTML=E;w.style.display=""}else{if(s==1){var E='<applet id="3dviewer-java" code="org.jdesktop.applet.util.JNLPAppletLauncher" width="600" height="400" archive="http://static.wowhead.com/modelviewer/applet-launcher.jar,http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jar,http://download.java.net/media/gluegen/webstart/gluegen-rt.jar,http://download.java.net/media/java3d/webstart/release/vecmath/latest/vecmath.jar,http://static.wowhead.com/modelviewer/ModelView510.jar"><param name="jnlp_href" value="http://static.wowhead.com/modelviewer/ModelView.jnlp"><param name="codebase_lookup" value="false"><param name="cache_option" value="no"><param name="subapplet.classname" value="modelview.ModelViewerApplet"><param name="subapplet.displayname" value="Model Viewer Applet"><param name="progressbar" value="true"><param name="jnlpNumExtensions" value="1"><param name="jnlpExtension1" value="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp"><param name="contentPath" value="http://static.wowhead.com/modelviewer/"><param name="model" value="'+d+'"><param name="modelType" value="'+y+'">';if(y==16&&A.length){E+='<param name="equipList" value="'+A.join(",")+'">'}E+='<param name="bgColor" value="#181818"></applet>';n.innerHTML=E;n.style.display=""}else{var H={model:d,modelType:y,contentPath:"http://static.wowhead.com/modelviewer/",blur:(OS.mac?"0":"1")};var G={quality:"high",allowscriptaccess:"always",menu:false,bgcolor:"#181818"};var B={};if(y==16&&A.length){H.equipList=A.join(",")}swfobject.embedSWF("http://static.wowhead.com/modelviewer/ModelView.swf","dsjkgbdsg2346","600","400","10.0.0","http://static.wowhead.com/modelviewer/expressInstall.swf",H,G,B);u.style.display=""}}var I=a(),D=I.r,F=I.s;if(!h.noPound){var C="#modelviewer";switch(h.type){case 1:C+=":1:"+h.displayId+":"+(h.humanoid|0);break;case 2:C+=":2:"+h.displayId;break;case 3:C+=":3:"+h.displayId+":"+(h.slot|0);break;case 4:C+=":4:"+A.join(";");break}if(D&&F){C+=":"+D+"+"+F}else{C+=":"}if(h.extraPound!=null){C+=":"+h.extraPound}location.replace(rtrim(C,":"))}}function b(){var F=a(),C=F.r,D=F.s;if(!C){if(e.style.display=="none"){return}e.style.display="none";d=A[1];switch(h.slot){case 1:y=2;break;case 3:y=4;break;default:y=1}}else{if(e.style.display=="none"){e.style.display=""}if(q.style.display==""){sc("modelviewer_model_race",7,C,"/",".wowhead.com");sc("modelviewer_model_sex",7,D,"/",".wowhead.com")}var F=function(G){return G.id};var E=in_array(o,C,F);var B=in_array(i,D,F);if(E!=-1&&B!=-1){d=o[E].model+i[B].model;y=16}}v();t()}function j(B){if(B==s){return}g_setSelectedLink(this,"modelviewer-mode");v();if(s==null){s=B;setTimeout(t,50)}else{s=B;sc("modelviewer_mode",7,B,"/",".wowhead.com");t()}}function r(G,B){var I=-1,J=-1,C,F;if(B.race!=null&&B.sex!=null){I=B.race;J=B.sex;g.style.display="none";G=0}else{g.style.display=""}if(I==-1&&J==-1){if(location.hash){var H=location.hash.match(/modelviewer:.*?([0-9]+)\+([0-9]+)/);if(H!=null){if(c(H[1],H[2])){I=H[1];J=H[2];e.style.display=""}}}}if(G){C=p;F=1;p.style.display="";p.selectedIndex=-1;q.style.display="none";if(J==-1){e.style.display="none"}}else{if(I==-1&&J==-1){var M=parseInt(gc("modelviewer_model_race")),E=parseInt(gc("modelviewer_model_sex"));if(c(M,E)){I=M;J=E}else{I=1;J=0}}C=q;F=0;p.style.display="none";q.style.display="";e.style.display=""}if(J!=-1){e.selectedIndex=J}if(I!=-1&&J!=-1){var L=function(N){return N.id};var K=in_array(o,I,L);var D=in_array(i,J,L);if(K!=-1&&D!=-1){d=o[K].model+i[D].model;y=16;K+=F;if(Browser.opera){setTimeout(function(){C.selectedIndex=K},1)}else{C.selectedIndex=K}e.selectedIndex=D}}}function f(){var C=navigator.mimeTypes["application/x-zam-wowmodel"];if(C){var B=C.enabledPlugin;if(B){return true}}return false}function k(){if(!h.noPound){if(!h.fromTag&&m&&m.indexOf("modelviewer")==-1){location.replace(m)}else{location.replace("#.")}}if(h.onHide){h.onHide()}}function z(O,I,F){var E,C;if(!F.displayAd||g_user.premium){Lightbox.setSize(620,452)}else{Lightbox.setSize(749,546)}if(I){O.className="modelviewer";var N=ce("div");u=ce("div");n=ce("div");w=ce("div");var M=ce("div");M.id="dsjkgbdsg2346";ae(u,M);N.className="modelviewer-screen";u.style.display=n.style.display=w.style.display="none";ae(N,u);ae(N,n);ae(N,w);var K=ce("div");K.style.backgroundColor="#181818";K.style.margin="0";ae(K,N);ae(O,K);E=ce("a"),C=ce("a");E.className="modelviewer-help";E.href="/?help=modelviewer";E.target="_blank";ae(E,ce("span"));C.className="modelviewer-close";C.href="javascript:;";C.onclick=Lightbox.hide;ae(C,ce("span"));ae(O,C);ae(O,E);var L=ce("div"),D=ce("span"),E=ce("a"),C=ce("a");L.className="modelviewer-quality";E.href=C.href="javascript:;";ae(E,ct("Flash"));ae(C,ct("Java"));E.onclick=j.bind(E,0);C.onclick=j.bind(C,1);ae(D,E);ae(D,ct(" "+String.fromCharCode(160)));ae(D,C);if(f()){var B=ce("a");B.href="javascript:;";ae(B,ct("Plugin"));B.onclick=j.bind(B,2);ae(D,ct(" "+String.fromCharCode(160)));ae(D,B)}ae(L,ce("div"));ae(L,D);ae(O,L);g=ce("div");g.className="modelviewer-model";var M=function(T,S){return strcmp(T.name,S.name)};o.sort(M);i.sort(M);p=ce("select");q=ce("select");e=ce("select");p.onchange=q.onchange=e.onchange=b;ae(p,ce("option"));for(var H=0,J=o.length;H<J;++H){var G=ce("option");G.value=o[H].id;ae(G,ct(o[H].name));ae(p,G)}for(var H=0,J=o.length;H<J;++H){var G=ce("option");G.value=o[H].id;ae(G,ct(o[H].name));ae(q,G)}for(var H=0,J=i.length;H<J;++H){var G=ce("option");G.value=i[H].id;ae(G,ct(i[H].name));ae(e,G)}e.style.display="none";ae(g,ce("div"));ae(g,p);ae(g,q);ae(g,e);ae(O,g);L=ce("div");L.className="clear";ae(O,L);if(F.displayAd){L=ce("div");L.id="modelviewer-ad";L.style.paddingBottom="10px";ae(O,L)}}switch(F.type){case 1:g.style.display="none";if(F.humanoid){y=32}else{y=8}d=F.displayId;break;case 2:g.style.display="none";y=64;d=F.displayId;break;case 3:A=[F.slot,F.displayId];if(in_array([4,5,6,7,8,9,10,16,19,20],F.slot)!=-1){r(0,F)}else{switch(F.slot){case 1:y=2;break;case 3:y=4;break;default:y=1}d=F.displayId;r(1,F)}break;case 4:A=F.equipList;r(0,F)}var Q=ge("modelviewer-ad");if(I){if(gc("modelviewer_mode")=="2"&&f()){B.onclick()}else{if(gc("modelviewer_mode")=="1"){C.onclick()}else{E.onclick()}}}else{if(Q){ee(Q)}v();setTimeout(t,1)}if(F.displayAd&&Q){Ads.fillSpot("leaderboard",Q)}var P="/tracker/modelviewer/";if(F.fromTag){P+="custom/";switch(F.type){case 1:P+="1:"+F.displayId+":"+(F.humanoid|0);break;case 2:P+="2:"+F.displayId;break;case 3:P+="3:"+F.displayId+":"+(F.slot|0);break;case 4:P+="4:"+A.join(".");break}}else{switch(F.type){case 1:P+="npc/"+(F.typeId?F.typeId:"display/"+F.displayId);break;case 2:P+="object/"+F.typeId;break;case 3:P+="item/"+F.typeId;break;case 4:P+="itemset/"+F.typeId;break}}var R=function(){if(isset("pageTracker")&&pageTracker!=null){pageTracker._trackPageview(P)}};if(DomContentLoaded){DomContentLoaded.addDelayedEvent(R)}else{R()}m=location.hash}this.checkPound=function(){if(location.hash&&location.hash.indexOf("#modelviewer")==0){var F=location.hash.split(":");if(F.length>=3){F.shift();var D=parseInt(F.shift());var C={type:D,displayAd:1};switch(D){case 1:C.displayId=parseInt(F.shift());var B=parseInt(F.shift());if(B==1){C.humanoid=1}break;case 2:C.displayId=parseInt(F.shift());break;case 3:C.displayId=parseInt(F.shift());C.slot=parseInt(F.shift());break;case 4:var E=F.shift();C.equipList=E.split(";");break}if(C.displayId||C.equipList){ModelViewer.show(C)}if(l!=null){if(F.length>0&&F[F.length-1]){l(F[F.length-1])}}}else{if(l!=null&&F.length==2&&F[1]){l(F[1])}else{var G=ge("dsgndslgn464d");if(G){G.onclick()}}}}};this.addExtraPound=function(B){l=B};this.show=function(B){h=B;Lightbox.show("modelviewer",{onShow:z,onHide:k},B)};DomContentLoaded.addEvent(this.checkPound)};var g_screenshots={};var ScreenshotViewer=new function(){var A,k,e,z,C,c,o,q=0,u,b,n,i,w,y,t,h,v,j;function g(D){var G=A[k];var E=Math.max(50,Math.min(618,g_getWindowSize().h-72-D));if(q!=1||G.id||G.resize){c=Math.min(772/G.width,618/G.height);C=Math.min(772/G.width,E/G.height)}else{c=C=1}if(c>1){c=1}if(C>1){C=1}e=Math.round(C*G.width);z=Math.round(C*G.height);var F=Math.max(480,e);Lightbox.setSize(F+20,z+52+D);if(Browser.ie6){n.style.width=F+"px";if(A.length>1){w.style.height=y.style.height=z+"px"}else{t.style.height=z+"px"}}if(D){i.firstChild.width=e;i.firstChild.height=z}}function d(F){var E=A[F],D="#screenshots:";if(q==0){D+="id="+E.id}else{D+=u+":"+(F+1)}return D}function s(G){if(G&&(C==c)&&g_getWindowSize().h>b.offsetHeight){return}b.style.visibility="hidden";var D=A[k],J=(D.width>772||D.height>618);g(0);var F=(D.url?D.url:"http://static.wowhead.com/uploads/screenshots/"+(J?"resized/":"normal/")+D.id+".jpg");var K='<img src="'+F+'" width="'+e+'" height="'+z+'"';if(Browser.ie6){K+=' galleryimg="no"'}K+=">";i.innerHTML=K;if(!G){if(D.url){h.href=F}else{h.href="http://static.wowhead.com/uploads/screenshots/normal/"+D.id+".jpg"}if(!D.user&&typeof g_pageInfo=="object"){D.user=g_pageInfo.username}var M=(D.date&&D.user),L=(A.length>1);if(M){var I=new Date(D.date),O=(g_serverTime-I)/1000;var N=v.firstChild.childNodes[1];N.href="/?user="+D.user;N.innerHTML=D.user;var Q=v.firstChild.childNodes[3];while(Q.firstChild){de(Q.firstChild)}Listview.funcBox.coFormatDate(Q,O,I);v.firstChild.style.display=""}else{v.firstChild.style.display="none"}var Q=v.childNodes[1];if(L){var P="";if(M){P+=LANG.dash}P+=(k+1)+LANG.lvpage_of+A.length;Q.innerHTML=P;Q.style.display=""}else{Q.style.display="none"}v.style.display=(M||L?"":"none");if(g_getLocale(true)!=0&&D.caption){D.caption=""}var E=(D.caption!=null&&D.caption.length);var H=(D.subject!=null&&D.subject.length&&D.type&&D.typeId);if(E||H){var K="";if(H){K+=LANG.types[D.type][0]+LANG.colon;K+='<a href="/?'+g_types[D.type]+"="+D.typeId+'">';K+=D.subject;K+="</a>"}if(E){if(H){K+=LANG.dash}K+=D.caption}j.innerHTML=K;j.style.display=""}else{j.style.display="none"}if(A.length>1){w.href=d(r(-1));y.href=d(r(1));w.style.display=y.style.display="";t.style.display="none"}else{w.style.display=y.style.display="none";t.style.display=""}location.replace(d(k))}Lightbox.reveal();if(j.offsetHeight>18){g(j.offsetHeight-18)}b.style.visibility="visible"}function r(D){var E=k;E+=D;if(E<0){E=A.length-1}else{if(E>=A.length){E=0}}return E}function a(){k=r(-1);s();return false}function p(){k=r(1);s();return false}function m(D){D=$E(D);switch(D.keyCode){case 37:a();break;case 39:p();break}}function f(){s(1)}function l(){if(A.length>1){dE(document,"keyup",m)}if(o&&q==0){if(o.indexOf(":id=")!=-1){o="#screenshots"}location.replace(o)}else{location.replace("#.")}}function B(D,H,E){if(typeof E.screenshots=="string"){A=g_screenshots[E.screenshots];q=1;u=E.screenshots}else{A=E.screenshots;q=0;u=null}b=D;k=0;if(E.pos&&E.pos>=0&&E.pos<A.length){k=E.pos}if(H){D.className="screenshotviewer";n=ce("div");n.className="screenshotviewer-screen";w=ce("a");y=ce("a");w.className="screenshotviewer-prev";y.className="screenshotviewer-next";w.href="javascript:;";y.href="javascript:;";var J=ce("span");ae(J,ce("b"));ae(w,J);var J=ce("span");ae(J,ce("b"));ae(y,J);w.onclick=a;y.onclick=p;t=ce("a");t.className="screenshotviewer-cover";t.href="javascript:;";t.onclick=Lightbox.hide;var J=ce("span");ae(J,ce("b"));ae(t,J);if(Browser.ie6){ns(w);ns(y);w.onmouseover=y.onmouseover=t.onmouseover=function(){this.firstChild.style.display="block"};w.onmouseout=y.onmouseout=t.onmouseout=function(){this.firstChild.style.display=""}}ae(n,w);ae(n,y);ae(n,t);i=ce("div");ae(n,i);ae(D,n);var I=ce("a");I.className="screenshotviewer-close";I.href="javascript:;";I.onclick=Lightbox.hide;ae(I,ce("span"));ae(D,I);h=ce("a");h.className="screenshotviewer-original";h.href="javascript:;";h.target="_blank";ae(h,ce("span"));ae(D,h);v=ce("div");v.className="screenshotviewer-from";var F=ce("span");ae(F,ct(LANG.lvscreenshot_from));ae(F,ce("a"));ae(F,ct(" "));ae(F,ce("span"));ae(v,F);ae(v,ce("span"));ae(D,v);j=ce("div");j.className="screenshotviewer-caption";ae(D,j);var G=ce("div");G.className="clear";ae(D,G)}o=location.hash;if(A.length>1){aE(document,"keyup",m)}s()}this.checkPound=function(){if(location.hash&&location.hash.indexOf("#screenshots")==0){if(!g_listviews.screenshots){var E=location.hash.split(":");if(E.length==3){var F=g_screenshots[E[1]],D=parseInt(E[2]);if(F&&D>=1&&D<=F.length){ScreenshotViewer.show({screenshots:E[1],pos:D-1})}}}}};this.show=function(D){Lightbox.show("screenshotviewer",{onShow:B,onHide:l,onResize:f},D)};DomContentLoaded.addEvent(this.checkPound)};var Ads={dimensions:{leaderboard:[728,90],skyscraper:[160,600],medrect:[300,250]},spots:{leaderboard:["header-ad"],skyscraper:["sidebar-ad"],medrect:["infobox-ad","blog-sidebar-medrect","talentcalc-sidebar-ad","pl-rightbar-ad","contribute-ad","profiler-inventory-medrect","profiler-reputation-medrect","profiler-achievements-medrect"]},hidden:[],removed:false,install:function(){for(var f in Ads.dimensions){var c=Ads.spots[f],e=false;for(var b=0,a=c.length;b<a;++b){if(f=="medrect"&&location.href.indexOf("?profile")!=-1){e=true}var d=ge(c[b]);if(d){if(e){de(d)}else{e=Ads.fillSpot(f,d)}}}}},fillSpot:function(c,b){if(Ads.removed||g_user.premium){de(b);return false}var a=ce("iframe");a.width=Ads.dimensions[c][0];a.height=Ads.dimensions[c][1];a.frameBorder=0;a.scrolling="no";a.src="http://static.wowhead.com/ads/dynamic/"+c+".html?4";ae(b,a);return true},removeAll:function(){for(var e in Ads.dimensions){var c=Ads.spots[e];for(var b=0,a=c.length;b<a;++b){var d=ge(c[b]);if(d){de(d)}}}Ads.removed=true},hide:function(b){var a=gE(b,"iframe")[0];if(a){a.style.display="none";Ads.hidden.push(b)}},hideAll:function(){for(var e in Ads.dimensions){var c=Ads.spots[e];for(var b=0,a=c.length;b<a;++b){var d=ge(c[b]);if(d&&!Ads.isHidden(d)){Ads.hide(d)}}}},isHidden:function(b){var a=gE(b,"iframe")[0];if(a){return a.style.display=="none"}return false},intersect:function(g,e){var b;for(var h in Ads.dimensions){var d=Ads.spots[h];for(var c=0,a=d.length;c<a;++c){var f=ge(d[c]);if(f){if(!Ads.isHidden(f)){coords=ac(f);b=g_createRect(coords.x,coords.y,f.offsetWidth,f.offsetHeight);if(g_intersectRect(g,b)){if(e){Ads.hide(f)}return true}}}}}return false},restoreHidden:function(){if(Ads.hidden.length){for(var c=0,a=Ads.hidden.length;c<a;++c){var d=Ads.hidden[c],b=gE(d,"iframe")[0];if(b){b.style.display=""}}Ads.hidden=[]}}};DomContentLoaded.addEvent(Ads.install);