var $WowheadTalentCalculator;

function TalentCalc(){
	var Ax=0,Af=1,f=85,Aq=this,W,n={},Ap={},F,AY,Ay,t=-1,AD=-1,Aj=0,AB,Y=(Browser.opera),l=false,AZ,X,Ar,AM,AJ,Am,T=0,Ac,b,q,As,AN,L,Av,Aa,G,AP,H,a178A,a178B,O={},e={},Z,S,AW,k,Ag,j,C,AV,Al=[],AE="0zMcmVokRsaqbdrfwihuGINALpTjnyxtgevElBCDFHJKOPQSUWXYZ123456789",Ai="Z",AT=[7,24,26,27,30,34,37,38],Ad,a={};
	this.addGlyph=function(A0){
		y(AB,A0)
	};
	this.getBlizzBuild=function(){
		if(t==-1){return }
		var A3=n[t],A2="";
		for(var A0=0;A0<X;++A0){
			for(var A1=0;A1<A3[A0].t.length;++A1){
				A2+=A3[A0].t[A1].k
			}
		}
		A2=rtrim(A2,"0");
		return A2
	};
	this.getGlyphs=function(){
		if(t==-1){return }
		var A3=n[t],A1={1:"",2:""};
		for(var A2=0;A2<AM;++A2){
			if(A3.glyphs[A2]){
				A1[r(A2)]+=AE.charAt(g_glyphs[A3.glyphs[A2]].index)
			}
		}
		var A0=A1[1];
		if(A0.length<3){
			A0+=Ai
		}
		A0+=A1[2];
		A0=rtrim(A0,Ai);
		return A0
	};
	this.getWhBuild=function(){
		if(t==-1){return }
		var A5=n[t],A1="",A4,A3;
		for(var A0=0;A0<X;++A0){
			A4="";
			for(A3=0;A3<A5[A0].t.length;++A3){
				A4+=A5[A0].t[A3].k
			}
			A4=rtrim(A4,"0");
			A1+=At(A4);
			A3=A4.length;
			if(A3%2==1){
				++A3
			}
			if(A3<A5[A0].t.length){
				A1+=Ai
			}
		}
		var A2;
		if(AZ==Af){
			A2=AE.charAt(Math.floor(t/10))+AE.charAt((2*(t%10))+(T?1:0))
		}else{
			A2=AE.charAt(AS(t)*3)
		}
		A2+=rtrim(A1,Ai);
		return A2
	};
	this.initialize=function(A0,A1){if(As){return }A0=wh$(A0);if(!A0){return }As=A0;As.className="talentcalc";if(A1==null){A1={}}W=A1;if(W.onChange){Ad=W.onChange}if(W.mode==Af){AZ=Af;X=1;Ar=6;AM=0;AJ=3;Am=16;b=g_pet_families;As.className+=" talentcalc-pet"}else{AZ=Ax;X=3;Ar=11;AM=6;AJ=5;Am=71;b=g_chr_classes;As.className+=" talentcalc-default";$WowheadTalentCalculator=Aq;M()}Ac=Am+T;D();P();AA();AL();if(W.whBuild){Ah(W.whBuild)}else{if(W.classId>0&&b[W.classId]){if(W.blizzBuild){Ab(W.classId,W.blizzBuild)}else{Q(W.classId)}}}if(W.glyphs){x(W.glyphs)}};this.promptBlizzBuild=function(){if(AZ==Af){return }var A2,A3,A0=prompt(LANG.prompt_importblizz,"");if(!A0){return }if(A0.indexOf("?")!=-1){for(var A1 in g_file_classes){if(A0.indexOf(g_file_classes[A1])!=-1){A2=parseInt(A1);break}}}if(!A2){alert(LANG.alert_invalidurl);return }A3=A0.substring(A0.indexOf("?")+1);Ab(A2,A3)};this.promptWhBuild=function(){var A1;var A2,A0=prompt(LANG.prompt_importwh,"");if(!A0){return }var A3=A0.indexOf("=");if(A3!=-1){A2=A0.substr(A3+1);A1=Ah(A2)}if(!A1){alert(LANG.alert_invalidurl);return }};this.registerClass=function(A1,A0){v(A1,A0)};this.reset=function(A0){if(t==-1){return }if(A0>X-1){return }l=false;An(A0,t,true)};this.resetAll=function(){if(t==-1){return }l=false;AH(t);u()};this.resetGlyphs=function(){p()};this.restore=function(){AK()};this.setBlizzBuild=function(A0,A1){Ab(A0,A1)};this.setBonusPoints=function(A0){if(AZ!=Af){return }AC(A0)};this.setClass=function(A0){return Q(A0)};this.setGlyphs=function(A0){if(t==-1){return }x(A0)};this.setLevelCap=function(A0){A0=parseInt(A0);if(isNaN(A0)||A0<1||A0>80){return }var A1;if(AZ==Af){A1=Math.max(0,Math.floor((A0-16)/4))}else{A1=Math.max(0,A0-9)}B(A1,-1)};this.setLock=function(A0){if(t==-1){return }AF(A0)};this.setWhBuild=function(A0){return Ah(A0)};this.showSummary=function(A5){if(t==-1){return }var A6=n[t],A4=window.open("","","toolbar=no,menubar=yes,status=yes,scrollbars=yes,resizable=yes"),A3,A2,A1,A0="<html><head><title>"+document.title+'</title></head><body style="font-family: Arial, sans-serif; font-size: 13px">';A4.document.open();if(A5){A0+="<h2>";if(AZ==Af){A0+=sprintf(LANG.tc_printh,m(),g_pet_families[A6.n])}else{A0+=sprintf(LANG.tc_printh,m(),g_chr_classes[A6.n])+" ("+A6[0].k+"/"+A6[1].k+"/"+A6[2].k+")"}A0+="</h2>";A0+="<p></p>";for(A3=0;A3<X;++A3){A0+="<h3>"+A6[A3].n+" ("+A6[A3].k+" "+LANG[A6[A3].k==1?"tc_point":"tc_points"]+")</h3>";A0+="<blockquote>";A1=0;for(A2=0;A2<A6[A3].t.length;++A2){if(A6[A3].t[A2].k){if(A1){A0+="<br /><br />"}A0+="<b>"+A6[A3].t[A2].n+"</b>"+LANG.hyphen+sprintf(LANG.tc_rank,A6[A3].t[A2].k,A6[A3].t[A2].m)+"<br />";A0+=z(A6[A3].t[A2]);++A1}}if(A1==0){A0+=LANG.tc_none}A0+="</blockquote>"}}else{A0+="<pre>";for(A3=0;A3<X;++A3){A0+="<b>"+A6[A3].n+" ("+A6[A3].k+" "+LANG[A6[A3].k==1?"tc_point":"tc_points"]+")</b>\n\n";A1=0;for(A2=0;A2<A6[A3].t.length;++A2){if(A6[A3].t[A2].k){A0+="&nbsp;&nbsp;&nbsp;&nbsp;"+A6[A3].t[A2].k+"/"+A6[A3].t[A2].m+" "+A6[A3].t[A2].n+"\n";++A1}}if(A1==0){A0+="&nbsp;&nbsp;&nbsp;&nbsp;"+LANG.tc_none+"\n"}A0+="\n"}A0+="</pre>"}A0+="</body></html>";A4.document.write(A0);A4.document.close()};this.simplifyGlyphName=function(A0){return AQ(A0)};this.toggleLock=function(){if(t==-1){return }U()};function y(A3,A1,A0){var A2=n[t];glyph=g_glyphs[A1];if(glyph&&A(glyph,A3)){if(A2.glyphs[A3]){A2.glyphItems[A2.glyphs[A3]]=0}A2.glyphs[A3]=A1;A2.glyphItems[A1]=1;if(!A0){c(A3);u()}}}function Au(){var A4=n[t];if(A4.k>Ac){for(var A0=X-1;A0>=0;--A0){for(var A3=A4[A0].t.length-1;A3>=0;--A3){var A1=A4[A0].t[A3].k;for(var A2=0;A2<A1;++A2){J(A4[A0].t[A3]);if(A4.k<=Ac){return }}}}}}function Ao(A1,A0){if(T){AC(0)}else{AC(4)}AI(A1,A0)}function AI(A1,A0){Tooltip.showAtCursor(A0,LANG[T?"tc_rembon":"tc_addbon"],null,null,"q")}function g(A4,A3,A0){var A5=ce("div"),A2,A1;A5.className="talentcalc-arrow";switch(A4){case 0:A3=15;A2=o(1,2);A2.className="talentcalc-arrow-down";A1=A2.firstChild.childNodes[0].childNodes[0].style;A1.width="15px";A1.height="4px";A1=A2.firstChild.childNodes[1].childNodes[0].style;A1.backgroundPosition="bottom";A1.height=(A0-4)+"px";break;case 1:A2=o(2,2,true);A2.className="talentcalc-arrow-leftdown";A1=A2.firstChild.childNodes[0].childNodes[0].style;A1.backgroundPosition="left";A1.width=(A3-4)+"px";A1.height="11px";A1=A2.firstChild.childNodes[0].childNodes[1].style;A1.backgroundPosition="right";A1.width="4px";A1=A2.firstChild.childNodes[1].childNodes[0].style;A1.backgroundPosition="bottom left";A1.backgroundRepeat="no-repeat";A1.height=(A0-11)+"px";break;case 2:A2=o(2,2,true);A2.className="talentcalc-arrow-rightdown";A1=A2.firstChild.childNodes[0].childNodes[0].style;A1.backgroundPosition="left";A1.width="4px";A1=A2.firstChild.childNodes[0].childNodes[1].style;A1.backgroundPosition="right";A1.width=(A3-4)+"px";A1.height="11px";A1=A2.firstChild.childNodes[1].childNodes[0].style;A1.backgroundPosition="bottom right";A1.backgroundRepeat="no-repeat";A1.height=(A0-11)+"px";break;case 3:A0=15;A2=o(2,1);A2.className="talentcalc-arrow-right";A1=A2.firstChild.childNodes[0].childNodes[0].style;A1.backgroundPosition="left";A1.width="4px";A1=A2.firstChild.childNodes[0].childNodes[1].style;A1.backgroundPosition="right";A1.width=(A3-4)+"px";break;case 4:A0=15;A2=o(2,1);A2.className="talentcalc-arrow-left";A1=A2.firstChild.childNodes[0].childNodes[0].style;A1.backgroundPosition="left";A1.width=(A3-4)+"px";A1=A2.firstChild.childNodes[0].childNodes[1].style;A1.backgroundPosition="right";A1.width="4px";break}A5.style.width=A3+"px";A5.style.height=A0+"px";ae(A5,A2);return A5}function AL(){var A2,A3,A1;AV=ce("div");AV.className="talentcalc-lower";AV.style.display="none";for(var A0=0;A0<X;++A0){A2=Al[A0]=ce("div");A2.className="talentcalc-lower-tree"+(A0+1);A3=ce("p");A3.className="rcorners";ae(A3,ce("b"));ae(A3,ce("span"));A1=ce("a");A1.href="javascript:;";A1.onclick=Aq.reset.bind(null,A0);ae(A3,A1);ae(A3,ce("tt"));ae(A3,ce("strong"));ae(A3,ce("var"));ae(A3,ce("em"));ae(A2,A3);ae(AV,A2)}ae(As,AV)}function AA(){C=ce("div");C.className="talentcalc-main";var A0=ce("div");A0.className="clear";ae(C,A0);ae(As,C)}function N(A8){var A3=[{}],A7,A9;var A0=in_array(AT,A8)!=-1;for(var A4=0,A6=g_pet_talents.length;A4<A6;++A4){var A5=g_pet_talents[A4];if(in_array(A5.f,A8)>=0){A3[0].n=A5.n;A3[0].t=[];A3[0].i=A4;for(var A2=0,A1=A5.t.length;A2<A1;++A2){A7=A5.t[A2];A9=A3[0].t[A2]={};cO(A9,A7);if(A4==0&&((A2==1&&A0)||(A2==2&&!A0)||(A2==11&&A0)||(A2==12&&!A0))){A9.hidden=true}if(A4==2&&((A2==1&&A0)||(A2==2&&!A0)||(A2==6&&A0)||(A2==7&&!A0))){A9.hidden=true}}break}}return A3}

function D(){var A4,BD,BC,A3;AN=ce("div");AN.className="talentcalc-sidebar rcorners";ae(AN,ce("tt"));ae(AN,ce("strong"));ae(AN,ce("var"));ae(AN,ce("em"));A4=ce("div");A4.className="talentcalc-sidebar-inner";

//help link
//BD=ce("a");BD.className="talentcalc-button-help";BD.href=(AZ==Af?"http://petopia.brashendeavors.net/html/patch30/patch30faq_talents.php":"/?help=talent-calculator");BD.target="_blank";ae(BD,ct(LANG.tc_help));ae(A4,BD);

L=ce("div");L.className="talentcalc-sidebar-controls";L.style.display="none";BD=ce("a");
BD.className="talentcalc-button-reset";BD.href="javascript:;";BD.onclick=Aq.resetAll;ae(BD,ct(LANG.tc_resetall));ae(L,BD);BD=Av=ce("a");
BD.className="talentcalc-button-lock";BD.href="javascript:;";BD.onclick=U;ae(BD,ct(LANG.tc_lock));ae(L,BD);BD=ce("div");BD.className="clear";
ae(L,BD);a178A=ce("p");ae(a178A,ct("天赋与雕文配置已锁定。点击上方的“解锁”按钮可以编辑天赋与雕文配置。"));ae(L,a178A);ae(A4,L);BD=ce("div");
BD.className="talentcalc-sidebar-controls2";BC=ce("a");BC.className="talentcalc-button-import";
BC.href="javascript:;";BC.onclick=Aq.promptBlizzBuild;ae(BC,ct(LANG.tc_import));ae(BD,BC);BC=Aa=ce("a");
BC.className="talentcalc-button-summary";BC.style.display="none";BC.href="javascript:;";BC.onclick=Aq.showSummary.bind(null,0);ae(BC,ct(LANG.tc_summary));

ae(BD,BC);G=ce("a");
/*BC=G=ce("a");
BC.className="talentcalc-button-restore";
BC.style.display="none";
BC.href="javascript:;";
BC.onclick=AK;ae(BC,ct(LANG.tc_restore));
ae(BD,BC);*/
if(W.profiler){BC=AP=ce("a");BC.className="talentcalc-button-export";BC.style.display="none";BC.href="#";BC.target="_blank";ae(BC,ct(LANG.tc_export));ae(BD,BC)}BC=ce("div");BC.className="clear";ae(BD,BC);ae(A4,BD);
a178B=ce("p");a178B.innerHTML="本页面地址会随天赋与雕文配置自动变化。可用该地址快速查看该天赋与雕文配置。";ae(BD,a178B);
if(!W.noAd){BD=ce("div");

BD.id="talentcalc-sidebar-ad";ae(A4,BD)}if(AZ==Ax){H=ce("div");H.style.display="none";BD=ce("h3");ae(BD,ct(LANG.tc_glyphs));ae(H,BD);BC=ce("a");BC.href="javascript:;";
BC.onclick=Aq.resetGlyphs;ae(BC,ct("[x]"));

ae(BD,BC);

BD=ce("div");BD.className="talentcalc-sidebar-majorglyphs q9";BC=ce("b");ae(BC,ct(g_item_glyphs[1]));


ae(BD,BC);ae(H,BD);BD=ce("div");BD.className="talentcalc-sidebar-minorglyphs q9";BC=ce("b");ae(BC,ct(g_item_glyphs[2]));ae(BD,BC);ae(H,BD);

BD=ce("div");BD.className="clear";

ae(H,BD);



var BE=ce("table"),A2=ce("tbody"),A5,A0,A1,A8,A7,BA;BE.className="icontab";for(var A6=0;A6<3;++A6){A5=ce("tr");for(var A9=0;A9<2;++A9){var BB=(A9*3)+A6;A0=ce("th");A8=Icon.create("inventoryslot_empty",1,null,"javascript:;");A7=Icon.getLink(A8);O[BB]=A8;ae(A0,A8);ae(A5,A0);A1=ce("td");BA=ce("a");e[BB]=BA;ae(A1,BA);ae(A5,A1);BA.target=A7.target="_blank";BA.rel=A7.rel="np";BA.onmousedown=A7.onmousedown=rf;BA.onclick=A7.onclick=rf;BA.onmouseup=AG.bind(Aq,BA,BB);BA.onmouseover=h.bind(null,BA,BB);BA.onmousemove=Tooltip.cursorUpdate;BA.onmouseout=Tooltip.hide;A7.onmouseup=AG.bind(Aq,A7,BB);A7.onmouseover=h.bind(null,A7,BB);A7.onmouseout=Tooltip.hide;A1.oncontextmenu=A7.oncontextmenu=rf}ae(A2,A5)}ae(BE,A2);ae(H,BE);ae(A4,H)}ae(AN,A4);BD=ce("div");BD.className="talentcalc-sidebar-anchor";ae(BD,AN);ae(As,BD)}


function o(A1,A6,A2){var A8=ce("table"),A0=ce("tbody"),A3,A7;for(var A4=0;A4<A6;++A4){A3=ce("tr");for(var A5=0;A5<A1;++A5){if(A2&&A4>0){A7=ce("th");A7.colSpan=2;ae(A3,A7);break}else{ae(A3,ce("td"))}}ae(A0,A3)}ae(A8,A0);return A8}


function Ae(BD){var BL=n[BD],BO;BL.k=0;BL.div=ce("div");BL.div.style.display="none";aef(C,BL.div);for(var BA=0;BA<X;++BA){BL[BA].k=0;var BK=ce("div");BK.style.backgroundRepeat="no-repeat";BK.style.cssFloat=BK.style.styleFloat="left";if(BA>0){BK.style.borderLeft="1px solid #404040"}ae(BK,o(4,Ar));ae(BL.div,BK);var BG=gE(BK,"td"),BC,BN="";if(!Browser.ie6){BN="?"+f}if(AZ==Af){BK.style.backgroundImage="url(http://static.wowhead.com/images/pet/petcalc"+(g_locale.id==25?"-ptr":"")+"/bg_"+(BL[0].i+1)+".jpg"+BN+")";BC="http://static.wowhead.com/images/pet/petcalc"+(g_locale.id==25?"-ptr":"")+"/icons_"+(BL[0].i+1)+".jpg"+BN}else{BK.style.backgroundImage="url(http://cimg.178.com/wow/tf/talents/bg/"+g_file_classes[BD]+"_"+(BA+1)+".jpg"+BN+")";BC="http://cimg.178.com/wow/tftw/talents/icons/"+(g_locale.id==25?"-ptr":"")+"/"+g_file_classes[BD]+"_"+(BA+1)+".jpg"+BN}for(var BH=BL[BA].t.length-1;BH>=0;--BH){var A0=BL[BA].t[BH],BJ=Icon.create(BC,1,null,"javascript:;"),A6=Icon.getLink(BJ),BM=BG[(A0.y*4+A0.x+1)-1];if(Browser.ie6){A6.onfocus=tb}A6.rel="np";A6.target="_blank";A6.onmousedown=A6.oncontextmenu=rf;A6.onclick=i;A6.onmouseup=Aw.bind(A6,A0);A6.onmouseover=AO.bind(null,A6,A0);A6.onmouseout=Tooltip.hide;var BF=ce("div"),BB=ce("div");ae(BB,ct("0"));BF.className="icon-border";BB.className="icon-bubble";ae(BJ,BF);ae(BJ,BB);A0.k=0;A0.i=BH;A0.tree=BA;A0.classId=BD;A0.icon=BJ;A0.link=A6;A0.border=BF;A0.bubble=BB;if(!A0.hidden){ae(BM,BJ)}if(A0.r){var A1=BL[BA].t[A0.r[0]],A4=A0.x-A1.x,A3=A0.y-A1.y,BE,A8,A7,BI,A5=-1;if(A1.links==null){A1.links=[BH]}else{A1.links.push(BH)}if(A3>0){if(A4==0){A5=0}else{if(A4<0){A5=1}else{A5=2}}}else{if(A3==0){if(A4>0){A5=3}else{if(A4<0){A5=4}}}}if(AZ==Af){A7=(Math.abs(A4)-1)*60;BI=(Math.abs(A3)-1)*60}else{A7=(Math.abs(A4)-1)*50;BI=(Math.abs(A3)-1)*50}if(AZ==Af){switch(A5){case 0:BI+=27;BE=21;A8=6-BI;break}}else{switch(A5){case 0:BI+=17;BE=16;A8=6-BI;break;case 1:A7+=36;BI+=42;BE=16;A8=6-BI;break;case 2:A7+=37;BI+=42;BE=-6;A8=6-BI;break;case 3:A7+=15;BE=-6;A8=12;break;case 4:A7+=15;BE=37;A8=12;break}}var A2=g(A5,A7,BI);A2.style.left=BE+"px";A2.style.top=A8+"px";var A9=ce("div");A9.className="talentcalc-arrow-anchor";ae(A9,A2);if(!A0.hidden){BM.insertBefore(A9,BM.firstChild)}A0.arrow=A2}}}}function P(){var A3,A1,A2;Z=ce("div");Z.className="talentcalc-upper rcorners";Z.style.display="none";ae(Z,ce("tt"));ae(Z,ce("strong"));ae(Z,ce("var"));ae(Z,ce("em"));A3=ce("div");A3.className="talentcalc-upper-inner";A1=ce("span");A1.className="talentcalc-upper-class";A2=S=ce("b");if(AZ==Af){var A0=ce("a");A0.target="_blank";ae(S,A0);S=A0}ae(A1,A2);ae(A1,ct(" "));AW=ce("b");ae(A1,AW);ae(A3,A1);A1=ce("span");A1.className="talentcalc-upper-ptsleft";ae(A1,ct(LANG.tc_ptsleft));Ag=ce("b");ae(A1,Ag);ae(A3,A1);if(AZ==Af){A2=j=ce("a");A2.href="javascript:;";A2.onclick=Ao.bind(null,A2);A2.onmouseover=AI.bind(null,A2);A2.onmousemove=Tooltip.cursorUpdate;A2.onmouseout=Tooltip.hide;ae(A1,A2)}A1=ce("span");A1.className="talentcalc-upper-reqlevel";ae(A1,ct(LANG.tc_reqlevel));k=ce("b");ae(A1,k);ae(A3,A1);A1=ce("div");A1.className="clear";ae(A3,A1);ae(Z,A3);ae(As,Z)}function At(A4){var A0="";var A1=[];for(var A3=0;A3<A4.length;A3+=2){for(var A2=0;A2<2;++A2){A1[A2]=parseInt(A4.substring(A3+A2,A3+A2+1));if(isNaN(A1[A2])){A1[A2]=0}}A0+=AE.charAt(A1[0]*6+A1[1])}return A0}function J(A5,A4,A7){var A6=n[A5.classId];if(A5.k>0){if(A5.links){for(A2=0;A2<A5.links.length;++A2){if(A6[A5.tree].t[A5.links[A2]].k){return }}}var A3=0;A5.k--;for(var A2=0;A2<A6[A5.tree].t.length;++A2){var A1=A6[A5.tree].t[A2];if(A1.k&&A5.y!=A1.y){if(A3<A1.y*AJ){A5.k++;return }}A3+=A1.k}A6[A5.tree].k--;A2=A6.k--;Az(A5.tree,A4,null,A5.classId);if(A4){AO(A7,A5);if(A2>=Ac){for(var A0=0;A0<X;++A0){Az(A0,true,null,A5.classId)}}u()}}}function I(A2){var A0=I.L;if(A0==null){A0=I.L={};for(var A1 in AS.L){A0[AS.L[A1]]=A1}}return A0[A2]}function AS(A0){return AS.L[A0]}AS.L={6:9,11:0,3:1,8:2,2:3,5:4,4:5,7:6,9:7,1:8};function r(A0){return(A0<=2?1:2)}function m(){var A0=n[t];if(AZ==Af){return Math.max(T?60:0,A0.k>0?(A0.k-T)*4+16:0)}else{return(A0.k?A0.k+9:0)}}function z(A2,A0){var A1=A2.d;var A3=Math.max(0,A2.k-1)+(A0?1:0);return A2.d[A3]}function AG(A2,A1,A0){A0=$E(A0);if(A0._button==3||A0.shiftKey||A0.ctrlKey){if(AR(A1)){h(A2,A1)}}else{if(A0._button==1){AB=A1;Lightbox.show("glyphpicker",{onShow:V})}}}function V(A8,A3,A0){Lightbox.setSize(620,564);var A2;if(A3){A8.className="talentcalc-glyphpicker listview";var A1=[],A5=ce("div"),A7=ce("a"),A4=ce("div");for(var A6 in g_glyphs){A1.push(g_glyphs[A6])}A5.className="listview";ae(A8,A5);A7.className="screenshotviewer-close";A7.href="javascript:;";A7.onclick=Lightbox.hide;ae(A7,ce("span"));ae(A8,A7);A4.className="clear";ae(A8,A4);A2=new Listview({template:"glyph",id:"glyphs",parent:A5,data:A1,customFilter:A});if(Browser.gecko){aE(A2.getClipDiv(),"DOMMouseScroll",AU)}else{A2.getClipDiv().onmousewheel=AU}}else{A2=g_listviews.glyphs;A2.clearSearch();A2.updateFilters(true)}setTimeout(function(){A2.focusSearch()},1)}function AU(A0){A0=$E(A0);if(A0._wheelDelta<0){this.scrollTop+=27}else{this.scrollTop-=27}}function i(){return l}function Aw(A1,A0){A0=$E(A0);if(l){return }if(A0._button==3||A0.shiftKey||A0.ctrlKey){J(A1,true,this)}else{if(A0._button==1){K(A1,true,this)}}}function K(A2,A1,A4){var A3=n[A2.classId];if(A3.k<Ac){if(A2.enabled&&A2.k<A2.m){A3.k++;A3[A2.tree].k++;A2.k++;Az(A2.tree,A1,A2,A2.classId);if(A1){AO(A4,A2);if(A3.k==Ac){for(var A0=0;A0<X;++A0){if(A0!=A2.tree){Az(A0,A1,null,A2.classId)}}}u()}}}else{if(AZ==Af&&A3.k==Ac&&!A1){B(-1,4,true);K(A2,A1,A4)}}}function M(){var A1,A3,A0;for(var A2 in g_glyphs){A1=g_glyphs[A2];A3=A1.classs;A0=A1.type;if(!Ap[A3]){Ap[A3]={1:[],2:[]}}A1.id=A2;A1.index=Ap[A3][A0].length;Ap[A3][A0].push(A1.id)}}function A(A0,A2){var A1=n[t];return(A0.classs==t&&A0.type==r(A2!=null?A2:AB)&&!A1.glyphItems[A0.id])}

function u(){var A2=n[t];if(!A2){return }a.mode=AZ;a.classId=t;a.locked=l;a.requiredLevel=m();a.pointsLeft=Ac-A2.k;a.pointsSpent=(AZ==Af?A2[0].k:[A2[0].k,A2[1].k,A2[2].k]);a.bonusPoints=T;st(AW,"("+(AZ==Af?A2.k:a.pointsSpent.join("/"))+")");st(k,a.requiredLevel?a.requiredLevel:"-");st(Ag,a.pointsLeft);if(l){st(Av,LANG.tc_unlock);Av.className="talentcalc-button-unlock";a178A.style.display="block";a178B.style.display="none";}else{st(Av,LANG.tc_lock);Av.className="talentcalc-button-lock";a178A.style.display="none";a178B.style.display="block";}if(AZ==Af){if(T){st(j,"[-]");j.className="q10"}else{st(j,"[+]");j.className="q2"}}if(AP){AP.href="/?talent#"+Aq.getWhBuild()}for(var A0=0;A0<X;++A0){var A1=Al[A0].firstChild.childNodes[1];st(A1," ("+A2[A0].k+")")}if(Ad){Ad(Aq,a,A2)}}function d(){st(S,b[t]);if(AZ==Af){S.href="/?pet="+t}else{S.className="c"+t}if(Aj==0){L.style.display="";if(AZ==Ax){Aa.style.display=""}if(AP){AP.style.display=""}if(H){H.style.display=""}Z.style.display="";AV.style.display=""}var A2=n[t];for(var A0=0;A0<X;++A0){var A1=Al[A0].firstChild.childNodes[0];if(AZ==Ax){A1.style.backgroundImage="url(http://static.wowhead.com/images/talent/classes/trees/"+g_file_classes[t]+"_"+(A0+1)+".gif)"}st(A1,A2[A0].n)}Au();E(t);u();++Aj}function Ak(A8,A7){var A6=n[A7];var A9=0,A5=0;var A2=null,A0;for(var A4=0;A4<A8.length;++A4){var A1=Math.min(parseInt(A8.charAt(A4)),A6[A9].t[A5].m);if(isNaN(A1)){continue}for(var A3=0;A3<A1;++A3){K(A6[A9].t[A5])}if(A2){for(var A3=0;A3<A0;++A3){K(A2)}A2=null}if(A6[A9].t[A5].k<A1){A2=A6[A9].t[A5];A0=A1-A6[A9].t[A5].k}if(++A5>A6[A9].t.length-1){A5=0;if(++A9>X-1){break}}}}function R(A2){var A4=0;for(var A1=0,A0=A2.length;A1<A0&&A1<AM;++A1){var A3=A2.charAt(A1);if(A3=="Z"){A4=3;continue}y(A4,Ap[t][r(A4)][AE.indexOf(A3)],true);++A4}}function AX(BA,A9){var A8=n[A9];var BC=0,A7=0;var BB=[];var A3=null,A1;for(var A6=0;A6<BA.length;++A6){var A0=BA.charAt(A6);if(A0!=Ai){var A2=AE.indexOf(A0);if(A2<0){continue}BB[1]=A2%6;BB[0]=(A2-BB[1])/6;for(var A5=0;A5<2;++A5){A2=Math.min(BB[A5],A8[BC].t[A7].m);for(var A4=0;A4<A2;++A4){K(A8[BC].t[A7])}if(A3){for(var A4=0;A4<A1;++A4){K(A3)}A3=null}if(A8[BC].t[A7].k<A2){A3=A8[BC].t[A7];A1=A2-A8[BC].t[A7].k}if(++A7>=A8[BC].t.length){break}}}if(A7>=A8[BC].t.length||A0==Ai){A7=0;if(++BC>X-1){return }}}}function s(A2){if(!Browser.ie6){return }if(!q){var A1=q=ce("div");A1.style.position="absolute";A1.style.left=A1.style.top="-2323px";A1.style.visibility="hidden";ae(ge("layers"),A1)}var A5=n[A2];for(var A0=0;A0<X;++A0){var A4=ce("img"),A3=ce("img");if(AZ==Af){A4.src="http://static.wowhead.com/images/pet/petcalc"+(g_locale.id==25?"-ptr":"")+"/bg_"+(A0+1)+".jpg";A3.src="http://static.wowhead.com/images/pet/petcalc"+(g_locale.id==25?"-ptr":"")+"/icons_"+(A0+1)+".jpg"}else{A4.src="http://cimg.178.com/wow/tf/talents/bg/"+g_file_classes[A2]+"_"+(A0+1)+".jpg";A3.src="http://cimg.178.com/wow/tftw/talents/icons/"+(g_locale.id==25?"-ptr":"")+"/"+g_file_classes[A2]+"_"+(A0+1)+".jpg"}ae(q,A4);ae(q,A3)}}function E(A1){w();for(var A0=0;A0<X;++A0){Az(A0,true,null,A1)}}function w(){if(AZ!=Ax){return }var A0=0;for(var A1=0;A1<AM;++A1){if(c(A1)){++A0}}H.style.display=(A0==0&&l?"none":"")}function v(A2,A1){if(n[A2]==null){A1.n=A2;n[A2]=A1;var A3=n[A2];A3.glyphs=[];A3.glyphItems={};Ae(A2);if(F&&F.classId==A2){for(var A0=0;A0<X;++A0){Az(A0,false,null,A2)}if(F.wh||F.blizz){l=true;if(F.wh){AX(F.wh,A2)}else{Ak(F.blizz,A2)}}}else{l=false}F=null;if(Ay&&Ay.classId==A2){R(Ay.str)}Ay=null;if(A2==t){d();A3.div.style.display="";for(var A0=0;A0<X;++A0){Az(A0,true,null,A2)}}}}function AR(A2,A0){var A1=n[t];if(A1.glyphs[A2]){A1.glyphItems[A1.glyphs[A2]]=0;A1.glyphs[A2]=0;if(!A0){c(A2);u()}return true}}function AH(A1){if(AZ==Af){B(-1,0,true)}for(var A0=0;A0<X;++A0){An(A0,A1,false)}E(A1)}function p(A0){var A2=n[t];for(var A1=0;A1<AM;++A1){AR(A1,!A0)}w();u()}function An(A0,A3,A2){var A4=n[A3];var A1;for(A1=0;A1<A4[A0].t.length;++A1){A4[A0].t[A1].k=0}A1=(A4.k<Ac);A4.k-=A4[A0].k;A4[A0].k=0;if(A2){if(A1){Az(A0,true,null,A3)}else{for(A0=0;A0<X;++A0){Az(A0,true,null,A3)}}u()}}function AK(){if(AY){if(AY.wh){Ah(AY.wh)}else{Ab(AY.classId,AY.blizz)}}}function Ab(A0,A1){if(!A1){return }l=true;if(!AY){AY={classId:A0,blizz:A1};G.style.display=""}if(n[A0]){AH(A0);Ak(A1,A0);E(A0)}else{F={classId:A0,blizz:A1}}if(!Q(A0)){u()}}function AC(A0){if(isNaN(A0)||(A0!=0&&A0!=4)){return }B(-1,A0)}function Q(A0){if(b[A0]==null){return }if(A0!=t){AD=t;t=A0;if(AZ==Af&&n[A0]==null){v(A0,N(A0))}else{if(n[A0]){d();var A1=n[A0];A1.div.style.display=""}else{s(A0);



g_ajaxIshRequest("http://wowdb.178.com/datageter/talent/tw/"+A0+".js")}}if(n[AD]){n[AD].div.style.display="none"}return true}}function x(A0){if(!A0){return }if(n[t]){p();R(A0);w();u()}else{Ay={classId:t,str:A0}}}function AF(A0){if(l!=A0){l=A0;E(t);u();}}function B(A2,A3,A1){var A0=Ac;if(A2==-1){A2=Am}if(A3==-1){A3=T}Am=A2;T=A3;Ac=A2+A3;if(t!=-1){if(Ac<A0){Au()}E(t);if(!A1){u();}}}function Ah(A4){if(!A4){return }var A0=A4,A1=false,A2;if(AZ==Af){var A5=AE.indexOf(A4.charAt(0));if(A5>=0&&A5<=4){var A3=AE.indexOf(A4.charAt(1));if(A3%2==1){B(-1,4,true);--A3}else{B(-1,0,true)}A2=A5*10+(A3/2);if(g_pet_families[A2]!=null){A4=A4.substr(2);A1=true}}}else{var A5=AE.indexOf(A4.charAt(0));if(A5>=0&&A5<=27){var A3=A5%3,A2=(A5-A3)/3;A2=I(A2);if(A2!=null){A4=A4.substr(1);A1=true}}}if(A1){if(A4.length){l=true;if(!AY){AY={wh:A0};G.style.display=""}}if(n[A2]){AH(A2);AX(A4,A2);E(A2)}else{F={classId:A2,wh:A4}}if(!Q(A2)){u()}return A2}}function h(A2,A1){var A0=n[t];upper="",lower="";glyph=g_glyphs[A0.glyphs[A1]];if(glyph){upper+="<b>"+glyph.name+"</b>";upper+='<br /><span class="q9">'+LANG[A1<=2?"tc_majgly":"tc_mingly"]+"</span>";lower+='<span class="q">'+glyph.description+"</span>";lower+='<br /><span class="q10">'+LANG[Y?"tc_remgly2":"tc_remgly"]+"</span>"}else{upper+='<b class="q0">'+LANG.tc_empty+"</b>";upper+='<br /><span class="q9">'+LANG[A1<=2?"tc_majgly":"tc_mingly"]+"</span>";lower+='<span class="q2">'+LANG.tc_addgly+"</span>"}if(glyph&&A2.parentNode.className.indexOf("icon")!=0){Tooltip.setIcon(glyph.icon)}else{Tooltip.setIcon(null)}Tooltip.show(A2,"<table><tr><td>"+upper+"</td></tr></table><table><tr><td>"+lower+"</td></tr></table>")}function AO(A3,A1){var A2=n[A1.classId],A0="<table><tr><td><b>";if(A1.z){A0+='<span style="float: right" class="q0">'+A1.z+"</span>"}A0+=A1.n+"</b><br />"+sprintf(LANG.tc_rank,A1.k,A1.m)+"<br />";if(A1.r){if(A2[A1.tree].t[A1.r[0]].k<A1.r[1]){A0+='<span class="q10">';A0+=sprintf(LANG[A1.r[1]==1?"tc_prereq":"tc_prereqpl"],A1.r[1],A2[A1.tree].t[A1.r[0]].n);A0+="</span><br />"}}if(A2[A1.tree].k<A1.y*AJ){A0+='<span class="q10">'+sprintf(LANG.tc_tier,(A1.y*AJ),A2[A1.tree].n)+"</span><br />"}if(A1.t&&A1.t.length>=1){A0+=A1.t[0]}A0+="</td></tr></table><table><tr><td>";if(A1.t&&A1.t.length>1){A0+=A1.t[1]+"<br />"}A0+='<span class="q">'+z(A1)+"</span><br />";if(l){A0+='<span class="q2">'+LANG.tc_view+"</span><br />"}else{if(A1.enabled){if(!A1.k){A0+='<span class="q2">'+LANG.tc_learn+"</span><br />"}else{if(A1.k==A1.m){A0+='<span class="q10">'+LANG[Y?"tc_unlearn2":"tc_unlearn"]+"</span><br />"}}if(A1.k&&A1.k<A1.m){A0+="<br />"+LANG.tc_nextrank+'<br /><span class="q">'+z(A1,1)+"</span><br />"}}}A0+="</td></tr></table>";Tooltip.show(A3,A0)}function AQ(A0){if(g_locale.id==0||g_locale.id==25){return A0.substr(0,A0.length-2)}return A0}function U(){l=!l;E(t);u();return l}function c(A5){var A4=n[t],A1=O[A5],A3=Icon.getLink(A1),A0=e[A5];if(A4.glyphs[A5]){var A2=g_glyphs[A4.glyphs[A5]];Icon.setTexture(A1,1,A2.icon);A0.href=A3.href="http://wowdb.178.com/tw/item/"+A2.id+".html";st(A0,AQ(A2.name));A0.className="q1";return true}else{Icon.setTexture(A1,1,"inventoryslot_empty");A0.href=A3.href="javascript:;";st(A0,LANG.tc_empty);A0.className="q0";return false}}function Az(A9,A5,A3,A7){var A6=n[A7];var A4;var A0;if(!A3||A6.k==Ac){A0=0;A4=Ac-21}else{A0=A3.i;A4=Math.floor(A6[A9].k/5)*5+5}if(A3!=null&&A3.links!=null){for(var A1=0,A2=A3.links.length;A1<A2;++A1){if(A0>A3.links[A1]){A0=A3.links[A1]}}}for(var A1=A0;A1<A6[A9].t.length;++A1){A3=A6[A9].t[A1];if(A6.k==Ac&&!A3.k){A3.enabled=0}else{if(A6[A9].k>=A3.y*AJ){if(A3.r){if(A6[A9].t[A3.r[0]].k>=A3.r[1]){A3.enabled=1}else{A3.enabled=0}}else{A3.enabled=1}}else{A3.enabled=0}}if(A5){if(A3.enabled&&(!l||A3.k)){if((A3.k==A3.m)){A3.border.style.backgroundPosition="-42px 0";A3.bubble.style.color="#E7BA00"}else{A3.border.style.backgroundPosition="-84px 0";A3.bubble.style.color="#17FD17"}Icon.moveTexture(A3.icon,1,A1,0);A3.link.className="bubbly";A3.bubble.style.visibility="visible";if(A3.r){var A8=A3.arrow.firstChild;if(A8.className.charAt(A8.className.length-1)!="2"){A8.className+="2"}}}else{A3.border.style.backgroundPosition="0 0";Icon.moveTexture(A3.icon,1,A1,1);A3.link.className="";A3.bubble.style.visibility="hidden";if(A3.r){var A8=A3.arrow.firstChild;if(A8.className.charAt(A8.className.length-1)=="2"){A8.className=A8.className.substr(0,A8.className.length-1)}}}A3.bubble.firstChild.nodeValue=A3.k;A3.link.href="http://wowdb.178.com/tw/spell/"+A3.s[Math.max(0,A3.k-1)]+".html";}}}}TalentCalc.MODE_DEFAULT=0;TalentCalc.MODE_PET=1;Listview.funcBox.glyphPickerOnClick=function(A){$WowheadTalentCalculator.addGlyph(A.id);Lightbox.hide()};Listview.templates.glyph={sort:[1],nItemsPerPage:-1,hideBands:2,hideNav:1|2,hideHeader:1,searchable:1,searchDelay:100,poundable:0,filtrable:0,clip:{w:600,h:486},onBeforeCreate:function(){this.applySort();if(!Browser.ie6){this.template.columns[0].span=2}},columns:[{id:"glyph",type:"text",align:"left",value:"name",compute:function(E,G,F){if(!Browser.ie6){var B=ce("td");B.style.width="1px";B.style.padding="0";B.style.borderRight="none";
var C=Icon.create(E.icon,0,null,"http://wowdb.178.com/tw/item/"+E.id+".html"),D=Icon.getLink(C);
if(!Browser.ie7){ae(B,C)};
ae(F,B);G.style.borderLeft="none";D.onclick=rf}var A=ce("a");A.style.fontFamily="Verdana, sans-serif";A.onclick=rf;A.href="http://wowdb.178.com/tw/item/"+E.id+".html";ae(A,ct($WowheadTalentCalculator.simplifyGlyphName(E.name)));G.style.whiteSpace="nowrap";ae(G,A);F.onclick=Listview.funcBox.glyphPickerOnClick.bind(this,E)}},{id:"description",type:"text",align:"left",value:"description",compute:function(A,D,B){var C=ce("div");C.className="small crop";ae(C,ct(A.description));ae(D,C)}},{id:"skill",type:"text",align:"center",getValue:function(A){return g_spell_skills[A.skill]},compute:function(A,B){if(A.skill){B.className="small q0";B.style.whiteSpace="nowrap";return g_spell_skills[A.skill]}}}]};