//CONSTRUCTOR

function RewardItem(playerFaction, itemName, itemIcon, itemMoneyPrice, itemHonorPrice, itemTokenPrice, itemCost, itemStats, itemHTML)
{													//Constructor for RewardItem datatype; accepts up to 7 arguments
  this.playerFaction	 		= playerFaction;					//string variable, can be "alliance", "horde" or "both"
  this.itemName		 	 			= itemName;								//string variable, contains the name shown in the rewards list
  this.itemIcon		 	 			= itemIcon;								//string variable, contains path to item icon to be used
  this.itemMoneyPrice			=	itemMoneyPrice;
  this.itemHonorPrice		 	= itemHonorPrice;					//how much the item costs, in HONOR POINTS
  this.itemTokenPrice			= itemTokenPrice;
  this.itemCost						= itemCost;
	this.itemStats		 			= itemStats;							//Array
  this.itemHTML			 			= itemHTML;								//string variable, contains the HTML code for the item
}

tokenIcons = new Array("battletoken","researchtoken","honorholdtoken","arathi","nether","warsong");
//(thisObject.itemTokenPrice) ? processPrice(thisObject.itemHonorPrice[thisBracket],thisObject.itemTokenPrice[thisBracket]) : 
function selectBracket(thisObject,thisBracket)
{
  if (thisBracket >= 0)
  {
    if (thisObject.itemStats[thisBracket])
		{
			thisObject.itemCost = generateCostString(thisObject,thisBracket);
			thisObject.itemHTML = thisObject.itemStats[thisBracket];
		}
    else
		{
			thisObject.itemHTML = "none";
			thisObject.itemCost = "none";
			selectBracket(thisObject,thisBracket-1);
		}
  }
}

function generateCostString(thisObject,thisBracket)
{
	outPutString = "";
	if(thisObject.itemMoneyPrice && thisObject.itemMoneyPrice[thisBracket])
	{
		copperPart = thisObject.itemMoneyPrice[thisBracket];
		goldPart = Math.floor(copperPart / 10000);
		if (goldPart >= 1) copperPart -= goldPart * 10000;
		silverPart = Math.floor(copperPart / 100);
		if (silverPart >= 1) copperPart -= silverPart * 100;
		if (goldPart > 0) outPutString += goldPart+"<img src='http://wowimg.the9.com/images_wow/gameinfo/factions/icons/gold.gif'>&nbsp;";
		if (silverPart > 0) outPutString += silverPart+"<img src='http://wowimg.the9.com/images_wow/gameinfo/factions/icons/silver.gif'>&nbsp;";
		if (copperPart > 0) outPutString += copperPart+"<img src='http://wowimg.the9.com/images_wow/gameinfo/factions/icons/copper.gif'>&nbsp;";
	}
	if(thisObject.itemHonorPrice && thisObject.itemHonorPrice[thisBracket])
	{
		outPutString += thisObject.itemHonorPrice[thisBracket]+"<img src='http://wowimg.the9.com/images_wow/gameinfo/factions/icons/"+thisObject.playerFaction+"-honor.gif'>&nbsp;";
	}
	if(thisObject.itemTokenPrice && thisObject.itemTokenPrice[thisBracket])
	{
		for(carl=0; carl<thisObject.itemTokenPrice[thisBracket].length; carl++)
		{
			if (thisObject.itemTokenPrice[thisBracket][carl] > 0) outPutString += thisObject.itemTokenPrice[thisBracket][carl]+"<img src='http://wowimg.the9.com/images_wow/gameinfo/factions/icons/"+tokenIcons[carl]+".gif'>&nbsp;";
		}
	}
	return outPutString;
}

//------BEGIN REWARDS DEFINITION------
i = 0;
var RewardItems = new Array();

