def encode_wowhead(talentstr, classindex):
	print 'Encoding wowhead'
	print 'talentstr is', talentstr
	print 'classindex is', classindex

	encrypt_string = '0zMcmVokRsaqbdrfwihuGINALpTjnyxtgevElBCDFHJKOPQSUWXYZ123456789Z'
	# begin output with the class
	outstr = encrypt_string[classindex*3]

	tc = treecounts[classindex]
	build_trees = talentstr[0:tc[0]], \
		talentstr[tc[0]:tc[0]+tc[1]], \
		talentstr[tc[0]+tc[1]:tc[0]+tc[1]+tc[2]]

	for curtree in build_trees:
		encode = ''
		b = curtree.rstrip('0')
		for i in range(0, len(b), 2):
			tens = int(b[i])
			ones = 0
			if i+1 < len(b):
				ones = int(b[i+1])
			print 'tens is',tens,'ones is',ones
			encode += encrypt_string[tens*6+ones]
		print encode
		if len(b) == len(curtree):
			outstr += encode
		else:
			outstr += encode + encrypt_string[62]
	return outstr
