var tc_loaded=false,tc_object,tc_classId=-1,tc_classIcons={},tc_build="",tc_glyphs="";
function tc_init(){
	var C;
	g_initPath([1,0]);
	ge("tc-classes").className="choose";
	var E=g_sortJsonArray(g_chr_classes,g_chr_classes);
	C=ge("tc-classes-inner");
	for(var D=0,B=E.length;D<B;++D){
		var H=E[D],F=Icon.create("class_"+g_file_classes[H],1,null,"javascript:;"),G=Icon.getLink(F);
		tc_classIcons[H]=F;
		if(Browser.ie6){
			G.onfocus=tb
		}
		G.onclick=tc_classClick.bind(G,H);
		G.onmouseover=tc_classOver.bind(G,H);
		G.onmouseout=Tooltip.hide;ae(C,F)
	}
	var A=ce("div");
	A.className="clear";
	ae(C,A);
	tc_object=new TalentCalc();
	tc_object.initialize("tc-itself",{onChange:tc_onChange});
	tc_readPound();
	setInterval(tc_readPound,1000)
}
function tc_classClick(A){
	if(tc_object.setClass(A)){
		Tooltip.hide()
	}
	return false
}
function tc_classOver(A){
	Tooltip.show(this,"<b>"+g_chr_classes[A]+"</b>",0,0,"c"+A)
}
function tc_onChange(A,E,D){var C;if(E.classId!=tc_classId){if(!tc_loaded){var C=ge("tc-classes");de(gE(C,"p")[0]);C.className="";tc_loaded=true}if(tc_classId!=-1){C=tc_classIcons[tc_classId];C.className=tc_classIcons[tc_classId].className.replace("iconmedium-gold","")}tc_classId=E.classId;C=tc_classIcons[tc_classId];C.className+=" iconmedium-gold";g_initPath([1,0,tc_classId])}tc_build=A.getWhBuild();tc_glyphs=A.getGlyphs();var B="#"+tc_build;if(tc_glyphs!=""){B+=":"+tc_glyphs}location.replace(B);var G=document.title;if(G.indexOf("/")!=-1){var F=G.indexOf("- ");if(F!=-1){G=G.substring(F+2)}}document.title=g_chr_classes[tc_classId]+" ("+D[0].k+"/"+D[1].k+"/"+D[2].k+") - "+G}function tc_readPound(){if(location.hash){var B=location.hash.substr(1).split(":"),C=B[0]||"",A=B[1]||"";if(tc_build!=C){tc_build=C;tc_object.setWhBuild(tc_build)}if(tc_glyphs!=A){tc_glyphs=A;tc_object.setGlyphs(tc_glyphs)}}};