var fAvengersWaistguard = new RewardItem("alliance","复仇者的腰带","http://wowimg.the9.com/images_wow/gameinfo/factions/icons/INV_Belt_14.gif");
fAvengersWaistguard.itemTokenPrice = new Array();
fAvengersWaistguard.itemTokenPrice[0] = new Array(20,1,0,0);
fAvengersWaistguard.itemStats = new Array();
fAvengersWaistguard.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span class=\"myBlue\">复仇者的腰带</span>\
<br>拾取后绑定<br>唯一<br>腰部<span class=\"myRight\">板甲</span>\
<br>573点护甲<br>+16 力量<br>+24 耐力<br>+11 智力<br>耐久度 45 / 45<br>需要等级 66<br>\
<span class=\"myGreen\">装备：爆击等级提高12。</span>\
<br>\
<span class=\"myGreen\">装备：使你的韧性等级提高17。</span>\
<br>\
<span class=\"myGreen\">装备：提高所有法术和魔法效果所造成的伤害和治疗效果，最多20点。</span>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fAvengersWaistguard; ++i;


var fAvengersLegguards = new RewardItem("alliance","复仇者的腿甲","http://wowimg.the9.com/images_wow/gameinfo/factions/icons/INV_Pants_Plate_15.gif");
fAvengersLegguards.itemTokenPrice = new Array();
fAvengersLegguards.itemTokenPrice[0] = new Array(40,2,0,0);
fAvengersLegguards.itemStats = new Array();
fAvengersLegguards.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span class=\"myBlue\">复仇者的腿甲</span>\
<br>拾取后绑定<br>唯一<br>腿部<span class=\"myRight\">板甲</span>\
<br>891点护甲<br>+22 力量<br>+33 耐力<span class=\"myYellowGem\">黄色插槽</span><span class=\"myGray\">镶孔奖励：+2 韧性等级</span>\
<br>耐久度 100 / 100<br>需要等级 66<br>\
<span class=\"myGreen\">装备：爆击等级提高14。</span>\
<br>\
<span class=\"myGreen\">装备：使你的韧性等级提高22。</span>\
<br>\
<span class=\"myGreen\">装备：提高所有法术和魔法效果所造成的伤害和治疗效果，最多27点。</span>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fAvengersLegguards; ++i;

var fMarksmansBelt = new RewardItem("alliance","神射手的腰带","http://wowimg.the9.com/images_wow/gameinfo/factions/icons/INV_Belt_20.gif");
fMarksmansBelt.itemTokenPrice = new Array();
fMarksmansBelt.itemTokenPrice[0] = new Array(20,1,0,0);
fMarksmansBelt.itemStats = new Array();
fMarksmansBelt.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span class=\"myBlue\">神射手的腰带</span>\
<br>拾取后绑定<br>唯一<br>腰部<span class=\"myRight\">锁甲</span>\
<br>321点护甲<br>+19 敏捷<br>+28 耐力<br>+12 智力<br>耐久度 40 / 40<br>需要等级 66<br>\
<span class=\"myGreen\">装备：爆击等级提高9。</span>\
<br>\
<span class=\"myGreen\">装备：使你的韧性等级提高13。</span>\
<br>\
<span class=\"myGreen\">装备：攻击强度提高20。</span>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fMarksmansBelt; ++i;

var fMarksmansLegguards = new RewardItem("alliance","神射手的护腿","http://wowimg.the9.com/images_wow/gameinfo/factions/icons/INV_Pants_Mail_04.gif");
fMarksmansLegguards.itemTokenPrice = new Array();
fMarksmansLegguards.itemTokenPrice[0] = new Array(40,2,0,0);
fMarksmansLegguards.itemStats = new Array();
fMarksmansLegguards.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span class=\"myBlue\">神射手的护腿</span>\
<br>拾取后绑定<br>唯一<br>腿部<span class=\"myRight\">锁甲</span>\
<br>499点护甲<br>+25 敏捷<br>+39 耐力<br>+13 智力<span class='myYellowGem'>黄色插槽</span>\<span class=\"myGray\">镶孔奖励：+2 韧性等级</span>\
<br>耐久度 90 / 90<br>需要等级 66<br>\
<span class=\"myGreen\">装备：爆击等级提高11。</span>\
<br>\
<span class=\"myGreen\">装备：使你的韧性等级提高13。</span>\
<br>\
<span class=\"myGreen\">装备：攻击强度提高22。</span>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fMarksmansLegguards; ++i;

var fHierophantsSash = new RewardItem("alliance","圣职者腰带","http://wowimg.the9.com/images_wow/gameinfo/factions/icons/INV_Belt_17.gif");
fHierophantsSash.itemTokenPrice = new Array();
fHierophantsSash.itemTokenPrice[0] = new Array(20,1,0,0);
fHierophantsSash.itemStats = new Array();
fHierophantsSash.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span class=\"myBlue\">圣职者腰带</span>\
<br>拾取后绑定<br>唯一<br>腰部<span class=\"myRight\">布甲</span>\
<br>77点护甲<br>+28 耐力<br>+19 智力<br>耐久度 30 / 30<br>需要等级 66<br>\
<span class=\"myGreen\">装备：使你的韧性等级提高19。</span>\
<br>\
<span class=\"myGreen\">装备：提高所有法术和魔法效果所造成的伤害和治疗效果，最多22点。</span>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fHierophantsSash; ++i;

var fHierophantsLeggings = new RewardItem("alliance","圣职者护腿","http://wowimg.the9.com/images_wow/gameinfo/factions/icons/INV_Pants_Cloth_05.gif");
fHierophantsLeggings.itemTokenPrice = new Array();
fHierophantsLeggings.itemTokenPrice[0] = new Array(40,2,0,0);
fHierophantsLeggings.itemStats = new Array();
fHierophantsLeggings.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span class=\"myBlue\">圣职者护腿</span>\
<br>拾取后绑定<br>唯一<br>腿部<span class=\"myRight\">布甲</span>\
<br>119点护甲<br>+39 耐力<br>+17 智力<span class=\"myYellowGem\">黄色插槽</span><span class=\"myGray\">镶孔奖励：+2 韧性等级</span>\
<br>耐久度 65 / 65<br>需要等级 66<br>\
<span class=\"myGreen\">装备：使你的韧性等级提高25。</span>\
<br>\
<span class=\"myGreen\">装备：提高所有法术和魔法效果所造成的伤害和治疗效果，最多29点。</span>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fHierophantsLeggings; ++i;

var fShadowstalkersSash = new RewardItem("alliance","暗影追猎者腰带","http://wowimg.the9.com/images_wow/gameinfo/factions/icons/INV_Belt_15.gif");
fShadowstalkersSash.itemTokenPrice = new Array();
fShadowstalkersSash.itemTokenPrice[0] = new Array(20,1,0,0);
fShadowstalkersSash.itemStats = new Array();
fShadowstalkersSash.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span class=\"myBlue\">暗影追猎者腰带</span>\
<br>拾取后绑定<br>唯一<br>腰部<span class=\"myRight\">皮甲</span>\
<br>144点护甲<br>+17 敏捷<br>+24 耐力<br>耐久度 35 / 35<br>需要等级 66<br>\
<span class=\"myGreen\">装备：爆击等级提高13。</span>\
<br>\
<span class=\"myGreen\">装备：使你的韧性等级提高16。</span>\
<br>\
<span class=\"myGreen\">装备：攻击强度提高26。</span>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fShadowstalkersSash; ++i;

var fShadowstalkersLeggings = new RewardItem("alliance","暗影追猎者护腿","http://wowimg.the9.com/images_wow/gameinfo/factions/icons/INV_Pants_Leather_03.gif");
fShadowstalkersLeggings.itemTokenPrice = new Array();
fShadowstalkersLeggings.itemTokenPrice[0] = new Array(40,2,0,0);
fShadowstalkersLeggings.itemStats = new Array();
fShadowstalkersLeggings.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span class=\"myBlue\">暗影追猎者护腿</span>\
<br>拾取后绑定<br>唯一<br>腿部<span class=\"myRight\">皮甲</span>\
<br>224点护甲<br>+23 敏捷<br>+33 耐力<span class=\"myYellowGem\">黄色插槽</span><span class=\"myGray\">镶孔奖励：+2 韧性等级</span>\
<br>耐久度 75 / 75<br>需要等级 66<br>\
<span class=\"myGreen\">装备：爆击等级提高15。</span>\
<br>\
<span class=\"myGreen\">装备：使你的韧性等级提高17。</span>\
<br>\
<span class=\"myGreen\">装备：攻击强度提高30。</span>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fShadowstalkersLeggings; ++i;

var fSlayersWaistguard = new RewardItem("alliance","刺客腰带","http://wowimg.the9.com/images_wow/gameinfo/factions/icons/INV_Belt_14.gif");
fSlayersWaistguard.itemTokenPrice = new Array();
fSlayersWaistguard.itemTokenPrice[0] = new Array(20,1,0,0);
fSlayersWaistguard.itemStats = new Array();
fSlayersWaistguard.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span class=\"myBlue\">刺客腰带</span>\
<br>拾取后绑定<br>唯一<br>腰部<span class=\"myRight\">板甲</span>\
<br>573点护甲<br>+22 力量<br>+24 耐力<br>耐久度 45 / 45<br>需要等级 66<br>\
<span class=\"myGreen\">装备：近战爆击等级提高19。</span>\
<br>\
<span class=\"myGreen\">装备：使你的韧性等级提高19。</span>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fSlayersWaistguard; ++i;

var fSlayersLegguards = new RewardItem("alliance","刺客护腿","http://wowimg.the9.com/images_wow/gameinfo/factions/icons/INV_Pants_Plate_15.gif");
fSlayersLegguards.itemTokenPrice = new Array();
fSlayersLegguards.itemTokenPrice[0] = new Array(40,2,0,0);
fSlayersLegguards.itemStats = new Array();
fSlayersLegguards.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span class=\"myBlue\">刺客护腿</span>\
<br>拾取后绑定<br>唯一<br>腿部<span class=\"myRight\">板甲</span>\
<br>891点护甲<br>+25 力量<br>+39 耐力<span class=\"myYellowGem\">黄色插槽</span><span class=\"myGray\">镶孔奖励：+2 韧性等级</span>\
<br>耐久度 100 / 100<br>需要等级 66<br>\
<span class=\"myGreen\">装备：爆击等级提高17。</span>\
<br>\
<span class=\"myGreen\">装备：使你的韧性等级提高25。</span>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fSlayersLegguards; ++i;

var fStormbreakersGirdle = new RewardItem("alliance","破雷束带","http://wowimg.the9.com/images_wow/gameinfo/factions/icons/INV_Belt_20.gif");
fStormbreakersGirdle.itemTokenPrice = new Array();
fStormbreakersGirdle.itemTokenPrice[0] = new Array(20,1,0,0);
fStormbreakersGirdle.itemStats = new Array();
fStormbreakersGirdle.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span class=\"myBlue\">破雷束带</span>\
<br>拾取后绑定<br>唯一<br>腰部<span class=\"myRight\">锁甲</span>\
<br>321点护甲<br>+28 耐力<br>+19 智力<br>耐久度 40 / 40<br>需要等级 66<br>\
<span class=\"myGreen\">装备：法术爆击等级提高19。</span>\
<br>\
<span class=\"myGreen\">装备：使你的韧性等级提高19。</span>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fStormbreakersGirdle; ++i;

var fStormbreakersLeggings = new RewardItem("alliance","破雷护腿","http://wowimg.the9.com/images_wow/gameinfo/factions/icons/INV_Pants_Mail_12.gif");
fStormbreakersLeggings.itemTokenPrice = new Array();
fStormbreakersLeggings.itemTokenPrice[0] = new Array(40,2,0,0);
fStormbreakersLeggings.itemStats = new Array();
fStormbreakersLeggings.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span class=\"myBlue\">破雷护腿</span>\
<br>拾取后绑定<br>唯一<br>腿部<span class=\"myRight\">锁甲</span>\
<br>499点护甲<br>+39 耐力<br>+16 智力<span class=\"myYellowGem\">黄色插槽</span><span class=\"myGray\">镶孔奖励：+2 韧性等级</span>\
<br>耐久度 90 / 90<br>需要等级 66<br>\
<span class=\"myGreen\">装备：法术爆击等级提高14。</span>\
<br>\
<span class=\"myGreen\">装备：使你的韧性等级提高22。</span>\
<br>\
<span class=\"myGreen\">装备：提高所有法术和魔法效果所造成的伤害和治疗效果，最多27点。</span>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fStormbreakersLeggings; ++i;

var fDreamstalkerSash = new RewardItem("alliance","梦行者腰带","http://wowimg.the9.com/images_wow/gameinfo/factions/icons/INV_Belt_17.gif");
fDreamstalkerSash.itemTokenPrice = new Array();
fDreamstalkerSash.itemTokenPrice[0] = new Array(20,1,0,0);
fDreamstalkerSash.itemStats = new Array();
fDreamstalkerSash.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span class=\"myBlue\">梦行者腰带</span>\
<br>拾取后绑定<br>唯一<br>腰部<span class=\"myRight\">皮甲</span>\
<br>184点护甲<br>+15 力量<br>+13 敏捷<br>+24 耐力<br>+15 智力<br>耐久度 35 / 35<br>需要等级 66<br>\
<span class=\"myGreen\">装备：使你的韧性等级提高15。</span>\
<br>\
<span class=\"myGreen\">装备：提高法术所造成的治疗效果，最多31点。</span>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fDreamstalkerSash; ++i;

var fDreamstalkerLeggings = new RewardItem("alliance","梦行者护腿","http://wowimg.the9.com/images_wow/gameinfo/factions/icons/INV_Pants_07.gif");
fDreamstalkerLeggings.itemTokenPrice = new Array();
fDreamstalkerLeggings.itemTokenPrice[0] = new Array(40,2,0,0);
fDreamstalkerLeggings.itemStats = new Array();
fDreamstalkerLeggings.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span class=\"myBlue\">梦行者护腿</span>\
<br>拾取后绑定<br>唯一<br>腿部<span class=\"myRight\">皮甲</span>\
<br>284点护甲<br>+20 力量<br>+6 敏捷<br>+30 耐力<br>+10 智力<span class=\"myRedGem\">红色插槽</span><span class=\"myYellowGem\">黄色插槽</span><span class=\"myGray\">镶孔奖励：+3 韧性等级</span>\
<br>耐久度 75 / 75<br>需要等级 66<br>\
<span class=\"myGreen\">装备：使你的韧性等级提高20。</span>\
<br>\
<span class=\"myGreen\">装备：提高法术所造成的治疗效果，最多44点。</span>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fDreamstalkerLeggings; ++i;

var fHalaaniBag = new RewardItem("alliance","哈兰背包","http://wowimg.the9.com/images_wow/gameinfo/factions/icons/INV_Misc_Bag_17.gif");
fHalaaniBag.itemTokenPrice = new Array();
fHalaaniBag.itemTokenPrice[0] = new Array(0,8,0,0);
fHalaaniBag.itemStats = new Array();
fHalaaniBag.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span class=\"myBlue\">哈兰背包</span>\
<br>拾取后绑定<br>唯一<br>18格包</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fHalaaniBag; ++i;

var fSublimeMysticDawnstone = new RewardItem("alliance","卓越秘法黎明石","http://wowimg.the9.com/images_wow/gameinfo/factions/icons/INV_Misc_Gem_Topaz_01.gif");
fSublimeMysticDawnstone.itemTokenPrice = new Array();
fSublimeMysticDawnstone.itemTokenPrice[0] = new Array(100,0,0,0);
fSublimeMysticDawnstone.itemStats = new Array();
fSublimeMysticDawnstone.itemStats[0] = "\
<table width=\"275\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\
<tr>\
<td>\
<div class=\"myTable\">\
<span class=\"myPurple\">卓越秘法黎明石</span>\
<br>拾取后绑定<br>唯一<br>+10 韧性<br>\
<span class=\"myYellow\">\"对应黄色插槽。\"</span>\
</div>\
</td>\
</tr>\
</table>\
";
RewardItems[i] = fSublimeMysticDawnstone; ++i;



//------END REWARDS DEFINITION------


